load(draw)$ 
set_draw_defaults(draw_realpart=false)$
kill(all)$ fpprintprec:5$ ratprint:false$

# Time

This chapter considers two aspects of time. The first involves the analysis
of decisions whose effects have implications over time for costs or revenues.
The second involves processes that play out over time, in a dynamic fashion.

## Introduction

## Intertemporal Decisions

## Investment

## Harvest Rotation

A stand of trees is to be managed in perpetuity. All crops are the same over time.
The manager/seller is a price taker.

The analysis in this section is in two parts. The first part treats 
the general case in which the function that governs forest growth 
is not specified. The second part specifies a simple growth function 
and provides a numerical illustration of the principles developed 
in the first part.

### Analyzing the General Case

The cell below uses nusum( ) to determine the value of the series implied by
the model specified above. The sum( ) command is not used, because it 
returns a symbolic expression that cannot be assigned to a name
for use in further analysis. 

nusum( ) shows the present value as the sum of two terms. The second term is 
vanishingly small, and is excised for computational. The part(%,1) commmand
extracts the relevant part of the output.

nusum(p*b*%e^-(%rho*n*T),n,1,inf ); 
PV:part(%,1)$  
print("The present value is", 'PV[T], "=", PV)$

The next cell generates an expression in terms of the value of T that
generates maximum PV. 

depends(b, T)$   diff(PV,T);   solve(diff(PV,T),T);

Manipulating this equality generates an expression in terms of b's growth rate: 
(db/dT)*(1/b) = %rho/(1 - exp(-%rho*T))

Let T = 30 (within the rotation range for many softwood species) and %rho = 0.05. 
In that case, the value of T should be such that the growth rate is (db/dT)/b = 0.0644. 
Therefore, the rotation cycle should exceed 30 years.

print(%rho," = 5% and T = 30 imply",  %rho/
(1 - exp(-%rho*T)),  "=", 0.05/(1 - exp(-0.05*30)) )$

An important special case is wh 4 Harvest Rotationen no discounting is applied (%rho=0).
The limit as we approach that case is (db/dT)(1/b) = 1/T, so the 
growth rate is b/T. That is, the marginal change in the volume equals
its average value, implying that the rotation cycle should be such that
b/T, the growth per year, is maximized.

limit(%rho/(1 - exp(-%rho*T)),%rho,0);

An Illustration

Suppose that b(T, K, b_0, r) = (K*b_0*exp(r*T))/(K + b_0*exp(r*T) -1), a 
logistic growth function.

This expression for $b$ replaces the variable $b$ in the expression 
used in the previous section. As before, \texttt{nusum} 
produces an expression for the present value. We now 
cast this expression as an explicit function of $T$, $p$, and
$\rho$. Having created the equation, we create a second 
scenario, \texttt{PresentValue}, based a on set of parameter
values, to be graphed. Finally, \texttt{wxdraw} generates the 
required graph. 
 4 Harvest Rotation
The text explains why the downward-sloping range of the present
value curve can be ignored.

/*The logistic biomass growth function */
b(T, K, r) := K*exp(r*T)/(K + exp(r*T) - 1); 

/*Biomass Growth Scenario*/  
Growth:gr2d(ylabel = "Volume",  ytics=[0,500,1000],
  explicit(b(T, 1000, 0.2), T, 1, 75))$ 

/*Present Value Expression*/
nusum(p*b(T, 1000, 0.2)*%e^-(%rho*n*T),n,1,inf)$ 
  PV(T,  p,  %rho) := ''(part(%,1)); 

/*Present Value Scenario*/   
PresentValue: gr2d(ylabel="Dollars",xlabel="T",
 explicit(PV(T,1,0.05),T,1,75),dimensions=[480,540])$ 

/* Draw the graphs */
wxdraw(Growth, PresentValue)$

Determining the Relevant Values

Applying find_root( ) to determine T for which the derivative
of the PV function equals zero. Note 

/* Solve dPV/dT = 0 */
diff(PV(T,1000,0.05),T)$  solnPV: solve(%,T); 

/* Determine optimal T, rounded */
Topt:round(find_root(solnPV[1],T,10,100))$

/* Determine growth rate at optimal T */
diff(b(T, 1000, 0.20), T)$    b_growth:subst(T=Topt,%)$ 

/*Produce a table of values */
transpose(matrix(["Optimal rotation period =",
"Total biomass as period's end =", 
"Annual growth rate at Topt =",
"Percentage growth =","Percentage for optimality ="],
 [Topt, b(Topt,1000,0.20), b_growth,100*b_growth/
 b(Topt,1000,0.20),100*0.05/(1-exp(-0.05*Topt))],
["years","units","units per year","percent","percent"]));

Implications of Maximum Sustainable Yield

Next create a function that states output per year as a function of T
and then determine the T value such that output per year is maximized.
The expressions and the values appear below.

The table shows that PV is less its maximum value when average annual yield 
is maximized.

b_per_year(T, K, r) := (K*exp(r*T)/(K + exp(r*T) - 1))/T$ 
diff_b_per_year : diff(b_per_year(T, 1000, 0.20), T)$
solve(%, T);   Tmsy : round(find_root(%[1], T, 10, 100))$
transpose(matrix(["Max. sustainable yield period =",
"Total biomass as period's end =",
"PV with maximum sustainable yield =",
"PV with optimal rotation ="],[Tmsy,b(Tmsy,1000,0.20),
 float(PV(Tmsy,  1,  0.05)),float(PV(Topt,  1,  0.05))],
 ["years","units","dollars","dollars"]  ));