max/min of more than two values

Use this forum to post Vensim related questions.
Post Reply
SteveVijayan
Junior Member
Posts: 17
Joined: Mon Jun 04, 2018 5:25 pm
Vensim version: PLE+

max/min of more than two values

Post by SteveVijayan »

In my model, I have equations where I use min and max with more than two values. For example, max(A,B.C). I am getting an error. It looks like vensim can find min or max of only two values. Is that correct?

And if so, how to find min/max of more than two values?

Thanks,
Steve
tomfid
Administrator
Posts: 3993
Joined: Wed May 24, 2006 4:54 am

Re: max/min of more than two values

Post by tomfid »

What version are you on? Recent 10.x can handle variable arguments.

You can always write MIN(a,MIN(b,c)).
SteveVijayan
Junior Member
Posts: 17
Joined: Mon Jun 04, 2018 5:25 pm
Vensim version: PLE+

Re: max/min of more than two values

Post by SteveVijayan »

Thanks Tom.

I have an older version - 7.3.5.

Are you referring to vmin/vmax in version 10.x?

Thanks,
Steve
Administrator
Super Administrator
Posts: 4834
Joined: Wed Mar 05, 2003 3:10 am

Re: max/min of more than two values

Post by Administrator »

SteveVijayan wrote: Tue Dec 17, 2024 2:41 pmI have an older version - 7.3.5.

Are you referring to vmin/vmax in version 10.x?
No, VMIN/VMAX are for working with subscripted/arrayed variabled.

In the latest version of Vensim, you can use
some value = max (a,b,c,d)
Prior to this, you would need to use
some value = max (a,max(b,max(c,d)))
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
SteveVijayan
Junior Member
Posts: 17
Joined: Mon Jun 04, 2018 5:25 pm
Vensim version: PLE+

Re: max/min of more than two values

Post by SteveVijayan »

Thanks Tom.
I have not extended maintenance for a few years.
If I extend maintenance, will I be able to get the latest version?
Thanks,
Steve
Administrator
Super Administrator
Posts: 4834
Joined: Wed Mar 05, 2003 3:10 am

Re: max/min of more than two values

Post by Administrator »

SteveVijayan wrote: Tue Dec 17, 2024 2:53 pm I have not extended maintenance for a few years.
If I extend maintenance, will I be able to get the latest version?
Yes. But you can just nest the min/max calls as well if you need to. Vensim now has a completely different interface to the one you are used to.
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
SteveVijayan
Junior Member
Posts: 17
Joined: Mon Jun 04, 2018 5:25 pm
Vensim version: PLE+

Re: max/min of more than two values

Post by SteveVijayan »

Thanks Tom.
If I download the new version, I will still be able to use my files/models created using my current (old) version - correct?
Thanks,
Steve
Administrator
Super Administrator
Posts: 4834
Joined: Wed Mar 05, 2003 3:10 am

Re: max/min of more than two values

Post by Administrator »

SteveVijayan wrote: Tue Dec 17, 2024 3:03 pmIf I download the new version, I will still be able to use my files/models created using my current (old) version - correct?
Yes, of course.
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
SteveVijayan
Junior Member
Posts: 17
Joined: Mon Jun 04, 2018 5:25 pm
Vensim version: PLE+

Re: max/min of more than two values

Post by SteveVijayan »

Thanks for patiently answering my questions.
Steve
tomfid
Administrator
Posts: 3993
Joined: Wed May 24, 2006 4:54 am

Re: max/min of more than two values

Post by tomfid »

v10 is a pretty big upgrade from 7. There will be some interface changes that take getting used to, but it's worth it.
Post Reply