pendulum
Objective: clear all close all clc g=9.8; L=1; m=5; w=g/(L*m); t=[0 200]; theta0=[45 0]; [t,theta]=ode45(@(t,theta)pend_function(t,theta,w),t,theta0); thetad=theta(:,1); %axis O=[0 0]; axis(gca,\'equal\'); axis([-1 1 -1 0.8]); grid on; %loop for i=1:length(t); Origin=viscircles(O,0.02); P=[L*sind(thetad(i)) -L*cosd(thetad(i))]; circle_P=viscircles(P,0.04);…