Skip to content

Homework 1

a) Numerically solve the Lotka-Volterra (ie, predator-prey) equations using

  • Euler method
  • 4th order runge kutta method  (you can find its algorithm on the internet)

\begin{eqnarray}
\frac{dx}{dt} &=& \alpha x – \beta xy  \\
\frac{dy}{dt} &=& \delta xy – \gamma y
\end{eqnarray}

with parameter values.

\begin{eqnarray}
\alpha = 1,\quad \beta = 1,\quad \gamma = 1,\quad \delta = 1
\end{eqnarray}

for the following four initial conditions: (x,y) = (1.1, 1), (2, 1), (4, 1),  (4, 0.2). Solve from t=0 to t=40 in all four cases and use \(h=0.01\)  as a time step.

For each initial condition, plot both \(x(t)\) and \(y(t)\) against time to see the populations evolve in response to each other.

b)  Using only Runge-Kutta 4, plot the phase portrait of the system.

================================

You should generate a pdf which includes the eight solutions (4 with RK4, 4 with Euler) and a phase portrait.

send your results to semih.ay@marmara.edu.tr  untill 21 oct, 11:59pm.