Question: Numerical Methods for Ordinary Differential Equations: Initial Value Problems NOTE: Python is required , not MATLAB . 4. Recall the Rabbit (ui(t)) and Fox (uz(t))

Numerical Methods for Ordinary Differential Equations: Initial Value Problems

NOTE:

Python is required, not MATLAB.

Numerical Methods for Ordinary Differential Equations: Initial Value Problems NOTE: Python is

4. Recall the Rabbit (ui(t)) and Fox (uz(t)) population model: d [ui] [k1u1 - k2u1u2] dt [ua] [k3u1 U2 - kauz] u1(0) = 1000, u2(0) = 500, ki = 3, kg = 2 x 10-3, k3 = 6 x 10-4, k4 = 0.5. (a) Write a PYTHON code to solve the above system using the implicit Trapezoidal method: def trapezoidal(f, eta,T,N,J, TOL, MaxIters): Note that f(t, u) is the right-hand side function, n is the vector of initial conditions, T is final time, N is the number of time-steps, and Jit, u) is the Jacobian matrix needed in the Newton solver: rafi afil 214 . 2) = 2) = 2 dui duz Recall that the Newton's method for the system of equations g(u) = 0 looks like for m = 1,2,3,... 2 cm) = y m=1) ((z\m-))) [ (26m-). (b) Use your code to solve the Rabbit-Fox problem. Choose a final time of T = 20 and a time step k and tolerance TOL in order to get a sufficiently resolved solution. Produce a plot of the time-series of uit) and u2(t) and a plot of the solution in phase space (i.e., u2 vs. ui). 4. Recall the Rabbit (ui(t)) and Fox (uz(t)) population model: d [ui] [k1u1 - k2u1u2] dt [ua] [k3u1 U2 - kauz] u1(0) = 1000, u2(0) = 500, ki = 3, kg = 2 x 10-3, k3 = 6 x 10-4, k4 = 0.5. (a) Write a PYTHON code to solve the above system using the implicit Trapezoidal method: def trapezoidal(f, eta,T,N,J, TOL, MaxIters): Note that f(t, u) is the right-hand side function, n is the vector of initial conditions, T is final time, N is the number of time-steps, and Jit, u) is the Jacobian matrix needed in the Newton solver: rafi afil 214 . 2) = 2) = 2 dui duz Recall that the Newton's method for the system of equations g(u) = 0 looks like for m = 1,2,3,... 2 cm) = y m=1) ((z\m-))) [ (26m-). (b) Use your code to solve the Rabbit-Fox problem. Choose a final time of T = 20 and a time step k and tolerance TOL in order to get a sufficiently resolved solution. Produce a plot of the time-series of uit) and u2(t) and a plot of the solution in phase space (i.e., u2 vs. ui)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!