Damped, driven pendulum
This script calculates a solution to the ODE for a driven pendulum with damping.
I*d(dθ/dt)/dt + m*g*l*sin(θ) + b*dθ/dt = a*cos(Ω*t)
This second order non linear ODE has been to be modified to a system of two first order ODEs.
dω/dt = 1/I*( -g*m/l*sin(θ) - b*ω + a*cos(Ω*t) )
dθ/dt = ω
The script uses a 4th order Runge-Kutta method to calculate a solution of this system.
This solution is then plotted.
The libraries math, numpy and matplotlib are used.