1.10 Answers to the Problem Set
General
- A(T) represents the total change in the resource. Thus the rate of change, P(t), is integrated: A(T)=∫T0P(t)dt
- With P(t)=P0ekt, A(T)=∫T0P0ektdt=(P0/k)(ekT−1)
- The initial use rate in P0, the rate of increase is k, and the time interval ends at 1983-1973 = 10 years. Thus
6.99 * 10^9 #kg
P0=0.08
k=10.0 #years
T=
#Estimate A(T) in kg
/k)*(exp(k*T)-1) (P0
## [1] 107081638627
- We solve for T. The total change equals the current reserves (at t=0); thus, the parameters are
require("stats")
library(stats)
6.99 * 10^9 #kg
P0=0.08
k= 336 * 10^9 #kg
A_T=
#Using A(T)= (P0/k)*(exp(k*T)-1)
#Solve T in years
function(T) (P0/k)*(exp(k*T)-1) - A_T
Tsolve=uniroot(Tsolve, interval=c(0, 100))$root
## [1] 19.72562
2a. Check the initial conditions: N(0)=5000, W(0)=80.
function(time) 5000*exp(-0.5*time)
N_t=N_t(0)
## [1] 5000
function(time) 10000*(1-0.8*exp(-0.05*time))^3
W_t=W_t(0)
## [1] 80
#Biomass B(t)=N(t)*W(t)
#Calculate biomass at 12 months
function(time) 5000*exp(-0.5*time) * 10000*
B_t= (1-0.8*exp(-0.05*time))^3
B_t(12)
## [1] 21876.47
- Average biomass (g) for the first 12 months, ¯B(12) uses the definite integral. ¯B(12)=(1/12)∫120B(t)dt Substitution for B(T) gives ¯B(12)=(1/12)∫1205.0×107e−0.5t(1−0.8e−0.05t)3dt ¯B(12)=4.17×106∫120e−0.5t(1−0.8e−0.05t)3dt Integrate by parts where u=(1−0.8e−0.05t)3 and dv=e−0.5tdt ∫120e−0.5t(1−0.8e−0.05t)3dt
=e−0.5t−0.5(1−0.8e−0.05t)3|120−∫120e−0.5t−0.5(3)(1−0.8e−0.05t)2(0.04)e−0.05tdt =(−0.00496)(0.177)+0.016+0.24∫120e−0.55t(1−0.8e−0.05t)2dt Integrate by parts again with u=(1−0.8e−0.05t)2 and dv=e−0.55tdt An intermediate stage is (two steps skipped), with the left side included, ∫120e−0.5t(1−0.8e−0.05t)3dt=0.0324+0.0349∫120e−0.60t(1−0.8e−0.05t)dt =0.0324+0.0349∫120e−0.60t−0.8e−0.65tdt=0.0324+0.0349(0.4353)=0.0476
#Biomass B(t)=N(t)*W(t)
#Calculate average biomass (g) for the first 12 months
4.17*10^6)*(0.0476) (
## [1] 198492
function(time){5000 * exp(-0.5 * time) * 10000 *
B_t= (1 - 0.8 * exp(-0.05 * time))^3}
#Initial biomass in g
B_t(0)
## [1] 4e+05
#Plot the graph of biomass over time.
plot(0:12, B_t(0:12)/10^3, ylab="Production (kg)",
xlab= "Time (months)", type='l')
3a. The rate of change of N is a decrease (i.e. negative) and proportional to N. For k>0, we have dNdt=−kN.
Separate variables dNN=−kdt ∫dNN=∫−kdt lnN=−kt+C, C = integration constant N=e−kteC But N(0)=N0. Thus N(0)=N0=e0eC=eC and the solution is N(t)=N0e−kt.
Substitute into the solution equation. N(t1)=N0e−kt10.5N0=N0e−kt1ln(0.5)=−kt1t1=−(ln(0.5))/k=(ln2)/k
Let N(t) be the number of C14 atoms in the wood. Then N(t)/N0=0.87. The half life of 5568 gives (ln2)/k=5568, k=(ln2)/5568=0.0001245. The equation for N(t) then gives N(t)/N0=e−kt0.87=exp(−0.0001245t)ln(0.87)=−0.0001245tt=1119years
- a is the amplitude (half the total change in tidal height); b is 2π/p where p=period=2|Thigh−Tlow|; and Th is the phase shift or lag. The simple cosine function begins at t=0 so the lag is the time of high tide. Ha is the vertical shift.
#first interval
2.47
h_h= -0.82
h_l= 4+35/60
time_h= 11+40/60
time_l=
#second interval
2.77
h_h= -0.82
h_l= 19+40/60
time_h= 11+40/60
time_l=
(h_h-h_l)/2
a= 2*abs(time_h-time_l)
p=2*pi/p
b= time_h #phase lag, time of high tide
time_h= (h_h+h_l)/2
Ha=
a; p; b; time_h; Ha
## [1] 1.795
## [1] 16
## [1] 0.3926991
## [1] 19.66667
## [1] 0.975
function(a,b,time, time_h, Ha) a*cos(b*(time-time_h))+Ha
H=plot(1:24, H(a=a,b=b,time=1:24, time_h=time_h, Ha=Ha), type='l',
xlab="Tide height (m)", ylab="Time (hours)")
b. ¯H= average height, first interval = 7.24 hours.
¯H=17.24∫11.824.58acos(bT−bTh)+Hadt=17.24(−a/b)(sin(11.82b−4.58b)−sin(4.58b−4.58b))+17.24(Ha)(11.82−4.58)=−a7.24b(sin(7.24(2π/2(7.24)))−0)+Ha=Ha, since sinπ=0.
For the two intervals combined, we must weight the average height in each interval by the length of the time interval. ¯H=115.09∫19.674.58H(t)dt=115.09∫11.824.58H(t)dt+115.09∫19.6711.82H(t)dt=7.2415.0917.24∫11.824.58H(t)dt+7.8515.0917.85∫19.6711.82H(t)dt=7.2415.09¯H1+7.8515.09¯H2
- We need the times of day when the 0.0 tide level is reached. The easiest way is to invert the function H(t) for each subinterval. H=acos(b(T−Th))+Ha(H−Ha)/a=cos(b(T−Th))cos−1((H−Ha)/a)=b(T−Th)(1/b)cos−1((H−Ha)/a)+Th=T Now substitute the appropriate constants and 0 for H.
#first interval
2.47
h_h= -0.82
h_l= 4+35/60
time_h= 11+40/60
time_l=
#second interval
2.77
h_h= -0.82
h_l= 19+40/60
time_h= 11+40/60
time_l=
(h_h-h_l)/2
a= 2*abs(time_h-time_l)
p=2*pi/p
b= time_h #phase lag, time of high tide
time_h= (h_h+h_l)/2
Ha=
0
H=
#Estimate T
1/b)*acos((H-Ha)/a)+time_h (
## [1] 25.12889
This answer is obviously wrong since the 0.0 height must be attained sometime between low tide (11.82 hours) and the next high tide (19.67 hours). The fallacy is in treating the “arcos x” as an inverse function. It is one-to-one only when the domain of “cos x” is restricted to [0,π]; i.e., arcos x always has [0,π] as its range. Thus the first term is 10.400cos−1(−0.975/1.795) correctly tells how far the maximum (Th) is from the desired time T, but now whether T lies above or below Th. With the second subinterval, T is obviously below Th and hence we subtract from Th:
19.67-1/0.400*acos(-0.975/1.795)
## [1] 14.30747
∂E∂B=n∑i=12[Axi+B−yi]E=n∑i=1[Axi+B−yi]2∂E∂A=n∑i=1[Axi+B−yi]xi Set equal to zero: n∑i=12[Axi+B−yi]xi=0n∑i=1[Axi+B−yi]xi=0∂E∂B=n∑i=12[Axi+B−yi]
Equate to 0 and divide by 2: n∑i=1[Axi+B−yi]=0 Thus we have two equations which are linear in A and B. This is more easily seen if we rework them. From (1.30)
A(n∑i=1x2i)+B(n∑i=1xi)−(n∑i=1xiyi)=0
And (1.31) becomes A(n∑i=1x2i)+nB−(n∑i=1yi)=0
We solve for A and B.
B=(268.50−65.90A)/5A=(3750.50−65.90B)/(1353.25)=2.771−2.615+0.642A=0.156+0.642A
Thus
A=0.156/(1−0.642)=0.436B=(268.50−65.90(0.436))/5=47.95
To prove that these values for A, B do give a minimum sum of squares, we must show that, for A = 0.44, B = 47.95,
- ∂f/∂A=∂f/∂B=0
- (∂2f/∂A2)(∂2f/∂B2)−(∂2f/∂A∂B)2>0
- ∂2f/∂A2>0,
where f is the sum of squares f=∑i(yi−Axi−B)2 We have ∂f/∂A=−2∑i(yi−Axi−B)xi∂f/∂B=−2∑i(yi−Axi−B)
Since A, B were calculated by setting these derivatives to zero, we do not need to check (i). ∂2f/∂A2=2∑ix2i,∂2f/∂B2=2n∂2f/∂A∂B=2∑ixi
Substituting into (ii) gives (2∑ix2i)(2n)−4(∑ixi)2=20∑ix2i−4(∑ixi)2 =20(1353.25)−4(65.90)2 =9693.76>0 Note that (iii) is obviously satisfied so we have a minimum for f.
- Begin with y=AxeBx Divide by x to isolate the exponential function. y/x=AeBx Now take logarithms of both sides. ln(y/x)=lnA+Bx Thus, in the form h=f+gx, we have h=ln(y/x)f=lnAg=B
The transformed table is below.
x | h |
---|---|
3.0 | 2.565 |
5.3 | 2.340 |
9.6 | 1.790 |
18.0 | 1.204 |
30.0 | 0.642 |
The least squares calculations give the transformed equation
h=2.642−0.071x
and thus
y=14.041xe−0.071x
- The following graph 1.20 compares the least squares line and exponential curve of parts (a) and (b) with the data and the exponential curve in the text eqn. (1.12). The fit of eqn. (1.12) seems superior to that of the curve from (b). However, the fit of
h=2.642−0.071x
to the transformed data is quite good, as shown by figure 1.21. Thus we conclude that a good least squares fit to transformed data does not necessarily imply a good curve fit to the original data.

Figure 1.20: Comparison of fitted growth functions.

Figure 1.21: Least squares line of transformed data.