Tabbed Array and slider?

Use this forum to post Vensim related questions.
Post Reply
Travis
Senior Member
Posts: 137
Joined: Tue Jul 15, 2008 8:42 pm

Tabbed Array and slider?

Post by Travis »

Situation: I have data in XLS that I would like to use to initialize a variable in a model. Currently it is stored in a Tabbed Array var in the model.

BUT, I would the like to control that variable value using a slider when running in SyntheSim. Is this possible somehow?

For instance, I was wondering if an ACTIVE INITIAL would, so that a second variable would be initialized by the Tabbed Array value, and then act like a normal constant (with slider).

Anyway to do this?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Tabbed Array and slider?

Post by tomfid »

The GET ... CONSTANTS functions are compatible with synthesim. ACTIVE INITIAL won't work.
https://www.vensim.com/documentation/in ... stants.htm or https://www.vensim.com/documentation/fn ... stants.htm
Travis
Senior Member
Posts: 137
Joined: Tue Jul 15, 2008 8:42 pm

Re: Tabbed Array and slider?

Post by Travis »

Double checking because I didn't think this was true: GET DIRECT CONSTANT() will give me a standard slider in SyntheSim, initialized by the value in the external file? We'd like to not have to use the Input Tool slider, but instead the normal default slider that constant get for free.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Tabbed Array and slider?

Post by tomfid »

I just tested GET XLS and yes, it works that way.
Travis
Senior Member
Posts: 137
Joined: Tue Jul 15, 2008 8:42 pm

Re: Tabbed Array and slider?

Post by Travis »

Got this working. For others in the future, we figured out what wasn't working at first.

GET DIRECT() provides a slide when there are no subscripts. I guess this is like any subscripted constant. We were using GET DIRECT for a range of XLS cells, since that is the obvious way to read in an array of values.

So what ended up doing was creating a var for each subscript value, and then merging into a new subscripted var for later use in the model. Each of the new, non-subscripted vars uses GET DIRECT for different single cells in XLS, so they now each have sliders.

Thanks Tom.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Tabbed Array and slider?

Post by tomfid »

That shouldn't be necessary. GET DIRECT should give you a slider whether or not there's a subscript. Example:
sub_get_direct_slider.png
sub_get_direct_slider.png (8.37 KiB) Viewed 2955 times
Post Reply