Page 1 of 1

Tabbed Array and slider?

Posted: Fri Mar 31, 2017 8:40 pm
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?

Re: Tabbed Array and slider?

Posted: Fri Mar 31, 2017 9:14 pm
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

Re: Tabbed Array and slider?

Posted: Mon Apr 03, 2017 1:47 pm
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.

Re: Tabbed Array and slider?

Posted: Tue Apr 04, 2017 1:38 am
by tomfid
I just tested GET XLS and yes, it works that way.

Re: Tabbed Array and slider?

Posted: Thu Apr 06, 2017 3:22 pm
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.

Re: Tabbed Array and slider?

Posted: Thu Apr 06, 2017 5:17 pm
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 2984 times