Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

Mathematical Modeling 4th Edition

Meerschaert Solutions Manual


Visit to download the full and correct content document: https://testbankdeal.com/dow
nload/mathematical-modeling-4th-edition-meerschaert-solutions-manual/
CHAPTER 6 EXERCISES

1. (a) The following graph shows the results of a simulation of the model with lambda=3
and w=0.25, starting with 2 blue and 5 red divisions. Red wins the battle in 39 hours with
2.2 divisions remaining.

b
l
1
u
e

0
0 1 2 3 4 5
red
(b) Repeated simulations as in part (a) but varying w yield the following results.

Weather Winning Hours of Divisions


(w) side combat remaining
0.1 Red 102 1.3
0.2 Red 49 2.0
0.25 Red 39 2.2
0.5 Red 20 2.7
0.75 Red 13 2.9
0.9 Red 11 3.0

(c) Red benefits from good weather, blue benefits from bad weather. We should expect
red to attack during good weather.

(d) Our conclusions from part (c) are still valid. Red would prefer to attack in good
weather. For example, in the scenario where 5 red divisions attack 2 blue divisions, and
the blue divisions have an equipment and training advantadge which makes one blue troop
as effective as 5 red troops, weather plays a deciding role. Red wins the war if the
weather is good, and blue wins if the weather is bad.
Case of lambda = 1.5

Weather Winning Hours of Divisions


(w) side combat remaining
0.1 Red 58 3.3
0.2 Red 34 3.6
0.25 Red 29 3.7
0.5 Red 16 3.9
0.75 Red 11 4.0
0.9 Red 9 4.0

Case of lambda = 2.0

Weather Winning Hours of Divisions


(w) side combat remaining
0.1 Red 66 2.7
0.2 Red 38 3.1
0.25 Red 31 3.3
0.5 Red 17 3.6
0.75 Red 12 3.7
0.9 Red 10 3.7

Case of lambda = 4.0

Weather Winning Hours of Divisions


(w) side combat remaining
0.1 Blue 107 0.5
0.2 Red 113 0.4
0.25 Red 66 0.8
0.5 Red 26 1.7
0.75 Red 16 2.0
0.9 Red 13 2.1

Case of lambda = 5.0

Weather Winning Hours of Divisions


(w) side combat remaining
0.1 Blue 61 0.9
0.2 Blue 46 0.8
0.25 Blue 43 0.7
0.5 Blue 36 0.4
0.75 Red 28 0.6
0.9 Red 20 0.9
2. (a) We used a spreadsheet implementation of the algorithm in Figure 6.2 with x1=Red
and x2=Blue to obtain the following results. Some lines are omitted.

n x1 x2 lambda
0 3 2 2
1 2.74 1.82
2 2.508132 1.658066
3 2.300738916 1.511866158
4 2.114768207 1.379437166
5 1.947652592 1.259112806
6 1.797218168 1.149468605
7 1.661612849 1.049278467
8 1.539250057 0.957480352
9 1.428764005 0.87314884
10 1.328973884 0.795473022
11 1.238854953 0.723738514
12 1.157515031 0.657312731
13 1.084175265 0.595632732
22 0.695240263 0.185026569
23 0.675451227 0.149621366
24 0.659478471 0.115343495

(b) Next we continue the simulation but add reinforcements. In the case where we wait 1
day for reinforcements, Red wins after 17 hours with 2.9 divisions remaining.

n x1 x2 lambda
0 3 2 2
12 1.157515031 0.657312731
13 3.084175265 0.595632732
14 3.006241634 0.43223879
17 2.898358935 -0.023656879

In the case where we wait 2 days for reinforcements, Red wins after 26 hours with 2.6
units remaining.

n x1 x2 lambda
0 3 2 2
24 0.659478471 0.115343495
25 2.647183456 0.081989238
26 2.636814126 -0.051455137

(c) In the case where Red commits all 5 divisions at the beginning of the battle, Red wins
after 9 hours with 3.7 divisions remaining. See Table I on p. 160 of the text. This is the
best option for Red.
(d) Regardless of the magnitude of Blue's weapons effectiveness advantadge, it is optimal
for Red to attack full force on day one. Holding troops back in reserve only makes Red
do worse.

Advantadge Reinforcements Hours of Winning Remaining


(lambda) arrive on day combat side forces
1.0 0 8 red 4.4
1.0 1 15 red 4.1
1.0 2 16 red 2.1
1.5 0 9 red 4.1
1.5 1 16 red 3.5
1.5 2 19 red 1.5
3.0 0 10 red 3.0
3.0 1 29 red 0.8
3.0 2 13 blue 1.0
5.0 0 17 red 1.0
5.0 1 7 blue 1.4
5.0 2 7 blue 1.4
6.0 0 13 blue 0.6
6.0 1 5 blue 1.5
6.0 2 5 blue 1.5

3. (a) Using a spreadsheet implementation of the algorithm in figure 6.2 we see that in the
case where Blue calls for an immediate nuclear strike, Blue wins in 9 hours with 0.9
divisions remaining. In the conventional warfare scenario, Red won in 10 hours with 3.0
divisions remaining. So the nuclear strategy is to Blue's advantadge in this case.
n x1 x2 lambda
0 1.5 1.3 3
1 1.27575 1.21525
2 1.070207172 1.143710724
8 0.083924597 0.933595178
9 -0.057289954 0.929007191

(b) We multiply x1 by 0.3 and x2 by 0.65 at hour 6 and continue the simulation. Now
x1=Red wins in 16 hours with 0.7 divisions remaining. This is better than the
conventional scenario, but not as good as the immediate strike.
n x1 x2 lambda
0 5 2 3
1 4.55 1.7
5 3.425449827 0.779073247
6 0.980567608 0.386397293
15 0.673912692 0.01897323
16 0.670874913 -0.014786336
(c) A nuclear strike can be very effective. In this case, it makes the difference between
winning and losing the war. If tactical nuclear weapons are used, they should be used
immediately in order to produce the maximum benefit to Blue.

(d) For any value of the weapons effectiveness advantadge parameter lambda, we find
that the optimal strategy for Blue is to attack immediately with tactical nuclear weapons.
Advantadge Nuclear weapons Hours of Winning Remaining
(lambda) used on hour combat side forces
1.0 0 26 red 0.7
1.0 6 10 red 1.3
1.0 never 8 red 4.4
1.5 0 27 blue 0.4
1.5 6 11 red 1.2
1.5 never 9 red 4.1
2.0 0 16 blue 0.7
2.0 6 12 red 1.0
2.0 never 9 red 3.7
5.0 0 5 blue 1.1
5.0 6 12 blue 0.4
5.0 never 17 red 1.0
6.0 0 4 blue 1.1
6.0 6 9 blue 0.5
6.0 never 13 blue 0.6

4. (a) A spreadsheet implementation of the discrete time simulation yields the following
results. Recall that n is the number of 15 second time steps, x1 is the current velocity
(m/sec), and x2 is the previous velocity (m/sec). In this case, docking is achieved after 15
steps or 225 seconds.
n x1 x2 k
0 50 50 0.02
1 35 50
2 23 35
3 14.9 23
4 9.62 14.9
5 6.206 9.62
6 4.0028 6.206
7 2.58164 4.0028
8 1.665032 2.58164
9 1.0738616 1.665032
10 0.69258608 1.0738616
11 0.446682704 0.69258608
12 0.288087555 0.446682704
13 0.185801774 0.288087555
14 0.119832663 0.185801774
15 0.077285953 0.119832663
(b) We repeat the simulation of part (a) for each value of k and tabulate the results.
According to these results, the optimal value is k = 0.03 which results in a successful
docking in 6 steps or 90 seconds.

k Steps to dock Time to dock (sec)


0.01 36 345
0.02 15 225
0.03 6 90
0.04 8 120
0.05 8 120
0.06 11 165
0.07 12 180
0.08 14 210
0.09 15 225
0.10 17 255
0.11 22 330
0.12 25 375
0.13 31 465
0.14 37 555
0.15 46 690
0.16 58 870
0.17 82 1230
0.18 100+ 1500+
0.19 100+ 1500+
0.20 never docks infinity

(c) We repeat the simulation exercise of part (b) but change the initial velocity to 25
m/sec. In this case the optimal value is again k = 0.03 which results in a successful
docking in 5 steps or 75 seconds. We did not tabulate the cases k>0.10 since the time to
dock was much larger than the optimal.

k Steps to dock Time to dock (sec)


0.01 32 480
0.02 13 195
0.03 5 75
0.04 6 90
0.05 7 105
0.06 9 135
0.07 10 150
0.08 12 180
0.09 13 195
0.10 15 225

(d) We repeat the simulation exercise of part (b) but change the initial velocity to 100
m/sec. In this case the optimal value is again k = 0.03 which results in a successful
docking in 8 steps or 120 seconds. We did not tabulate the cases k>0.10 since the time to
dock was much larger than the optimal. On the basis of our sensitivity analysis we
conclude that a value of k = 0.03 is optimal for this control parameter. In other words, we
should apply an acceleration in the opposite direction as our velocity, and 3% as large,
each 15 seconds.

k Steps to dock Time to dock (sec)


0.01 40 600
0.02 16 240
0.03 8 120
0.04 9 135
0.05 10 150
0.06 11 165
0.07 13 195
0.08 16 240
0.09 17 255
0.10 19 285

5. (a) See exercise 10, chapter 4 for the complete description of this model. We let x1 =
number of currently infected persons and x2 = number of immune persons. We model this
problem as a discrete time dynamical system Delta x = F(x) where x = (x1, x2) and F =
(f1, f2) with
f1(x1,x2) = (40/18*70,000)*x1*(100,000-x1-x2) - (1/3)*x1
f2(x1,x2) =(1/3)*x1
Our state space is S = {(x1, x2): x1 >=0, x2 >=0}, and our initial condition is x1 = 18 and
x2 = 30,000. We use a spreadsheet implementation of the algorithm in figure 6.2 to obtain
the following results. Some lines are omitted. Eventually the entire population has been
infected and becomes immune.

week x1 x2
0 18 30000
1 51.98971429 30006
2 150.0967978 30023.3299
3 432.7865971 30073.36217
4 1243.318284 30217.62437
5 3534.144352 30632.0638
6 9742.322383 31810.11192
7 24571.54913 35057.55271
8 47872.31871 43248.06909
9 45409.72439 59205.50866
10 23619.92862 74342.08345
39 0.228974136 99937.09938
40 0.153104985 99937.1757

(b) The maximum number of infected persons is about 48,000 on week eight. See above.
(c,d) We investigate the sensitivity of the maximum number of infected persons to the
number I infected on week one. Note that I effects our dynamical system equations as
well as our initial condition. In our new, generalized model we have
f1(x1,x2) = (40/I*70,000)*x1*(100,000-x1-x2) - (1/3)*x1
f2(x1,x2) =(1/3)*x1
with initial condition x1 = I and x2 = 30,000. This maximum varies significantly with I. If
the 18 cases reported on week 1 was underestimated by a factor of two, then the
maximum number of infected persons will be about half what we currently expect.
I Maximum
10 69104.06079
15 56850.06283
20 48954.92825
25 38728.39584
30 33752.68515
35 27932.75422
40 24047.28027

6. (a) See exercise 4 of chapter 4 for the complete model. We let x = Blue whales and
y = Fin whales and we write d(x,y)/dt = F(x,y) where F = (f1, f2) and
f1(x,y) = 0.05*x - alpha*x*y
f2(x,y) = 0.08*y - alpha*x*y
The state space is the set S consisting of all (x,y) for which x >= 0 and y >= 0. We
assume that alpha=10^(-7) and we use the initial conditions x = 5,000 and y = 70,000.
The results of the simulation are shown below. The Blue whales go extinct and the Fin
whale population just keeps increasing.
DISCRETE TIME SIMULATION DISCRETE TIME SIMULATION
12000 7000000
10000 6000000
8000 5000000
4000000
x 6000 y
3000000
4000 2000000
2000 1000000
0 0
0 10 20 30 40 50 60 0 10 20 30 40 50 60
n n
(b, c) Essentially the same behavior occurs in each case.

(d) There is not much qualitative change in the behavior of the fin whale population. It
always continues to grow. There is also no change in the fact that the blue whales are
eventually extinct. But the time it takes for the blue whale population to become extinct is
quite sensitive to alpha.
alpha time to extinction (years)
10^(-5) 10
10^(-6) 25
10^(-7) 60
10^(-8) 90
10^(-9) 120

DISCRETE TIME SIMULATION DISCRETE TIME SIMULATION


alpha = 10^(-5) alpha = 10^(-6)
5000 5000
4000 4000
3000 3000
x x
2000 2000
1000 1000
0 0
0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40
n n
DISCRETE TIME SIMULATION DISCRETE TIME SIMULATION
alpha = 10^(-8) alpha = 10^(-9)
50000 200000
40000
150000
30000
x 20000 x 100000
10000
50000
0
-10000 0
0 20 40 60 80 100 120 140 0 20 40 60 80 100 120 140
n n
7. (a) See exercise 5 of chapter 4 for the complete model. Let x1 = Blue whales and
x2 = Fin whales and let dx1/dt = f1(x1,x2) and dx2/dt = f2(x1,x2) where
f1(x1, x2) = 0.05*x1*(x1-3000)/(x1+3000)*(1-x1/150,000) - 10^(-8)*x1*x2
f2(x1, x2) = 0.08*x2*(x2-15,000)/(x2+15,000)*(1-x2/400,000) - 10^(-8)*x1*x2
The state space is the set S consisting of all (x1,x2) for which x1 >= 0 and x2 >= 0.
Starting at x1 = 5,000 and x2 = 70,000 the blue whale population grows back to around
140,000 blue whales in about 200 years, and the fin whale population settles down to
around 400,000 fin whales in about 100 years. The graphs below summarize the results
of our simulation. They were prepared using a Microsoft Excel spreadsheet
implementation of the simple simulation method of Section 6.2, equivalent to the Euler
method of Section 6.3 with step size h=1.

160 450
140 400
350
120
Blue (1000s)

Fin (1000s) 300


100
250
80
200
60 150
40 100
20 50
0 0
0 100 200 300 400 500 0 50 100 150 200
t (years) t (years)

(b) There are two distinct cases depending on the initial population of the Blue whale. If
the Blue whale population starts below 4,000 then the behavior is much different than the
case considered in part (a). The Fin whale population grows back rapidly to its
equilibrium value of around 400,000 and the Blue whale population becomes extinct.
The case where we start with x1(0) = 2,000 Blue whales is shown below. The time it
takes for the Blue whale to become extinct is quite sensitive to the initial number of Blue
whales.

Initial Blue whale population time to extinction (years)


2,000 100
3,000 200
2.5 400
350
2
300
Blue (1000s)

Fin (1000s)

1.5 250
200
1 150
100
0.5
50
0 0
0 50 100 150 200 0 50 100 150 200
t (years) t (years)

If we start with 4,000 or more Blue whales then the Blue whale population does not
become extinct. Instead the Blue whales grow back to their equilibrium value of near
150,000. We conclude that our model is quite sensitive to the initial population of Blue
whales, which makes sense since our model was constructed to include the effects of a
minimum viable population.

Initial Blue whale population time to grow back (years)


4,000 300
5,000 200
6,000 200
8,000 200

(c.) In all cases, the Fin whale population grows back rapidly to its equilibrium value of
around 400,000 and the Blue whale population also grows back. The time it takes for the
Blue whale to grow back is quite sensitive to the intrinsic growth rate of the Blue whales.

Intrinsic growth rate (%) time to extinction (years)


0.02 1000
0.03 500
0.04 300
0.06 200
0.07 200

(d) There are two distinct cases depending on the minimum viable population M for the
Blue whale. If we M <= 4000 then the behavior is like the case considered in part (a).
Instead the Blue whales grow back to their equilibrium value of near 150,000. We
conclude that our model is sensitive to the minimum viable population of Blue whales.

Minimum viable population time to grow back (years)


1000 200
2000 200
4000 300

If M >= 5000 then the Fin whale population grows back rapidly to its equilibrium value
of around 400,000 and the Blue whale population becomes extinct. The time it takes for
the Blue whale to become extinct is sensitive to the minimum viable population of the
Blue whales.

Minimum viable population time to extinction (years)


5000 200
6000 150
8. (a) See exercise 6 in chapter 4 for the complete model. Let x = Blue whales and y =
Fin whales and write d(x,y)/dt = F(x,y) where F = (f1, f2) and
f1(x, y) = 0.05*x*(1-x/150000) - 10^(-8)*x*y - 10^(-5)*E*x
f2(x, y) = 0.08*y*(1-y/400000) - 10^(-8)*x*y - 10^(-5)*E*y
The state space is the set S={(x, y): x >= 0 and y >= 0}. Our initial condition is x(0) =
5,000 and y(0) = 70,000 and we assume that E = 3,000 boat-days. We use a spreadsheet
to simulate the behavior of this dynamical system as in section 6.2 of the text. Some lines
are omitted. Eventually both species increase to around x=52,600 blue whales and
y=247,000 fin whales. It takes around 100 years for the fin whale population to grow
back, and around 300 years for the blue whales, which are more severely depleted and
have a lower intrinsic growth rate.
n x y E
0 5000 70000 3000
1 5088.166667 72516.5
2 5177.610426 75086.90669
3 5268.339044 77709.7556
4 5360.360013 80383.38814
5 5453.680554 83105.95089
10 5940.011064 97374.41773
20 7013.578163 128007.5693
50 11076.72132 206313.0089
100 20630.5365 245149.3537
200 41465.93119 248083.6598
300 50263.60821 247542.4757
400 52166.88457 247402.6375
500 52507.80541 247376.5432
600 52566.67762 247371.999
700 52576.77899 247371.2181
800 52578.51028 247371.0843
900 52578.80695 247371.0613
1000 52578.85779 247371.0574

(b) We repeat part (a) but now we assume that E=6000 boat-days per year. Now the fin
whale population increases in about 100 years to around 100,000 fin whales, while the
blue whales become extinct in a few centuries.
n x y E
0 5000 70000 6000
1 4938.166667 70416.5
2 4877.179219 70829.65602
3 4817.023979 71239.42662
4 4757.687545 71645.77235
5 4699.156791 72048.65578
10 4418.146875 74009.96711
20 3909.705184 77656.97289
50 2728.26245 86342.62428
100 1522.311712 94482.38458
200 489.6120263 99197.60172
300 160.4351427 99882.10036
400 52.90858986 99980.82129
500 17.48592392 99996.29156
600 5.783129629 99999.12313
700 1.913113831 99999.75634
800 0.632926092 99999.92555
900 0.209399935 99999.97619
1000 0.069279356 99999.99223

(c) We repeat the above simulation for several different values of E and take x(1000) to
be the equilibrium value for blue whales. We judge that the blues are becoming extinct if
x(1000)<100. On this basis we conclude that the blues will become extinct if E>5,220
boat-days per year.

(d) We repeat part (c) for some different values of alpha, the parameter which measures
the extent of interspecies competition. We tabulate the largest value of E for which both
the Blue whales and Fin whales can coexist. This value is quite sensitive to alpha.
alpha Emax
10^(-9) 5 ,340
10^(-8) 5 ,220
10^(-7) 2 ,820
10^(-6) 0
10 ^(-5) 0

9. (a) We used a spreadsheet implementation of the simple simulation technique of


Section 6.2 to obtain the following results. The harvest rate in BWU at 300 years is taken
as the long-term harvest rate. We find the rate to be 3782.221196 or about 3780 BWU
per year.

n x y BWU E
0 5000 70000 1200 3000
1 5056.666667 72485 1238.975
2 5112.623459 75021.78171 1278.705429 LT Harvest
3 5167.807143 77608.86143 1319.167136 3782.221196
4 5222.154446 80244.57067 1360.333193
5 5275.602282 82927.05602 1402.173909
6 5328.087985 85654.28048 1444.656847
7 5379.54955 88424.026 1487.746876
8 5429.92588 91233.89748 1531.406239

(b) We repeat the limulation in each of the cases E = 500, 1,000, 1,500, ..., 7,500, boat-
days per year. We find that 4000 boat days per year yields the maximum long term yield
of about 4000 BWU per year.
n x y BWU E
0 5000 70000 1600 4000
1 5006.666667 71785 1635.966667
2 5012.437406 73589.8424 1672.294344 LT Harvest
3 5017.30049 75413.45667 1708.961153 4008.832932
4 5021.245196 77254.71985 1745.944205
5 5024.261858 79112.4588 1783.21965
6 5026.341903 80985.45276 1820.762731
7 5027.477893 82872.4361 1858.547838
8 5027.66356 84772.10147 1896.548572
9 5026.893835 86683.10314 1934.737816
10 5025.164877 88604.06051 1973.087805

(c) It seems that the blue whales will go extinct in a few centuries and the fin whale
population will stabilize at about 200,000 whales. Since there are less fins than this now,
we wonder whether this is really the way whalers are behaving.

DISCRETE TIME SIMULATION DISCRETE TIME SIMULATION


6000 200000
5000 180000
4000 160000
140000
x 3000 y
120000
2000 100000
1000 80000
0 60000
0 50 100 150 200 250 300 0 50 100 150 200 250 300
n n
(d) As stated in part (c), this would cause the Blue whale to become extinct.

10. (a) We used a spreadsheet implementation of the model to produce the following
results. The total discounted REVENUE converges as n increases. We took the total
discounted revenue to be the total after 300 years. In the case of 3000 boat-days we
obtain 158354728.2 or approximately $158 billion.

n x y REVENUE E BWU
0 5000 70000 12000000 3000 1200
1 5056.666667 72485 23150775 1238.975
2 5112.623459 75021.78171 33508288.98 Total REV 1278.705429
3 5167.807143 77608.86143 43125017.4 158354728.2 1319.167136
4 5222.154446 80244.57067 52050163.48 1360.333193
5 5275.602282 82927.05602 60329860.19 1402.173909
6 5328.087985 85654.28048 68007358.99 1444.656847
7 5379.54955 88424.026 75123206.18 1487.746876
8 5429.92588 91233.89748 81715407.89 1531.406239
9 5479.157036 94081.32822 87819584.32 1575.594634
10 5527.184485 96963.58673 93469114.17 1620.269335

(b) The highest yield was at 7500 boat-days, which resulted in a total discounted revenue
of 272841399.2 or about $273 billion.

n x y REVENUE E BWU
0 5000 70000 30000000 7500 3000
1 4831.666667 69335 56661937.5 2962.4375
2 4669.592972 68686.70619 80362302.24 Total REV 2925.970955
3 4513.510885 68054.49311 101434461.4 272841399.2 2890.556808
4 4363.16605 67437.7663 120173685.7 2856.15369
5 4218.316942 66835.96045 136841578.6 2822.722287
6 4078.734093 66248.5376 151669979.4 2790.225217
7 3944.199366 65674.98553 164864406.3 2758.62691
8 3814.505289 65114.81618 176607093.4 2727.893504
9 3689.454426 64567.56433 187059670.1 2697.992744
10 3568.858798 64032.78617 196365527.7 2668.893891

(c) A few more simulations as in part (b) seem to indicate that total discounted revenue
keeps increasing as level of effort increases. Thus the whalers will try to maximize their
level of effort. For example if the level of effort is 10,000 boat-days per year, the total
discounted revenue is $305 billion. In this case the behavior of the populations of blue
whales (x) and fin whales (y) are shown below. Both species will become extinct within a
few centuries. This model seems more likely to describe the real behavior of whalers than
the model in problem 9, since whalers do seem to have depleted both populations of
whales. If we assume E=7,500 then blue whales go extinct and fins decline to 25,000.

DISCRETE TIME SIMULATION


DISCRETE TIME SIMULATION
5000 70000
60000
4000 50000
3000 40000
x y
30000
2000
20000
1000 10000
0 0
0 50 100 150 200 250 300 0 50 100 150 200 250 300
n n
(d) The general behavior remains the same. Total discounted revenue is monotone
increasing as a function of level of effort, and so whalers will harvest as many whales as
the can as fast as they can, resulting in the eventual extinction of both species. Since there
is an economic incentive for the whalers to extinct the whales, outside intervention is
necessary in order to save the whales. It is interesting to observe that, when we take into
account the discount rate, it is economically optimal for the whalers to put themselves out
of business. But after all, the stock of whales can never increase by as much as 10% per
year, which is how fast the profit from harvesting will appreciate if we invest it in some
other enterprise (assuming a 10% discount rate).

11. (a) As in exercise 7 of chapter 4 we let


x1 = number of blue whales
x2 = number of fin whales
The dynamical system is
x1' = f1(x1,x2)
x2' = f2(x1,x2),
where
f1(x1,x2) = .05x1(1-x1/150,000)+(.02/500) x1 x2
f2(x1,x2) = .25 x2(1-x2/500)-(.10/150000) x1 x2.
The state space is
S = {(x1,x2): x1>= 0, x2>= 0}.
Starting at any initial condition x1>0, x2>0, and using a computer simulation based on the
simple simulation techniques of section 6.2, the state variables x1 and x2 eventually
stabilize at their equilibrium levels. For example we have

n x1 x2
0 50000 500
1 52666.66667 483.3333333
2 55393.62963 470.3907407
3 58182.75906 459.9836011
4 61034.01047 451.3449681
5 63945.88992 443.960141
6 66915.73585 437.4735886
(intermediate steps deleted)
493 181034.4828 258.6206897
494 181034.4828 258.6206897
495 181034.4828 258.6206897
496 181034.4828 258.6206897
497 181034.4828 258.6206897
498 181034.4828 258.6206897
499 181034.4828 258.6206897
500 181034.4828 258.6206897

(b) We repeat the simulation of part (a) starting at


x1(0) = 0.80 (181034.4828) = 144827.5862
x2(0) = 0.20 (258.6206897) = 51.72413793.
The following graphs show the results of this simulation. Both species grow back to
equilibrium in about 100 years. The whale population increases gradually over this period.
The krill population actually overshoots the equilibrium and then it comes back down.
185000 300
180000
w 175000 250
170000 k
h
a 165000 r 200
i
l 160000 l 150
e 155000
s l
150000 100
145000
140000 50
0 20 40 60 80 100 0 20 40 60 80 100
years years

(c) We repeat the simulation of part (a) starting at


x1(0) = 0.05 (181034.4828) = 9051.724095
x2(0) = 258.6206897.
The following graphs show the results of this simulation. Again it takes about 100 years
for both populations to return to their equilibrium levels. The whale population grows
slowly and steadily. The krill population grows rapidly to a level near the environmental
carrying capacity for krill in the absence of whales (500 tons/acre), and then as the whale
population grows the krill population is again forced down to its equilibrium level.

200000 500

w 150000 450
k
h
r 400
a
100000 i
l
l 350
e
s 50000 l
300

0 250
0 20 40 60 80 100 0 20 40 60 80 100
years years
(d) To be definite we measure the time T it takes for the blue whale population to grow
back to 180,000 whales. We repeat the simulation of part (c) starting at p = 1, 3, 5, 7, and
10 percent of the equilibrium value of 181034.4828 whales to obtain the results tabulated
below. There is not too much sensitivity to this parameter. In every case it takes about
100 years for the whales to grow back. Numerically we approximate S(T,p) = -0.1.

x1(0) p T
1810.34 0.01 133
5431.03 0.03 117
9051.72 0.05 109
12672.41 0.07 104
18103.45 0.10 98

12. (a) We assume d(x,y)=F(x,y) where F=(f1,f2) and


f1(x, y) = 0.10*x-(0.10/10000)*x^2-(0.05/10000)*x*y
f2(x, y) = 0.25*y-(0.25/6000)*y^2-(0.125/6000)*x*y
on the state space S={(x,y):x>=0 and y>=0} starting at x(0)=100 tons/acre of hardwoods
and y(0)=1500 tons/acre of softwoods. We use a spreadsheet implementation of the
simulation technique in section 6.2 of the text. Some lines are omitted. On p. 121
equation (2) in the text we calculated that the equilibrium point is at (9333,1333). The
hardwoods increase to (0.9)*9333=8400 in about 100 years. The softwoods overshoot
the equilibrium and then start back down. They come back down to (1.1)*1333=1467 in
about 150 years.
n x y
0 100 1500
1 109.15 1778.125
2 118.9754511 2086.87418
3 129.4900106 2421.959923
4 140.7032369 2776.504084
5 152.6222711 3141.284001
10 223.2407272 4750.592156
20 439.0361206 5738.715955
50 2546.091487 4979.097908
75 6178.030154 3370.748499
100 8372.7694 2157.477294
125 9032.582288 1653.02917
150 9224.62208 1461.858243

(b) After 63 years there are 4407 tons/acre of hardwoods and 4187 tons/acre of
softwoods. At this point the hardwoods are increasing by 154 tons/acre per year, the
maximum rate. This number is f1(x,y).

(c) After 63 years the value of the forest timber is increasing at the fastest rate. In units
of one ton/acre of softwood the rate is 549 per year, i.e. this is the value of V=4*f1(x,y) +
f2(x,y) at this point, and this is the maximum of this quantity.

13. (a) See exercise 12 above. We compute A=V/n where V=4*f1(x,y) + f2(x,y) and n is
time in years. The units are in the value of one ton/acre of softwood. The maximum
occurs at n=75 years. So this model suggests that we should clear-cut in intervals of 75
years.
DISCRETE TIME SIMULATION
600
550
500
450
400
A
350
300
250
200
150
0 10 20 30 40 50 60 70 80 90 100
n
(b) If we only plant hardwoods then it is optimal to clear-cut on intervals of 55 years.
This also produces about 50% higher value than in part (a). Note that the highest value
occurs after one year, but our model is not really valid over such a short range. The new
saplings are not as valuable as older trees.
DISCRETE TIME SIMULATION
900
800
700
600
A
500
400
300
200
0 10 20 30 40 50 60 70 80 90 100
n
(c) If we only plant softwoods then it is optimal to clear-cut on intervals of 20 years. The
value here is the lowest of the three options considered.
DISCRETE TIME SIMULATION
250

200

A 150

100

50
0 10 20 30 40 50 60 70 80 90 100
n
(d) We do not really know how much one ton/acre of softwoods is worth, or how many
acres in the forest tract. Suppose that one ton of softwood will generate P dollars of
profit for the company. The best use that the company can make of the land under the
clear-cutting scheme is to clear-cut every 55 years, and replant only hardwoods. This will
generate 600*P dollars per year per acre. Suppose that the company can sell the land for
a price of Q dollars per acre, and that the company can put the money to another use
which will net a return of R% per year. Then the company should sell the land if
(R/100)*Q exceeds 600*P.

14. (a) See exercise 5 in chapter 4 for the complete model. Let x = Blue whales and y =
Fin whales and write d(x, y)/dt = F(x,y) where F = (f1, f2) and
f1(x1, x2) = 0.05*x1*(x1-3000)/(x1+3000)*(1-x1/150,000) - 10^(-8)*x1*x2
f2(x1, x2) = 0.08*x2*(x2-15,000)/(x2+15,000)*(1-x2/400,000) - 10^(-8)*x1*x2
The state space is the set S consisting of all (x1,x2) for which x1 >= 0 and x2 >= 0.
Starting at x1 = 5,000 and x2 = 70,000 the blue whale population grows back to around
140,000 blue whales in about 200 years, and the fin whale population settles down to
around 400,000 fin whales in about 100 years. The graphs below summarize the results
of our simulation. They were prepared using a Microsoft Excel spreadsheet
implementation of the Euler method of Section 6.3 with step size h=0.5. The picture are
more or less indistinguishable from the results of Exercise 6.7 using the simple
simulation method of Section 6.2, evidence that h=1.0 is small enough for this problem.
160 400
140 350
120 300
Blue (1000s)

Fin (1000s)

100 250
80 200
60 150
40 100
20 50
0 0
0 100 200 300 400 500 0 50 100 150 200
t (years) t (years)

(b, c, d) For most initial the solution curve tends towards the stable equilibrium near
(140,000, 400,000) so that both species coexist. For initial values of Blue or Fin whales
near or below the minimum viable population, that species goes extinct.
500
450
400
350
Fin (1000s)

300
250
200
150
100
50
0
0 50 100 150 200
Blue (1000s)

40
35
30
Fin (1000s)

25
20
15
10
5
0
0 50 100 150 200
Blue (1000s)
15. (a) Using the assumptions from Figure 5.7 the dynamical system is now

dx1/dt = f1(x1,x2) = (x1-x1^3-x2) / L


dx2/dt = f2(x1,x2) = x1

so the vector field is much like Figure 5.11 except that as L grows the f1 coordinate
shrinks, making the vectors steeper.

(b) The linear system is x'=Ax where A=[[1/L,-1/L],[1,0]]. The eigenvalues of A are
both complex with positive real part when 1 - 4L < 0 or in other words L > 1/4.

( c) We use Excel to simulate the solution starting at x1=0.1, x2=0.3 for different values
of L. The limit cycle gets larger as L increases. These graphs use T=20 and h=0.1.

L = 0.5 L = 0.75

2 2

1.5 1.5

1 1

0.5 0.5
x2

x2

0 0
-1.5 -1 -0.5 0 0.5 1 1.5 -1.5 -1 -0.5 0 0.5 1 1.5
-0.5 -0.5

-1 -1

-1.5 -1.5

-2 -2
x1 x1

L = 1.5 L = 2.0

2 2

1.5 1.5

1 1

0.5 0.5
x2

x2

0 0
-1.5 -1 -0.5 0 0.5 1 1.5 -1.5 -1 -0.5 0 0.5 1 1.5
-0.5 -0.5

-1 -1

-1.5 -1.5

-2 -2
x1 x1
(d) The Excel portraits for each value of L show the same behavior. There is a unique
limit cycle that attracts all solution curves. As L gets smaller we need a smaller step size
h to maintain accuracy. We used h=0.1 for L=1.5, 2.0 and h=0.05 for L=0.5,0.75.

L = 0.5 L = 0.75

3 3

2 2

1 1
x2

x2
0 0
-2 -1 0 1 2 -2 -1 0 1 2
-1 -1

-2 -2

-3 -3
x1 x1

L = 1.5 L = 2.0

3 3

2 2

1 1
x2

x2

0 0
-2 -1 0 1 2 -2 -1 0 1 2
-1 -1

-2 -2

-3 -3
x1 x1
16. (a) Using equation (11) we see that when C > 4 there are two real, distinct
eigenvalues of the form 1 / 2 + A and 1 / 2 - A where A = SQRT(1-4 / C) / 2 so that
A < 1 / 2. Then v1 = [1, 1 / 2 - A] is an eigenvector belonging to 1 / 2 + A and likewise
v2 = [1, 1 / 2 + A] is an eigenvector belonging to 1 / 2 - A. Then the general solution is of
the form x = [x1, x2] = c1*v1*exp(t*(1 / 2 + A)) + c2*v2*exp(t*(1 / 2 - A)).

(b) The following graph shows the phase portrait for the linear system in the case
C = 16 / 3, in which case A = 1 / 4. All solution curves travel outwards. The phase
portrait is similar for any C > 4. As C decreases towards 4 the eigenvalue lines get closer,
both tending toward slope 1 / 2. As C gets larger the eigenvalue lines spread apart,
tending to the horizontal and vertical as C goes to infinity.
3
2
1
0
-1
-2
-3
-3 -2 -1 0 1 2 3
(c) We used a spreadsheet implementation of the Euler method to produce the following
results. As C increases the rotation gets slower, so we must either use a larger step size or
more steps. As C increases the limit cycle gets smaller.

C=5
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5
C=6
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5
C=8
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5
C=10
1.5
1.0
0.5
0.0
-0.5
-1.0
-1.5
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5

(d) The phase portrait in the cases C = 5, 6, 8, 10 are quite similar to the case C = 1 in the
text. There is a general counterclockwise flow, and a unique limit cycle. As C increases
the limit cycle gets smaller, and the flow gets slower. The only qualitative difference in
the phase portraits occurs near the origin. For 0 < C < 4 we get spirals, and for C > 4 we
get the behavior detailed in part (b) above. As C increases towards 4 the spirals rotate
more and more slowly, and then as C increases past 4 they disappear completely, but in a
smooth way. But on a scale large enough to see the overall behavior, the differences near
the origin are impossible to see.
17. (a) Now the dynamical system is
x1' = f1(x1,x2)
x2' = f2(x1,x2),
where
f1(x1,x2) = a x1 - x13 - x2
f2(x1,x2) = x1.
The vector field is essentially the same as in Figure 5.11 in the text, for all values of a > 0.

(b) The form of the linear system that approximates the behavior of our dynamical system
x'=F(x) in the neighborhood of the equilibrium x=(0,0) is x'=Ax where A is the matrix of
partial derivatives of F(x) evaluated at the equilibrium point. We use DERIVE to
compute the matrix of partial derivatives A at the equilibrium point and its eigenvalues.

f1:=a*x1-x1^3-x2
f2:=x1
A:=[[DIF(f1,x1),DIF(f1,x2)],[DIF(f2,x1),DIF(f2,x2)]]
[[a-3*x1^2,-1],[1,0]]
[x1:=0,x2:=0]
[[a,-1],[1,0]]
EIGENVALUES(A)
[w=(a-SQRT(a^2-4))/2,w=(SQRT(a^2-4)+a)/2]

For 0 < a < 2 both eigenvalues are complex with positive real part (a/2) and so the
equilibrium is unstable. For a > 2 both eigenvalues are real and positive (see graph
below), so the equilibrium is still unstable.
10
9
8
e
i 7
g
e 6
n 5
v
a 4
l
u 3
e
2
1
0
0 1 2 3 4 5 6 7 8 9 10
a
(c) For 0 < a < 2 the phase portrait consists of spirals outward, counterclockwise. As a
increases the spirals spread out. The following graphs were obtained using a spreadsheet
implementation of the Euler method to simulate the dynamical system for different values
of the parameter a. Each graph shows a representative solution curve beginning at
x1(0) = 0.01 and x2(0) = 0.01. As a approaches 2 from below the rate of rotation tends to
zero. After a increases beyond 2 the solution curves tend to infinity without any rotation.

a = 0.25
1.0

0.5

0.0

-0.5

-1.0
-1 0 1
a = 0.5
1.0

0.5

0.0

-0.5

-1.0
-1 0 1
a = 0.75
1.0

0.5

0.0

-0.5

-1.0
-1 0 1
(d) We used a spreadsheet implementation of the Euler method to simulate the nonlinear
dynamical system model for several different values of a. In each case there is a unique
counterclockwise limit cycle. Solution curves beginning inside the limit cycle spiral
outward, and those starting outside spiral inward, just as in the base case a=1 considered
in the text. As a increases the limit cycle gets larger. The period also increases slowly as a
increases, from about 6.5 in the case a=0.5 to about 8 in the case a=2. Since the behavior
of this dynamical system does not vary significantly as we change the form of the v-i
characteristic, we conclude that the model is robust with regard to the assumed form of
this function.

a=0.5 a=0.75
3 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-2 -1 0 1 2 -2 -1 0 1 2
a=1.5 a=2.0
3 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-2 -1 0 1 2 -2 -1 0 1 2
19. (a) Step 1: Ask the question. This problem requires some knowledge of elementary
physics. The total force on an object F moving in the direction parameterized by s must
satisfy F=m*s'' where s'=ds/dt. The force due to gravity on an object of mass m on or near
the surface of the earth can be expressed in vector form as F=(-m*g,0) where g=980
cm/sec^2 is the gravitaional constant and the coordinate axes are oriented so that the first
coordinate direction is parallel to the ground and the second coordinate direction points
upward. If the pendulum makes an angle of theta radians with a vertical line then the
component of the force which acts on the pendulum is the projection of the force vector in
the direction perpendicular to the rod. This component has length -m*g*sin(theta). The
other component of the force vector is parallel to the rod and since the rod is rigid it does
not effect the movement of the pendulum. The 100 gm weight on the end of the
pendulum moves along a circle. Let s (cm) denote the distance between the weight and
the bottom of the circle, measured along the arc of the circle. Then s=120*theta since the
radius of the circle equals the length of the rod. The units of force are
Newtons=gm*cm/sec^2.

Variables: theta = pendulum angle (radians)


s = distance from vertical (cm)
G = gravitational force acting in the s direction (Newtons)
D = frictional force (Newtons)
t = time (sec)

Assumptions: s = 120*theta
G = -100*980*sin(theta)
D = -0.05*(theta)'
F = G+D
F = 100*s''

Objective: Determine s(t) given theta(0)=Pi/4 and (theta)'(0)=0.

Step 2: We will model this problem as dynamical system, and simulate a solution using the
Euler method..

Step 3: Let x1=theta and x2=(theta)' in order to obtain a first order system of differential
equations. Then
F = 100*s''
G+D = 100*(120*theta)''
-100*980*sin(theta)-0.05*(theta)' = 120*100*(theta)''
-100*980*sin(x1)-0.05*x2 = 120*100*x2'
Putting this together with the fact that x2=x1' we get the dynamical system equations
dx/dt = F(x1,x2) where x = (x1, x2) and F=(f1, f2) with
f1(x1,x2) = x2
f2(x1,x2) = -980*sin(x1)/120-0.05*x2/(12000)
Our goal is to solve the dynamical system equations with initial conditions x1(0)=Pi/4 and
x2(0)=0.
Step 4: We use a spreadsheet implementation of the Euler method algorithm in figure
6.19 on p. 170 of the text. The following graph shows the results of the algorithm using
t(0)=0, x1(0)=0.785398163, x2(0)=0, N=100, and T=5. In this case the step size h=0.05.
The results are surprising. Notice that the oscillations of x=x1 actually get larger, rather
than smaller as we expect. This is due to numerical instability in the Euler method.
Decreasing the step size (increasing N) reduces the extend to which the oscillations
increase, but it is virtually impossible to make h small enough to get the oscillations to
decrease in size. There is an upper limit to how large we can make N for this spreadsheet.

2.0
1.5
1.0
0.5
x 0.0
-0.5
-1.0
-1.5
-2.0
0 1 2 3 4 5
t
Next we tried a BASIC program implementation of the Euler method. Starting with the
same input values as before, we kept increasing N until we began to see some stability in
the resulting estimate of x1(5)and x2(5). We show the first and last output lines for some
of these runs. Since doubling N is supposed to decrease the error by about 1/2, we judge
that we have achieved 2 decimal place accuracy when the next doubling of N changes the
outputs by less than 0.005. This requires something on the order of N=20,000 or
h=0.00025. However, even with a step size this small, the oscillations continue to grow.
It seems impossible to successfully simulate this model using the Euler method. The effect
of the damping is too small. It is overwhelmed by the accumulated error which occurs in
the course of the simulation. This exercise highlights the need for better simulation
methods in general. A more sophisticated method for simulating dynamical systems is
presented in exercise 21 below.

LIST
10 REM EULER METHOD IN TWO VARIABLES
20 DEF FNF1 (X1, X2) = X2
30 DEF FNF2 (X1, X2) = -980 * SIN(X1) / 120 - .05 * X2 / (12000)
40 X1 = .7853982#: X2 = 0: T = 0
50 INPUT T1, N
60 PRINT T, X1, X2
70 H = (T1 - T) / N
80 FOR I = 1 TO N
90 S1 = FNF1(X1, X2)
100 S2 = FNF2(X1, X2)
110 X1 = X1 + H * S1
120 X2 = X2 + H * S2
130 T = T + H
140 PRINT T, X1, X2
150 NEXT I
160 END
RUN
? 5,5000
0 .7853982 0
4.99982 .3218918 -2.030906
RUN
? 5,10000
0 .7853982 0
5.000206 .314679 -2.017639
RUN
? 5,20000
0 .7853982 0
5.000159 .3111407 -2.010962

(b) We use the computer algebra system DERIVE to compute the eigenvalues of the
linear system dx/dt=Ax which approximates the behavior of the dynamical system in the
neighborhood of the origin. For values of k<SQRT(4704000000) there are two complex
conjugate eigenvalues with negative real part, and so the equilibrium is stable. Note also
that for any reasonable value of k the real part is extremely small in relation to the
complex part. For k=0.05 for example the real part is about 10^6 times smaller. This
means that the spirals tend to the origin extremely slowly. This is why the problem is so
hard to simulate.

f1:=X2
f2:=-980*SIN(X1)/120-K*X2/12000
A:=[[DIF(f1,X1),DIF(f1,X2)],[DIF(f2,X1),DIF(f2,X2)]]
[[0,1],[-49*COS(X1)/6,-K/12000]]
[X1:=0,X2:=0]
[[0,1],[-49/6,-K/12000]]
EIGENVALUES(A)
[w=(SQRT(K^2-4704000000)-K)/24000,w=-(SQRT(K^2-4704000000)+K)/24000]
K:=0.05
[w=-2.08333*10^(-6)+2.85773*#i,w=-2.08333*10^(-6)-2.85773*#i]
(c) For small oscillations where (x1,x2) stay close to the equilibrium (0,0) the behavior of
the pendulum is approximately that of the linear system. For k=0.05 the periodic part has
terms involving sin(bx) and cos(bx) where b=2.85773 and so the period is 2*Pi/b=2.20
seconds. Our simulation using the Euler method produces about the same period, so even
though we are not effective in determining the amplitude of the x1(t) wave, we seem to be
able to do a fairly good job of estimating the period. More generally we have
b=SQRT(k^2-4704000000)/24000 and since most reasonable values of k are negligable in
this formula, it seems that the period is extremely insensitive to the exact value of k.

(d) Since our attempt to simulate the model was unsuccessful, we must rely on the linear
approximation. It is easy to see that [1,lambda] is an eigenvector belonging to the
eigenvalue lambda. Then [1,lambda]*exp(lambda*t) is a complex solution. Taking real
and imaginary parts yields two linearly independent real solutions s1 and s2, and then the
general solution to the linear system is x=c1*s1+c2*s2. For a given initial angular velocity
V, the solution which satisfies x(0)=[Pi/6,V] is obtained by solving this vector equation for
c1,c2. Then we can set x(2*pi/b)=[pi/6,0] and solve for V. Using DERIVE we find a
solution of V=3.96637*10^(-13) cm/sec. Then if the linear approximation is reasonably
accurate, we need to impart an angular velocity of around 4*10^(-13) cm/sec every time
the pendulum swings back 30 degrees to the right. This is such a small fraction of the
typical values for x2 that it is naturally next to impossible to compute using Euler method
approximations. Different values of k give essentially the same answer, i.e. a very small
one. Real grandfather clocks work on a slightly different mechanism. They impart a much
larger angular velocity, and then when the pendulum returns, they absorb the extra kinetic
energy in to a spring, and use it to impart angular velocity for the next pendulum swing.

K:=0.05
[a:=-K/24000,b:=SQRT(-K^2+4704000000)/24000]
L:=a+#i*b
s1:=RE([-1,L]*EXP(L*t))
s2:=IM([-1,L]*EXP(L*t))
x:=c1*s1+c2*s2
t:=0
x-[pi/6,V]
[-pi/6-c1,-V-c1/480000+SQRT(1881599999999)*c2/480000]
[c1:=-pi/6,c2:=480000*SQRT(1881599999999)*V/1881599999999-
SQRT(1881599999999)*pi/11289599999994]
t:=2*pi/b
x-[pi/6,0]
[0,V+10000000000000/2521196346401*10^(-13)]
V=-3.96637*10^(-13)

20. (a,b) Substitute x1 = x2 = (a-1)/a to check that (a-1)*x1-a*x1^2=0 and x1-x2=0 at


this point. In (a) the eigenvalues of A=DF at x1=x2=(a-1)/a are -1 and 1-a so this
equilibrium is stable for a>1.

(c) It suffices to describe the behavior of x1(n) since x2(n)=x1(n-1). For a=1.5 there is an
equilibrium at x1=1/3 and for any nearby initial condition x1(0) we see x1(n) tending
monotonely to 1/3. For a=2.0 there is an equilibrium at 1/2 and for any nearby initial
condition x1(0) we see that x1(1) overshoots the equilibrium, but then x1(n) tends to 1/2
monotonely. For a=2.5 the equilibrium is at 3/5 and for any nearby initial condition x1(0)
we see that x1(n) tends to 3/5 but oscillates, jumping over the equilibrium every time step.
For a=3.0 the equilibrium is at 2/3. Now x1(n) tends to 2/3 but very slowly, and oscillates
as in the case a=2.5. For values of a just slightly larger than 3.0 the solutions actually tend
towards a 2-cycle, i.e. there are two numbers b and c such that x1(2n) tends to b and
x1(2n+1) tends to c. Neither b nor c equals the original equilibrium x1=(a-1)/a, which
becomes unstable. For a=3.5 the equilibrium is 5/7 but it is unstable. Nearby solutions
tend to a 4-cycle. For large n we have approximately that
(...,x1(n),x1(n+1),x1(n+2),x1(n+3),...) = (...,.87,.38,.83,.50,.87,.38,.83,.50,...)
For the case a=4 the equilibrium is 3/4 but it is unstable. Nearby solutions seem to jump
randomly around the entire interval [0,1]. This is chaos.
a=1.5 a=2.0
0.50 0.8

0.45 0.7
0.6
x 0.40 x
0.5
0.35
0.4
0.30 0.3
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
n n
a=2.5 a=3.0
0.9 0.9
0.8 0.8
0.7 0.7
0.6 0.6
x x
0.5 0.5
0.4 0.4
0.3 0.3
0.2 0.2
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
n n
a=3.5 a=4.0
0.9 1.0
0.8 0.8
0.7
0.6
x 0.6 x
0.4
0.5
0.4 0.2
0.3 0.0
0 2 4 6 8 10 12 14 16 18 20 0 5 10 15 20 25 30 35 40 45 50
n n

21. (a,b) The following BASIC program implements the algorithm in Figure 6.27 in the
text. In order to verify the code, we use it so solve the linear system (18) from p.136 in
chapter 5 of the text. The general solution is given in (19) on p.137. If c1=c2=1 then the
solution is x1=-exp(-3*t)-exp(-1*t) and x2=exp(-3*t)+3*exp(-1*t). The corresponding
initial condition is (x1,x2)=(-2,4). Setting t=1 we obtain x1=-0.41766651 and
x2=1.153425392. A simulation run with t(0)=0, x1(0)=-2, x2(0)=4, N=20, and T=1.0 (so
that the step size h=0.05) yields x1(1)=-0.4176672 and x2(1)=1.153426.

10 REM RUNGE-KUTTA METHOD IN TWO VARIABLES


20 DEF FNF1(X1,X2)=-4*X1-X2
30 DEF FNF2(X1,X2)=3*X1
40 T=0:X1=-2:X2=4
50 INPUT T1,N
60 H=(T1-T)/N
70 PRINT T,X1,X2
80 FOR I=1 TO N
90 R1=FNF1(X1,X2)
100 S1=FNF2(X1,X2)
110 R2=FNF1(X1+H*R1/2,X2+H*S1/2)
120 S2=FNF2(X1+H*R1/2,X2+H*S1/2)
130 R3=FNF1(X1+H*R2/2,X2+H*S2/2)
140 S3=FNF2(X1+H*R2/2,X2+H*S2/2)
150 R4=FNF1(X1+H*R3,X2+H*S3)
160 S4=FNF2(X1+H*R3,X2+H*S3)
170 X1=X1+(H/6)*(R1+2*R2+2*R3+R4)
180 X2=X2+(H/6)*(S1+2*S2+2*S3+S4)
190 T=T+H
200 PRINT T,X1,X2
210 NEXT I
220 END
RUN
? 1.0,20
0 -2 4
.05 -1.811938 3.714397
.1 -1.645657 3.455332
.15 -1.498338 3.219754
.2 -1.367544 3.005006
.25 -1.251169 2.808771
.3 -1.14739 2.629026
.35 -1.054628 2.464004
.4 -.971516 2.312156
.45 -.8968701 2.172127
.5000001 -.8296624 2.042724
.5500001 -.7690012 1.922901
.6000001 -.714112 1.811735
.6500001 -.6643212 1.708413
.7000001 -.619043 1.612214
.7500001 -.577767 1.5225
.8000001 -.540048 1.438706
.8500001 -.5054976 1.360328
.9000002 -.4737761 1.286916
.9500002 -.4445862 1.218068
1 -.4176672 1.153426
(c) In order to verify the results in Figure 6.20 we change a few lines of code and run the
simulation again. A simulation run with t(0)=0, x1(0)=-1.0, x2(0)=-1.5, N=20, and T=10
(so that the step size h=0.5) yields essentially the same results as in the original graph.
The solution curve moves counterclockwise and spirals inward. The period of rotation is
about 7 seconds.
10 REM RUNGE-KUTTA METHOD IN TWO VARIABLES
20 DEF FNF1(X1,X2)=X1-X1^3-X2
30 DEF FNF2(X1,X2)=X1
40 T=0:X1=-1.0:X2=-1.5
RUN
? 10,20
0 -1 -1.5
.5 -.3065966 -1.826992
1 .6592568 -1.750189
1.5 1.255589 -1.221036
2 1.221642 -.5682529
2.5 1.114227 2.456876E-02
3 .9342316 .5399055
3.5 .6871492 .9487015
4 .3219745 1.207606
4.5 -.2785767 1.230113
5 -.973536 .9049047
5.5 -1.136374 .3491284
6 -1.044055 -.2047279
6.5 -.8553326 -.6831149
7 -.5824865 -1.046789
7.5 -.1582817 -1.24048
8 .5240515 -1.158244
8.5 1.087475 -.7327482
9 1.121516 -.1594716
9.5 .9897423 .3741064
10 .7757097 .8188627
In order to verify the results in Figure 6.21 we change one line of code and run the
simulation again. A simulation run with t(0)=0, x1(0)=0.1, x2(0)=0.3, N=20, and T=10
(so that the step size h=0.5) yields essentially the same results as in the original graph.
The solution curve moves counterclockwise and spirals outward. The period of rotation is
about 7 seconds.

40 T=0:X1=0.1:X2=0.3
RUN
? 10,20
0 .1 .3
.5 -3.921125E-02 .3184298
1 -.2535842 .2478362
1.5 -.4942596 5.974719E-02
2 -.6452057 -.2310165
2.5 -.6346642 -.5575789
3 -.472134 -.8402658
3.5 -.1455785 -1.002553
4 .4030529 -.946906
4.5 .9509516 -.5954812
5 1.062923 -7.295962E-02
5.5 .9489138 .4365745
6 .7342777 .861191
6.5 .4093571 1.152864
7 -.1238059 1.235363
7.5 -.846743 .9891418
8 -1.133733 .4647446
8.5 -1.071987 -9.823477E-02
9 -.8990487 -.594875
9.5 -.6460523 -.9849772
10 -.2617729 -1.219247
22. (a) We use a spreadsheet implementation of the Euler method with time step h = 1.
Selected lines are shown. The Blue whale population x1 increases gradually for the first
50 years, but does not attain its equilibrium level.
t x1 x2 h alpha
0 5000 70000 1 1E-08
1 5238 74617
2 5487 79468
3 5747 84558
5 6302 95458
10 7914 126796
20 12308 202478
30 18685 278322
40 27515 334722
50 39061 367632
(b) The following graphs show the results of repeated simulations where we vary the step
size h years. For h = 1, 5, 10, 20 the only difference is that the blue whale population
growth is projected further into the future. For h = 30 the equilibrium at x1=138,207
becomes unstable and there appears a discrete limit cycle of period two. The solution
eventually settles down to a pattern of x1 = 145652, 131556, 145652, 131556,... For h =
35 the behavior is chaotic. The second graph for h = 35 zooms in to show additional
detail. When h = 40 (graph not shown) the solution quickly diverges to infinity.
160000
h=5 160000
h = 10

120000 120000

80000 80000

40000 40000

0 0
0 50 100 150 200 250 0 100 200 300 400 500

160000
h = 20 160000
h = 30

120000 120000

80000 80000

40000 40000

0 0
0 200 400 600 800 1000 0 200 400 600 800 1000 1200 1400 1600

160000
h = 35 160000
h = 35

120000 150000

80000 140000

40000 130000

0 120000
0 500 1000 1500 2000 0 500 1000 1500 2000

(c) For h = 1, 5, 10, 20, and 40 there are no significant differences between the cases
alpha = 10^(-7), 10^(-8), 10^(-9). For h = 30 the there is always a two cycle, which gets
smaller as alpha decreases. For h = 35 there is always chaos, but the band in which the
solution is confined gets narrower as alpha gets smaller. Our general conclusions are not
sensitive to the parameter alpha.

(d) Starting at x1 = 150,000 and x2 = 400,000 the behavior is essentially the same as in
part (b). Our general conclusions are not at all sensitive to the choice of initial conditions.

23. (a) We use a spreadsheet implementation of the Euler method with a time step of h =
35 years to obtain the following results. Some lines are deleted. After N = 50 time steps
(T = 1750 years) starting with x1(0) = 5000 there are x1(T) = 142,681 Blue whales.
t x1 x2 h alpha
0 5000 70000 35 1E-08
35 13336 231578
70 33518 503517
350 125040 138917
700 156042 339389
1400 130076 280500
1750 142681 339463
(b) For x1(0) = 5050 we obtain x1(T) = 122,134 which is 14.4% smaller. Since x1(0) is
1% larger we obtain a sensitivity of -14.4 in this case.

(c) We tabulate results for the different initial conditions. The sensitivity gets much larger
as the initial condition gets closer to x1(0) = 5000.

old new % change Sensitivity


x1(0) 5000 5005 0.1
x1(T) 142681 152495 6.88 68.78
x1(0) 5000 5000.5 0.01
x1(T) 142681 138060 -3.24 -323.86
x1(0) 5000 5000.05 0.001
x1(T) 142681 124475 -12.76 -12760.42
x1(0) 5000 5000.005 0.0001
x1(T) 142681 140541 -1.50 -15000.08
c) The system is extremely sensitive to initial conditions. Since it is impossible to measure
the state of the system exactly, we cannot predict the future.
24. (a) For this problem we will use MAPLE to perform the necessary calculations. The equilibrium
point is x1=138,207 and x2 = 393,090. Since the eigenvalues are both negative, this is a stable
equilibrium for the continuous time model.

> restart:f1:=(5/100)*x1*(1-x1/150000)-alpha*x1*x2;
 11 
x1  1 −
f1 := x1  − α x1 x2
20  150000 
> f2:=(8/100)*x2*(1-x2/400000)-alpha*x1*x2;
2  1 
f2 := x2  1 − x2  − α x1 x2
25  400000 
> alpha:=10^(-8):
f11:=diff(f1,x1):f12:=diff(f1,x2):
f21:=diff(f2,x1):f22:=diff(f2,x2):
> solve({f1/x1=0,f2/x2=0},{x1,x2});assign(%);
>
785000000 276000000
{ x2 = , x1 = }
1997 1997
> A:=array([[f11,f12],[f21,f22]]);

 -92 -69 
 
 1997 49925
A := 
 -157 -157 
 
39940 1997 
> with(linalg):evalf(eigenvals(A));
Warning, the protected names norm and trace have been redefined and unprotected

-.04590303902, -.07878399152

(b) The discrete time system has x(n+1)=x(n)+F(x(n))*h = G(x(n)) so G(x)=x+hF(x) is the iteration
function. The iteration function is as follows.

> x1:='x1':x2:='x2':g1:=x1+h*f1;g2:=x2+h*f2;
1  1  1 
g1 := x1 + h  x1  1 − x1  − x1 x2 
 20  150000  100000000 
2  1  1 
g2 := x2 + h  x2  1 − x2  − x1 x2 
 25  400000  100000000 

(c) We compute the matrix of partial derivatives and the associated eigenvalues.

> g11:=diff(g1,x1):g12:=diff(g1,x2):
g21:=diff(g2,x1):g22:=diff(g2,x2):
> solve({f1/x1=0,f2/x2=0},{x1,x2}):assign(%):
A:=array([[g11,g12],[g21,g22]]);
>
 92 69 
1 − h − h 
 1997 49925 

A := 
 157 157 
− h 1− h
 39940 1997 
> s:=eigenvals(A);
249 1 249 1
s := 1 − h+ 2694790 h, 1 − h− 2694790 h
3994 99850 3994 99850

(d) Both eigenvalues are real and remain between +1 and -1 for 0 < h < 25.38 after which one
eigenvalue drops below -1. At this point the discrete time dynamical system becomes unstable. In the
text we found stability for h = 24 and instability for h = 27.

> plot({s[1],s[2]},h=0..30,xtickmarks=4);

> fsolve(s[2]=-1.0,h);
25.38586788
25. (a) We used a spreadsheet implementation of the Euler method to produce this graph.
(b) the graph below shows the four point limit cycle when the step size is h = 32 years.
(c) the remaining graphs show limit sets for h=33,...,37 and the emerging fractal pattern
(d) additional simulations with the initial condition x1(0)=150,000 and x2(0)=400,000 yield essentially the
same limit sets, indicating no dependence on initial condition.
(e) for alpha=3*10^(-8) the emergence of a fractal limit set is similar but the shape of the set is slightly
different.

h=32 h=33

600000 600000

500000 500000

400000 400000
Fin whales (x2)

Fin whales (x2)


300000 300000

200000 200000

100000 100000

0 0
125000 130000 135000 140000 145000 150000 155000 125000 130000 135000 140000 145000 150000 155000
Blue whales (x1) Blue whales (x1)

h=34 h=35

600000 600000

500000 500000

400000 400000
Fin whales (x2)

Fin whales (x2)

300000 300000

200000 200000

100000 100000

0 0
120000 125000 130000 135000 140000 145000 150000 155000 160000 120000 125000 130000 135000 140000 145000 150000 155000 160000
Blue whales (x1) Blue whales (x1)

h=36 h=37

600000 600000

500000 500000

400000 400000
Fin whales (x2)

Fin whales (x2)

300000 300000

200000 200000

100000 100000

0 0
110000 120000 130000 140000 150000 160000 170000 110000 120000 130000 140000 150000 160000 170000
Blue whales (x1) Blue whales (x1)
26. (a) We used a spreadsheet implementation of the Euler method
(b) The graph shown below left was produced using N=500 and T=5 so that h=0.01 is the step size. Using
a smaller step size h yields essentially the same graph.

12 10
9
10
8
8
7
6 6
5
4
4
2
3
0 2
0 2 4 6 8 2 4 6

(c) The graph shown above right uses the same N,T as in (b) but starts at initial condition (x1,x2,x3) =
(7,1,2). As before the solution approaches the equilibrium at (4.32,4.32,7).
(d) The graph on the left below shows the case r=18 and uses h=.0025 (N=2000,T=5) with initial condition
(1,1,1). The solution curve loops around the equilibrium point E+ but then is attracted to the E- equilibrium
point, where it slowly spirals inward. Larger step sizes h yield very different results which do not reflect
the true behavior of the continuous time model. The graph on the right below shows the case h=28 and
uses h=.009 (N=2000,T=18) with initial condition (1,1,1). Smaller step sizes h yield similar results. The
solution settles into a pattern of looping about both unstable equilibrium points E+ and E- and remains
bounded. The limit set here is a strange attractor.

35 60
30 50
25
40
20
30
15
20
10
5 10

0 0
-20 -10 0 10 20 -20 0 20
27. (a) We use a spreadsheet implementation of the Euler method.
(b) For h=.01,.015 the solution curve spirals outward, more rapidly for larger h. For h=.02, .025, .03 the
solution curve resembles the strange attractor shown in Figure 6.37 of the text.

h=0.01 h=0.015

6.82 7.1
6.8 7
6.78 6.9
6.76
6.8
6.74
6.7
6.72
6.7 6.6
6.68 6.5
6.66 6.4
6.65 6.7 6.75 6.8 6.5 6.6 6.7 6.8 6.9 7

h=0.02 h=0.025

10 20
15
8 10
5
6 0
4 -5
-10
2 -15
-20
0 -25
4 6 8 10 -20 -10 0 10 20

h=0.03

20
15
10
5
0
-5
-10
-15
-20
-20 -10 0 10 20

(c) The equilibrium E+=(p,p,23) where p=7.83156008298. A simulation beginning at this initial condition
should show that the state variables do not change over time.
(d) A step size of h=0.001 or smaller is necessary to prevent the simulated solution from spiraling outward.
The solution should spiral inward toward E+.

You might also like