[A mass on a Hooke's Law spring is a simple harmonic oscillator.]

Week 3 Notes: Introduction to Ordinary Differential Equations

In order to begin our study of the numerical solution of ordinary differential equations, we model a mass on a spring using a Hooke's Law approximation to the spring force.  Although the analytic solution to this simple harmonic oscillator is well known, it pays to begin with a model with a known analytic result so that we can compare this result with various numerical approximations.

First model: Analytic Simple Harmonic Oscillator

The SHO Analytic Model displays the analytic time evolution of a simple harmonic oscillator.  This simple model will be used to test solutions that solve Newton's Second Law using various numerical approximations.

 

As you learned in introductory physics, the solution of a second order differential equation (such as Newton's Second Law F=ma) has two arbitrary constants determined by the initial position x0 and the initial velocity v0.  For example, the one-dimensional simple harmonic harmonic oscillator solution can be written:

where the (angular) frequency of oscillation ω is determined by the spring constant and the mass ω = (k/m)½.  An alternate form of the SHO solution uses a single sinusoidal function with an amplitude A and a phase shift φ

where A = (x02 + v02/ω2)½ and φ = tan-1(ωx0/v0).

 

Exercise:

Use EJS to plot the time development of a damped mass on a spring.  Look up the analytic solution in your introductory physics or intermediate mechanics textbook.  Decide what variables are important and build a user interface that allows users to adjust these variables.  Describe the physics of the model in your documentation including screen shots of output graphs.

 

Related Models

The following simple harmonic oscillator (SHO) models compare different solution techniques.  These models are listed in order of complexity.

Credits:

The SHO Analytic Model was created by Wolfgang Christian using the Easy Java Simulations (EJS) version 4.1 authoring and modeling tool.  You can examine and modify a compiled EJS model if you run the model (double click on the model's jar file), right-click within a plot, and select "Open Ejs Model" from the pop-up menu.  You must, of course, have EJS installed on your computer.

 

Information about Ejs is available at: <http://www.um.es/fem/Ejs/> and in the OSP comPADRE collection <http://www.compadre.org/OSP/>.