The equation for the SHM is Fx=-k*x;

EJS did not know how to solve the above equation. But it can solve first order differential equation.

The above is a particle move in x direction with velocity v, and it's velocity will change with time due to the above force (give acceleration ax).

So

d(vx)/dt= -k*x/m; // this equation tell EJS how the velocity should change with time.

dx/dt=vx; // this equation tell EJS how the x-coordinate change with time.

Movie is a snap shot of image at different time step. Simulation calculate the variable value at different time step and show it on the screen with GUI elements.

With the above two equations: EJS know how x/vx will change with time. So it will update it's new value and draw view elements according to your design.

The following is the simulation and the swf movie. Please download EJS xml source and modify the model to change it into a 2D SHM motion.

Hints: Change the resizable property for the arrow so that you can change it's size with your mouse when the simulation is in pause state.

Tutorial SWF file

http://www.phy.ntnu.edu.tw/ntnujava/swf/shmx.swf

**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

- Please feel free to post your ideas about how to use the simulation for better teaching and learning.
- Post questions to be asked to help students to think, to explore.
- Upload worksheets as attached files to share with more users.