Class Home

Class 3: Numerical Solutions of Ordinary Differential Equations


Problem (8.2): Euler & 4th Order RK solutions to SHM

Performance of both methods with varying step size:

Performance of Euler Method

Python source for Euler method

Performance of 4th order RK Method

Python source for 4th order RK method


Problem (8.3): 4th order Runge-Kutta adaptive stepper

Chosen step size as desired local error varies:

Performance of RK adaptive stepper

Python source for 4th order Runge-Kutta adaptive stepper


Problem (8.4): Numerical Solution for pendulum for periodic support motion

Solved with the RK adaptive stepper form the previous problem. Gravity = 10, length = 1, desired local error = 0.0001

Solution not animated. Consider animating it and posting a video

Python source code

Solution with with amplitude = 6 and frequency = 2:

Solution with with amplitude = 6 and frequency = 1: