Get variable maximum

Use this forum to post Vensim related questions.
Post Reply
JiejunYang
Junior Member
Posts: 4
Joined: Wed Jul 27, 2011 6:55 am

Get variable maximum

Post by JiejunYang »

Image

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
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Get variable maximum

Post by Administrator »

Is VAL1 subscripted?

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
JiejunYang
Junior Member
Posts: 4
Joined: Wed Jul 27, 2011 6:55 am

Re: Get variable maximum

Post by JiejunYang »

Administrator wrote:Is VAL1 subscripted?

If use, just use the MAX function
MAX ( variable[range!] )
VAL-1 isn't subscripted. It is Auxiliary.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Get variable maximum

Post by Administrator »

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?
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
JiejunYang
Junior Member
Posts: 4
Joined: Wed Jul 27, 2011 6:55 am

Re: Get variable maximum

Post by JiejunYang »

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?
Yes, you are right. I cann't solve the problem you described above.


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?
JiejunYang
Junior Member
Posts: 4
Joined: Wed Jul 27, 2011 6:55 am

Re: Get variable maximum

Post by JiejunYang »

Image
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Get variable maximum

Post by tomfid »

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.
Post Reply