Welcome to WEAP's Website WEAP
WEAP is an initiative of the Stockholm Environment Institute.


About WEAP

Home
Why WEAP?
Features
What's New?
Sample Screens
Demonstration
Publications
History and Credits

Using WEAP
Download
Licensing
User Guide
Tutorial
Videos (YouTube)

User Forum
Discussions
Members List
Edit Profile

Additional Support
Training
University Courses
Collaboration

About Us
SEI-US Water Resources Program
Please Contact Us

LEAP
Interested in Energy?
Read about LEAP: SEI's software for energy planning.

Link WEAP and LEAP for combined Water-Energy planning.
Watch a video demo!
   

User Forum

All Topics | Topic "Maximum Flow of Transmission is Variable"
Log in to post new messages or reply to existing messages.
 
Author Message
Mr. shaohua liu

Subject: Maximum Flow of Transmission is Variable   
Posted: 1/20/2021 Viewed: 6233 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: 6205 times
Dear Shaohua,

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."

Topic "Maximum Flow of Transmission is Variable"