Search code examples
pythonnumpygoogle-colaboratorydifferential-equations

Solving a system of first order differential equations and second order differential equations (Non-linear)


The problem

I currently have a system of four equations. Two are second-order differential equations and two are first-order differential equations:

Four equations

The initial conditions are:

x = 0 |
y = 0.3 | 
f(x) = 2.05 |
f(y) = 0.55 |

All angles are in degrees.

What I have tried

I have tried to use Google Colabs and worked with SciPy and NumPy. Unfortunately, I cannot figure out how to program it as these equations are non-linear. Could somebody give me some tips on any other modules to use?


Solution

  • Scipy has a Runge Kutta solver. First, you have to transform your ODEs to first order system (you can always do that by setting z=y') and then try the RK solver.