resuming a run based on a existing dataset does not work

Use this forum to post Vensim related questions.
Post Reply
tfhavel
Junior Member
Posts: 11
Joined: Wed Jan 30, 2008 9:41 pm

resuming a run based on a existing dataset does not work

Post by tfhavel »

I am trying to use the simulation control tab to resume a run, by setting the "based on" field to an existing data set, clicking the "resume" button and leaving the time blank, which the reference manual says should cause it to resume from the end of the previous run. If that had worked, I would also have specified a ".cin" file to change some of the constants in midstream, but instead I got a bunch of warnings about variables having changed values (even though the pairs of values reported by those warnings were the same), and then apparently nothing happened (i.e. no new data seems to have been written to the new data set ".vdf" file). I should mention that I *did* set the FINAL TIME variable to a larger value than the length of the previous run. The only other option I am aware of for changing some parameters in midstream (besides coding it in!) is to run a game with all the parameters I want to change specified as game variables, but this is extremely unwieldy by comparison (especially since I am still trying to decide what to change).

Someone please let me know what is wrong and how I can work around it!
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

i am not totally clear on how you have tried to do this but a couple of notes:

1) The model must be a .vmf file not a .mdl file.
2) Check the model, then save it, then simulate to get the base run.
3) Make sure the run name for the new run s different than the name from step 2.

You can't make any changes to the model (Final Time or anything) between steps 2 and 3. To change final time use a .cin file or the Changes button after hitting Set, or the changes tab of the simulation control dialog or SIMULATE>SETVAL if this is all being done via the vensim DLL.
tfhavel
Junior Member
Posts: 11
Joined: Wed Jan 30, 2008 9:41 pm

Post by tfhavel »

Thank you, that is much clearer than the reference manual was!

I have found, however, that the initial conditions for levels are not reset to the values in the ".cin" file on resuming a run, even if they were specified as separate constant variables in the model which are reset in the ".cin" file; do you have any advice on how I could do this in a reasonably efficient manner?

Best, -- TFH
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Levels use the values from the simulation to initialize. If you want to initialize all levels then don't use Resume, simply specify the values.

If you want to change only selected levels from the resumed values that is trickier. You will need to create a rate equation that forces a reset to the new value when the resume starts. I would need to experiment to see if there is an elegant way to do this. What exactly are you trying to accomplish - there may be an easier way.
tfhavel
Junior Member
Posts: 11
Joined: Wed Jan 30, 2008 9:41 pm

Post by tfhavel »

Yes, of course if I want to reset all the initial values there'd be no reason to do a resume!

What I'm actually trying to do is to find a set of constant and initial values that starts a simulation reasonably near to a steady state, which it seems to eventually settle into almost no matter where I start from if I just wait long enough. Unfortunately, there are enough constants, including initial values, in the model to make extracting them by hand from a dump of a data set quite laborious (even if it did not ignore my attempt to tell it to only dump values from a narrow time range near the end of the run, and instead dumped values at all times as it does; fortunately I am good enough with regular expression based text editors to extract what I want fairly quickly).

It would be nice if there were an easy way to do this ...
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

reinitializing values from the end of a previous run

Post by LAUJJL »

Hi

I would use the following solution:
I would run my model and then export the values in an excel file using the model button and the export dataset then choose a name with .xls extension and choose export as excel choose the variables to export (in your case constants and levels) in a list file choose time from final time to final time showing time or not and click ok and that will generate a file with the values in it.
Then copy your model to a model_bis and change the values of the constants and the initializing value in your new model to GET XLS CONSTANTS to get the data back from your excel file. This can be eventually automatized with a script file if you have the DSS version.
Regards.
JJ
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

One solution, which will require a bit of bootstrapping, would be to use the GET VDF CONSTANTS function to set initial level values for those steady state variables. To bootstrap you could create a data file with a reasonable set of initial values and only 1 time and then import that. Use a string constant for the run name to make it easier to switch inputs.
Post Reply