Running command files

Use this forum to post Vensim related questions.
Post Reply
Sarah8888
Junior Member
Posts: 16
Joined: Thu Feb 08, 2018 12:46 pm
Vensim version: DSS

Running command files

Post by Sarah8888 »

Hello

Sorry that use this forum again for a challenge I face. I wanted to Vensim to do several runs by using a command file (see attached).

1) at the moment, for some reason the file is not convertible to a cmd file?

2) If I run the script (before, I converted it to the right format), nothing happens. That is, I have my 11 runs simulated, but they are all the same. This suggests, that vensim does not read my changes. I checked my equations with the equations used in the Vensim help documentation. I can't find any difference... Could you please advice me on this?

Moreover:
3) is it possible to use this commands (using different values for a variable) for endogenously simulated variables?
4) Could I also have a code that is not only a constant, but a time series?
5) is it possible to somehow write a script that creates runs use all values between a certain interval (e.g. 1-10) for every 0.5 change? (and that also saves the runs).

Again, many thanks!

*** for some reason, I can't upload the file: so this is what is in my text-file:

SPECIAL>LOADMODEL|Consumption250218.mdl

SIMULATE>RUNNAME|Run 1
SIMULATE>SETVAL|DDisposable income HH=527216
MENU>RUN|o

SIMULATE>RUNNAME|Run 2
SIMULATE>SETVAL|DDisposable income HH=52000
MENU>RUN|o

SIMULATE>RUNNAME|Run 3
SIMULATE>SETVAL|DDisposable income HH=51500
MENU>RUN|o

.... etc.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Running command files

Post by Administrator »

Sarah8888 wrote:1) at the moment, for some reason the file is not convertible to a cmd file?
What do you mean by this? Do you mean you cannot upload a CMD file to the forum? CMD files can contain code to do bad things to machines, so they are blocked on the forum.
Sarah8888 wrote:2) If I run the script (before, I converted it to the right format), nothing happens. That is, I have my 11 runs simulated, but they are all the same. This suggests, that vensim does not read my changes. I checked my equations with the equations used in the Vensim help documentation. I can't find any difference... Could you please advice me on this?
If you look at the table of values for "DDisposable income HH", are these different?
Sarah8888 wrote:3) is it possible to use this commands (using different values for a variable) for endogenously simulated variables?
Can you give an example of what you want to do here?
Sarah8888 wrote:4) Could I also have a code that is not only a constant, but a time series?
You would need to prepare some data files and use SIMULATE>DATA to switch between these.
Sarah8888 wrote:5) is it possible to somehow write a script that creates runs use all values between a certain interval (e.g. 1-10) for every 0.5 change? (and that also saves the runs).
No, not at present. CMD files will only execute commands in sequence, they are not like a programming language.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Running command files

Post by tomfid »

You could do #5 with a sensitivity file - choose "univariate" and use the VECTOR distribution.

Is DDisposable income HH a constant?
Sarah8888
Junior Member
Posts: 16
Joined: Thu Feb 08, 2018 12:46 pm
Vensim version: DSS

Re: Running command files

Post by Sarah8888 »

Hello,

No, "DDisposable income" is not a constant - it endogenously simulated (by other variables - that are data-variables). And therefore, I thought the command got executed (hence, I have my 11 runs) , but the variable (DdDisposable income) did not actually change.
Afterwards, I thought that probably the command files work only for constants. When I changed it I couldn't anymore convert my text-file into a cmd-file (I put cmd instead of txt, but it remains according to venim a text-file. So, this is why I cannot test at the moment anything...

With regard to taking different data-time series: I am not entirely sure what you mean, but it sounds as if I need to execute in that case the runs by myself?

Thanks again

Sarah
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Running command files

Post by tomfid »

command files work only for constants.
- True. You can only override a dynamic variable in Synthesim.
When I changed it I couldn't anymore convert my text-file into a cmd-file
- The built-in editor in Vensim can do this, as can open source editors like Notepad++. The OS can do it, if you have file extensions set to visible.
With regard to taking different data-time series:
- if you need to simulate different time-varying exogenous trajectories in a command script, you can put each scenario in a separate vdf, then use SIMULATE>DATA|scenario.vdf to pick the one you need in each run in the script.
Post Reply