APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Wank Tank Modeling in EJS post and replies

Return to the Wank Tank Modeling in EJS thread
Login to post to this thread

Water Tank Modeling in EJS
Omar Ahmed
1 Posts

Hi, I need some help with a simulation I'm doing with water tanks. I am trying to show the water level slowly increasing but if I use a for loop it always changes the level instantly without showing the gradual increase. All I'm trying to do is make the level increase slowly but I cannot seem to figure it out?? Also, is there any way to rotate the water tanks in EJS to a certain degree measure?


Replies to Water Tank Modeling in EJS

Re: Water Tank Modeling in EJS -
Wolfgang
192 Posts

Omar--

You are exactly correct.  If you compute all your data in a loop the data and the state of the system is displayed at the end of the loop.  To show the data as it is being generated you must do a time evolution.  Evolve the system using an appropriate time step and EjsS will display the state of the system after every timestep.  See, for example:

http://www.compadre.org/osp/items/detail.cfm?ID=7565



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book