I am new towards using EJS. I would like to know how can I make a simulation of a transverse wave with the following features to show a group of students who are learning waves motion for the first time and have no idea of sine or cosine function. Hopefully, they can play with the simulation.

In the beginning of simulation, I hope to show a string of N particles,  (hope that the number can vary by an input box) horizontally.
Something similar to this

I would like to show if the first particle is "pulled up or down", the string of N particles would be set in vibration one by one like a transverse wave.

I also would like to show when all the particles are set in vibration up and down, I can select any of the particles to follow the up and down motion. When I pause the simulation, I also hope that can show where is the selected particle a few time steps backward and forward. It would be better if the simulation can show the positions of all the particles a few time steps backward and forward, so that I can explain the motion.

If period, wavelength and amplitude can vary, it would be even be better. But I think I can add these features.

I hope someone can be kind enough to guide me how to make this simulation using ejs or provide me a working basics skeleton that I can work on it. I cannot figure out how to input something like this into the evolution page of the Model. I can create a string of particles.

Any help or suggestion is appreciated. Thanks.

I have create a simulation according to your requirement above.
I hope it is what you want. Enjoy it!

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(1409.1kB):double click downloaded file to run it. (21 times by 20 users) , Download EJS source View EJS source