pendulum second order ode
Objective: clear allclose allclc b=0.05;g=9.81;l=1;m=1; %intial conditiontheta_0=[0;3]; %time pointst_span=linspace(0,20,500); %sole ode[t,results] = ode45(@(t,theta) ode_fuc(t,theta,b,g,l,m),t_span,theta_0); ct=1; for i=1:length(t)V = l*[-sin(results(i,1)) -cos(results(i,1))] ;%plotclfhold onplot([0, V(1)],[0, V(2)])plot(V(1),V(2),\'o\',\'MarkerSize\',15,\'MarkerFaceColor\',\'red\')…