Pendulum Motion
Objective: Main Code clear all close all clc g=9.81; l=0.5; m=0.5; theta_O=[0;5]; t_span = linspace(0,10,500); [t,results]= ode45(@(t,theta) ode_func(t, theta,g,l,m),t_span,theta_O); plot(t,results(:,1)) drawnow hold on plot(t,results(:,2)) ct=1; for i=1:length(t_span) theta=results(i,1); x0=0; y0=0; x1=l*sin(theta); y1=-l*cos(theta);…