If then Else

Use this forum to post Vensim related questions.
Post Reply
rbandari
Junior Member
Posts: 4
Joined: Thu Jul 22, 2021 12:51 pm
Vensim version: DSS

If then Else

Post by rbandari »

Hi all
I have below function, but when I wanna simulate it, show error of expecting an operator.
I want to ask you to help me to solve this error.
IF THEN ELSE (Agricultural water demand > Agricultural surface water use rate, (MIN (Groundwater allocation volume for consumptive use/Time)-Industrial Groundwater Use-Domestic Groundwater Use), Agricultural water demand-Agricultural surface water use rate), 0)

a: Agricultural water demand > Agricultural surface water use rate
b:MIN ((Groundwater allocation volume for consumptive use/Time)-Industrial Groundwater Use-Domestic Groundwater Use), Agricultural water demand-Agricultural surface water use rate
c:0
Thanks
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: If then Else

Post by Administrator »

Try this, looks like your brackets are a little muddled up.

IF THEN ELSE ( Agricultural water demand > Agricultural surface water use rate
, MIN ( ( Groundwater allocation volume for consumptive use/Time ) - Industrial Groundwater Use-Domestic Groundwater Use
, Agricultural water demand-Agricultural surface water use rate)

, 0)
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
rbandari
Junior Member
Posts: 4
Joined: Thu Jul 22, 2021 12:51 pm
Vensim version: DSS

Re: If then Else

Post by rbandari »

Administrator wrote: Fri Jul 23, 2021 12:04 pm Try this, looks like your brackets are a little muddled up.

IF THEN ELSE ( Agricultural water demand > Agricultural surface water use rate
, MIN ( ( Groundwater allocation volume for consumptive use/Time ) - Industrial Groundwater Use-Domestic Groundwater Use
, Agricultural water demand-Agricultural surface water use rate)

, 0)
Thank you so much.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: If then Else

Post by tomfid »

On other thought:

Groundwater allocation volume for consumptive use/Time will produce a declining allocation as simulation time increases. This would be especially problematic if INITIAL TIME = 0. Maybe a parameter describing the minimum time required to consume the remaining volume would be more appropriate?
Post Reply