Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now



Harmonic Motion

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
Resource File(s):

Download Icon 4309.sit Updated: Monday, January 16, 2006 at 12:53 PM
Download Icon 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.

Basic Concepts

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.




Weblog Commenting and Trackback by HaloScan.com