Solving system of differential equations using Runge Kutta method

$\begingroup$

I have two differential equations:

\begin{align}\frac{dx}{dt} &= 1 -(1+b)x+ax^2y\\ \frac{dy}{dt} &= bx - ax^2y\end{align}

I have been asked to solve them on Python using the Runge Kutta (4th order) method. I know how to solve a single ODE using this method, but don't know how to extend it to a system of ODEs.

Any help (or pointers) would be greatly appreciated,

Jack

$\endgroup$ 2

1 Answer

$\begingroup$

HINT

You can reduce your system using the first equation: $$ ax^2y = x' - 1+b+bx $$ and so $$ y = \frac{x' - 1+b+bx}{ax^2} $$ (assuming $a \ne 0$) and now your ODE system will become a 2nd order ODE.

$\endgroup$ 6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like