Modeling With Discrete Dynamical Systems
Modeling With Discrete Dynamical Systems
6.1 INTRODUCTION
One of the most exciting areas of modeling concerns predicting temporal evolution.
The main question that is posed in this setting is how do variables of interest change
over time? This type of problem is everywhere to be found, for example in areas as
diverse as science, engineering and finance. Prediction means that given the values
of the variables at a certain instant of time we can predict, i.e. compute their values
at any future time. A system of equations that allows such a prediction is called a
Dynamical System.
In this chapter we consider discrete dynamical systems. The mathematical
assumption is that the time variable n is incremented discretely and corresponds
to the integers {0, 1, 2, 3, 4, . . . }. The value of a variable x of interest is then a
sequence {x0 , x1 , x2 , x3 , x4 , . . . }. Now the problem of modeling is to determine an
equation of the form
xn+1 = xn + ∆xn
and this is done by estimating how the variable xn changes as n is incremented
from time n to time n + 1.
We develop this topic along the following four complementary lines:
• numerical solutions,
• analytical solutions,
• qualitative behavior,
• modeling techniques.
106
Section 6.1 Introduction 107
2.5 2.5
x0=2.5
x0=1 x =0.5*x +1
2 n+1 n
2
1.5
n
x
xn 1
1.5
0.5
xn+1=0.5*xn
x =2.5
0
x =1
0
0 1
0 5 n 10 15 0 5 n 10 15
(a) (b)
8000 2.5
x =0.2 x =2.5
0
0
x0=−0.2 2 x =−1
0
4000
1.5
1
n
xn
x
0
0.5
−4000 0
x =2*x
n+1 n
−0.5 x =−0.5*x +1
n+1 n
−8000 −1
0 5 n 10 15 0 5 n 10 15
(c) (d)
FIGURE 6.1: Comparison of the numerical solutions for some simple difference equations.
Numerically simulated solutions of (6.1) for various values of the parameters a and
b are shown in Figure 6.1. In Figure 6.1 (a) we see that the solutions decay to zero
while in Figure 6.1 (b) they tend to the value 2. In Figure 6.1 (c) the initial values
are close to zero. Both solutions remain close to zero for a while, but eventually
they split apart and tend to ±∞. In Figure 6.1 (d) the solutions tend to x ≈ 0.7.
Here the solutions alternate between values above and below 0.7 when approaching
108 Chapter 6 Modeling with Discrete Dynamical Systems
this value. Thus, a noticeable feature for all of these solutions is the long term
behavior. Qualitatively we say the solution either blows up or approaches a finite
limiting value.
pn+1 − pn = kpn + β,
Section 6.1 Introduction 109
2 3
2.5
1.5
2
xn
n
1 1.5
x 2
x
n+1
=2.8*x −x
n n
1 x =3.3*x −x2
n+1 n n
0.5
x =0.1 0.5
0 x0=0.1
0 0
0 5 10 n 15 20 25 0 5 10 n 15 20 25
(a) (b)
The equation
xn+2 + 2xn+1 + 3xn = cos(n)
is an example of a linear second order difference equation. We shall see that this
type of equation always can be transformed to a linear system of two first order
equations. The general form of such a system is
where fn , gn are known sequences. If the right hand sides are replaced by nonlinear
functions we have a nonlinear system, for instance
This system is used in population modeling as a model for the population growth
of two interacting species. The terms −bx2n and −eyn2 model competition within
each of the two species whereas the terms −cxn yn and −f xn yn model competition
between the species.
110 Chapter 6 Modeling with Discrete Dynamical Systems
x1 = ax0
x2 = ax1 = a2 x0
x3 = ax2 = a3 x0
..
.
xn = an x0 . (6.6)
From (6.6) we can easily infer how the qualitative behavior of xn depends on a: if
|a| > 1 then xn goes off to infinity (the equilibrium is said to be unstable), whereas
if |a| < 1 then xn tends to 0 (the equilibrium is said to be stable). This explains
the behavior of the numerical solutions of Figures 6.1 (a) and (c). Note also that
if a > 0 then xn has the same sign as x0 for all n. In contrast if a < 0 the solution
alternates between positive and negative values.
The cases a = 1 and a = −1 are special. If a = 1 we have xn = x0 for all n,
hence every x is an equilibrium. If a = −1 the solution xn = (−1)n x0 flips back
and forth between x0 and −x0 .
A more general equation is the following,
Again the value of |a| determines whether xn goes off to infinity or approaches x,
and the sign of a determines whether xn − x alternates or has a constant sign.
EXAMPLE 6.3
The equation
1
xn+1 = xn + 1
2
is of the form of (6.7). The equilibrium is
b
x= = 2.
1−a
Since a = 1/2 < 1 and a > 0 the solutions approach the equilibrium 2 and the sign
of xn − 2 is the same for all n. This explains the behavior of the numerical solutions
shown in Figure 6.1 (d).
EXAMPLE 6.4
Verify that pn = −n − 1 is a particular solution of
xn+1 = 3xn + 2n + 1.
EXAMPLE 6.5
Find the general solution of
xn+1 = 3xn + 2n + 1
and the particular solution that satisfies x0 = 1.
Solution Form Example 6.4 we know that pn = −n − 1 is a particular solution.
Since a = 3 the general solution is
xn = c3n − n − 1.
To find the particular solution asked for we evaluate at n = 0,
x0 = c − 1 = 1.
It follows that c = 2, hence
xn = 2 3n − n − 1
is the solution with x0 = 1.
Section 6.2 Linear First Order Difference Equations 113
TABLE 6.1: Solution forms pn for bn given by Equations (6.11) and (6.12)
EXAMPLE 6.6
Find a particular solution of
xn+1 = 3xn + 2n + 1.
This equation holds for all n if A and B satisfy the equations 2A − B = −1 and
2B = −2. The solution is A = B = −1, hence
pn = −n − 1.
EXAMPLE 6.7
Find a particular solution of
Solution Substitution of the trial form pn = A cos 2n+B sin 2n into the difference
equation yields
We apply the formulae for cos(α + β) and sin(α + β) to the terms on the left hand
side and then rearrange the equation as
[A(1 + cos 2) + B sin 2 − 1] cos 2n + [−A sin 2 + B(1 + cos 2)] sin 2n = 0.
This equation holds for all n if the terms in both brackets vanish. Setting these
terms equal to zero gives the following system of equations for A and B,
EXAMPLE 6.8
Find a particular solution of
xn+1 = xn /2 + n(1/2)n .
Section 6.2 Linear First Order Difference Equations 115
2(A − 1)n + (A + B) = 0.
pn = (n2 − n)(1/2)n .
where
r
k =1+ .
1200
If pn = p = const we know the solution already (Equation (6.8) with a = k, b = p,
xn = an ),
p p (k n − 1)p
an = k n (a0 + )− = k n a0 + . (6.14)
k−1 k−1 k−1
EXAMPLE 6.9
After graduating from High School Peter works for four years. During this time he
deposits each month $1000 on a savings account at an annual interest rate of 5%
(no initial deposit). The next four years Peter spends on College. During this time
he withdraws each month an amount of $pw from his savings account so that at
the end of the four years the balance is zero again. Find pw and the total interest
earned.
116 Chapter 6 Modeling with Discrete Dynamical Systems
(k 48 − 1)p
a48 = .
k−1
After the second four years this has evolved into
(k 48 − 1)pw k 48 − 1 48
a96 = k 48 a48 − = (k p − pw ).
k−1 k−1
Loans. Equation (6.13) also holds for loans. In this case a0 is the amount bor-
rowed and an is the amount owed after n months. The term −pn > 0 is the monthly
payment. For constant monthly payment p the difference equation for an is
k N (k − 1)
p= a0 . (6.16)
kN − 1
EXAMPLE 6.10
You decide to purchase a home with a mortgage at 6% annual interest and with a
term of 30 years. For k = 1 + 6/1200 = 1.005 and N = 360 the factor
k N (k − 1)
R=
kN − 1
in Equation (6.16) is R = 0.00600. If the house costs a0 = $200, 000, the monthly
payment is p = Ra0 = $1, 199.10. On the other hand, if your income restricts your
monthly payment to a maximum of pm = $1000, the maximal amount you can
spend for the house is pm /R = $166, 791.61.
Section 6.2 Linear First Order Difference Equations 117
hence
− ln[1 − (k − 1)a0 /p]
N= . (6.17)
ln k
Note however that the right hand side of (6.17) needs not to be an integer. Nev-
ertheless it can be used to estimate N and then to improve p or a0 . For example,
assume you need $200, 000 and you want your payment to be close to, but not above
$1500. With r = 8%, a0 = 200, 000 and p = 1500, (6.17) evaluates to N = 330.68.
If this is rounded up to N = 331, Equation (6.16) gives p = $1499.60.
In our last example on savings accounts and loans we have to solve the non-
homogeneous equation (6.9) with nonconstant bn .
EXAMPLE 6.11
An employee starts her position at the age of 25 with an annual salary of $40, 000.
She deposits each month 8% of her monthly salary on a retirement savings account.
The salary increases by 3% each year and the annual interest rate of her retirement
savings account is 6%. What is the accumulated amount when she retires at the
age of 65?
Solution Let Am be the accumulated amount on the retirement savings account
at the end of year m and let am,n be the accumulated amount in month n of year
m + 1, that is,
am,0 = Am , am,12 = Am+1 .
The amount am,n satisfies difference equation
sm+1 = ks sm ,
sm = ksm s0 .
(krn − 1)ksm kp s0
am,n = krn am,0 + .
kr − 1
Evaluating this at n = 12 yields
where
(kr12 − 1)kp s0
f= = $3289.48, ka = kr12 = 1.0616778.
kr − 1
It remains to solve the nonhomogenous difference equation (6.19). By using the
method of undetermined coefficients a particular solution can be determined to be
pm = f ksm /(ks − ka ). The solution with initial value A0 = 0 then is
(ksm − kam )f
Am = .
ks − ka
For m = 40 this evaluates to A40 = 799, 106.39. Hence the employee starts her
retirement with an amount of $799, 106.39 on her retirement savings account.
Newton’s law of cooling states that the rate of change of the temperature of an
object is proportional to the difference of the temperature of the object and its
surrounding. Let ∆Tn = Tn+1 − Tn be the change in temperature of the object
over a time interval τ , typically τ = 1 hour. According to Newton’s law of cooling
we have
∆Tn ∝ Rn − Tn ,
or
∆Tn = k(Rn − Tn ),
where Rn is the surrounding temperature. Since we know that temperature de-
creases if Rn > Tn it follows that k > 0. The difference equation that arises from
this model is
Tn+1 = Tn + k(Rn − Tn ).
If Rn = R = const this equation is again of the form (6.7) with solution
Tn = (1 − k)n (T0 − R) + R.
EXAMPLE 6.12
A murder victim is discovered in an office building that is maintained at 68 degrees
F. Given the medical examiner found the body temperature to be 88 degrees F at
8am and that one hour later the body temperature was 86 degrees F, at what time
was the crime committed?
Solution Setting T0 = 98.6 (where 0 is the time the crime was committed) and
R = 68 we obtain
Tn = 68 + 30.6(1 − k)n .
Section 6.3 Linear Second Order Equations 119
If we define n1 as the time the body was observed initially by the medical examiner
and the time one hour later as n1 + 1 we have the equations
and
Tn1 +1 = 86 = 68 + 30.6(1 − k)n1 +1 .
These two equations may be solved to give k = 1/10 and n1 = 4.036. So the crime
was committed just before 4am.
xn = λn
λ2 + αλ + β = 0
This quadratic equation has solutions that break down into three cases: i) both
solutions real and distinct, ii) one real double solution, and iii) a pair of complex
solutions as p
−α ± α2 − 4β
λ± =
2
hn = c1 (λ+ )n + c2 (λ− )n
Since the equation is linear we know that the superposition of solutions is again a
solution. Notice that there are now two free parameters c1 and c2 to accommodate
the two initial conditions x0 and x1 required for a second order difference equation.
Notice also that hn → 0 for n → ∞ if λ± | < 1, but in general |hn | → ∞ if |λ+ | > 1.
120 Chapter 6 Modeling with Discrete Dynamical Systems
EXAMPLE 6.13
xn+2 = xn+1 + xn
The auxiliary equation is now
λ2 − λ − 1 = 0
The solutions to this quadratic are
√
1± 5
λ± =
2
Thus, the general solution to the homogeneous problem is
√ n √ n
1+ 5 1− 5
hn = c1 + c2
2 2
If we select h0 = h1 = 1 we have the Fibonocci sequence {1, 1, 2, 3, 5, 8, 13, . . . }. Em-
ploying this pair of initial conditions it is easily shown that the particular solution
is √ √ n √ √ n
5+1 1+ 5 5−1 1− 5
hn = √ + √
2 5 2 2 5 2
You might impress your friends by telling them the 50th number in this sequence
h50 = 20365011074. It is also apparent that these numbers increase exponentially
fast.
EXAMPLE 6.14
xn+2 + 2xn+1 + xn = 0
The auxiliary equation is
λ2 + 2λ + 1
which has the solution λ = −1. Thus, the general solution to this homogeneous
problem is
hn = c1 (−1)n + c2 n(−1)n
Section 6.3 Linear Second Order Equations 121
z = x + iy = r exp(iθ)
r2 = x2 + y 2
so
p
2 −α 2 4β − α2 2
r =( ) +( )
2 2
=β
So p
r= β
The angle satisfies p
y 4β − α2
tan θ = =
x −α
In polar form, the solution is
hn = c1 rn exp(inθ) + c2 rn exp(−inθ)
1 Unlike the previous cases we now assume familiarity with basic complex numbers.
122 Chapter 6 Modeling with Discrete Dynamical Systems
where we have used the facts that exp(inθ) = cos(nθ) + i sin(nθ) and that the real
and imaginary parts of a complex solution are real solutions (see problems). The
form of the solution tells that hn → 0 for n → ∞ if r < 1 and |hn | → ∞ if r > 1.
If r = 1 the solution remains bounded, but does not approach zero.
EXAMPLE 6.15
Find the general solution to the homogeneous difference equation
λ± = −2 ± i
(md q2n−1 + bd ) − bs
q2n+1 =
ms
or,
md bd − b s
q2n+1 = q2n−1 + . (6.21)
ms ms
xn = hn + pn ,
q2n+1 = αq2n−1
hn = c1 αn/2 + c2 (−α1/2 )n
It is clear from our previous work that this equation will only converge if
md
| |<1
ms
Note also that if this condition holds then the quantity supplied converges,
bd − b s
qn →
ms − m d
and approaches the market equilibrium.
where the growth constant k > 0 reflects the rate of reproduction. One would
assume that for rabbits this constant would be larger than for elephants. Actual
values for k must be determined empirically from the data using a data fitting
technique such as least squares.
If instead of simply taking k > 0 in Equation (6.22) we could have modeled
both the birth rate kb and the death rate kd such that
pn+1 − pn = kb pn − kd pn (6.23)
where βn is the net flux of population. Now we might expect that growth rates
could be offset by immigration or emigration. For example k < 0 but βn = β can
produce a positive equilibrium population.
Obviously ignoring competition for finite resources places significant limita-
tions on this model. It will work well where the assumptions hold true but when
the effects of competition for resources become important it will not capture them.
To model competition we may argue as follows: competition occurs when there is
interaction between two members of a species and the total amount of competition
is the number of ways we can select subsets of 2 from a population p which is
p(p − 1)
number of pairwise interactions ∝
2
where we have divided by two to compute the number of combinations rather than
permutations. Now we may modify the model to incorporate competition as
again ignoring effects due to migration. Here we are assuming k2 > 0 and use
the negative sign to reflect the fact that competition reduces the population. This
equation can be simplified to
This is the well-known logistic difference equation for population growth and it
appears to correspond well to the growth of bacteria in agar jelly, for example.
Superficially we see that the difference between the model that does not model
competition and the one that does is a quadratic term. A more fundamental dif-
ference is that Equation (6.22) is linear while Equation (6.26) is nonlinear. The
only fixed point for Equation (6.22) is p = 0. For Equation (6.26) there are now
two fixed points p1 = 0 and p2 = cc12 ; see Figure 6.3. From the plot of pn+1 − pn
it is clear that this new model predicts that the population will be limited, i.e., it
can’t grow unbounded to ∞ because as soon as pn > c1 /c2 then ∆pn < 0 so the
population must decrease.
One is initially tempted to conclude that the equilibrium point p1 = 0 is
unstable while the equilibrium point p2 = c1 /c2 is stable. As we shall see in
the numerical simulations this can be true, but for certain values of c1 and c2
the situation can be much more complicated including periodic and even chaotic
solutions!
pn+1−pn>0
pn+1−pn<0
pn+1−pn
0
pn c /c
1 2
pn+1−pn>0
pn+1−pn <0
FIGURE 6.3: A plot of the change in population pn+1 − pn as a function of the population pn .
an+1 − an = g1 an − c1 an bn
bn+1 − bn = g2 bn
If species A and B both like each others food we would employ the model
an+1 − an = g1 an − c1 an bn
bn+1 − bn = g2 bn − c2 an bn
See Figure 6.4 for a numerical simulation of this system. Note that this nonlinear
system does not have a closed form solution. For the parameters selected we see
that even though species A initially has a lower population it appears to grow
without bound while population B becomes extinct. Here we may conclude that
species A is more fit than species B and consequently survives.
If species A and B compete both with each other and with themselves the
population model would then become
an+1 − an = g1 an − c1 an bn − k1 a2n
bn+1 − bn = g2 bn − c2 an bn − k2 b2n
Section 6.4 Nonlinear Difference Equations and Systems in Population Modeling 127
35
30 a
n
b
n
25
20
15
10
0
0 10 20 30 40 50
iteration n
FIGURE 6.4: Competition for finite resources. We have selected the initial conditions a1 = 25 and
b1 = 30. In addition the parameters were chosen to be g1 = .047, c1 = .012, g2 = .023, c2 = .015.
Notice that if population B becomes extinct while A survives then the model reduces
to the logistic difference equation for a single species.
∆fn = −g1 fn
where the constant g1 > 0. If rabbits are available, then they should contribute
positively to a change in the fox population. It seems reasonable to assume that
the increase in the fox population will be proportional to the number of fox and
128 Chapter 6 Modeling with Discrete Dynamical Systems
∆fn = −g1 fn + c1 fn rn
∆rn = g2 rn
where the constant g2 > 0. The impact of the foxes on the rabbits is presumably
also proportional to the number of interactions but now this reduces the rabbit
population.
∆rn = g2 rn − c2 fn rn
In summary we have the model
Note that we have omitted the competition amongst the foxes for the rabbits as
well as the competition amongst the rabbits for their food. This is easily captured
by extending the above system to
See Figure 6.5 for a simulation of the above equations. Note that the predicted
oscillation is in fact there, however it is damped and the solution proceeds to a
stable equilibrium.
2000
1800
rabbits
foxes
1600
1400
1200
population
1000
800
600
400
200
0
0 100 200 300 400 500 600 700 800
iteration
FIGURE 6.5: Simulation of preditor prey equations. We have selected the initial conditions f1 = 25 and
r1 = 100. In addition the parameters were chosen to be g1 = 0.01, c1 = 0.0001, g2 = 0.1, c2 = 0.0005,
d1 = 0.0001 and d2 = 0.
∆Tn = k(M − Tn )
After repeatedly overcooking a certain kind of fish based on this law a frustrated
cook has decided to take science into her own hands. She speculates that the actual
law of cooking for this fish has the more general form
∆Tn = k(M − Tn )α
and that for certain types of foods, call them Non-Newtonian foods, that α 6= 1.
To test her hypothesis, our cook measures the temperature of a fish every
minute until it approaches the temperature of the oven which is set to 425 degrees
F. The results of her data collection are shown in Figure 6.6.
Now ∆Tn is known since Tn is known for n = 1, . . . , 200. Thus, for any α and
k we can compute a model error of
X 2
E(α, k) = ∆Tn − k(425 − Tn )α
n
We recall from our previous work with least squares that computing α and k requires
differentiating the error term E(α, k) with respect to α and k. For this particular
130 Chapter 6 Modeling with Discrete Dynamical Systems
Non−Newtonian Fish
450
400
350
300
Tn: temperature of fish
250
200
150
100
50
0
0 20 40 60 80 100 120 140 160 180 200
time n in minutes
FIGURE 6.6: Observations of a Non-Newtonian fish. These are (synthetic) measurements of the
temperature of the fish as a function of time.
Solving these equations using only the first 101 observations T0 , T1 , . . . , T100 and
the MATLAB code provided produces the results
α = 1.25
and
k = 0.01
Section 6.5 Empirical Modeling 131
160
140
120
100
population
80
60
rabbits
40 foxes
20
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
iteration x 10
4
FIGURE 6.7: Simulation of preditor prey equations. We have selected the initial conditions f0 = 25
and r0 = 100. In addition the parameters were chosen to be g1 = .01, g2 = .0005, c1 = .0001, c2 =
.0001, d1 = 0.0, d2 = 0.0
∆fn = −g1 fn + c1 fn rn
∆rn = g2 rn − c2 fn rn
the points {fn , rn } are now observations while the equation coefficients {g1 , g2 , c1 , c2 }
are to be determined.
The least squares error is now
X X
E(g1 , c1 , g2 , c2 ) = (∆fn + g1 fn − c1 fn rn )2 + (∆rn − g2 fn + c2 fn rn )2 (6.31)
n n
Setting
∂E ∂E ∂E ∂E
= = = =0
∂g1 ∂c1 ∂g2 ∂c2
produces the necessary conditions for a minimum error. Taking the uncoupled
132 Chapter 6 Modeling with Discrete Dynamical Systems
Solving these equations produces the exact coefficients that were used to gen-
erate the data. In principal, this procedure may be applied to direct observations
from nature. One may conclude if a model fits the data and, if so, which species
plays which role, i.e., by examining the computed signs of c1 , c2 , g1 and g2 one may
infer which species is the predator and which is the prey. See the MATLAB code
for these equations in the Appendix.
Section 6.5 Empirical Modeling 133
PROBLEMS
6.1. Consider the following equations and identify as
• linear or nonlinear
• homogeneous or nonhomogenous
• which order
(a) x2n+1 + xn = 1.
(b) xn+1 = xn−1 + 2
(c) xn+1 = sin(xn−1 )
(d) xn+3 = xn+1 + xn−3 + n2
6.2. Determine particular solutions to the following equations
(a) xn+1 = xn + 1
(b) xn+1 = 5xn + n2
(c) xn+1 = x2n + 6n
6.3. Show that the real and imaginary parts of a complex solution to a linear difference
equation are also solutions to the same difference equation.
6.4. Determine general solutions to the following equations
(a) xn+1 = xn + 1
(b) xn+1 = 5xn + n2
(c) xn+1 = x2n + 6n
(d) xn+1 = x2n + 4n2 + 2n + 1
6.5. You currently have $5000 in a savings account that pays 6% interest per year.
Interest is compounded monthly. You add another $200 each month. What do
you have on your savings account after five years, and what is the total interest
earned during these five years?
6.6. You owe $500 on a credit card that charges 1.5% interest in each month. You
can pay $50 each month and make no new charges. When is your loan paid off
and what is your last payment? How much interest have you paid?
6.7. Your parents are considering a 30–year $100, 000 mortgage at an annual interest
rate of 6%. What is the monthly payment, and what will be the total interest
paid?
6.8. Mary receives $5000 as graduation present from her parents when graduating
from High School. She deposits the money on a savings account at an annual
interest rate of 3%. Interest is compounded monthly. Before going to college she
works for three years, and during this time she deposits each month a certain
amount on the savings account. She plans to withdraw $1200 each month in
her first year on college, and to increase the monthly withdrawal in each of the
following three years by $100 (in her fourth year on college she withdraws $1500
each month). What must the monthly payment during the first three years be in
order that after Mary’s four years on college the balance on the savings account
is zero again, and what is the total interest Mary has earned after the seven
years?
6.9. Redo Example 6.11 for the case that the annual salary sm is paid during the
first nine months (monthly payment sm /9) in each year, i.e., there is no income
and hence no payment on the retirement savings account during the last three
months of the year. (This is the situation of university professors if they don’t
have additional income from grants.)
6.10. Assume the temperature of a roast in the oven increase at a rate proportional to
the difference between the oven (set to 400 degrees F) and the roast. If the roast
enters the oven at 50 degrees F and is measured one hour later to be at 90 when
134 Chapter 6 Modeling with Discrete Dynamical Systems
should the table be set if the eating temperature is 166 degrees F? Hint: write
down the difference equation and solve analytically.
6.11. Computer. This question concerns numerically exploring the solutions of the
equation
pn+1 = pn + αpn (1 − pn )
First determine all the equilibrium solutions of this difference equation by setting
p = pn+1 = pn . Now investigate the stability of these equilibrium numerically.
Consider the initial conditions
• p0 = 0
• p0 = 0.0001
• p0 = 2
Numerically simulate the difference equation using the following values of α
• α = .1
• α = .7
• α = 1.2
Describe your results and comment on the stability of the equilibrium you found.
Provide plots of all your results. It will make your comparisons easier if you plot
all the results for one value of α on a single graph.
6.12. Computer. This question concerns numerically exploring the solutions of the
equation
pn+1 = pn + 0.1pn (1 − pn )(2 − pn )
First determine all the equilibrium solutions of this difference equation. Numeri-
cally simulate the difference equation using the following initial conditions
• p0 = 0
• p0 = 0.0001
• p0 = .9999
• p0 = 1
• p0 = 1.0001
• p0 = 1.9999
• p0 = 2
• p0 = 2.0001
Describe your results and comment on the stability of the equilibrium you
found. Provide plots of all your results. It will make your comparisons easier if
you plot all the results on a single graph.
6.13. Computer. Simulate the fourth order difference equation
• Species C is competes with itself for food while this is not true for species
A and B.
Write down a system of three coupled difference equations modeling the popu-
lations of the three species.
6.21. Computer. Provide a model for the bee colony population data in Table 6.2.
What does your model predict the long-term population to be?
day 1 2 3 4 5 6 7 8 9 10
number 20 25 60 85 111 146 177 182 184 171
day 11 12 13 14 15 16 17 18 19 20
number 179 167 161 146 159 154 162 166 166 168
xn+1 = rxn (1 − xn )
pn+1 = rpn (1 − pn ).
6.26. Computer. Numerically compute and plot 50 iterates of the difference equation
pn+1 = rpn (1 − pn )
First generate 200 points using this equation and compute k based on these
points. Now predict the next 200 points and calculate the error. If a fish is well
cooked at 170 degrees F how long does each model predict it will take to cook
the fish? Use the values M = 425 and T0 = 50.
6.28. Computer. Using the data provided in Table 6.3 estimate via least squares the
coeffients c1 , c2 , d1 , d2 in the model
an+1 = an + c1 an + d1 bn
bn+1 = bn + c2 an + d2 bn
Include your equations for the unknown coefficients in your write-up.
n an bn
1 15.00 45.00
2 30.00 30.00
3 24.00 36.00
4 26.40 33.60
5 25.44 34.56
6 25.82 34.18
7 25.67 34.33
8 25.73 34.27
9 25.71 34.29
10 25.72 34.28
11 25.71 34.29
6.29. Extend the Equations (6.32) and (6.33) provided for computing the coefficients
c1 , c2 , g1 , g2 for the predator-prey model with no intra-species competition given
by Equation (6.27) to the case of Equations 6.29 where intraspecies competition is
accounted for. Your equations should now provide estimates for c1 , c2 , g1 , g2 , d1 , d2
138 Chapter 6 Modeling with Discrete Dynamical Systems
6.30. Consider the differential equation for the unforced damped nonlinear pendulum
d2 x dx
+α + sin x = 0
dt2 dt
where x(t) represents the angular displacement from the equilibrium in radians.
Using the expressions for the numerical estimates of the derivatives
d2 x x + xn−1 − 2xn
= n+1
dt2 (∆t)2
and
dx xn − xn−1
=
dt ∆t
where xn ≡ x(n∆t).
(a) Show that the differential equation can be approximated by the second order
difference equation
xn+1 = (2 − α∆t)xn + (α∆t − 1)xn−1 − (∆t)2 sin(xn ) (6.34)
(b) Simulate this difference equation for 1000 iterations using the values ∆t =
0.05, α = 0.1, x1 = 0, x2 = 0.0001 and plot your result. Repeat this calcula-
tion for x1 = 2, x2 = 2.0001 and compare your results.
(c) Redo this simulation using the small angle approximation sin x = x, i.e.,
simulate
xn+1 = (2 − α∆t)xn + (α∆t − 1)xn−1 − (∆t)2 xn (6.35)
using the values ∆t = 0.05, α = 0.1, x1 = 0, x2 = 0.0001 and plot your
result. Again, repeat this calculation for x1 = 2, x2 = 2.0001 and compare
your results with those found in part (c).
(d) Rewrite the second order Equation (6.34) as a system of two first order
equations via the substitution yn+1 = xn and determine all equilibria. Note
that the equilibria can also be determined directly from Equation (6.34).
(e) By computing the eigenvalues of the Jacobian matrix of this system, ascer-
tain which equilibria are stable and unstable. Discuss.
6.31. Repeat parts (d) and (e) of Problem 6.30 for the small angle approximation
Equation (6.35) and compare.
6.32. Analytically solve the linear difference equation from the previous problem
xn+1 = (2 − α∆t)xn + (α∆t − 1)xn−1 − (∆t)2 xn
and compare with your numerical simulation above. For simplicity you may take
∆t = 0.05, α = 0.1, x1 = 2, x2 = 2.0001.
6.33. Analytically solve the linear nonhomogeneous difference equation
xn+1 = (2 − α∆t)xn + (α∆t − 1)xn−1 − (∆t)2 xn + 0.01 sin(n/50)
Simulate this problem numerically and compare with your analytical solution for
2000 iterations. Can you identify a transient (i.e., a term that goes to zero) and
steady state (persistent) components of your solution? Again, for simplicity you
may take ∆t = 0.05, α = 0.1, x1 = 2, x2 = 2.0001. Hint: combine your solution
to the homogeneous problem found above with a particular solution of the form
pn = A cos(n/50) + B sin(n/50)
Solve for the undetermined coefficients A and B .
Section 6.5 Empirical Modeling 139
REFERENCES
[1] Bagnet, G. C., 2206, The widget maker’s guide to snarfle splatting and freen
wongling, 17th Edition, Buena Free Press, Crawdadsville, South Vermont.
[3] I. Lepper, Theoret. Comput. Sci. 269 (2001), no. 1-2, 433–450.