Page 1 of 1

Negative values over time

Posted: Fri Feb 24, 2006 4:48 pm
by LBD
For a particular variable, I have an equation. According to that equation the value of the variable becomes negative over time. How do I specify in the equation editor that it should show 0 for any values less than 0?

variable becoming negative

Posted: Fri Feb 24, 2006 6:06 pm
by LAUJJL
Hi

If you want the variable to become equal to zero if negative write X = if then else (f(x) < 0,0,f(X))
If you do not want the variable to become equal to zero but only want to show it, you use a second variable
Z = if then else (X < 0,0,1) and show that variable.
Regards
JJ

Posted: Fri Feb 24, 2006 6:08 pm
by LBD
Thanks

Variable taking a zero value

Posted: Fri Feb 24, 2006 6:11 pm
by LAUJJL
in fact you must write Z = if then else (F(X) < 0,0,F(X)) and
show Z in place of X.

Posted: Sat Feb 25, 2006 1:01 pm
by bob@vensim.com
also

z = MAX(0,x)

will work.