Clear Filters
Clear Filters

Using Euler-Cromer to find the motion of a simple pendulum?

1 view (last 30 days)
My professor wants us to find the number of periods a simple, meter-long pendulum will have in a day if given an initial angle of 50 degrees using the Euler-Cromer method. My problem is that I can't come up with al the equations I need.
I know that I need: dθ/dt = f(t, ω) and dω/dt = g(t, θ).
I managed to get dω/dt = -9.8*sin(θ). I can't figure out what dθ/dt should be, though. Once I have that, I understand how to use for loops to find θ and ω for time steps and if statements to fin the number of periods throughout the day (even if it is inefficient), I just can't seem to get started. Can anybody give me some help as to what dθ/dt is? Remember, the starting angle is 50 degrees, so the small angle approximation cannot be used.

Answers (1)

Matt Kindig
Matt Kindig on 4 Apr 2012
Can you use the ODE solvers built-in to Matlab (something like 'ode45')? If so, that would be the easiest way, and would avoid looping completely.
If the objective of the assignment is to implement your own ODE solver, then I would look up the definition for Runge-Kutta integration on Wikipedia or similar.
By the way, d(theta)/dt is just w (omega).
  2 Comments
Rachel
Rachel on 4 Apr 2012
We are supposed to implement our own ODE solver, and I know about the Runge-Kutta method, but we are told explicitly in the problem to use the Euler-Cromer.
I tried using dθ/dt(i) = ω(i), but I end up with a pendulum that swings in circles, not an arc of 100 degrees total.
Matt Kindig
Matt Kindig on 4 Apr 2012
Ah, my apologies. I realized I overlooked that you specified the Euler-Cromer method. Can you post your code for us to look over?

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!