Uploaded May 2018 | Updated September 2026, 3 hours ago
Used Runge-Kutta of order 4 for an equation of a pendulum:
y''(t) = -g/L * sin(y) - (k/ML^2) y'
I used Matlab to plot the position of the pendulum over time.
Then I got the movie file and I thought maybe I could share it, idk.
It's some basic ODE thingy:
You call z the vector (y'(t),y(t))
Then you find the Cauchy equation : z'(t) = (-g/L * sin(z_1) - (k/ML^2) z_0 = f(t,z(t))
You can calculate an approximation of all the values of z(t) using the following algorithm:
k1 = f(tn,yn)
k2 = f(tn+h/2,yn + h/2 k1)
k3 = f(tn + h/2, yn + hk3)
yn+1 = yn + (h/6) (k1 + 2k2 + 2k3 + k4)
It's some basic numerical approach to differential equations.
Used Runge-Kutta of order 4 for an equation of a pendulum:
y''(t) = -g/L * sin(y) - (k/ML^2) y'
I used Matlab to plot the position of the pendulum over time.
Then I got the movie file and I thought maybe I could share it, idk.
It's some basic ODE thingy:
You call z the vector (y'(t),y(t))
Then you find the Cauchy equation : z'(t) = (-g/L * sin(z_1) - (k/ML^2) z_0 = f(t,z(t))
You can calculate an approximation of all the values of z(t) using the following algorithm:
k1 = f(tn,yn)
k2 = f(tn+h/2,yn + h/2 k1)
k3 = f(tn + h/2, yn + hk3)
yn+1 = yn + (h/6) (k1 + 2k2 + 2k3 + k4)
It's some basic numerical approach to differential equations.










