NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Questions related to EJS => Topic started by: Fred Chuit on October 10, 2009, 03:43:17 am



Title: how to use the memory of Trace component
Post by: Fred Chuit on October 10, 2009, 03:43:17 am
Dear Ejs-users,

I would like to have graphs where the previous lines are redrawn (or stay vissible) on restart (_play) of the animation.
So a graph will show new plotted and previous lines.
Could any one please explain how to do that?
How to use the memory options of the trace component?
Already thanks for any help or advice.
Regards,
Fred


Title: Re: how to use the memory of Trace component
Post by: lookang on October 10, 2009, 08:18:32 am
Try to have a button called action _initialize()
so the applet still think it is running the simulation, thus continue to draw as t increases.

_Reset() button really reset the simulation to original state so that is not the button to use.
 


Title: Re: how to use the memory of Trace component
Post by: Fu-Kwun Hwang on October 10, 2009, 08:42:32 am
Suggestion for using "trace" GUI element:
1. Set Max Points to a fixed number:  for example: I normally define npt=300, then assign Max Points=npt , otherwise it will record all data points (it possible to use all computer memory).
2. set "Memory" to 3 will keep the last 3 trace triggered by _initialize() . i.e. when _initialize() is execute a new trace is drawn.
3. If "Mem Color" is assigned and different from "Line color" , previous traces will change color to Mem Color.


Title: Re: how to use the memory of Trace component
Post by: Fred Chuit on October 10, 2009, 08:35:13 pm
Dear prof. Fu-Kwun Hwang and mr. lookang,

Your information helped me to fix the problem I had with the graph.
Many thanks for your help.
Regards,
Fred