Subject: Maximum Flow of Transmission is Variable Posted: 1/20/2021 Viewed: 2378 times
Maximum Flow of Transmission links is changing by reservoir elevation,how to set it in model?
Ms. Anne Hereford
Subject: Re: Maximum Flow of Transmission is Variable Posted: 1/28/2021 Viewed: 2351 times
Your expression might look something like this, based on reservoir elevation from the previous timestep:
If(PrevTSValue(Supply and Resources\River\American River\Reservoirs\Folsom Lake:Storage Elevation[m]) >2000,20,PrevTSValue(Supply and Resources\River\American River\Reservoirs\Folsom Lake:Storage Elevation[m]) >1000,10,5)
You'll find the reservoir parameters in the Branches tab in the Expression Builder window. When you drag the Reservoir into the Expression Builder, WEAP will ask you which reservoir parameter you want to input.
From the Description of the If Function (under the Functions tab in the Expression Builder):
"The If function evaluates each TestExpression in sequence, and for the first one that is not FALSE ( 1000, 10, 20)
If the branch named Income has a value greater than 1000 then the function evaluates to 20. Otherwise, is it 10.
If( year >= 2005, 30, 0)
= 30 in years 2005 and after, 0 before 2005
if( year < 2005, 0, year < 2010, 10, year < 2020, 15, 20)
= 0 in years before 2005, 10 in years 2005-2009, 15 in 2010-2019, and 20 in years 2020 and after."
And from the WEAP Help documment:
"WEAP borrows an approach made popular in spreadsheets: the ability for users to enter data and construct models using mathematical expressions. Expressions are standard mathematical formulae used to specify the values of variables in WEAP's Data View. In the Current Accounts an expression defines the initial value for a given variable at a branch, while in scenarios, the expression defines how that variable changes over time (from one year after the Current Accounts to the end of the study period).
"Expressions can range from simple numeric values to complex mathematical formulae. Each formula can optionally use WEAP's many built-in functions, as well as referencing the values of other branches, both data and result variables. Expressions can even create dynamic links to the values stored in an external Microsoft Excel spreadsheet."