Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Energy in predator-prey models In Volterra Equations, dx/dt = rx - axy dy/dt = -ky + bxy It is hard to find the analytic solutions
"Energy" in predator-prey models In Volterra Equations, dx/dt = rx - axy dy/dt = -ky + bxy It is hard to find the analytic solutions for x(t) and y(t). However, a conserved "energy" E(x, y) can be defined for checking the consistency of the numerical solutions: E(x, y) = -bx + k ln x - ay + r ln y In this exercise, take r = k = 0.5 and a = b = 0.01 From Problem 3, please show E(x, y) is conserved along the time t for a given initial condition (x_0, y_0). Use ode45 to solve the Lotka-Volterra equations and obtain x(t) and y(t) for t between t = 0 and t = 50, given at time t = 0, x(0) = 100 and y(0) = 80. With the default settings, the number of time steps taken should be 133. Plot x(t) verse t and y(t) verse t in the given time range. you should find that the solutions x(t) and y(t) seems to be periodic and oscillate somewhere between 10 and 120. We know the trace (x(t), y(t)) should form a closed orbit around the fixed point (50, 50). Please plot x(t) verse y(t). In fact, you will see that the path in the phase diagram is actually not closed due to numerical instabilities The numerical instabilities can also be revealed by checking the "constancy" of the energy function. Please plot E(x(t), y(t)) as a function of t. You will see the irregularity of the energy evolution. This instability is because the Lotka-Volterra equations are stiff with respect to ode45. The stiffness of the system can be dealt with by using a better ODE solver. Repeat the above calculations in (2) using the Trapezoidal Rule-Backward Differentiation Formula (TR/BDF2) solver ode23tb. The trace in the phase diagram is "more" closed. "Energy" in predator-prey models In Volterra Equations, dx/dt = rx - axy dy/dt = -ky + bxy It is hard to find the analytic solutions for x(t) and y(t). However, a conserved "energy" E(x, y) can be defined for checking the consistency of the numerical solutions: E(x, y) = -bx + k ln x - ay + r ln y In this exercise, take r = k = 0.5 and a = b = 0.01 From Problem 3, please show E(x, y) is conserved along the time t for a given initial condition (x_0, y_0). Use ode45 to solve the Lotka-Volterra equations and obtain x(t) and y(t) for t between t = 0 and t = 50, given at time t = 0, x(0) = 100 and y(0) = 80. With the default settings, the number of time steps taken should be 133. Plot x(t) verse t and y(t) verse t in the given time range. you should find that the solutions x(t) and y(t) seems to be periodic and oscillate somewhere between 10 and 120. We know the trace (x(t), y(t)) should form a closed orbit around the fixed point (50, 50). Please plot x(t) verse y(t). In fact, you will see that the path in the phase diagram is actually not closed due to numerical instabilities The numerical instabilities can also be revealed by checking the "constancy" of the energy function. Please plot E(x(t), y(t)) as a function of t. You will see the irregularity of the energy evolution. This instability is because the Lotka-Volterra equations are stiff with respect to ode45. The stiffness of the system can be dealt with by using a better ODE solver. Repeat the above calculations in (2) using the Trapezoidal Rule-Backward Differentiation Formula (TR/BDF2) solver ode23tb. The trace in the phase diagram is "more" closed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started