필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Rachel
Rachel 2012년 4월 3일
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.

답변 (1개)

Matt Kindig
Matt Kindig 2012년 4월 4일
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
Rachel
Rachel 2012년 4월 4일
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 2012년 4월 4일
Ah, my apologies. I realized I overlooked that you specified the Euler-Cromer method. Can you post your code for us to look over?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by