Plotting Simple Pendulum in MATLAB: Tutorials & Tips

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
tigertan
Messages
24
Reaction score
0
I'm really confused at the moment and would quite appreciate some guidance.

I've got little to no background in Matlab and am needing to plot a simple pendulum.

I have found the equation of motion which is q(doubledot) = -(g/l)sin(beta)

I don't know how to go about this?

After declaring the variables:

runtime = 50; %duration of simulation in seconds
g = 9.8;
startingangle = 20; %starting angle in degrees
initialvelocity = 0;
length = 1;


How do I go about this?
Does anyone have any good tutorials to help me out?

I know I need to incorporate some function called ode45..
 
Physics news on Phys.org