Get variable maximum
-
- Junior Member
- Posts: 4
- Joined: Wed Jul 27, 2011 6:55 am
Get variable maximum
Hi!
I am working with a vensim model that must get the maximum of a variable over a time range.
For example:
1. the output of val-1 is [1,2,3,4,]; 2. at the same time, the output of Max val-1 is [4,4,4,4]
Could any of you please help me to deal with this issue?
Thanks.
Jiejun Yang
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Get variable maximum
Is VAL1 subscripted?
If use, just use the MAX function
MAX ( variable[range!] )
If use, just use the MAX function
MAX ( variable[range!] )
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 4
- Joined: Wed Jul 27, 2011 6:55 am
Re: Get variable maximum
VAL-1 isn't subscripted. It is Auxiliary.Administrator wrote:Is VAL1 subscripted?
If use, just use the MAX function
MAX ( variable[range!] )
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Get variable maximum
So am I right in saying that you have
Time = 0,1,2,3
VAL1 = 1,2,3,4
and you want
Time = 0,1,2,3
MAXVAL1 = 4,4,4,4
This cannot be done as you want to know the maximum before it has been calculated.
Can you explain the problem you are trying to solve?
Time = 0,1,2,3
VAL1 = 1,2,3,4
and you want
Time = 0,1,2,3
MAXVAL1 = 4,4,4,4
This cannot be done as you want to know the maximum before it has been calculated.
Can you explain the problem you are trying to solve?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Junior Member
- Posts: 4
- Joined: Wed Jul 27, 2011 6:55 am
Re: Get variable maximum
Yes, you are right. I cann't solve the problem you described above.Administrator wrote:So am I right in saying that you have
Time = 0,1,2,3
VAL1 = 1,2,3,4
and you want
Time = 0,1,2,3
MAXVAL1 = 4,4,4,4
This cannot be done as you want to know the maximum before it has been calculated.
Can you explain the problem you are trying to solve?
I want to normalize a indicator which need the Max &Min value of the indicator. But I failed. I don't know which function in the Vensim DSS can realize that.
So I think I can success by the external function of Vensim DSS. Will you agree with me?
Or would you like to give me some good suggestions?
Re: Get variable maximum
What you're describing is what we'd call an 'acausal' model, in which the calculation of 'max val-1' at a given time uses information about 'pop' from the future. This is not physically realizable in a system, and requires restrictive assumptions for analytic solution or iterative methods (optimization) to solve in a simulation, so Vensim does not support such arrangements. An external function won't help.
Your only options are to (a) calculate the maximum future value of 'pop' analytically, which may not be possible, or (b) establish the max value via optimization or from a previous run. Neither of these is likely to be very satisfactory in terms of interactivity of the model.
Your only options are to (a) calculate the maximum future value of 'pop' analytically, which may not be possible, or (b) establish the max value via optimization or from a previous run. Neither of these is likely to be very satisfactory in terms of interactivity of the model.
/*
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
*/