pendulum undamped ODE
Objective: %solving ODE for the undamped pendulum motionclear allclose allclc g=9.81;l=0.5;m=0.5; theta_0 = [0;5]; t_span = linspace(0,8,500); [t,results] = ode45(@(t,theta) ode_func(t, theta, g,l,m),t_span,theta_0); figure(1)plot(t,results(:,1))hold onplot(t,results(:,2))xlabel(\'plot\')ylabel(\'time\')legend({\'Displacement\',\'Velocity\'});%%Animating…