The pendulum as an elegant example of harmonic motion
Issue: 4.3 (January/February 2006)
Author: JC Cruz
Article Description: No description available.
Article Length (in bytes): 16,368
Starting Page Number: 15
RBD Number: 4309
4309.sit Updated: Monday, January 16, 2006 at 12:53 PM
4309.zip Updated: Monday, January 16, 2006 at 12:53 PM
Related Web Link(s):
Known Limitations: None
Excerpt of article text...
In my previous article, I demonstrated how to use the Euler Method to simulate the motion of a projectile. I have introduced a new REALbasic class, rbc_vector, which enables me to solve motion ODEs (Ordinary Differential Equations) using vector quantities. I have also shown a Sprite subclass, rbc_newton, which encapsulates the Euler Method as well as various motion parameters.
The topic for today is the physics of harmonic motion. I will introduce a new algorithm that can solve more complex ODEs with better precision and stability than the Euler Method. I will also discuss the physics behind harmonic motion. Finally, I will demonstrate how to simulate an elegant example of harmonic motion, the simple pendulum.
The Runge-Kutta Method
The Euler Method is a quick and simple way of numerically solving ODE equations. However, this algorithm suffers from a number of limitations. One primary limitation is that its accuracy is strongly dependent on the simulation step size. The smaller the step size, the better the accuracy. Consequently, smaller step sizes also translate to longer processing cycles.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.