Week 3 - Solving second order ODEs
ODE FUNCTION AND SIMPLE PENDULUM
given,
(d^2 theta/dt^2)+b/m(d theta /dt)+g/l (sin theta)=0
b=0.05; damping
l=1m;length
g=9.81; gravity
m=1kg; mass
and we write the code using above data.
clear all; close all; clc;
using 'linspace commamd 'get time multiple value
then get special funtion is,
[t, results] = ode45(@(t,theta) ode_func(t, theta,b,g,l,m),t_span,theta_0);
finally get the answer. and plot the graph , and create the simple pendulum using a command like
[plot(X0,Y0,'O','markersize',3,'markerfacecolor','y');
plot(X1,Y1,'O','markersize',20,'markerfacecolor','r');
title('Damping of simple pendulum');
legend('support rod','length of pendulum','fixed point','Bod of pendulum');]
x0 yo origin point,x1 y1 end point
'y' yellow;'r' red ; 'o' circle
it means
markersize mean initial point of pendulum size mention
markerfacecolor mean mention the color of orgin point
all command mention the different meaning

in between get some error

and create avi. also some error

finally resolve the error ,get the answers
