Page 1 of 1

If then else function

Posted: Sun Oct 08, 2023 7:42 pm
by reza1999
Hi,
How to write this function in vensim?
Thanks in advance.

Re: If then else function

Posted: Sun Oct 08, 2023 8:07 pm
by tomfid
Ugh.

The general framework will be something like:

QFP1 = IF THEN ELSE( tfp>0
, IF THEN ELSE( expression beginning with pp>0
,expression beginning with sum over QH
,expression beginning with sum over QH*fraction with pp in numerator )
, 0 )

It's pretty confusing subscripting though - I would strongly encourage making each summation a separate variable.