Negative values over time

Use this forum to post Vensim related questions.
Post Reply
LBD
Member
Posts: 25
Joined: Wed Jan 25, 2006 7:56 pm

Negative values over time

Post 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?
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

variable becoming negative

Post 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
LBD
Member
Posts: 25
Joined: Wed Jan 25, 2006 7:56 pm

Post by LBD »

Thanks
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Variable taking a zero value

Post by LAUJJL »

in fact you must write Z = if then else (F(X) < 0,0,F(X)) and
show Z in place of X.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

also

z = MAX(0,x)

will work.
Post Reply