Submitted by: Submitted by Elaine0066
Views: 10
Words: 897
Pages: 4
Category: Science and Technology
Date Submitted: 02/10/2016 02:43 PM
Computer project 1 Solution
The goal of this project is to investigate the contagious behavior of a disease, which is
modeled by the following iterative non-linear model
2
In+1 = f (In ) = In − rIn + sIn 1 −
In
N
,
where In is the number of infected people at n-th week, N is the total population, r is
the recovery rate, and s is a positive constant. Note that this model is different from the
non-linear infection model we’ve discussed in class.
1. Suppose that the recovery rate r is 0.7 and the total population is 10000. Find the
condition for s that f (x) defines a dynamical system (note that the image of f
must be in the domain of f ).
For this model, the domain is [0, 10000]. So In+1 = f (In ) is an unbreakable dynamical system if the image of f is in [0, 10000].
If we plot a general graph of f (x) (with an appropriate s), the graph looks like
the following:
plot(x-0.7*x+0.0005*x^2*(1-x/10000),(x,0,10000),aspect_ratio=1)
+plot(10000,(x,0,10000))
1
MATH 1700 Homework
Han-Bom Moon
So the image of f is in [0, 10000] if the maximum occurring when x is around 7000
is less than 10000. By sketching graphs with various s, we can conclude that if s
is in (0, 0.000537], then f defines an unbreakable dynamical system.
2. In addition to conditions in 1, suppose that s = 0.00051. Find all fixed points.
solution_set = solve(x-0.7*x+0.00051*x^2*(1-x/10000) == x,x)
for s in solution_set:
print float(s.right_hand_side())
1642.24631578
8357.75368422
0.0
Thus we can find three fixed points 1642.24631578, 8357.75368422, and 0.
3. By making a table of In for 0 ≤ n ≤ 20 with various I0 , investigate the stability of
each fixed point.
I = [1500]
for j in range(20):
I.append(I[j]-0.7*I[j]+0.00051*I[j]^2*(1-I[j]/10000))
for j in range(21):
print "I_%(index)s = %(value)f" % {"index" : j, "value" : I[j]}
I0
I1
I2
I3
I4
I5
I6
I7
I8
I9
I10
I11
I12
I13
I14
I15
I16
I17
I18
I19
I20
1500
1425.37500000000
1316.08417457192...