Motion of Simple Pendulum using Matlab
Objective: % solving second order ode close all clear all clc t = linspace(0,20,300); y0 = [0 3]; [t, y] = ode45(@(t,y) odefun_second_order_pendulum(t,y), t, y0); % Plotting figure(1) plot(t,y(:,1),\'color\',\'r\',\'linewidth\',3); xlabel(\'time\') hold on plot(t,y(:,2),\'color\',\'k\',\'linewidth\',3); legend(\'displacement\',\'velocity\',\'Location\',\'northeast\')…