Newton's Cannonball Thought Experiment Simulation in MATLAB
Newton's Cannonball Thought Experiment Simulation in MATLAB
Newton's Cannonball Thought Experiment Simulation in MATLAB
Thought Experiment
simulation in MATLAB
BY: PRASHANT KUMAR CHOUHAN (2019MEM2761)
MANISH KUMAR (2019MEM2759)
State Space Representation Small
Displacement of double pendulum
• x1 & x3 represent the & coordinate respectively
• Converting the above two 2nd order differential equation into four 1 st order differential equation
• The above four coupled 1st order ODEs have been solved using ODE45 Solver.
State Space Representation Large
Displacement of Double Pendulum
• x1 & x3 represent the & coordinate respectively
• Converting the above two 2nd order differential equation into four 1 st order differential equation
• The above four coupled 1st order ODEs have been solved using ODE45 Solver.
State Space Representation Double
Compound Pendulum
• x1 & x3 represent the & coordinate respectively
• Converting the above two 2nd order differential equation into four 1 st order differential equation
• The above four coupled 1st order ODEs have been solved using ODE45 Solver.
MATLAB PROGRAM FOR SMALL DISPLACEMENT OF DOUBLE
PENDULUM
N_count=0;
fram=0;
N_count=N_count+1;
fram=fram+1;
h=gca;
get(h,'fontSize')
set(h,'fontSize',12)
xlabel('X','fontSize',12);
ylabel('Y','fontSize',12);
title('For double compound pendulum with spring constant k1=100,k2=200 theta=90, phi=-90','fontsize',14)
fh = figure(4);
F=getframe(fh);
im = frame2im(F);
[imind,cm] = rgb2ind(im,256);
if i == 1
imwrite(imind,cm,'pendulum47.gif','gif','LoopCount',Inf,'DelayTime',.1);
else
imwrite(imind,cm,'pendulum47.gif','gif','WriteMode','append','DelayTime',.1);
end
movie(F,fram,1000)