Education Prize Logo
Science SPORE Prize
November 2011

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

Resetting certain variables with reset button but not all the variables post and replies

Return to the Resetting certain variables with reset button but not all the variables thread
Login to post to this thread

Resetting certain variables with reset button but not all the variables - May 8, 2013 at 10:16AM
fergal wallace
3 Posts

I'm trying to reset some of my variables with the rest button but not all the variables. Basically what i want to do is choose which variables are reset when the reset button is clicked.
_reset()    is just resetting everything. I want to reset just three variables.
Seems like such an easy thing to do in my head but i've just had trouble with it.
Any help much appreciated!!


Replies to Resetting certain variables with reset button but not all the variables

Re: Resetting certain variables with reset button but not all the variables - May 08 2013 6:16PM
Francisco Esquembre
147 Posts

_reset() does the following:
- sets all variables to the values indicated in the tables of variables
- runs the Initialization code (+ Fixed relations)

however, initialise() only runs the Initialization code (+ Fixed relations)

By setting the value of some variables (and not others) in the Initialization pages, you can call initialise(9 to get what you want.

Cheers,

Paco



Re: Re: Resetting certain variables with reset button but not all the variables - May 09 2013 1:21PM
fergal wallace
3 Posts

worked great paco :-)
Many thanks!!



The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics