Thursday, August 21, 2014

EJSS SHM model with all 7 graphs

EJSS SHM model with all 7 graphs, thanks to Chi-Feng Lin for helping to figure out the complex EJSS models can be compiled using 64 bit OS using Java 67.  bit http://www.compadre.org/osp/bulletinboard/TDetails.cfm?FID=58&TID=3126&ViewType=2#PID75426

based on models and ideas by


http://weelookang.blogspot.com/2014/08/ejss-shm-model-with-all-7-graphs.html
EJSS simple harmonic motion model with all 7 graphs
https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_SHM/SHM_Simulation.xhtml
source: https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_src_SHM.zip
author: lookang
author of EJSS 5.0 Francisco Esquembre


  1. lookang http://weelookang.blogspot.sg/2010/06/ejs-open-source-simple-harmonic-motion.html?q=SHM
  2. Wolfgang Christian and Francisco Esquembre http://www.opensourcephysics.org/items/detail.cfm?ID=13103
The equations that model the motion of the spring mass system are:
Mathematically, the restoring force $ F $ is given by 

$ F = - k x $

where $ F $  is the restoring elastic force exerted by the spring (in SI units: N), k is the spring constant (N·m−1), and x is the displacement from the equilibrium position (in m).

Thus, this model assumes 

$ \frac{\delta x}{\delta t} = v_{x} $


$ \frac{\delta v_{x}}{\delta t} = -\frac{k}{m}(x-l) - \frac{bv_{x}}{m} + \frac{A sin(2 \pi f t)}{m} $

where the terms

$ -\frac{k}{m}(x-l) $ represents the restoring force component as a result of the spring extending and compressing.

$ - \frac{bv_{x}}{m}$ represents the damping force component as a result of drag retarding the mass's motion.

$ + \frac{A sin(2 \pi f t)}{m} $ represents the driving force component as a result of a external periodic force acting the mass $ m $.

What is SHM?

Simple harmonic motion is typified by the motion of a mass on a spring when it is subject to the linear elastic restoring force given by Hooke's Law. The motion is sinusoidal in time and demonstrates a single resonant frequency. In order for simple harmonic motion to take place, the net force of the object at the end of the pendulum must be proportional to the displacement. In other words, oscillations are periodic variations in the value of a physical quantity about a central or equilibrium value.

Once the mass is displaced from its equilibrium position, it experiences a net restoring force. As a result, it accelerates and starts going back to the equilibrium position. When the mass moves closer to the equilibrium position, the restoring force decreases. At the equilibrium position, the net restoring force vanishes. However, at x = 0, the mass has momentum because of the impulse that the restoring force has imparted. Therefore, the mass continues past the equilibrium position, compressing the spring. A net restoring force then tends to slow it down, until its velocity reaches zero, whereby it will attempt to reach equilibrium position again.

As long as the system has no energy loss, the mass will continue to oscillate. Thus, simple harmonic motion is a type of periodic motion.


Developers' Note:

currently, seems to be compilable using system like
Win 7 x64
EJS_5.0_140730
Java 7 Update 60 (64-bit)

Win 8.1 x64
EJS_5.0_140730
Java 1.7.0_67 found C:/Program Files/Java/jre7/ (32-bit)

FAILED.
Win 8.1 x64
EJS_5.0_140730
C:/Program Files (x86)/Java/jre7/