0% found this document useful (0 votes)
42 views

Numerical Methods With MATLAB (MAM202) Tutorial 5

The document provides instructions for a numerical methods tutorial assignment with the following requirements: 1) Write a program to solve a logistic differential equation using Euler's method and the Predictor-Corrector method, plotting the two solutions on the same figure. 2) Complete exercises 1 and 2 on pages 194-195 of the course notes. 3) Write a script called SIR to solve a system of differential equations modeling the spread of disease given initial conditions and rate constants provided by the user.

Uploaded by

JungleSquid
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Numerical Methods With MATLAB (MAM202) Tutorial 5

The document provides instructions for a numerical methods tutorial assignment with the following requirements: 1) Write a program to solve a logistic differential equation using Euler's method and the Predictor-Corrector method, plotting the two solutions on the same figure. 2) Complete exercises 1 and 2 on pages 194-195 of the course notes. 3) Write a script called SIR to solve a system of differential equations modeling the spread of disease given initial conditions and rate constants provided by the user.

Uploaded by

JungleSquid
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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