Exercise 16.3

Exercise 16.3#

Question 1#

An early predator-prey population model is the Lotka-Volterra Model (http://www.scholarpedia.org/article/Predator-prey_model) given by:

\[\begin{align*} \dot{x} &= (b - py)x\\ \dot{y} &= (rx - d)y \end{align*}\]

Where \(x\) denotes the prey population and \(y\) denotes the predator population. This can be integrated out directly to arrive at the identity:

\[ C = b \ln y(t) - p y(t) - r x(t) + d \ln x(t) \]

where \(C\) is a constant determined by the initial conditions and parameters. All solutions should satisfy this relation.

  1. Use Euler’s method to solve this system of ODEs for \(b = p = r = d = 1\) up to \(t = 10\).

  2. Use your solutions to calculate \(C\) over time. Does it stay constant? What happens if you reduce the size of your \(t\) step?

Question 2#

Consider a planet orbiting the Sun. By Newton’s law of gravity, the components of acceleration in the \(x\)- and \(y\)-directions are

\[\begin{split} \begin{align*} {d^2x \over dt^2} &= -{GMx \over r^3}\\ {d^2y \over dt^2} &= -{GMy \over r^3} \end{align*} \end{split}\]

where \(r^2 = x^2 + y^2\), \(G\) is the gravitational constant and \(M\) is the mass of the Sun. Re-write these equations as four first-order differential equations.

  1. These four differential equations require four initial conditions. Choosing units such that \(GM = 1\), the initial conditions at \(t = 0\) are \(x = 1.0,~~ y = 0.0,~~dx/dt = 0.0,~~dy/dt = 1.0.\) Solve the differential equations using Euler’s method and write values of \(t, x, y\) for \(0 < t < 7\) using a step size of \(0.001\) in \(t\). Plot the the orbit (\(y\) as a function of \(x\)).

  2. Repeat above solution using initial conditions \(x = 1.0\), \(y = 0.0\) , \(\tfrac{d}{d t}x = 0.0\), \(\tfrac{d}{dt} y = 1.1\) at \(t = 0\) for \(0 < t < 10\) and the same step size. Plot the orbit.