simulation of pendulum Solving of second order ODE
Objective: Here time span is taken 100sec and initial angular velocity is 20 rad/s^2; clc clear close all b = 0.005; g = 9.81; l = 1; m = 0.1; % initial condition theta_0 = [0;20]; t_span = linspace(0,100,250); syms t x a g = @(t,x)[x(2);-(b/m)*x(2)-(g/l)*sind(x(1))]; [t,xa] = ode45(g,t_span,theta_0); %plot(t,xa(:,1),t,xa(:,2))…