Page 1 of 1
Inactive subscripts
Posted: Mon May 13, 2024 12:33 pm
by BrittZ
Hello,
In my model in Vensim I have one subscript StoreID with three different stores as elements. I want to compare what would happen with the stocks and flows in the model if one of these stores is closed.
My plan of action would be to remove one of the elements from the active list, so that it would be "unactive". The idea is that this store would then not be taken into account in the calculations. However when I run the simulation with that one element left out, the outcomes are still the same as with all three elements active.
Could anyone help me with what I am trying to do?
Tldr: is there any way to leave out one of the subscript elements without rewriting all the formulas/inputs etc?
Re: Inactive subscripts
Posted: Mon May 13, 2024 1:33 pm
by LAUJJL
When you modify suscripts you must exit Vensim and enter it again and then make your run.
Is it not possible to modify interactively the structure of a Vensim model. i think that Ventity can do that.
if you want to make it possible to make a store inactive interactively, it is better to build a constant that will show which stores are active, value 0 or 1 and modify your equations accordingly, taking into consideration which stores are active. Doing that by modifying the structure, is more sophisticated and to my opinion more error prove. It is maybe possible to do it in Ventity in a clean way.
JJ
Re: Inactive subscripts
Posted: Mon May 13, 2024 2:58 pm
by Administrator
BrittZ wrote: ↑Mon May 13, 2024 12:33 pm
Hello,
In my model in Vensim I have one subscript StoreID with three different stores as elements. I want to compare what would happen with the stocks and flows in the model if one of these stores is closed.
My plan of action would be to remove one of the elements from the active list, so that it would be "unactive". The idea is that this store would then not be taken into account in the calculations. However when I run the simulation with that one element left out, the outcomes are still the same as with all three elements active.
Could anyone help me with what I am trying to do?
Tldr: is there any way to leave out one of the subscript elements without rewriting all the formulas/inputs etc?
You will need to modify the model. Removing them from the "active" list does not change the model in any way, all it does is remove them from graphs etc.
Maybe the easiest thing to do is have a zero/one multiplier. Here is a simple example, create a constant that determines when the store closes (TIME STORE CLOSES), then work out if the store is "active" (STORE IS ACTIVE) and multiply existing calculations by this. If the store is inactive, the multiplier is zero.
TIME STORE CLOSES[storeid] = 50
STORE IS ACTIVE[storeID] = if then else (time < TIME STORE CLOSES[storeid] , 1 , 0 )
store revenue[storeID] = old calculation[storeID] * STORE IS ACTIVE[storeID]
Re: Inactive subscripts
Posted: Tue May 14, 2024 5:53 am
by BrittZ
Hello all,
Thank you for your quick replies. This sounds like a good foulproof way to work with the different IDs.