l-13 if-then-else
TRANSCRIPT
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 1/12
Hydrologic Engineering Center
IF-Then-Else Blocks
Adding Conditional Logic to the HEC-
ResSim Operation Scheme
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 2/12
Need for if-then-else logic
Typically, water
control system
regulations follow
conditional paths
for decision-making
Conditions are used
to determine the
applicability of
operational goalsand constraints
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 3/12
IF-THEN-ELSE in HEC-ResSim
Operational constraints with
conditional statements
Compound conditions
Nested if-then-else
current inflow < 85% of Average
Or current inflow < 50 cms
current inflow > 85% of Average
And current inflow < 120% of Average
current inflow > 120% of Average
And current Date > 20 Mar 2005
And current Date < 15 Apr 2005
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 4/12
How to…Create an IF block
From the Operationstab of the ReservoirEditor, select a zonein your currentoperation set…
Select New from the
If_Block menuor
Right-click on thezone in the tree.
Select Add IF Block…from the context
menu Give your IF Block a
name…
Press OK
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 5/12
Adding Conditions
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 6/12
Specifying Test Values
Constant -> numericvalue
Date/Time ->
ddmmmyyyy, hh:mm
Current Time Step
Time Series ->External Variable,Model Variable, orState Variable
Seasonal -> ddmmm
( ) -> groupconditional tests
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 7/12
Test Values – Time Series
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 8/12
Test Values – Time Series
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 9/12
Test Operators
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 10/12
Compound Conditional Test
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 11/12
Add rules to the IF blockAdd ELSE IF and/or ELSE blocks
7/23/2019 L-13 If-Then-Else
http://slidepdf.com/reader/full/l-13-if-then-else 12/12
ComplexExample