You are on page 1of 1

Numerical Methods with MATLAB (MAM202) Tutorial 5

Submission deadline: 19h00, 29th October 2012. Note: All gures should have their axes labeled, and should have a suitable title. 1. Solve the following logistic dierential equation using both Eulers method and the PredictorCorrector method: dy = ky(1 y). dt The value of k, the domain [a, b] and y(a) should be solicited from the user. Your program should then solve the ODE, and plot the two numerical solutions (i.e. the solution obtained with Eulers method and the solution obtained with the Predictor-Corrector method), on the same gure. 2. Complete the following exercises in the course notes: (a) Page 194-195: Exercises 1, 2. 3. (The SIR Model of an Epidemic.) In an epidemic, the people are classied as: S, susceptible; I, infected; or R, removed from the system by either death or no longer being able to be infected. The rate of loss of S to I is assumed to be proportional to the number of interactions between these categories. The rate of gain to I is proportional to the number of interactions between I and S minus those lost to R. We assume that the rate of loss of I to R is proportional to the size of I. The rate of gain of R from I is then proportional to the size of I. We can express this as a system of dierential equations and construct a computational model of the system: dS = r1 SI dt dI = r1 SI r2 I dt dR = r2 I. dt The rate constants here are typically of the order 1/S0 , where S0 is the initial value of S. Write a script, called SIR, to solve the system given user-dened initial conditions and rate constants.

You might also like