solving second order ode s
Objective: clear all close all clc %Dampimg Cofficient b = 0.05; %Gravity m/s^2 g= 9.81; %Length of the pendulum m l = 1; %Mass of the ball kg m = 0.1; %For Simplication r = g/l; k = b/(m*l); %Initial Condition init = [pi/2;0]; %The Pendulum ODE f = @(t,x) [x(2);-k*x(2)-r*sin(x(1))]; %Solving ODE. The time interval is set from 0…