Page 1 of 1

max/min of more than two values

Posted: Mon Dec 16, 2024 10:41 pm
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

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 12:49 am
by tomfid
What version are you on? Recent 10.x can handle variable arguments.

You can always write MIN(a,MIN(b,c)).

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 2:41 pm
by SteveVijayan
Thanks Tom.

I have an older version - 7.3.5.

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

Thanks,
Steve

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 2:50 pm
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)))

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 2:53 pm
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

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 2:58 pm
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.

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 3:03 pm
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

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 3:07 pm
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.

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 3:09 pm
by SteveVijayan
Thanks for patiently answering my questions.
Steve

Re: max/min of more than two values

Posted: Tue Dec 17, 2024 4:41 pm
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.