Using Python, write a program to model a non-linear pendulum to determine the period and frequency of oscillation of the pendulum. Plot a graph of displacement (degrees) vs time using the Euler, Runge Kutta, and your analytical method. Do not include the impact of damping or oscillating driving forces.
15.1 Investigation of damped driven oscillation including chaotic motion of a damped driven pendulum:
15.1.1 Physics
The dynamics of a non-linear pendulum can be modeled using the following differential equation:
d^2θ/dt^2 + sin(θ) = 0
which should be split up into the two equations:
dθ/dt = ω
dω/dt = -sin(θ)
Note that this splitting of a second-order differential equation into two first-order differential equations was also used for the simple harmonic oscillator above. To include damping and an oscillating driving force, the equations are modified to:
d^2θ/dt^2 + q*dθ/dt + F*sin(p*t) = 0
which splits up into:
dθ/dt = ω
dω/dt = -q*ω - F*sin(p*t)
where q is a frictional damping coefficient, F is the driving force, and p is the angular driving frequency in radians. Strictly speaking, F is the maximum angular acceleration due to the periodic driving force.
15.1.2 Structured work:
Write a program to model a non-linear pendulum. Use the value of θ given by 5678 [=0.5 meters * 10000, where 5678 are the last four digits of your student number. Use your model to determine the period and frequency of oscillation of your pendulum with amplitudes of oscillation of 50°, 10°, 208°, and 40°.