Third Programming Assignment

Due: April 22 (originally April 15, postponed on April 13)

Dr. Kris Stewart (stewart@rohan.sdsu.edu)
San Diego State University

This URL is http://www.stewart.cs.sdsu.edu/cs205/code3.html

We want to combine programming and visualization in this exercise examining Timber Regrowth
(p. 122, Engineering Problem Solving With MATLAB, by D. Etter).

A problem in timber management is to determine how much of an area to leave uncut so that the harvested area is reforested in a certain period of time. It is assumed that reforestation takes place at a known rate per year, depending on climate and soil conditions. A reforestation equation expresses this growth as a function of the amount of timber standing and the reforestation rate. For example, if 100 acres are left standing after harvesting and the reforestation rate is 0.05, then 100 + 0.05 * 100 (or 105 acres) are forested at the end of the first year. At the end of the second year, the number of acres forested is 105 + 0.5 * 105, or 110.25 acres.

  1. Assume that there are 14,000 acres with 2500 acres uncut and that the reforestation rate is 0.02. Print a table showing the amount of acres reforested at the end of each year, for a total of 20 years.
  2. Modify the program developed above so that the user can enter the number of years to be used for the table.
  3. Modify the program developed above so that the user can enter a number of uncut acres, and the program will determine how many years are required for the total number of acres (14,000) to be forested.
  4. Using the final program above, add the ability to present the results in a graph in 2 manners:
  5. Recast your data to be able to compute the percentage of the final forested acrage each year contributes. That is, with your final program that lets you compute how many years are required to reforest the user provided initial uncut acreage - take this as your number of year, N.

    Now, compute a vector of length N whose contents are each year's contribution, there

    Contrib(1) = uncut acres
    Contrib(2) = uncut + reforested amount in year one
    Contrib(3) = Contrib(2) + reforested amount in year two
    and so forth

    Display these final results in a MATLAB pie chart with the initial uncut acreage "pulled out".

The program subission process will be as before. Move your script file (called reforest.m) into yourturnin directory and send email to stewart@rohan that your problem is ready to be checked.