Converting INITIAL to AUXILIARY globally

Use this forum to post Vensim related questions.
Post Reply
PWR
Junior Member
Posts: 10
Joined: Wed Sep 22, 2010 5:11 pm

Converting INITIAL to AUXILIARY globally

Post by PWR »

Is there a way to wholesale/globally convert all instances of INITIAL variables to AUXILIARY?
or
Is there a way to prevent the "\" line breaks from being automatically inserted when going from Sketch mode to text mode? If I can suppress the auto-linebreaks, then I can use Excel to remove the "INITIAL(" and the ")" from the following line and convert the variables to AUXILIARY.

If it matters, I want to do this because:

I have a large vensim model (En-ROADS) that is used with it's Vensim interface as well as with a Forio UI. So I don't want to mess up the Vensim model. I want to make a "Forio-ready" version when I need it.

For the Forio UI, when there is a variable that is designated as an INITIAL that is between the input variable and the output variable on a graph or table, the model doesn't work in Forio. There are ~300 variables that are assigned as INITIAL which makes changing them each to AUXILIARY not feasible. The model is complex wich makes tracing each input (there are about 150 inputs) to find out which has an INITIAL between it and the output graph or table not feasible. I'm not at a skill level with Excel to make a parser that can deal conditionally with removing a ")" that is on a line that isn't the next line after the occurence of the "INITIAL(" which is where the parser that inserts "\" gets in my way.

My plan was to gather all the INITIAL variables into one .GROUP and then when I need to upload a new version of the Vensim model to the Forio UI, I would remove the "INITIAL(" and the ")" and then upload it into Forio. But I don't want to do this permanently to the model-- only when I need a copy for the Forio UI. I process the model to have "GAME(" for each of the input variables which I don't want in the parent model.

Any suggestions welcome. This is unfortunately a showstopper at this point.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Converting INITIAL to AUXILIARY globally

Post by tomfid »

If you're working in DSS, you could do the following:

1. Create a macro called something like MIGHT_BE_INITIAL, which returns INITIAL(x), but could be instantly changed to just return (x).
2. Search and replace all instances of INITIAL( to MIGHT_BE_INITIAL(

If you're not using DSS, you could search and replace INITIAL( with just (. However, that would be a one-way trip. However, it might work to replace INITIAL( with {INITIAL}( being sure to use curly brackets, which delimit inline comments. That would be reversible.

If the \ gives you trouble, use an external editor rather than the Vensim editor.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Converting INITIAL to AUXILIARY globally

Post by tomfid »

BTW I wouldn't guarantee that any of this will actually produce desirable results. Some of those INITIALs may be there for good reasons.

If the problematic chains are something like,

constant x -> INITIAL( f(x) ) -> dynamics

and you want

GAME(x) -> f(x) -> dynamics,

it's not clear that the dynamics will work with non-constant inputs.

If the issue is that Forio can't set a constant directly, it has to be wrapped in GAME, that seems like a significant omission on their part and I'd check whether it's really true.
Post Reply