Transient Response of Pendulum using Python
Objective: import numpy import matplotlib.pyplot as plt import math from scipy.integrate import odeint def pendulum(theta,time,damping,gravity,length,mass): theta1 = theta[0] theta2 = theta[1] dt1_dt = theta2 dt2_dt = (-(damping/mass)*theta2) - ((gravity/length)*math.sin(theta1)) d_dt = [dt1_dt,dt2_dt] return d_dt damping = 0.05…