MIN with more than two alternatives

Use this forum to post Vensim related questions.
Post Reply
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

MIN with more than two alternatives

Post by kaveh.dianati »

Hi,

What is the best way to implement MIN (x, y, z) in Vensim. One can do MIN (x, MIN (y,z)), but this doesn't look very neat, especially if you have more than 3 alternatives.

Thank you.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: MIN with more than two alternatives

Post by Administrator »

MIN (x, MIN (y,z)) is the only way unless you write a macro to do it.
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
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

Re: MIN with more than two alternatives

Post by kaveh.dianati »

Thanks a lot for the quick reply!
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: MIN with more than two alternatives

Post by tomfid »

Code: Select all

:MACRO: MIN3(x,y,z)
MIN3 = MIN(x,MIN(y,z))~x~|
:END OF MACRO:
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

Re: MIN with more than two alternatives

Post by kaveh.dianati »

Thank you Tom!
Post Reply