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.
MIN with more than two alternatives
-
- Senior Member
- Posts: 50
- Joined: Tue Dec 15, 2015 1:52 pm
- Vensim version: DSS
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: MIN with more than two alternatives
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Senior Member
- Posts: 50
- Joined: Tue Dec 15, 2015 1:52 pm
- Vensim version: DSS
Re: MIN with more than two alternatives
Thanks a lot for the quick reply!
Re: MIN with more than two alternatives
Code: Select all
:MACRO: MIN3(x,y,z)
MIN3 = MIN(x,MIN(y,z))~x~|
:END OF MACRO:
/*
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
*/
-
- Senior Member
- Posts: 50
- Joined: Tue Dec 15, 2015 1:52 pm
- Vensim version: DSS
Re: MIN with more than two alternatives
Thank you Tom!