This is a simulation for simple harmonic motion:
F=m \frac{dv}{dt}=-k*x;

For the purpose numerical calculation, the above second order differential equation is transformer into two equations (first order differential equation):
\frac{dx}{dt}=v_x // use this equation to calculate x(t+dt) from x(t) and v_x(t)
\frac{dv_x}{dt}=-k*x/m // use this equation to calculate v_x(t+dt) from v_x(t) and x(t), k, m

With two initial conditions: x(0) and v_x(0), the rest of x(t) and v_x(t) can be calculated.
 

translate strings in simulation to different language format before download
Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
Download EJS jar file(1071.6kB):double click downloaded file to run it. (11 times by 7 users) , Download EJS source View EJS source