Starting from:

$29.99

CTA200 Assignment 2

CTA200 Assignment 2

[4] Question 1
For each point in the complex plane c = x + iy, with −2 < x < 2 and −2 < y < 2, set z0 = 0 and iterate
the equation zi+1 = z
2
i + c. Note what happens to the zi
’s: some points will remain bounded in absolute
value |z|
2 = <(z)
2 + =(z)
2
, while others will run off to infinity. Make an image in which your points c that
diverge are given one color and those that stay bounded are given another. (Once you have done this, you
can try coloring the points that diverge using a colorscale that indicates the iteration number at which the
given point diverged.) Try zooming in on a portion of the image and trying again.
[4] Question 2
The SIR model is a simple mathematical model of disease spread in a population. The model divides a fixed
population of size N into three groups, which vary as a function of time, t:
• S(t) is those that are susceptible but not yet infected
• I(t) is the number of infected individuals
• R(t) is those individuals that have recovered and are now immune
The model can be described by a set of 3 first order differential equations for each of the variables as
dS
dt = −
βSI
N
, (1)
dI
dt =
βSI
N
− γI, (2)
dR
dt = γI (3)
Using the ODE integrator of your choice (must be callable in Python, we recommend using Scipy as will
be covered in lecture on Friday), integrate the equations with N = 1000 from t = 0 to t = 200 for various
values of γ and β (at least 3-4 values, justify your choices physically).
Use the initial condition I(0) = 1, S(0) = 999, R(0) = 0 (you can also experiment with other initial conditions
if you wish). Plot the curves for S, I, R on the same figure with a legend. make separate plots for each choice
of the parameters.
Bonus: Add a 4th parameter D for deaths and justify the addition of a 4th differential equation as well as
any RHS terms that must be changed on the initial 3 equations. Integrate the new set of equations for some
choice of parameters and comment on the results compared to the SIR model.
1
[2] Question 3
To practice using the LaTex, markup language, we would like you to writeup your results in a .tex file and
submit both the LaTex code and the associated PDF. For each of the questions, save and insert your figures
into a tex file and write a 1 paragraph methods section, which briefly describes what you did as well as a 1
paragraph analysis section which describes what you see in the results.
How to Submit
Submit your assignment by creating a folder called assignment 2 in your repository from Assignment #1
and put the code file or notebook, the LaTex file and the PDF output from LaTex. Commit the files and
push to github. No need to email me your repo again since I have the URL from assignment 1.
2

More products