Page 1 of 1

If then Else

Posted: Fri Jul 23, 2021 11:59 am
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

Re: If then Else

Posted: Fri Jul 23, 2021 12:04 pm
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)

Re: If then Else

Posted: Fri Jul 23, 2021 12:11 pm
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.

Re: If then Else

Posted: Fri Jul 23, 2021 2:40 pm
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?