Solutions here

Computational modelling techniques
Exercise set 5
Solutions
1. The gross national product (GNP) represents the sum of consumption purchases of goods
and services, government purchases of goods and services, and gross private investment
(which is the increase in inventories plus buildings constructed and equipment acquired).
Assume that the GNP is increasing at the rate of 3% per year, and that the national debt is
increasing at a rate proportional to the GNP.
a) Construct a system of two ordinary differential equations modeling the GNP and
national debt.
๐‘‘๐บ๐‘๐‘ƒ
= 0.03 ๐บ๐‘๐‘ƒ
๐‘‘๐‘ก
๐‘‘๐ท
= ๐‘˜ ๐บ๐‘๐‘ƒ, ๐‘˜ > 0
๐‘‘๐‘ก
b) Solve the system in part a, assuming the GNP is M0 and the national debt is N0 at year
0.
For the GNP, we have to solve
๐‘‘๐บ๐‘๐‘ƒ
๐‘‘๐‘ก
= 0.03 ๐บ๐‘๐‘ƒ, given that GNP(t0=0) = M0.
๐‘–๐‘›๐‘ก๐‘’๐‘”๐‘Ÿ๐‘Ž๐‘ก๐‘–๐‘œ๐‘›
๐‘‘๐บ๐‘๐‘ƒ
= 0.03๐‘‘๐‘ก ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ ln(๐บ๐‘๐‘ƒ) + ๐ถ1 = 0.03๐‘ก + ๐ถ2 โ‡” ln(๐บ๐‘๐‘ƒ) = 0.03๐‘ก + ๐ถ
๐บ๐‘๐‘ƒ
At time t0=0 we get the equation
ln(๐บ๐‘๐‘ƒ) = 0.03๐‘ก0 + ๐ถ โ‡’ ๐ถ = ln(๐‘€0 )
Replacing the value of the constant C into the previous equation yields:
๐บ๐‘๐‘ƒ
๏ฟฝ = 0.03๐‘ก โ‡” ๐บ๐‘๐‘ƒ(๐‘ก) = ๐‘€0 ๐‘’ 0.03๐‘ก
ln(๐บ๐‘๐‘ƒ) = 0.03๐‘ก + ln(๐‘€0 ) โ‡” ln ๏ฟฝ
๐‘€0
For the national debt D, we have to solve
๐‘–๐‘›๐‘ก๐‘’๐‘”๐‘Ÿ๐‘Ž๐‘ก๐‘–๐‘œ๐‘›
๐‘‘๐ท
๐‘‘๐‘ก
๐‘‘๐ท = ๐‘˜๐‘€0 ๐‘’ 0.03๐‘ก ๐‘‘๐‘ก ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ ๐ท + ๐ถ1 =
At time t0=0 we get the equation
๐‘0 =
= ๐‘˜๐บ๐‘๐‘ƒ, given that D(t0=0)=N0.
๐‘˜๐‘€0 0.03๐‘ก
๐‘˜๐‘€0 0.03๐‘ก
๐‘’
+ ๐ถ2 โ‡” ๐ท =
๐‘’
+๐ถ
0.03
0.03
๐‘˜๐‘€0 0.03๐‘ก
๐‘˜๐‘€0
0 + ๐ถ โ‡’๐ถ = ๐‘ โˆ’
๐‘’
0
0.03
0.03
Replacing the value of the constant C into the previous equation yields:
๐ท(๐‘ก) =
๐‘˜๐‘€0 0.03๐‘ก
(๐‘’
โˆ’ 1) + ๐‘0
0.03
c) Does the national debt eventually outstrip the GNP? Consider the ratio of the
national debt to the GNP.
If the national debt is to outstrip the GNP, we get:
๐ท(๐‘ก) > ๐บ๐‘๐‘ƒ(๐‘ก) โ‡”
๐‘˜๐‘€0 0.03๐‘ก
(๐‘’
โˆ’ 1) + ๐‘0 > ๐‘€0 ๐‘’ 0.03๐‘ก โ‡”
0.03
๐‘˜๐‘€0 (๐‘’ 0.03๐‘ก โˆ’ 1) > 0.03(๐‘€0 ๐‘’ 0.03๐‘ก โˆ’ ๐‘0 ) โ‡” (๐‘˜ โˆ’ 0.03)๐‘€0 ๐‘’ 0.03๐‘ก > ๐‘˜๐‘€0 โˆ’ 0.03๐‘0
If the ratio k satisfies k > 0.03, then the relation above is equivalent to
๐‘˜๐‘€0 โˆ’ 0.03๐‘0
๐‘’ 0.03๐‘ก >
(๐‘˜ โˆ’ 0.03)๐‘€0
so we can conclude that national debt eventually outstrips the GNP in this case. If we
have k = 0.03, we obtain
0 > ๐‘˜๐‘€0 โˆ’ 0.03๐‘0 = 0.03(๐‘€0 โˆ’ ๐‘0 )
and in this case the debt is larger than the GNP only if this was also the case in year
0. For k < 0.03 we must have
๐‘’ 0.03๐‘ก <
๐‘˜๐‘€0 โˆ’ 0.03๐‘0
.
(๐‘˜ โˆ’ 0.03)๐‘€0
If the right hand side is negative, the inequality can never hold. If it is positive, it is
still a constant and in the long run the inequality becomes false, which means that
GNP will become greater than D even if it starts smaller.
2. For the differential equation
๐‘‘๐‘ฆ
๐‘‘๐‘ฅ
= (๐‘ฆ โˆ’ 1)(๐‘ฆ โˆ’ 2)(๐‘ฆ โˆ’ 3) identify the equilibrium values.
Which are stable and which are unstable?
๐‘‘๐‘ฆ
๐‘‘๐‘ฅ
The equilibrium points are given by solving the equation
equilibrium points: y1=1, y2=2, and y3=3.
= 0, so we get three
To identify the behavior around the equilibrium points, we need to establish the sign of the
๐‘‘2 ๐‘ฆ
function (๐‘ฆ โˆ’ 1)(๐‘ฆ โˆ’ 2)(๐‘ฆ โˆ’ 3), then solve ๐‘‘๐‘ฅ 2 = 0 and establish its sign.
yโ€™<0
yโ€™>0
yโ€™<0
yโ€™>0
y
1
2
3
๐‘‘2 ๐‘ฆ
= (๐‘ฆ 3 โˆ’ 6๐‘ฆ 2 + 11๐‘ฆ โˆ’ 6)โ€ฒ = (3๐‘ฆ 2 โˆ’ 12๐‘ฆ + 11)(๐‘ฆ โˆ’ 1)(๐‘ฆ โˆ’ 2)(๐‘ฆ โˆ’ 3)
๐‘‘๐‘ฅ 2
๐‘‘2 ๐‘ฆ
โˆš3
= 0 โ‡” ๐‘ฆ โˆˆ {2 ± , 1, 2, 3}
2
3
๐‘‘๐‘ฅ
Decreasing
concave
function
Increasing function;
concavity changes
convex to concave
yโ€™<0
yโ€™>0
yโ€™โ€™<0
yโ€™โ€™>0
Increasing convex
function
Decreasing function;
concavity changes
convex to concave
yโ€™<0
yโ€™โ€™<0
yโ€™โ€™>0
yโ€™>0
yโ€™โ€™<0
yโ€™โ€™>0
y
1
2-โˆš3/3
2
2+โˆš3/3
3
The points y1=1 and y3=3 are unstable equilibrium points, and y2=2 is stable.
3. Consider two species whose survival depends on their mutual cooperation. An example
would be a species of bee that feeds primarily on the nectar of one plant species and
simultaneously pollinates the plant. One simple model of this mutualism is given by the
autonomous system
๐‘‘๐‘ฅ
= โˆ’๐‘Ž๐‘ฅ + ๐‘๐‘ฅ๐‘ฆ
๐‘‘๐‘ก
๐‘‘๐‘ฆ
= โˆ’๐‘š๐‘ฆ + ๐‘›๐‘ฅ๐‘ฆ
๐‘‘๐‘ก
a) What assumptions are implicitly being made about the growth of each species in the
absence of cooperation?
In absence of cooperation, both species would decline up to eventual extinction.
b) Interpret the constants a, b, m and n in terms of the physical problem.
a and m are the decay rates for the two species. b and n represent the positive effect
of one species on the other.
c) What are the equilibrium levels?
๐‘‘๐‘ฅ
= 0 โ‡” โˆ’๐‘Ž๐‘ฅ + ๐‘๐‘ฅ๐‘ฆ = 0 โ‡” ๐‘ฅ(๐‘๐‘ฆ โˆ’ ๐‘Ž) = 0
๐‘‘๐‘ก
๐‘‘๐‘ฆ
= 0 โ‡” โˆ’๐‘š๐‘ฆ + ๐‘›๐‘ฅ๐‘ฆ = 0 โ‡” ๐‘ฆ(๐‘›๐‘ฅ โˆ’ ๐‘š) = 0
๐‘‘๐‘ก
๐‘š ๐‘Ž
๐‘› ๐‘
The two equilibrium points are (0, 0) and ๏ฟฝ , ๏ฟฝ.
d) Perform a graphical analysis and indicate the trajectory directions in the phase plane.
๐‘Ž
๐‘‘๐‘ฅ
โ‰ฅ 0 โ‡” โˆ’๐‘Ž๐‘ฅ + ๐‘๐‘ฅ๐‘ฆ โ‰ฅ 0 โ‡” ๐‘ฆ โ‰ฅ
๐‘
๐‘‘๐‘ก
y
๐‘š
๐‘‘๐‘ฆ
โ‰ฅ 0 โ‡” โˆ’๐‘š๐‘ฆ + ๐‘›๐‘ฅ๐‘ฆ โ‰ฅ 0 โ‡” ๐‘ฅ โ‰ฅ
๐‘›
๐‘‘๐‘ก
๐‘Ž
๐‘
๐‘š
๐‘›
e) Interpret the outcomes predicted by your graphical analysis. Do you believe the
model is realistic? Why?
๐‘Ž
๐‘š
When either of the two species is under the threshold ( or respectively), due to
๐‘
๐‘›
the mutual cooperation between species, also the other population will be driven
down, leading eventually to the extinction of the two species.
When either one of the two populations is above the corresponding threshold, due
to the mutualism the other species will also increase, leading to infinite growth.
The model reflects well mutual cooperation among two species, but it is not realistic
in predicting infinite growth. A maximum supported population factor should be
introduced for both species.
4. In the model for the arms race (see course 11, slides 23-25), assume that an-bm<0, so the
equilibrium point lies in a quadrant other than the first one in the phase plane. Sketch the
lines dx/dt=0 and dy/dt=0 in the phase plane and label them and their intercepts on the
coordinate axes. Perform a graphical stability analysis to respond to the following:
Model:
๐‘‘๐‘ฅ
= โˆ’๐‘Ž๐‘ฅ + ๐‘๐‘ฆ + ๐‘
๐‘‘๐‘ก
๐‘‘๐‘ฆ
= ๐‘š๐‘ฅ โˆ’ ๐‘›๐‘ฆ + ๐‘
๐‘‘๐‘ก
To find the equilibrium point, the above derivatives should both be zero. We obtain the
๐‘๐‘+๐‘๐‘›
๐‘Ž๐‘+๐‘๐‘š
,
๏ฟฝ. To decide where this point is located in the plane, we
equilibrium point ๏ฟฝ
๐‘Ž๐‘›โˆ’๐‘๐‘š ๐‘Ž๐‘›โˆ’๐‘๐‘š
use the hypothesis an-bm<0 and also we assume that, since the signs of each term were
chosen to characterize the intuitive behavior of the model, the constants involved in the
model are all positive.
To draw the two lines, we find their intersection with the axes and plot the corresponding
points according to their sign. Next, we need to distinguish, for each line, the semi-plane that
makes the corresponding equation positive and the one that makes it negative. For this, it is
enough to plug the point (0, 0) in both equation and see that the result is positive for both
lines.
y
๏ฟฝโˆ’
๐‘
๏ฟฝ0, ๏ฟฝ
๐‘›
๐‘
, 0๏ฟฝ
๐‘š
A
B
๐’…๐’™
=๐ŸŽ
๐’…๐’•
D
C
๐’…๐’š
=๐ŸŽ
๐’…๐’•
Region A:
๐‘‘๐‘ฅ
๐‘‘๐‘ก
> 0,
๐‘‘๐‘ฆ
๐‘‘๐‘ก
<0
๐‘
๏ฟฝ0, โˆ’ ๏ฟฝ
๐‘
๐‘
๏ฟฝ , 0๏ฟฝ
๐‘Ž
x
Region B:
Region C:
Region D:
๐‘‘๐‘ฅ
๐‘‘๐‘ก
๐‘‘๐‘ฅ
๐‘‘๐‘ก
๐‘‘๐‘ฅ
๐‘‘๐‘ก
> 0,
< 0,
< 0,
๐‘‘๐‘ฆ
๐‘‘๐‘ก
>0
๐‘‘๐‘ฆ
๐‘‘๐‘ก
<0
๐‘‘๐‘ฆ
๐‘‘๐‘ก
>0
a) Do any potential equilibrium levels for defense spending exist? List any such points
and classify them as stable or unstable.
๐‘๐‘+๐‘๐‘›
๐‘Ž๐‘+๐‘๐‘š
The only possible equilibrium point is ๏ฟฝ
,
๏ฟฝ which due to the sign of an๐‘Ž๐‘›โˆ’๐‘๐‘š ๐‘Ž๐‘›โˆ’๐‘๐‘š
bm is negative, and thus not viable for our defense spending model.
The equilibrium point is unstable. If we take for example a trajectory that starts in
region A, it will move downwards and to the right toward the equilibrium point. As it
approaches the equilibrium point, the derivatives dx/dt and dy/dt approach 0.
Depending on where the trajectory begins and the sizes of the constants a, b, c, m, n,
p, either the trajectory will continue moving downward into region D (and then move
away from the equilibrium point), or continue moving rightward into region B (and
again move away from the equilibrium point).
b) What outcome for defense spending is predicted by your graphical analysis?
Since defense expenses are positive, the initial values will correspond to a point in
region B (most probable), A or C (if one of the countries spends a lot more than the
other. In any case, according to this model, both countries will infinitely increase
their defense expenses.
5. Find the local minimum value of the function
๐‘“(๐‘ฅ, ๐‘ฆ) = ๐‘ฅ๐‘ฆ โˆ’ ๐‘ฅ 2 โˆ’ ๐‘ฆ 2 โˆ’ 2๐‘ฅ โˆ’ 2๐‘ฆ + 4
Calculate the critical point:
๐œ•๐‘“
= ๐‘ฆ โˆ’ 2๐‘ฅ โˆ’ 2 = 0
๐œ•๐‘ฅ
๐œ•๐‘“
= ๐‘ฅ โˆ’ 2๐‘ฆ โˆ’ 2 = 0
๐œ•๐‘ฆ
Check that the point (-2, -2) is a minimum: f(-2, -2)=0; f(-1,-1)=7 > f(-2, -2).
6. Find three numbers whose sum is 9 and whose sum of squares is as small as possible.
Let x, y and z be the two numbers. We need to minimize ๐‘“(๐‘ฅ, ๐‘ฆ, ๐‘ง) = ๐‘ฅ 2 + ๐‘ฆ 2 + ๐‘ง 2 in such a
way that x+y+z=9. We can use the Lagrange multiplier merit function:
๐ฟ(๐‘ฅ, ๐‘ฆ, ๐‘ง, ฮป) = ๐‘ฅ 2 + ๐‘ฆ 2 + ๐‘ง 2 + ฮป(๐‘ฅ + ๐‘ฆ + ๐‘ง โˆ’ 9)
Minimize ๐ฟ(๐‘ฅ, ๐‘ฆ, ๐‘ง, ฮป)
๐œ•๐ฟ
= 2๐‘ฅ + ฮป = 0
๐œ•๐‘ฅ
๐œ•๐ฟ
= 2๐‘ฆ + ฮป = 0
๐œ•๐‘ฆ
๐œ•๐ฟ
= 2๐‘ง + ฮป = 0
๐œ•๐‘ง
๐‘ฅ = 3; ๐‘ฆ = 3; ๐‘ง = 3; ฮป = โˆ’6
๐›ฟ๐ฟ
=๐‘ฅ+๐‘ฆ+๐‘งโˆ’9=0
๐›ฟฮป
๐‘“(๐‘ฅ, ๐‘ฆ, ๐‘ง) = 27. If we vary ๐‘ฅ, ๐‘ฆ, ๐‘ง we get for example ๐‘“(2, 3, 4) = 29 > 27, so (3, 3, 3) is
indeed a minimum point.