Hi how's it going,
I want to set a maximum value for a variable (maximum population grouth must be 8000, so it should not go further up than 8000). How do I set that up?
Cheers!
set a maximum value
-
- Junior Member
- Posts: 13
- Joined: Mon Aug 17, 2009 4:07 am
-
- Super Administrator
- Posts: 4838
- Joined: Wed Mar 05, 2003 3:10 am
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
A couple of things.
1. Try never to embed numbers in equations. So you should use
population change rate = MIN(indicated population change rate, maximum population change rate)
where
maximum population change rate = 8000
and
indicated population change rate = movement A+rep-mort-surv-movement B
2. You should not need to do anything to be sure that "indicated population change rate" is positive. In this case I can't see any reason why it should not go negative. If there is then you should fix the causal factor (eg mort) that has the problem not adjust the equation with a min.
[Edited on 2009-8-31 by bob@vensim.com]
1. Try never to embed numbers in equations. So you should use
population change rate = MIN(indicated population change rate, maximum population change rate)
where
maximum population change rate = 8000
and
indicated population change rate = movement A+rep-mort-surv-movement B
2. You should not need to do anything to be sure that "indicated population change rate" is positive. In this case I can't see any reason why it should not go negative. If there is then you should fix the causal factor (eg mort) that has the problem not adjust the equation with a min.
[Edited on 2009-8-31 by bob@vensim.com]