This preview shows page 1. Sign up to view the full content.
Unformatted text preview: RK2 and one plotting the numerical and exact solutions using RK4). 2. Consider the Predator-Prey model: dN dt = N-PN, (2) dP dt =-P + PN, (3) where P is the number of predators and N the number of prey (or nutrients). Write a code that solves these equations from t = 0 to t = 20. Use a time step of .1 and take initially P = 5 and N = 10. The parameters are = 1 . 5, = 1, = 3 and = 1. Plot the solutions P and N as a function of t on a single graph. Do this using Eulers method, RK2 and RK4. Comment on your results, i.e. explain the dynamics of interaction between predators and prey. What to turn in : your codes as well as a 3 graphs (one plotting P and N using the Eulers method, one plotting P and N using RK2 and one plotting P and N using RK4) and a paragraph on your explanation of the dynamics between predators and prey. 1...
View Full Document
- Fall '08