Transient Motion of Pendulum
Objective: %function for ode function[D]= ode_fun(t,theta,b,l,g,m) theta1=theta(1); theta2=theta(2); dtheta1dt= theta2; dtheta2dt= - (b/m)*theta2 - (g/l)* sin(theta1); D=[dtheta1dt;dtheta2dt]; end clc clear all %given inputs b=0.05; g=9.81; m=1; l=1; %initial position and velocity xinitial=[0;3]; %timespan tspan=linspace(1,20,200);…