Hello everyone,
I am looking for an elegant way to use a slider in a very extensive model to decide whether time series (“GET XLS DATA...”) or only constant (average) values (“GET XLS CONSTANTS...”) should be read in from the same EXCEL file. I thought this would be very helpful for calibration, testing, and analyses.
My spontaneous idea was to use an IF THEN ELSE function to check whether a slider or the variable behind it has the value 0 or 1. However, the “GET...” functions “cannot include other expressions”.
I could define two more constants for each parameter, in each of which a time series or a constant value is read in. I could then use an IF THEN ELSE function in the actual parameter. If I do the whole thing via shadow variables, the diagram would also remain clear. However, the model consists of several sub-models with quite a few parameters. The effort would therefore be very, very high.
Does anyone have another solution? I would appreciate any tips!
Best wishes from Germany,
Marvin
Reading in time series or constants
Re: Reading in time series or constants
This won't work due to different variable types. However, you could read both and put the IF statement downstream, like:
x = GET XLS CONSTANTS(...)
y = GET XLS DATA(...)
x or y = IF THEN ELSE( slider, x, y )
x = GET XLS CONSTANTS(...)
y = GET XLS DATA(...)
x or y = IF THEN ELSE( slider, x, y )
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Reading in time series or constants
Thank you for your feedback.
Does that pick up on what I had outlined? So, are you suggesting creating variables “x” and “y” and then using an IF THEN ELSE function in the parameter itself?
Does that pick up on what I had outlined? So, are you suggesting creating variables “x” and “y” and then using an IF THEN ELSE function in the parameter itself?
Re: Reading in time series or constants
Correct.
The effort shouldn't be too much. One possible trick would be to implement this via copy-paste in the text editor.
For example, if you currently have
paramX = 123
you can replace it with the pattern I suggested above
x = GET XLS CONSTANTS(...) ~ unit ~ doc |
y = GET XLS DATA(...) ~ unit ~ doc |
paramX = IF THEN ELSE( slider, x, y ) ~ unit ~ doc |
The effort shouldn't be too much. One possible trick would be to implement this via copy-paste in the text editor.
For example, if you currently have
paramX = 123
you can replace it with the pattern I suggested above
x = GET XLS CONSTANTS(...) ~ unit ~ doc |
y = GET XLS DATA(...) ~ unit ~ doc |
paramX = IF THEN ELSE( slider, x, y ) ~ unit ~ doc |
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/