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 Euler’s 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 Euler’s 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
- Graph Theory, Euler, Lotka–Volterra equation