CPD-95 HEC-PRM UsersManual PDF
CPD-95 HEC-PRM UsersManual PDF
CPD-95 HEC-PRM UsersManual PDF
Prescriptive Reservoir
Model
User’s Manual
Version 1.0
November 2003
The public reporting burden for this collection of information is estimated to average 1 hour per response, including the time for reviewing instructions,
searching existing data sources, gathering and maintaining the data needed, and completing and reviewing the collection of information. Send
comments regarding this burden estimate or any other aspect of this collection of information, including suggestions for reducing this burden, to the
Department of Defense, Executive Services and Communications Directorate (0704-0188). Respondents should be aware that notwithstanding any
other provision of law, no person shall be subject to any penalty for failing to comply with a collection of information if it does not display a currently
valid OMB control number.
PLEASE DO NOT RETURN YOUR FORM TO THE ABOVE ORGANIZATION.
1. REPORT DATE (DD-MM-YYYY) 2. REPORT TYPE 3. DATES COVERED (From - To)
November 2003 Computer Program Documentation
4. TITLE AND SUBTITLE 5a. CONTRACT NUMBER
HEC-PRM, Prescriptive Reservoir Model
User’s Manual 5b. GRANT NUMBER
Version 1.0
5c. PROGRAM ELEMENT NUMBER
16. SECURITY CLASSIFICATION OF: 17. LIMITATION 18. NUMBER 19a. NAME OF RESPONSIBLE
a. REPORT b. ABSTRACT c. THIS PAGE OF OF PERSON
ABSTRACT PAGES
U U U
U 118 19b. TELEPHONE NUMBER
User's Manual
November 2003
(530) 756-1104
(530) 756-8250 FAX
www.hec.usace.army.mil CPD-95
Prescriptive Reservoir Model, HEC-PRM, User’s Manual
2011. This Hydrologic Engineering Center (HEC) documentation was developed with U.S.
Federal Government resources and is therefore in the public domain. It may be used, copied,
distributed, or redistributed freely. However, it is requested that HEC be given appropriate
acknowledgment in any subsequent use of this work.
Use of the software described by this document is controlled by certain terms and conditions.
The user must acknowledge and agree to be bound by the terms and conditions of usage before
the software can be installed or used. For reference, a copy of the terms and conditions of usage
are included in Chapter 11 of this document so that they may be examined before obtaining and
loading the software. The software described by this document can be downloaded for free from
our internet site (www.hec.usace.army.mil).
HEC cannot provide technical support for this software to non-Corps users. Non-Corps
individuals should use any internet search engine to locate a vendor that can provide support for
the HEC software of interest. However, we will respond to all documented instances of program
errors. Documented errors are bugs in the software due to programming mistakes not model
problems due to user-entered data.
This document contains references to product names that are trademarks or registered trademarks
of their respective owners. Use of specific product names does not imply official or unofficial
endorsement. Product names are used solely for the purpose of identifying products available in
the public market place.
Table of Contents
i
Table of Contents HEC-PRM User's Manual
ii
HEC-PRM User's Manual Table of Contents
iii
Table of Contents HEC-PRM User's Manual
iv
HEC-PRM User's Manual List of Figures
List of Figures
v
List of Figures HEC-PRM User's Manual
vi
HEC-PRM User's Manual List of Tables
List of Tables
vii
List of Tables HEC-PRM User's Manual
viii
HEC-PRM User's Manual Chapter 1 - Program Description
1
Chapter 1 - Program Description HEC-PRM User's Manual
2) Compute the adjusted local incremental inflow by adding inflows and depletions.
The generalized utility programs DSS-MATH or MATHPK allow the user to add,
subtract, multiply, divide, etc., hydrographs and store the results in the same or a different
HEC-DSS data file. As an alternative, HEC-PRM allows the user to enter multiple
inflow hydrographs to one node where one hydrograph may be the inflow and a second
hydrograph the fixed depletions. However, each inflow hydrograph requires a separate
link, which adds complexity to the HEC-PRM processing.
3) Enter data and calculate the storage and flow penalty functions for each location
and category (water supply, hydropower, etc), and store penalty functions in the
"paired data" HEC-DSS data file.
These calculations are typically performed using commercial spreadsheet software. This
may require the careful selection of format so that the results can be transformed into an
ASCII input data file for the DSSPD program. (DSSPD reads an "xxxxxx.txt" file from
an Excel spreadsheet and stores the penalty functions using the "Paired Data” convention
in HEC-DSS.) Alternatively, the "Store DATAFILE" option of the PIP program may be
used. Specialized programs, including spreadsheet macros, may also be written to read
existing formatted data and store it in the HEC-DSS file.
4) Convert the penalty functions into "standard" units.
It may be necessary to convert penalty functions into "standard" units before using them
as input to HEC-PRM. All penalty functions must have the same penalty units (e.g.,
$1,000) and storage/flow units (e.g., KAF or thousands of acre-feet per month). For
example, storage penalties expressed as penalty in millions of dollars versus pool
elevation in feet must be converted to penalty in thousands of dollars versus storage in
thousands of acre-feet. Flow penalties expressed as penalty versus flow in thousands of
cubic feet per second must be converted to penalty versus flow in thousands of acre-feet
per month. (An average value of 30.5 days per month may be used to determine this
factor.) The MATHPK function "TABLE" facilitates this.
5) Compute a composite penalty function for each month at each location.
The ultimate goal is to have a separate pathname for each composite penalty function for
each location. This step creates the "computed composite" function by adding functions
for all categories (except hydropower energy) for a given link. For example, to compute
the June composite reservoir storage penalty function, the analyst must add the June
navigation storage function, the June pool recreation function, and the June water supply
function and store the result in the HEC-DSS data file. The composite computed
function is stored in the DSS data file as one record (pathname) for one location and one
link type for all months of the year (twelve curves). Note that the hydropower energy
functions are stored separately because separate links are defined for hydropower energy
only.
6) Estimate the "edited composite" penalty function from the "computed composite"
penalty function. (Optional)
Estimating the "edited composite" (or "model") penalty function serves to reduce the
number of arcs describing the functions. The "computed composite" function typically
contains many ordinates. For computational efficiency, the analyst should determine the
simplest "edited" function that still adequately describes the "computed" function. This
edited function may be convex or non-convex. In general, convex functions should be
used whenever possible, since the solution algorithm guarantees a global optimum
solution in this case (unless hydropower is considered). However, non-convex functions
may be preferable if these provide a much better representation of the actual (computed)
2
HEC-PRM User's Manual Chapter 1 - Program Description
composite penalty function. The DSPLAY program, the PENF program, or commercial
spreadsheet software can assist the analyst in this task.
7) Store pertinent paired data functions in the paired function input data file.
Other paired data needs to be entered in the input data DSS data file. This includes
hydropower functions relating energy and capacity to flow and reservoir storage, and
elevation-area-capacity curves.
8) Prepare HEC-PRM input data specifications.
The analyst invokes a text editor (such as COED) to create and enter information
pertinent to the HEC-PRM program. This is an ASCII file which contains some
miscellaneous parameters such as the time window associated with the calculations, the
HEC-DSS pathname part F under which the computed results are stored, factors which
are applied against flow and penalty data, etc. The primary content of this file is a list of
nodes and a list of links with associated information such as the connected nodes, the
pathname parts for the penalty functions and the regular time series data (inflow and
evaporation), upper and lower bounds, etc.
9) Perform the network flow optimization.
To optimize the network, HEC-PRM reads the ASCII data specifications file, retrieves
the appropriate time series data from the time series input DSS data file, retrieves the
appropriate "edited composite" penalty functions from the paired input data DSS file,
generates the network flow solver matrix, calls the solver, and stores the results in the
output HEC-DSS data file.
10) Display results graphically or tabular.
The analyst may use either the HEC-PRM post-processor PRMPP, or the DSPLAY
program, or commercial spreadsheet software to plot or tabulate the time series results.
These include reservoir storage, reservoir releases, channel flows, local inflows, natural
flows, energy generated, and capacity. Storage data is expressed in units of thousands of
acre-feet. Flow data is expressed in both thousands of acre-feet (KAF) and cubic feet per
second (cfs). The MATHPK program may be used to convert these into other units such
as pool storage in terms of elevation in feet or flow in terms of thousands of cubic feet
per second. Extensive MATHPK macros are written to compute hydropower, duration
functions, time series penalties, etc.
11) Review the solver Matrix.
Figure 1 also depicts HEC-PRM writing output data to an ASCII file. It contains an echo
of the user input including pathnames, warning messages, and optionally a list of the
solver matrix both before and after solution. While some of the information is useful, it
is very painful to look at the solver matrix and should be done only for optimization
models with a limited number of arcs. Useful output can be created using the PRMPP
and DSPLAY programs and possibly MATHPK. In particular, DSPLAY facilitates the
output of graphs in the standard HEC-DSS graphics format and includes the capability of
creating graphics metafiles which may be imported to other software packages such as
word processors and drawing programs.
3
Chapter 1 - Program Description HEC-PRM User's Manual
Structure of HEC-PRM
The internal flow of information within HEC-PRM is shown in Table 1. HEC-PRM retrieves
input data from three sources:
HECPRM ?
HECPRM: Prescriptive Reservoir Model - Vers. September 5, 2002 ( 1.019)
UNIT KEYWORD *ABREV **MAX DEFAULT
5 INPUT I 458 CON
6 OUTPUT O 512 CON
NOP TS_IN_DSS T 512 SCRATCH.031
NOP PF_IN_DSS P 512 SCRATCH.032
NOP RESULTS_DSS R 512 SCRATCH.033
NOP MIN_COST_SOLN M 64 PRM_MCST.BIN
29 TRACE TR 512 SCRATCH.009
1 MSG MS 512 C:\HECEXE\SUP\HECPRM.ERR
1) Source node
2) Target node
3) Lower bound
4) Upper bound
5) Unit cost
6) Amplitude (for the gains solver)
7) Flow (initialized to zero)
4
HEC-PRM User's Manual Chapter 1 - Program Description
There are several other scalar parameters that must also be set. HEC-PRM builds this matrix by
generating one or more "special" arcs and then processing each link in the same sequence in
which they were entered by the user. The first arc is always the arc between the super source and
the super sink. The second through NRES+1 arcs contain the starting storage for each reservoir
where "NRES" is the number of reservoirs. The subsequent arcs are dependent upon the order
and type of links entered by the user. When appropriate, data are retrieved from HEC-DSS data
files. For example, the inflow links require the retrieval of local incremental adjusted inflow;
storage links require the retrieval of evaporation rates and storage penalty functions, etc.
5
Chapter 1 - Program Description HEC-PRM User's Manual
If the user has defined constraints for a given link, the lower and upper bounds on the arcs are set
accordingly. The number of arcs associated with a given link for a given month is exactly the
same as the number of line segments in the penalty function. All inflow arcs have one arc per
time period and have lower and upper bounds which vary for every time period and are set to the
local inflow with a unit cost of zero. Once the solver matrix is filled and appropriate parameters
are set (such as the number of arcs, the number of nodes, and the total system inflow), HEC-PRM
calls the network flow with gains solver. HEC-PRM tracks the progress of solution by displaying
on the computer screen the number of iterations and the computed total flow. The solver
continues to iterate until the least-cost solution is determined. The typical application contains
many unknowns with far fewer equations. Therefore, there can be many feasible solutions to the
problem. Minor changes to input data can cause the solver to compute an entirely different least-
cost solution.
Once the solution is determined, the solver fills the "FLOW" array with the computed flow in
each arc of the matrix. HEC-PRM can then "post-process" this information by adding the flow in
all arcs for each time period and storing monthly regular interval time series data in the output
HEC-DSS data file. The output monthly time series data includes flow, storage, pool elevations,
natural flows, local flows, energy generated, and capacity. Total cost is reported in the ASCII
output file. Cost sub-totals (e.g., total hydropower penalty) can be computed by using the
program MATHPK and interpolating time series penalties from the appropriate flow and storage
penalty functions.
Executing HEC-PRM
HEC-PRM requires the use of the HEC-DSS software. All input penalty functions are read from
one DSS data file, all time series input data is read from another DSS data file, and time series
and frequency-duration results are written to a third HEC-DSS data file. The files may be defined
using "MENUPRM" as described in Chapter 2. Alternatively, these data files may be defined at
the DOS prompt which executes HEC-PRM as shown below:
To execute the program, you must enter the program name followed by the appropriate file
names. Use the "*ABREV" codes to define the file type. The following files should be defined:
INPUT, OUTPUT, TS_IN_DSS, PF_IN_DSS, and RESULTS_DSS. The file "HECPRM.ERR"
contains error messages. It is supplied with the program and it should be copied into the
\hecexe\sup subdirectory. An example command to execute HEC-PRM is as follows:
Data Units
All flow and storage must be entered in consistent units for both the time series data and penalty
functions. Default units are thousands of ace-feet (KAF) per month for flow data; thousands of
dollars (K$) per thousand ace-feet per month for penalty data; and, feet (FT) per month for
evaporation rates. The data may be entered in other units (e.g., penalties in millions of dollars),
but the analyst must then perform additional record keeping tasks. HEC-PRM results will be
reported (incorrectly) using the default units.
6
HEC-PRM User's Manual Chapter 1 - Program Description
First All job control records such as "TIME", "J1", "IDENT", and "ZW".
Third All link definition records, including: "LINK", "BL", "BU", "PS", "PS2", "PQ", "PQ2",
"QC", "QI", "QL", "QU", "EAC", "EV", and "IN". The "LINK" record is the first record
of each link. There is one "LINK" record for each link in the network. All other "LINK"
records which are required to define that link follow the "LINK" record.
Comment records ("..", "**", or " ") may be entered anywhere in the input file.
Note: In the following description, the character "=" indicates a blank character. Numeric
data should be right-justified in the fields. The editor COED will automatically justify all
records when it is used in the "help program" mode (which is the default for editing HEC-
PRM input data files). Be careful, the editor defaults to 80 columns of input data unless it
can detect more. If it assumes 80 columns of input, anything entered beyond 80 columns will
be lost. All fields which allow the last data value to be entered in column "n" indicate that
the field extends through column 240. However, the internal array holding the information
may store less than this.
7
Chapter 1 - Program Description HEC-PRM User's Manual
8
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
As its name implies, HEC-PRM is a prescriptive model that addresses a reservoir system
operation problem as one of optimal long-term allocation of available water. The model
identifies the allocation that maximizes benefits (or minimizes costs associated with poor
performance) for all defined system purposes. Performance is measured with analyst-provided
penalty functions of flow, storage, or both.
To determine the optimal water allocation, the physical system is represented as a network, and
the operating problem is formulated as a minimum-cost network flow problem. The objective
function of this network problem is the sum of piecewise-linear approximations of the penalty
functions. An off-the-shelf solver is used to define the optimal allocation of water within the
system. The results of the solver are processed to report and display reservoir releases, storage
volumes, channel flows, and other pertinent variables.
The HEC-PRM software is general-purpose. Accordingly, the software includes the following
model-building components:
1) Inflow link;
2) Initial-storage link;
3) Diversion link;
4) Final-storage link;
5) Channel-flow link;
6) Simple reservoir-release link;
7) Hydropower reservoir-release link;
8) Reservoir-storage link; and
9) Node.
An analyst can specify the characteristics and configuration of these components to represent any
water resources system.
Problem Statement
The problem addressed by HEC-PRM is identification of the optimal long-term operation plan for
a reservoir system. This plan will identify the priorities to be assigned to conflicting objectives of
operation. For example, the plan will determine whether water should be released from a
reservoir if a demand exists for downstream flow for wildlife protection but a conflicting demand
exists for continued storage of the water for recreation.
The model quantifies system performance for various purposes in multi-objective terms. In many
cases, the economic cost of operation may be the primary consideration, but social and
environmental costs can also be considered. These costs are expressed in commensurate terms to
permit display of trade-offs in operation for various purposes.
Constraints on the physical system can be included. For example, the outlet capacity of a
reservoir can be modeled explicitly. However, inviolable constraints on system operation are
used frugally. This avoids the problem described by Hitch and McKean (1960) when they wrote
"...casually selected or arbitrary constraints can easily increase system cost or degrade system
performance many fold, and lead to solutions that would be unacceptable to the person who set
9
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
the constraints in the first place." Instead, operation limitations should be imposed through value
functions in order to permit clear evaluation of the impacts of limitations. For example, instead
of specifying maximum flow requirements for flood control, the system model should represent
this objective through high costs of failure to maintain flows or storage levels below flood stage.
Solution Procedure
HEC-PRM considers the reservoir operation planning problem as a problem of optimal allocation
of available water. The solution procedure for this water allocation problem is as follows:
Network arcs intersect at nodes. The nodes may represent actual river or channel junctions,
gage sites, monitoring sites, reservoir sites, or water-demand sites. Flow is conserved at each
node: the total volume of water in arcs originating at any node equals the total volume in arcs
terminating at that node.
10
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
node. The arc from Node 3 to Node 4 represents the total reservoir outflow. The arc from
Node 1 to Node 4 represents the local runoff downstream of the reservoir. The arc from
Node 4 to Node 2 carries water from the reservoir/demand point network to the sink.
Unit costs may also be negative, representing benefits for increased flow. The total cost for
flow along the arc represented is the product of flow and the unit cost.
The simplest linear function may be too simple to represent adequately many of the goals of
reservoir operation. Instead, nonlinear functions, such as those shown in Figure 6, maybe
required.
Piecewise-linear Approximation.
Nonlinear cost functions can be
approximated in a piecewise
linear fashion for network model,
as shown in Figure 7. Linear
segments are selected to represent
the pertinent characteristics of the
function. The analyst controls the
accuracy of the approximation,
with more linear segments
yielding a more accurate
representation. However, the time
required for solution of the
resulting network-flow
programming problem depends on
the number of arcs included in the
network. Thus, as the
approximation improves, the time
for solution will likely increase.
Jensen and Barnes discuss this
approximation in detail (1987, pp.
355-357).
Cases arise, however, in which cost functions are non-convex. For example, the cost of flood
damage along a river reach may first increase rapidly as urban or industrial areas near the
river are flooded, but then increase at a slower rate as outlying rural areas are flooded. HEC-
PRM allows the analyst to specify a non-convex piecewise linear approximation, but a
specialized solution procedure called restricted basis entry (e.g., Hadley 1964, pp. 104-111) is
required. This procedure will identify a locally optimal solution (if a feasible solution exists),
but it cannot guarantee the global optimum. In many practical problems, there are likely to
be many local optima. The analyst may find it useful to identify several of these by starting
the solution procedure with different initial values.
With a piecewise linear approximation, the physical link for which the function applies is
represented in the network by a set of parallel arcs. One arc is included for each linear
segment of the piecewise approximation. For example, suppose the cost function in Figure 7
represents the cost of release from the reservoir represented by Node 3 in Figure 3. In the
12
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
proposed network model, four parallel arcs will connect Node 3 to Node 4. Characteristics of
the arcs are shown on Table 4.
Arc 1 has the least marginal cost. Therefore, as flow is increased from Node 3 to Node 4,
flow will pass first through Arc 1. When the capacity of this arc is reached, flow begins to
pass through Arc 2. Arc 3 will have non-zero flow if and only if Arc 2 is at its upper bound.
Finally, Arc 4 will have non-zero flow only when Arcs 1, 2, and 3 are flowing full. Because
the objective is to minimize cost, if two or more arcs are parallel, the one with the lowest unit
cost is used first.
Quadratic Approximation. HEC-PRM also provides the analyst the option of specifying
quadratic cost functions, or quadratic approximations to higher-order cost functions. For
these functions, the analyst must specify two coefficients, c1 and c2, to define a cost function
as follows:
f ( x) = c1 x + c 2 x 2
The solution procedure in this case involves implicit linear approximation of the quadratic
function, which is done "behind the scenes". The analyst has only to specify desired solution
13
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
accuracy, if the default value is not appropriate. Although an implicit piecewise linear
approximation is used, restricted basis entry is not available for quadratic cost functions.
Therefore, these functions must be convex.
14
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
Figure 9 is an example of a flow penalty function. This function represents the relative
penalty for diverting flow when the minimum desired diversion is 100 cfs. Less diversion is
undesirable. More diversion is acceptable, but that water does not reduce further the penalty.
The penalty function of Figure 9 is represented in the network by two parallel arcs. The
characteristics of these arcs are shown in Table 5.
The first arc represents flow up to the desired rate. As the flow increases from 0 cfs to 100
cfs, the total penalty decreases. At 100 cfs, the unit penalty is 0.0. As the flow increases
beyond 100 cfs, the unit penalty remains 0.0. Similar flow penalty functions can be developed
for reservoir release and channel flow.
Storage Penalty Functions. All reservoir operation goals uniquely related to storage are
expressed through penalty functions for arcs that represent reservoir storage. These functions
may represent operation goals for reservoir recreation, water supply, or flood control.
Figure 10 is an example of a reservoir storage penalty function. For this example, the top of
the permanent pool is 200 kaf, the top of the conservation pool is 800 kaf, and the top of the
flood-control pool is 1000 kaf. The function represents the penalty for storage when the
reservoir operation goal is to keep the inactive and conservation pools full and the flood
control pool empty.
15
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
The function shown in Figure 10 is represented in the network by three parallel arcs. The
flow along one arc represents storage in the permanent pool. Increasing the flow along this
arc reduces the penalty rapidly. Flow along the second arc represents storage in the
conservation pool. Increasing flow along this arc also decreases the penalty, but not as
rapidly as does flow along the inactive-pool arc. The third arc represents storage in the flood-
control pool. Increasing flow along this arc increases the penalty. The solver will allocate
flow to the arcs to minimize the total system penalty: first to the inactive-pool arc, then to the
conservation-pool arc, and finally to the flood-control pool arc.
Storage and Flow Penalty Functions. Certain system operation goals depend on both
storage and flow. The most significant is hydroelectric energy generated at a reservoir. This
is a function of the product of release and head on the turbine. Head is the difference in
reservoir-surface elevation and downstream water-surface elevation. Reservoir-surface
elevation is a function of reservoir storage, and downstream water-surface elevation is a
function of release. Thus, the energy generated is a complex function of storage and flow.
Other aspects of water resources systems that can be modeled using combined flow-storage
penalty functions include navigation and groundwater supply. In the case of a lock and dam
system, such as the Panama Canal, the amount of water needed for each lockage is a function
of the difference in elevation from upstream to downstream which, in turn, is a function of
storage in the canal or reservoir. In the case of groundwater supply, the cost of pumping is a
function of the lift required, which is a function of storage in the aquifer. Penalty functions
such as those shown in Figure 11 can be developed for these cases.
16
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
Minimize: ∑𝑀
𝐾 𝐶𝐾 𝐹𝐾 (1)
Subject to:
in which:
17
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
Network Simplex Method. The generalized minimum-cost network flow problem is solved
using the primal network simplex method, as described in Jensen and Barnes (1987). This
iterative procedure involves the following main steps:
If all cost functions are convex, constant gain factors are used for reservoir evaporation, and
the problem is not infeasible, the primal network simplex method will determine a globally
optimal solution.
Network Simplex with Restricted Basis Entry. In the case of non-convex penalty functions,
and/or non-constant gain factors for reservoir evaporation, a restricted basis entry procedure
(Hadley 1964) is used to ensure that parallel arcs fill in the correct sequence. This procedure
involves a number of minor modifications to the network simplex method. First, the initial
solution must be feasible with respect to the sequenced arcs. A simple initial solution that
satisfies this requirement has all 0 flows in parallel arc sets. If a non-zero initial flow is
specified, the flows in the parallel arc set are arranged to satisfy the sequence restriction.
Next, the method for selecting an arc to enter the basis is modified in two ways. If a parallel
set of arcs includes a basic arc, no other arc in that set is allowed to enter the basis. If a
parallel set of arcs does not include a basic arc, and one is found to violate the optimality
conditions, the arc may enter the basis only if the sequence restriction will remain satisfied.
Further details can be found in Appendix C.
If the problem is feasible, the network simplex method with restricted basis entry will find a
local optimum that is feasible for the sequenced problem. However, a global optimum cannot
be guaranteed. The analyst may find it useful to identify several local optima by starting with
different initial values.
Successive Linear Programming. In the case of combined flow and storage penalties, such
as those for hydroelectric power, the overall planning problem is being solved via iterative
solution of linear approximations. Such successive linear programming techniques are
described by Martin (1982), Grygier and Stedinger (1985), and Reznicek and Simonovic
(1990). In summary, these techniques convert the combined release-storage penalty functions
to release penalty functions by assuming a value of reservoir storage. Given the storage, head
can be estimated. Given this head, the unit penalty for release is used, and the flow allocation
problem is solved. Then the head assumption is checked, using the storage computed for the
optimal allocation. If the assumption is not acceptable, the heads corresponding to the
computed storages are used, and the process is repeated. Details are provided in Appendix C.
As with restricted basis entry, the successive linear programming method cannot guarantee a
global optimum. Since many local optima may exist for large-scale problems, the analyst
might find it useful to identify several local optima.
18
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
The flows corresponding to the minimum cost solution must be translated into reservoir
releases, hydropower generation, storage volumes, diversion rates, and channel flows to be
useful to the reservoir system operators. For convenience, HEC-PRM results are translated
and stored with the HEC-DSS. Then the results can be displayed or processed further as
needed to provide information required for decision making.
Besides to the total cost, HEC-PRM reports other economic information related to the
network solution. This information is termed "dual information" because the values are
closely related to the optimal values for the dual variables. This dual information can be very
useful for sensitivity analysis. For example, if the final solution reports that an arc has flow
at its capacity, the arc marginal cost is the cost (or benefit) that would result from increasing
the arc capacity by one unit. This has obvious ramifications for capacity expansion studies.
As another example, the dual cost associated with a given node indicates the cost (or benefit)
19
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
of obtaining an additional unit of water at that node. In the case of a fixed diversion
occurring at a node, the dual cost would measure the system-wide economic impact of
increasing that diversion by one unit. More details about the dual information, and how it is
reported by HEC-PRM, can be found in Appendix C.
1) Inflow link;
2) Initial-storage link;
3) Diversion link;
4) Final-storage link;
5) Channel-flow link;
6) Simple reservoir-release link;
7) Hydropower reservoir-release link;
8) Reservoir-storage link;
9) Node
By selecting the appropriate links and the manner in which they are interconnected, the analyst
can describe any system. By describing the characteristics of the links and the penalties
associated with flow along the links, the analyst can define operating constraints and goals.
Inflow Link
An inflow link brings flow into the reservoir-system network. It originates at the source node
and terminates at any other system node. In Figure 3, the link from Node 1 to Node 3 is an
inflow link. It originates at the source node, Node 1, and carries flow into the system at Node
3.
The flow along the arc representing the inflow link is an input to the model. This known
inflow may be an observed inflow from the historical record, or it may be an inflow from a
sequence generated with a statistical model. To insure that the link carries the specified flow,
the arc upper and lower bounds are equal and the unit penalty is zero.
Initial-storage Link
An initial-storage link is a special case of an inflow link. It originates at the source node and
terminates at a node that represents a reservoir in the first period of analysis only. It
introduces to the network the volume of water initially stored in the reservoir. In Figure 4,
the storage link terminating at Node 3 in Period 1 is an initial-storage link; it represents the
beginning-of-Period 1 storage.
Diversion Link
A diversion link originates at any system node and terminates at any node. In Figure 3, the
arc from Node 4 to Node 2 is a diversion link. It originates in the system at the downstream
control point, Node 4. It carries flow out of the system to the sink, Node 2. The flow along a
diversion link is a decision variable, selected to minimize total system penalty. The diversion
penalty function is specified by the analyst as penalty associated with deviating from the
20
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
diversion desired. This function may vary by month. The software defines appropriate arc
bounds and unit costs to represent the function.
The analyst may also specify inviolable minimum and/or maximum flow for a diversion link.
If the analyst specifies both minimum and maximum, and if these values are the same, the
diversion link will be represented in the network by a single arc. The upper and lower
bounds of the arc are equal. In that case, the only feasible solution is one in which flow
equals the specified value, regardless of cost. Any penalty function defined by the analyst for
the link is ignored in that case, as it has no impact on the solution.
If the analyst specifies only a lower bound or only an upper bound, the software will impose
the bound on the appropriate network arcs. If the penalty function is a simple function, like
that of Figure 5, the bound is applied to the single arc representing that function. For
example, if the analyst specified a lower bound of 25 cfs and an upper bound of 800 cfs, the
network arc will have lk = 25 and uk = 800 (see Equation 3).
For more complex penalty functions, HEC-PRM determines the proper network arcs on
which to impose the bound. For example, the penalty function of Figure10 is represented by
two parallel arcs, each with a bound and unit cost. If the analyst specifies an inviolable lower
bound of 25 cfs and an upper bound of 800 cfs, the network arcs must be adjusted to have
parameters shown on Table 6.
For the first arc, the lower bound increases from 0 to 25. The upper bound remains 100. The
unit cost does not change. For the second arc, the lower bound remains 0, and the upper
bound now is 800 - 100 = 700. The unit cost does not change.
Final-storage Link
A final-storage link is a special case of a diversion link. It carries flow out of the system, but
only from a reservoir in the last period of analysis. The final storage link thus originates at
any system reservoir and terminates at the sink node. In Figure 4, the storage link originating
at Node 3 in Period 3 is a final-storage link. The final-storage link is included in the system
model to permit assignment of a future value for water in system reservoirs. Otherwise, the
network solver will be indifferent regarding final storage. The solver may choose any storage
state, including empty or full, without regard for future use.
Just as with the diversion link, the flow along a final-storage link is a decision variable,
selected to minimize total system penalty. A penalty function may be specified by the analyst
as the penalty associated with deviating from an ideal final storage, or else an inviolable
(fixed) storage value can be specified.
21
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
Channel-flow Link
A channel-flow link originates at any non-reservoir node, terminates at any other network
node, and represents the flow in a channel reach. The flow along the link is a decision
variable, selected to minimize total system penalty.
As with the diversion link, the analyst may specify inviolable minimum and/or maximum
flow for a channel-flow link. HEC-PRM will impose these constraints on the appropriate
network arcs.
The analyst may specify also a multiplier for flow along a channel-flow link. The multiplier
is ak of Equation 2 for all arcs representing the link. If the multiplier is greater than 1.00, it
represents increase of flow in the channel. If the multiplier is less than 1.00, it represents loss
of flow.
The analyst may specify inviolable minimum and/or maximum flow constraints. The analyst
may specify also a multiplier for flow along a reservoir-release link. HEC-PRM will apply
the multiplier and impose the constraints on the appropriate network arcs.
The flow along a hydro-release link is a decision variable, selected to minimize total system
penalty. As hydroelectric energy is not a linear function of flow, however, determination of
the release that minimizes total penalty requires consideration of storage.
Other Release Penalties. Due to the special nature of the hydro-release link, all other
release-related penalties must be defined as a function of flow downstream. This is
accomplished by defining a "dummy" node downstream of the hydropower reservoir. The
hydro-release link connects the reservoir and this dummy node, and the hydropower penalty
function is associated with this link. A channel-flow link connects the dummy node with the
next downstream node. All penalty functions normally defined in terms of reservoir release
are defined in terms of channel flow instead.
Reservoir-storage Link
Link Description. A reservoir-storage link originates at any reservoir node in a layered,
multiple-period network. It represents the volume of water stored in the reservoir at the end
of the period. The reservoir-storage link terminates at the node representing the same
reservoir in the period following. The flow along a reservoir-storage link is a decision
variable, selected to minimize total system penalty.
22
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
For example, in Figure 4, the arc from Node 3 in Period 1 to Node 3 in Period 2 is a
reservoir-storage link. Flow along the arc leaving the Period 1 layer represents reservoir
storage at the end of Period 1. Flow along the arc entering the Period 2 layer represents
reservoir storage at the beginning of Period 2.
The evaporation volume is related to reservoir surface area with the following equation:
The quantity Et-1 is input to the model. It may be a historically observed evaporation rate, or
it may be generated with a stochastic model. The relationship of surface area and storage can
be approximated with a linear function as:
ß = a linear coefficient
The value of ß is found from analysis of specified reservoir characteristics. Substituting
Equations 5 and 6 into Equation 4 and simplifying yields:
The quantity (1 - Et-1 ß) is the arc multiplier ak of Eq. (2). The flow out of the reservoir-
storage arc, St, is the flow into the arc, St-1, multiplied by (1 - Et-1 ß). (Note: The quantity St-1
is limited by the reservoir-storage arc capacity, but St is the value reported by HEC-PRM as
the storage at the end of Period t-1. Thus, for positive evaporation rates, solution values for
reservoir storage will always be less than the reservoir capacity.)
The value of ß need not be a constant. If the analyst instructs HEC-PRM to read a reservoir
storage-area relationship from the HEC-DSS paired data input file, and reservoir storage in
each time period is represented by multiple arcs due to a piecewise linear penalty function,
the software may compute and assign a different gain factor to each arc (depending on the
characteristics of the storage-area relationship). Although this allows a more accurate
representation of reservoir evaporation, it may also make the model non-convex, thereby
requiring the use of the restricted basis entry solution procedure to ensure that the parallel
arcs for reservoir storage fill in sequence.
23
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
Nodes
Nodes are included in the model to permit joining the appropriate links. Two or more of the
links described may join at a node. The nodes represent system reservoirs, demand points,
channel junctions, or diversion points. These may be existing facilities or proposed facilities.
Additional nodes may be included in the network for convenience of description.
In addition to the analyst-defined nodes, HEC-PRM adds a source node and a sink node to
satisfy the mathematical requirements for defining a network. All water entering the system
flows from the source node, and all water leaving the system flows to the sink node.
24
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
Figure 15 is a typical river recreation penalty function. In this example, the desired range of
flow for boating, swimming, and fishing is 400 to 500 cfs. If the flow rate is less than 400
cfs, boating and swimming are dangerous due to shallow depths and fishing is poor. If the
flow rate exceeds 500 cfs, recreation is hazardous.
25
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
26
HEC-PRM User's Manual Chapter 2 - Overview of HEC-PRM
27
Chapter 2 - Overview of HEC-PRM HEC-PRM User's Manual
desired flow for towing barges in the channel. Between 400 and 600 cfs, the penalty is zero,
as this is the desired flow for navigation. Between 600 and 1100 cfs, the penalty increases
slightly, representing the increased effort required for navigation. Finally, the penalty
increases rapidly if the flow exceeds 1100 cfs. This is the upper limit on desired flow for
navigation.
In some cases, such as lock and dam systems, the navigation penalty may be a function of
both release and storage. In this case, as with the typical hydroelectric power penalty
function, a family of penalty functions would be defined - each representing the release-
penalty relationship for a given storage level.
28
HEC-PRM User's Manual Chapter 3 - Use of MENUPRM
MENUPRM
This should load the program and begin by displaying a banner page as described below. If the
banner page does not appear, then the most likely cause of failure is that either one of the
following files is missing:
[drive:]\HECEXE\MENUPRM.BAT or
[drive:]\HECEXE\PRMMENUX.EXE
• Banner page.
• Select Study.
• Enter or edit study name and associated data subdirectory.
• Select Program.
• Define Data Files.
• List files in current directory with mask.
To successfully execute a program, the user must progress through the primary menus. The
subordinate menus are used only if the user wishes and are not required for an individual
execution.
Key(s) Description
F2 Reset selection or definition. Example: in the "Define data files" menu, the F2 key resets
all file names to those initially selected when this menu was last invoked.
F4 Edit the selected file with COED. The F4 key initiates editing the currently selected file
with COED. This is operational only from the "Define data files" menu. The MENUPRM
program invokes COED in a full screen mode with "Help Program" files, if applicable. You
may obtain on-line documentation for COED by pressing the F1 function key while in
COED and by following subsequent instructions. A complete COED user's manual is stored
in the file "COED.DOC" (also available from HEC in printed form).
29
Chapter 3 - Use of MENUPRM HEC-PRM User's Manual
Key(s) Description
F5 Define the background screen color. The color is changed by pressing the F5 key in the
"Select Study" and "Select Program" menus. You may select from eight colors: black, blue,
green, light blue, red, violet, orange, or white.
F6 Define the foreground screen color. The color is changed by repeatedly pressing the F6 key
only in the "Select Study" and "Select Program" menus. You may select one of eight colors:
black, blue, green, light blue, red, violet, orange, and white. The foreground color may be
either normal or intense. To cycle through all possible definitions, you must press the F6
key sixteen times. Portions of the menu are displayed in reverse video. If you select an
intense foreground color, sometimes you will get unexpected results. One example is using
black as a foreground color. One combination that works well is a blue background and an
intense white foreground.
F8 Execute the selected program. Pressing the F8 key initiates execution of the currently
selected program (all necessary data files must have been defined). This is operational from
the "Select Program" and "Define Data Files" menus.
F9 Return to previous menu. The F9 key allows you to exit the current selected menu and
return to the previous menu. For example, if you are in the "Define data files" menu, you
can go to the "Select Study" menu by pressing the F9 key twice - the first time you will
access the "Select Program" menu and the second time the "Select Study" menu.
F10 Exit to DOS. By pressing the F10 key from any menu, you will immediately terminate the
MENUPRM program and return to the DOS environment.
Esc Reset the current selection or return to the previous menu. Pressing the Esc key resets the
current file, study name, data directory, etc. to that previously defined. The Esc key changes
only the current selection (e.g. the currently selected file) whereas the F2 key changes all
selections (e.g. all defined data files) or resets the current menu selection. The Esc key
returns to the previous menu if the user is not editing a file name.
Home Select the first option, file, study, etc. The Home key controls the item selection on the
current menu and page. For example, on the "Select Study" menu, pressing the Home key
selects the first study displayed on the current page of studies (the study in the upper left
corner of the menu).
End Select the last option, file, study, etc. The End key controls the item selection on the current
menu and page. For example, on the "Select Study" menu, pressing the End key selects the
last study displayed on the current page of studies (the study in the lower right corner of the
menu).
Move cursor to first character. Pressing the Home key, releasing it, and then pressing the
Home, 7 left arrow key moves the cursor to the first character in a field. This is operational when
you are editing study names, filenames, and directory names.
Move cursor to last character. Pressing the Home key, releasing it, and then pressing the
Home, 6 right arrow key moves the cursor to the last character in a field. This is operational when
you are editing study names, filenames, and directory names.
Move cursor one character to the left. Pressing the left arrow key moves the cursor one
7 character to the left. It is operational when you are editing study names, filenames, and
directory names.
30
HEC-PRM User's Manual Chapter 3 - Use of MENUPRM
Key(s) Description
Move cursor one character to the right. Pressing the right arrow key moves the cursor one
6 character to the right. It is operational when you are editing study names, filenames, and
directory names.
Select previous study, file, or option. Pressing the up arrow changes the current selection to
8 the one displayed just above the current selection. It is operational in all menus.
Select next study, file, or option. Pressing the down arrow changes the current selection to
9 the one displayed just below the current selection. It is operational in all menus.
PgUp Change to previous page. Pressing the PgUp key moves the display from the current page
to a previous page of information. This is operational in the "Select Study" and "Directory
Listing" menus and only if there are more studies (or files) than can fit on one page of
display.
PgDn Change to next page. Pressing the PgDn key moves the display from the current page to the
next page of information. This is operational in the "Select Study" and "Directory Listing"
menus and only if there are more studies (or files) than can fit on one page of display.
Ins Change insert character mode. Pressing the Ins key toggles the insert character mode
between on and off. It is operational when you are editing study names, filenames, and
directory names. When the "insert character" mode is on, any character entered will be
added to those existing. If the mode is off, any character entered will replace the existing
character at the cursor location.
Del Delete character. Pressing the Del key deletes the character at the current cursor position.
Alt-D Delete the selected disk file. Pressing the Alt key and holding it down while pressing the
"D" key deletes the currently selected file from the disk.
Alt-E Edit the selected disk file with COED. Pressing the Alt key and holding it down while
pressing the "E" key initiates editing the currently selected disk file with COED. This is
operational only from the "Define data files" menu. The MENUPRM program invokes
COED in a full screen mode and with "Help Program" files, if applicable. You may obtain
on-line documentation for COED by pressing the F1 function key while in COED and by
following subsequent instructions. A complete COED user's manual is stored in the file
"COED.DOC". It may be copied to a printer. Alternatively, a pre-printed manual is
available from HEC.
Alt-F1 While in COED, you may get information from the "Help Program" files by pressing Alt-
F1. This information should be available for the HEC-PRM input data file which requires a
fixed format. You access the help program feature by entering a valid two character record
identifier (e.g. "J1") in columns one and two of an input data file and then pressing Alt-F1.
You can get descriptions for each input field of the input data by positioning the cursor at
the desired field using the tab key and then by pressing the Alt-F1 key. COED then displays
the description for that field. It is similar or identical to the description contained in the
program user's manual. The COED user's manual contains a more detailed description of
the help program.
Alt-L List the currently selected disk file with "LIST". Pressing the Alt key and holding it down
while pressing the "L" key initiates listing the currently selected disk file. The currently
selected disk file is indicated by the highlighted box. This is operational only from the
"Define data files" menu. Documentation for the LIST program is located on the HEC-
PRM Installation diskette labeled "Install PRM" in the file LIST.DOC. If you try to list an
31
Chapter 3 - Use of MENUPRM HEC-PRM User's Manual
Key(s) Description
HECDSS file, the menu will attempt to list its associated catalog file. There is no protection
against listing a binary data file.
Alt-P Print the currently selected disk file using the MS-DOS PRINT command (or with
"PROUT" if printing HEC-1, HEC-2, or HEC-5 output). Pressing the Alt key and holding it
down while pressing the "P" key initiates printing the currently selected disk file. The
currently selected disk file is indicated by the highlighted box. This is operational only
from the "Define data files" menu. There is no documentation for the PROUT program. It
merely converts the mainframe carriage control character into a code recognized by PC
printers to assure proper pagination.
Alt-X Execute the selected program. Pressing the Alt key and holding it down while pressing the
"X" key initiates execution of the currently selected program (all data files must have been
defined). This is operational from the "Select Program" and "Define Data Files" menus.
32
HEC-PRM User's Manual Chapter 3 - Use of MENUPRM
Select Study
The "Select Study" menu allows you to select the study (or set of data) that you wish to
analyze. You select a study by maneuvering the highlighted box over the desired study and
pressing the <Enter> key. To enter a new study, position the highlighted box over the line
"(specify new study)" and press the <Enter> key or begin entering a new study name. To edit
an existing study, position the highlighted box over the study and press "Alt-E". The study
menu should appear as shown in Figure 22.
Edit Study
For each study, there is an associated subdirectory where the data is stored. Any time you
enter a new study (or edit an existing study reference by entering "Alt-E"), you may edit the
subdirectory into which the data will be entered. If data already exists in a subdirectory
and you change the subdirectory, the data will not be moved to the new subdirectory.
The subdirectory name is simply the location that the menu program searches to find data
files for a given study. If you enter a new study or edit an existing study, the "Edit study
name / data directory" menu should appear as shown in Figure 23.
33
Chapter 3 - Use of MENUPRM HEC-PRM User's Manual
Select Program
The "Select Program" menu allows you to indicate the program that you wish to execute or
the program for which you wish to enter or edit data. You may select the program for which
you wish to enter or edit data by either entering the appropriate integer (e.g., pressing the "1"
key for the HEC-PRM program) or by maneuvering the highlighted box over the desired
program and pressing the <Enter> key as shown in Figure 24. If you have already defined
the appropriate data files for the desired program, you may execute the program from this
menu by pressing and holding the "Alt" key and then pressing the "X" key (or alternatively
the F8 function key).
34
HEC-PRM User's Manual Chapter 3 - Use of MENUPRM
program is executed. (That FORTRAN unit is actually assigned to the default scratch file
internal to each program.) The menu program assumes certain default filename extensions as
described later in the "Default Data File Extensions" section. You may override these
defaults by entering a period (".") followed by your desired extension. The menu program
will use your defined extension for future definitions. This selection is stored in the file
"PRMMENU.FIL" which is associated with the selected study. In addition to defining the
data file names; you may edit, list, delete, and print files or execute the currently selected
program from this menu. The following codes invoke these operations. You must press and
hold down the "Alt" key and then press the appropriate key (such as the "L" key) for each
operation.
Alt Function
Key Key Operation
Alt-D F3 Delete currently highlighted file.
Alt-E F4 Edit currently highlighted file using COED.
Alt-L F6 List currently highlighted file using the “LIST” program.
Alt-P Print currently highlighted file using the “PROUT” program.
Alt-X F8 Execute the currently selected program using the selected files
displayed on the screen.
To get a file directory listing, you may do any one of the following:
File Description
F5 Pressing the F5 function key lists all files which have the current
default extension. For example, the HEC-PRM data input files have
the default extension ".PRI". If the "F5" key is pressed, the menu
program initiates a "DIR *.PRI" DOS command, then sorts all of the
files that meet that criteria, and displays them to the screen. The user
may select a file by positioning the highlighted box over a file and
pressing the <Enter> key. If the desired file does not exist, press the
"Esc" key to return to the previous menu.
35
Chapter 3 - Use of MENUPRM HEC-PRM User's Manual
*.* Entering the characters "*.*" lists all files (up to a maximum of 300
files) which are in the current default directory. You may select the
desired file by positioning the highlighted box over the desired file
and pressing the <Enter> key.
SLV01??.E Entering "SLV01??.E" lists any file meeting the user specified file
mask "SLV01??.E" (or any other file mask). You may select the
desired file by positioning the highlighted box over the desired file
and pressing the <Enter> key.
36
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
37
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
Penalty function names are modified based upon data entered on the CONDITION record and
the condition ID that is stored in the input time series DSS data file and retrieved using the
CONDTS record. HEC-PRM will modify part F of the penalty function pathname using the
appropriate condition name.
38
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
39
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
PR – Print Parameters
Columns Variable Value Description
1-5 CINREC PR This record allows the user to get specific output from HEC-PRM
in the ASCII output file. The following code names are entered in
free-format. If the name is entered, the output is activated. See the
NOPRINT record for suppressing output.
6-80 INP_ECHO Echo user input records when HEC-PRM reads them. (Default is
on).
USR_NODES Lists all user nodes. (Default is on).
USR_LINKS Lists all user links. (Default is on).
USR_PATHS Lists all pathnames generated from user input pathname parts.
(Default is off).
ORIG_ARCS Lists all solver arcs before the solver is called. (Default is off).
SOLN_ARCS Lists all solver arcs after a solution is determined. (Default is off).
SOLN_NODES Lists all solver nodes after solution is determined (Default is off).
FIXED_SPLY Lists all fixed supply flows to the nodes. (Default is off).
40
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
41
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
Output to HEC-DSS
ZW – Results Pathname Part F
Columns Variable Value Description
1-2 CINREC ZW This record contains the character identification for pathname part F of the results
for this simulation.
3-80 SIMLID character SIMLID is the portion of pathname part F which is used to identify this
simulation. It is used to store results under separate DSS records for different
simulations (e.g. to differentiate results after changing penalty functions between
simulations). HEC-PRM uses SIMLID to form pathname part F. (Maximum of
20 characters; recommend using less).
It is entered in the format of F=XXX where XXX is pathname part F.
42
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
43
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
Parameter Description
FLOW_NAT(KAF) Natural flow (in kaf) which would occur at this
node (diversions are ignored in calculating natural
flows).
DUAL_COST The marginal cost associated with an increase in
arc capacity or demand at a node.
NAV_LOCK Navigation lockages (input penalty function DSS
data file must contain a table of flow-navigation
for various reservoir storages.
44
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
ND – Node Description
Columns Variable Value Description
1-8 CINREC ND This record contains the description for the current node defined on the
"NODE" record. It is an optional record.
11-80 DENODE character The character description for this node. It can contain any textual
information.
45
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
46
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
LD – Link Description
Columns Variable Value Description
1-8 CINREC LD This record contains the description for the current link defined on the
"LINK" record. It is an optional record.
11-80 LIDESC character The character description for this link. It can contain any textual
information.
EAC – Elevation-Area-Capacity
Columns Variable Value Description
This record contains HEC-DSS pathname parts and instructs HEC-PRM to
1-3 CINREC EAC read elevation-area-capacity data for a reservoir. This “triplet” data must
be stored in the paired data (penalty function) HEC-DSS file. The order of
the triplet data is: elevation (feet), area (thousands of acres), and capacity
(thousands of acre-feet). HEC-PRM will use this data, along with net
evaporation rates, to determine the volume of evaporation in each month of
the analysis. If this record is omitted, and LIAMP is left blank or equal to
1.0, there will be no evaporation computed. Must be entered before the PS
record.
The HEC-DSS pathname parts, entered in free format. The pathname part
4-n – character is preceded by an equal "=" sign which is preceded by the part identifier (A
through F). Part C must be “EL-AR-CAP”. Parts D and E are to be left
blank. If a part is blank, enter the part identifier, the equal sign, and at
least one blank. HEC-PRM remembers time series parts from the last entry
(either "IN", "EV", "QC", "QL" or "QU" records)--you need only update
necessary parts. Example entry: EAC B = FOLSOM C = EL-AR-CAP
F=
47
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
48
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
49
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
EV – Evaporation Rate
Columns Variable Value Description
1-2 CINREC EV This record contains HEC-DSS pathname parts and instructs HEC-PRM to read
time series data for net evaporation from the input time series DSS data file. The
net evaporation should be expressed as a rate (in feet per month). This record is
valid only for Reservoir Storage ("RSTO") links. If no EV record is specified for a
given reservoir, evaporation from that reservoir is not computed.
3-n CINREC character The pathname parts are entered in free-format. The pathname part is preceded by
an equal "=" sign which is preceded by the part identifier (A through F).
Parts D and E are assumed. Part E is the time interval (1MON), and part D is the
standard block time for regular interval time series data. Part D is generated from
the time window entered on the "TIME" record.
If part C is not entered, HEC-PRM assumes it will be "EVAP_RATE".
If a part is blank, enter the part identifier, the equal sign, and at least one blank.
HEC-PRM remembers time series parts from the last entry (either "IN" or "EV"
records)--you need only update necessary parts.
Example entry: EV B = FTPK
Fixed Cost
Normally, arc costs are computed from the penalty functions. In lieu of entering a penalty
function, either the CM or CT records are entered to define a single fixed cost for each time
period.
Explicit Amplitudes
Normally, amplitudes are computed only for reservoir links that have evaporation based upon the
EV record. However, amplitudes may be explicitly defined as monthly values (AM record) or
time varying values (AT record). If both AM and AT records are entered, values based upon the
AT records take precedence.
50
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
AM – Monthly Amplitude
Columns Variable Value Description
1-2 CINREC AM This record defines the monthly amplitude. If the amplitude remains constant
throughout the simulation, it is entered on the "LINK" record. If it follows a
monthly pattern (all January amplitudes are the same, all February amplitudes are
the same but different than January, etc.), then they must be entered on this record.
If evaporation rates are defined using the EV record, the amplitudes calculated
from it will override the values entered on the CM record.
3-n – 0, + real no. The monthly varying amplitudes are entered in free-format. Twelve values must be
entered. The first value corresponds to January. If you enter adjacent commas, the
corresponding value is defined by the value entered on the LINK record.
IN – Local Inflow
Columns Variable Value Description
1-2 CINREC IN This record contains HEC�DSS pathname parts and instructs the HEC-PRM to
read time series data for local inflow. The flow should be expressed as a volume
per month in 1,000 Acre-Feet. This record may be entered for any inflow link.
3-n CINREC character The pathname parts are entered in free-format. The pathname part is preceded by
an equal "=" sign which is preceded by the part identifier (A through F).
Parts D and E are assumed. Part E is the time interval (1MON), and part D is the
standard block time for regular interval time series data. Part D is generated from
the time window entered on the "TIME" record.
If part C is not entered, the HEC-PRM assumes it will be "FLOW_LOC(KAF)".
If a part is blank, enter the part identifier, the equal sign, and at least one blank.
The HEC-PRM remembers time series parts from the last entry (either "IN" or
"EV" records)--you need only update necessary parts.
Example entry:
IN A = B = FTPK F =
51
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
52
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
Terminate Input
Any one of the following commands may be entered. If more than one command is entered, only
the first is observed. The entry of one of these commands instructs HEC-PRM to terminate
reading user input, generate the network matrix, call the solver, and store the results in the output
DSS data file.
STOP
Columns Variable Value Description
1-4 CINREC STOP Terminate user input and commence generating and solving the network.
FINISH
Columns Variable Value Description
1-4 CINREC FINISH Terminate user input and commence generating and solving the network.
QUIT
Columns Variable Value Description
1-4 CINREC QUIT Terminate user input and commence generating and solving the network.
53
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
54
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
The following lists a typical HEC-PRM output file. The input data records are listed as the first
part of the output data. This particular data set is for the 1-year time window from March 1965
through February 1966. By modifying the "TIME" record, it could easily be adapted to the 5-
year validation period or the 23-year critical period.
{Banner Page}
Reservoir System Operation Optimization
Version 1.0; April 1, 1994
IBM-PC Compatible (Lahey 32bit)
Run date 31MAR94 time 08:48:42
HECPRM
SUP_DIRECTORY: C:\HECEXE\SUP\HECPRM.ERR
NC_SUP_DIRECTORY: 24
{Dimensions allocated for user's system based upon input data file}
Di me n s i o n s a l l o c a t e d f o r t h i s J o b
Nu mb e r o f No d e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Nu mb e r o f Re s e r v o i r s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Nu mb e r o f Li n k s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Nu mb e r o f DSS Pa t h n a me s . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Nu mb e r o f Ti me Pe r i o d s . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Nu mb e r o f Ti me Se r i e s Bu f f e r . . . . . . . . . . . . . . . . . . . . . . 260
Nu mb e r o f Pa i r e d Da t a Bu f f e r ( Re t r i e v a l ) . . . . . . . . . . 700
Nu mb e r o f Pa i r e d Da t a Bu f f e r ( St o r a g e ) . . . . . . . . . . . . 1400
Nu mb e r o f Pe n a l t y Ca t e g o r i e s . . . . . . . . . . . . . . . . . . . . . . 14
Nu mb e r o f Te x t I n p u t Li n e s . . . . . . . . . . . . . . . . . . . . . . . . 1
55
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
ZWTS -ALL
ZWTS STOR FLOW FLOW(KAF) FLOW_NAT FLOW_NAT(KAF) FLOW_IN FLOW_IN(KAF)
ZWFRQ STOR FLOW FLOW(KAF)
..
PCAT PS_FDA Agricultural Flood Damage related to storage
PCAT PS_FDU Urban Flood Damage related to storage
PCAT PS_FIS Anadroumous Fish related to storage
PCAT PS_NAV Navigation related to storage
PCAT PS_REC Recreation related to storage
PCAT PS_WSP Water Supply related to storage
PCAT PQ_FDA Agricultural Flood Damage related to flow
PCAT PQ_FDU Urban Flood Damage related to flow
PCAT PQ_FIS Anadroumous Fish related to flow
PCAT PQ_NAV Navigation related to flow
PCAT PQ_REC Recreation related to flow
PCAT PQ_WSP Water Supply related to flow
PCAT PQ_HEA Hydropower Energy related to flow
PCAT PQ_HCA Hydropower Capacity related to flow
..
NODE DWORSHAK_P 3468.0 0.1 3468.0
ND Dworshak Reservoir Power Penalties
NODE DWORSHAK
ND Dworshak Reservoir Non-Power Penalties
NODE SPALDING
ND Spalding
NODE BROWNLEE_P 1426.7 0.1 1426.7
ND Brownlee, Oxbow, and Hells Canyon Power Penalties
NODE BROWNLEE
ND Brownlee, Oxbow, and Hells Canyon Non-Power Penalties
NODE GRANITE_P 1825.0 0.1 1825.0
ND L.Granite\Little Goose\L.Monumental\Ice Harbor Power Penalties
NODE GRANITE
ND L.Granite\Little Goose\L.Monumental\Ice Harbor Non-Power Penalties
56
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
57
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
STOP
58
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
Matrix generated.
March 31, 1994 08:48:48
Elapsed Time is 6 seconds or
0.10 minutes or
0.002 hours.
59
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
Time Frequency-
Parameter Series Duration
STOR Yes Yes
STOR_AVG No No
ELEV No No
EVAP(KAF) No No
EVAP No No
FLOW_IN Yes No
FLOW_IN(KAF) Yes No
ENERGY_GEN No No
POWER_CAP No No
FLOW_LOC No No
FLOW_LOC(KAF) No No
FLOW Yes Yes
FLOW(KAF) Yes Yes
FLOW_DIV No No
FLOW_DIV(KAF) No No
FLOW_NAT Yes No
FLOW_NAT(KAF) Yes No
{Print List of User's Nodes}
9 Nodes in this system
# ID Description
1 S_SOURCE
2 SINK
3 DWORSHAK_P Dworshak Reservoir Power Penalties
4 DWORSHAK Dworshak Reservoir Non-Power Penalties
5 SPALDING Spalding
6 BROWNLEE_P Brownlee, Oxbow, and Hells Canyon Power Penalties
7 BROWNLEE Brownlee, Oxbow, and Hells Canyon Non-Power Penalties
8 GRANITE_P L.Granite\Little Goose\L.Monumental\Ice Harbor Power Penalties
9 GRANITE L.Granite\Little Goose\L.Monumental\Ice Harbor Non-Power Penalties
Node: S_SOURCE
-------------------------------------------------------------------------------
Incoming Links
Link # Type From
------------------------------------------------------
Outgoing Links
Link # Type To
------------------------------------------------------
1 DIVR SINK
2 STO1 DWORSHAK_P
60
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
3 STO1 BROWNLEE_P
4 STO1 GRANITE_P
5 INFL DWORSHAK_P
9 INFL SPALDING
11 INFL BROWNLEE_P
15 INFL GRANITE_P
Node: SINK
-------------------------------------------------------------------------------
Incoming Links
Link # Type From
------------------------------------------------------
1 DIVR S_SOURCE
18 RREL GRANITE
Outgoing Links
Link # Type To
------------------------------------------------------
61
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
62
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
_______________________________________________________________________________
63
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
_______________________________________________________________________________
_______________________________________________________________________________
Start solution for hydropower iteration 1.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
March 31, 1994 08:49:42
Elapsed Time is 60 seconds or
1.00 minutes or
0.017 hours.
MIN COST = 0.100E-06 MAX COST = 0.149E+05
MIN CAP. = 0.500E+00 MAX CAP. = 0.100E+07
64
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
Start solution for hydropower iteration 2.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
March 31, 1994 08:50:02
Elapsed Time is 80 seconds or
1.33 minutes or
0.022 hours.
MIN COST = 0.100E-06 MAX COST = 0.149E+05
MIN CAP. = 0.470E+00 MAX CAP. = 0.100E+07
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
Start solution for hydropower iteration 3.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
March 31, 1994 08:50:22
Elapsed Time is 100 seconds or
1.67 minutes or
0.028 hours.
MIN COST = 0.100E-06 MAX COST = 0.149E+05
MIN CAP. = 0.902E+00 MAX CAP. = 0.100E+07
66
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
Start solution for hydropower iteration 4.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
March 31, 1994 08:50:39
Elapsed Time is 117 seconds or
1.95 minutes or
0.032 hours.
MIN COST = 0.100E-06 MAX COST = 0.149E+05
MIN CAP. = 0.565E+00 MAX CAP. = 0.100E+07
67
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
2.23 minutes or
0.037 hours.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
Start solution for hydropower iteration 5.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
March 31, 1994 08:50:58
Elapsed Time is 136 seconds or
2.27 minutes or
0.038 hours.
MIN COST = 0.100E-06 MAX COST = 0.149E+05
MIN CAP. = 0.496E+00 MAX CAP. = 0.100E+07
68
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
Start solution for hydropower iteration 6.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
March 31, 1994 08:51:17
Elapsed Time is 155 seconds or
2.58 minutes or
0.043 hours.
MIN COST = 0.100E-06 MAX COST = 0.149E+05
MIN CAP. = 0.156E+01 MAX CAP. = 0.100E+07
69
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
70
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
71
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
72
HEC-PRM User's Manual Chapter 5 - Example User Input & Output
Arc # From Node To Node Date Unit Cost Amp. Lower
Bound Upper Bound Flow
73
Chapter 5 - Example User Input & Output HEC-PRM User's Manual
74
HEC-PRM User's Manual Chapter 6 - Description of Sample Data for HEC-PRM
Sample 1 Read natural flow data formatted in NPD's HYSSR format and store in a DSS file
using program RDHYSR.
Read local inflow, depletions, and evaporation data formatted in MRD's format and
Sample 2
store in a DSS file using program RDATA0.
Compute the incremental local inflow from the "natural" flows stored in a DSS data
Sample 3
file using program MATHPK .
Edit the actual penalty function for June in the DSSPD input data file and store the
Sample 4
penalty function in a DSS data file using program DSSPD.
Sample 5 Execute HEC-PRM for a 20 year time window.
Execute MPKPRMPP to read the HEC-PRM input file and modify the MATHPK
Sample 6
macro file for the current system.
Sample 7 Execute MATHPK to Post-Process results from HEC-PRM.
Sample 8 Display HEC-PRM results using the post-processer PRMPP.
Sample 9 Read results from MRD's post-processor program "V1.exe" and store in DSS Data
File.
Each of these sample data sets is described below and the applicable file assignments are shown.
Sample 1 Description
Read "natural flow data" formatted in NPD's HYSSR format and store in a DSS file using
program RDHYSR.
75
Chapter 6 - Description of Sample Data for HEC-PRM HEC-PRM User's Manual
Example Execution:
RDHYSR I=SAMPLE1.RHI O=SAMPLE1.OUT H=SAMPLE1.DAT D=SAMPLE1.DSS
Sample 2 Description
Read local inflow, depletions, and evaporation data formatted in MRD's format and store in a
DSS file using program RDATA0.
Example Execution:
RDATA0 I=SAMPLE2.D0I O=SAMPLE2.D0O D=SAMPLE2.D0D DSS=SAMPLE2.DSS
Sample 3 Description
Compute the incremental local inflows from the "natural" flows stored in a DSS data file. This
sample uses the equivalent of the flows stored in Sample 1.
76
HEC-PRM User's Manual Chapter 6 - Description of Sample Data for HEC-PRM
Example Execution:
MATHPKI=SAMPLE3.MPE o=SAMPLE3.MPO T=SAMPLE3.MPT M=SAMPLE3.MAC
Sample 4 Description
Edit the actual penalty function for June in the DSSPD input data file and store the penalty
function in a DSS data file.
77
Chapter 6 - Description of Sample Data for HEC-PRM HEC-PRM User's Manual
Example Execution:
DSSPD I=SAMPLE4.PDI O=SAMPLE4.PDO DS=SAMPLE4.DSS
Figure 29. Sample 4 Menu (DSSPD, Stored Edited Penalty Function in DSS Data file)
Sample 5 Description
Execute HEC-PRM for a 20 year time window.
78
HEC-PRM User's Manual Chapter 6 - Description of Sample Data for HEC-PRM
Example Execution:
HECPRM I=SAMPLE5.PRI O=SAMPLE5.PRO R=SAMPLE5.DSS TS=SAMPLE5T.DSS PF=SAMPLE5P.DSS
Sample 6 Description
Execute MPKPRMPP to read the HEC-PRM input file and modify the MATHPK macro file for
the current system.
79
Chapter 6 - Description of Sample Data for HEC-PRM HEC-PRM User's Manual
Example Execution:
MPKPRMPP I=SAMPLE5.PRI M=SAMPLE6.MAC
Figure 31. Sample 6 Menu (MPKPRMPP, Modify MATHPK Macro for Post-Processing)
Sample 7 Description
Execute MATHPK to Post-process results from HEC-PRM. (The results from Sample 6 which
were written to file SAMPLE6.MAC are copied into "SAMPLE7.MAC". Normally, the same
file is used but they are separated here so that input and output are stored separately).
80
HEC-PRM User's Manual Chapter 6 - Description of Sample Data for HEC-PRM
Example Execution:
MATHPK I=SAMPLE7.MPI O=SAMPLE7.MPO T=SAMPLE7.MPT M=SAMPLE7.MAC
Sample 8 Description
Display HEC-PRM Results using the post-processer PRMPP.
Example Execution:
PRMPP SAMPLE5.PRI SAMPLE5.DSS PRMPPDEF.NLS
Sample 9 Description
Read results computed by MRD's simulation program ABS01 and post-processor "V1.EXE" and
store the results in a DSS data file. Due to the nature of V1.EXE, it must be executed four times.
Each time, a separate set of results are written to separate intermediate binary output files.
RDMATF is executed four times to store the results in a DSS Data File.
81
Chapter 6 - Description of Sample Data for HEC-PRM HEC-PRM User's Manual
Example Execution:
RDMATF O=SAMPLE9A.RDO DSS=SAMPLE9.DSS DM=SAMPLE9A.MAT
82
HEC-PRM User's Manual Chapter 7 - Recommended Pathname Part C
Part Description
A Leave blank.
B The maximum 10 character location identifier. Must be unique for each node. For
diversions only, part B consists of the "from" node identifier, followed by the dash
("-") character, followed by the "to" node identifier (e.g. S_SOURCE-S_SINK).
C Recommendations are below.
D For paired data, generally not used. For time series data, follows standard regular
interval time series convention, which is the starting date of the data block (e.g.,
01JAN1930).
E For penalty functions, contains the month or months for which edited functions
apply. For time series data, follows standard regular interval time series convention
(1MON).
F An alternative identifier (e.g., ALT1 for time series results) or a qualifier of penalty
functions (e.g., CRITERIA A).
HEC-PRM Pathname Part C For Regular Interval Time Series Input and
Output Data
Part C Data Units Description for Regular Interval Time Series Data
FLOW_IN cfs Total inflow to a location. HEC-PRM includes all
upstream releases, diversions, and local inflows.
FLOW_IN(KAF) kaf
FLOW_LOC cfs Incremental local inflow to location (all inflow above
location and below all upstream nodes).
FLOW_LOC(KAF) kaf
FLOW_NAT cfs Natural Flow at a location. Includes all runoff from
FLOW_NAT(KAF) kaf drainage area and may be adjusted for a level of
development and/or evaporation.
FLOW_DIV cfs Flow diverted from (to) this location. Pathname Part
FLOW_DIV(KAF) kaf B contains the "from" node and "to" node identifiers
(e.g. S_SOURCE-S_SINK).
FLOW cfs Reservoir outflow or flow leaving control point.
FLOW(KAF) kaf
FLOW_LEAK cfs Flow "leaking" from a link with amplitude (gain
FLOW_LEAK(KAF) kaf factor) not equal to 1.0. Applies to all non-
reservoir storage links (e.g. channel, reservoir
release, hydropower release links).
EVAP cfs Reservoir Pool evaporation. Applies to Reservoir
EVAP(KAF) kaf Storage Links only.
83
Chapter 7 - Recommended Pathname Part C HEC-PRM User's Manual
Part C Data Units Description for Regular Interval Time Series Data
EVAP_RATE inches/mo Reservoir Pool evaporation rate. Applies to reservoir
EVAP_RATE(FT) feet/mo storage links only.
CFS_KAF KAF/CFS Factor to convert flow in CFS into KAF per month by
multiplication. (Conversely, divide to convert KAF
into CFS).
Note: Italics denote items that can be computed and stored in the HEC-DSS data file by available
MATHPK macros.
84
HEC-PRM User's Manual Chapter 7 - Recommended Pathname Part C
Q-P_FDU cfs-k$ Flow penalty functions for urban flood damage, water
Q-P_WSP supply, and composite edited.
Q-P_EDT
Q(KAF)-P_FDU kaf-k$
Q(KAF)-P_WSP
Q(KAF)-P_EDT
Note: Italics denote items that can be computed and stored in the HEC-DSS data file by available
MATHPK macros.
85
Chapter 7 - Recommended Pathname Part C HEC-PRM User's Manual
86
HEC-PRM User's Manual Appendix A- References
APPENDIX A - References
Grygier, J.C., and Stedinger, J.R. (1985). "Algorithms For Optimizing Hydropower System Operation,"
Water Resources Research 21(1), 1-10.
Hadley, G. (1964). Nonlinear and Dynamic Programming. Addison-Wesley Publishing, Inc., Reading,
MA.
Hitch, C.J., and McKean, R. (1960). The Economics of Defense in the Nuclear Age. Harvard University
Press, Cambridge, MA.
Jensen, P.A., and Barnes, J.W. (1980). Network Flow Programming. John Wiley & Sons, New York,
NY.
Jensen, P.A., Bhaumik, G., and Driscoll, W. (1974). "Network Flow Modeling of Multireservoir
Distribution Systems," CRWR-107, Center for Research in Water Resources, University of
Texas, Austin, TX.
Martin, Q.W. (1982). "Multireservoir Simulation and Optimization Model SIM-V," UM-38, Texas
Department of Water Resources, Austin, TX.
Reznicek, K.K., and Simonovic, S.P. (1990). "An Improved Algorithm For Hydropower Optimization,"
Water Resources Research 26(2), 189-198.
87
Appendix A- References HEC-PRM User's Manual
88
HEC-PRM User's Manual Appendix B - Glossary
Appendix B - Glossary
ARC Connects two nodes of a network. In network-flow programming, each arc has three
parameters: a lower bound, which is the minimal amount that can flow along the arc; an upper
bound, which is the maximum amount that can flow along the arc; and a cost for each unit that
flows along the arc. Arcs of a generalized network also have an arc multiplier.
CHANNEL-FLOW LINK Represents the flow in a channel reach. A channel-flow link originates
at any non-reservoir node and terminates at any network node.
CONSTRAINT Limits the decision variables to their feasible or permissible values.
CONVEX FUNCTION A function f(X) for which the following is true for any two distinct points
X1 and X2 and for 0 < 8 < 1: f(8X1 + (1 - 8)X2) < 8f(X1) + (1 - 8)f(X2)
DECISION VARIABLE The unknowns which are to be determined from the solution of the
model.
DIVERSION LINK Carries flow out of the system. A diversion link originates at any system
node and terminates at the sink node.
FINAL-STORAGE LINK Carries flow out of the system, from a reservoir in the last period of
analysis. It originates at a reservoir node and terminates at the sink node.
GAIN A factor (multiplier) that transforms the amount of flow in an arc. The flow leaving the arc
equals the flow entering the arc times the gain. (The convention in HEC-PRM is for arc
capacity to apply to the flow entering the arc).
GENERALIZED NETWORK FLOW PROGRAM A generalized network flow program is a
network flow program in which arc flows have gains (multipliers) that are not equal to 1.0.
For arcs with non-unity gains, the flow leaving the arc equals the flow entering the arc times
the gain. If all gains are equal to 1.0, the problem is called a pure network flow program.
HYDROPOWER RESERVOIR-RELEASE LINK Represents the release from a hydropower
reservoir. The penalty function for a hydropower reservoir-release link depends on both the
release from the reservoir and the storage in the reservoir.
INFLOW LINK Brings flow into the reservoir-system network. An inflow link originates at the
source node and terminates at any system node.
INITIAL-STORAGE LINK Introduces to the network the volume of water initially stored in a
system reservoir. The initial-storage link originates at the source node and terminates at a
reservoir node in the first period of analysis only.
NETWORK A collection of arcs and nodes.
NETWORK-FLOW PROGRAMMING An optimization procedure for allocating flow along the
arcs of a network. Network-flow programming is a special class of linear programming.
NODE The junction of two or more network arcs. The node may represent a system reservoir,
demand point, channel junction, diversion point. The sum of flow in arcs originating at a node
equals the sum of flow in all arcs terminating at the node.
OBJECTIVE FUNCTION Defines the overall effectiveness of a system as a mathematical
function of its decision variables. The optimal solution to the model yields the best value of
the objective function, while satisfying all constraints.
PENALTY FUNCTION Defines the penalty for less-than-perfect operation as a function of flow,
storage, or both.
89
Appendix B - Glossary HEC-PRM User's Manual
90
HEC-PRM User's Manual Appendix C - Optimization Algorithms
Minimize:
m
∑c k
k fk (C-1)
subject to:
∑ f − ∑a
k k fk (for all nodes) (C-2)
k ∈ MO k ∈ MT
in which:
m = total number of network arcs;
ck = unit cost for flow along arc k;
fk = flow along arc k;
MO = the set of all arcs originating at a node;
MT = the set of all arcs terminating at a node;
ak = multiplier for arc k;
lk = lower bound on flow along arc k; and
uk = upper bound on flow along arc k.
Equations C-1, C-2, and C-3 represent a special class of linear-programming (LP) problem: the
generalized minimum-cost network-flow problem. Solution of the problem will yield an optimal
allocation of flow within the system.
3. Compute the arc marginal costs for all non-basic arcs. In any given iteration of the
solution algorithm, the non-basic arcs are generally those which have zero flow or flow at
the arc capacity. The marginal cost is the cost of increasing flow in the arc by one unit.
4. If all non-basic arc marginal costs satisfy the optimality conditions, stop; the optimal
solution has been found. Otherwise, select an arc to enter the basis.
5. Determine which arc will leave the basis, compute the new basic feasible solution, and
return to Step 2.
The algorithm proposed by Grygier and Stedinger (1985) is employed in HEC-PRM. This
algorithm solves the nonlinear problem as follows:
1. Initialize: Set ITER (iteration counter) = 0. Set ITMAX = the maximum number of
iterations allowed (must be > 1). Set CANDPEN (candidate optimal objective function
value) = a very large number. Set )Rmax = 0.50. Set Rj,upper = release corresponding to
maximum power generation at maximum head for reservoir j. ()Rmax and Rj,upper are used
in constraining release in step 3, and are subject to change as we collect information on
performance with alternative values.) For each reservoir j, for each period t, estimate Sj,t,
the end-of-period storage. Go to step 2.
2. Set Up the Network: Set ITER = ITER + 1. If ITER > ITMAX, declare the candidate
solution the optimal solution and stop. Otherwise, use the elevation-capacity function for
reservoir j to determine the end-of-period head. Average the beginning-of-period and
end-of-period heads. Select the "closest" user-provided linear approximation of the
combined release-storage penalty function for each period. Set up the system network
with arc bounds and costs to represent these combined penalty functions, along with flow
and storage penalty functions for other purposes. Go to step 3.
3. Limited Variation: If ITER = 1, go to step 4. Otherwise, constrain flow on the
reservoir release links so the total release does not vary from the candidate solution by
92
HEC-PRM User's Manual Appendix C - Optimization Algorithms
more than )Rmax. The link lower bound would be Rj,t(1 + )Rmax). If the candidate release
is zero, set the upper bound equal Rj,upper. Go to step 4.
4. Solve the Network: Solve the resulting flow-allocation problem to find CURRPEN, the
penalty associated with the current approximation. Use the best available network solver
at this step. If a previous network solution is available, and if the solver can use it as a
starting point, let it. Go to step 5.
5. Check for Solution to Nonlinear Problem: For each reservoir j, for each period t,
determine Sj,t-1 and Sj,t from the current solution of the network. Do these values differ
from the values used in step 2 to select the approximation? If all are close enough,
declare the current solution optimal and stop. Otherwise, go to step 6.
6. Update Candidate Solution: If CURRPEN < CANDPEN, it is an improvement, so save
the current solution (storages, releases, etc.) as the candidate optimal solution, set
CANDPEN = CURRPEN, and go to step 2. Otherwise, go to step 7.
7. Decrease the Allowable Variation: Set )Rmax = )Rmax/2. If )Rmax < minimum value,
declare the candidate solution optimal and stop. Otherwise, go to step 2.
93
Appendix C - Optimization Algorithms HEC-PRM User's Manual
94
HEC-PRM User's Manual Appendix D - Dual Cost Information
• Marginal (reduced) cost for each arc = the cost of a unit increase in arc capacity
• Dual value (shadow price) for each node = the cost of obtaining one additional unit of
flow at the node
The marginal (reduced) costs are labeled "MARG_COST" or "MARG_COST_S". In the absence
of degeneracy, all non-basic arcs (those with flows at their upper or lower bounds) should have
non-zero marginal costs, indicating the cost (benefit) of increasing the lower (upper) bound by
one unit. For a reservoir, two time series of marginal costs are output: "MARG_COST"
represents the marginal cost for the release link; and "MARG_COST_S" represents the marginal
cost for the storage link. Here, "link" is emphasized because of the minor complication arising
when links comprise parallel arcs (due to a piecewise linear cost function). In this case, HEC-
PRM outputs only the total flow on the link and, similarly, only the marginal cost for the link is
reported.
The dual values (shadow prices) at the nodes are labeled "DUAL_TERM" and
"DUAL_TERM_S" in the PRM output. These indicate the value (cost) of increasing (decreasing)
the node’s fixed external flow by one unit. Since all PRM output is labeled by arc in DSS, the
(arbitrary) choice was made to write the values for the terminal node of each arc. However, there
is also an option (hard-wired in the code) to print the values for the origin node of each arc.
These are appropriately labeled as "DUAL_ORIGIN" and "DUAL_ORIGIN_S". Again, for
reservoirs, the distinction is made between the terminal node of the release link
("DUAL_TERM") and the terminal node of the storage link ("DUAL_TERM_S"), which is
actually the origin node of the storage link in the next time period. Of course, in any given time
period, the origin node of the release link is the same as that of the storage link.
Considering an arc k from node i to node j, as shown in Figure 34, the arc marginal costs dk are
actually computed from the dual values (πi, πj), the arc unit cost ck, and the gain factor ak,
according to the following formula:
d k = π i + ck − ak π j
95
Appendix D - Dual Cost Information HEC-PRM User's Manual
As an example, consider the system shown in Figure 35with 4 nodes and 3 arcs. A consistent set
of dual information for this system is given in Error! Reference source not found.. In this case,
the "DUAL_TERM" values for the reservoir in the first and second time periods are 2.5 and –1.5,
respectively. "DUAL_TERM_S" for the reservoir in the first period equals –0.555.
96
HEC-PRM User's Manual Appendix E - MATHPK Macros
SET.F PL=84
!RUN DO_CHAN 'alternative'
SET.F PL=60
.. !RUN NPD_SYS 'alternative'
ENDMACRO
SET.F PL=46
CLEAR
TA.F-A V=
TA.FA
COM IXMON=$DATE(1MON,MONTH)
COM NUM_DAY_MON=$DATE(1MON,DAY)
.. compute FACTOR; converts cfs to kaf by multiplication
COM FACTOR=.00198347*NUM_DAY_MON
MACRO 50YR
TI 31JUL1928 2400 30JUN1978 2400
ENDMACRO
MACRO MONVARY
97
Appendix E - MATHPK Macros HEC-PRM User's Manual
PURGE V=PNLTY_FUNC
GET PNLTY_FUNC A= B=partB C=parameter-P_category D= E= F=pfalter file_index
ENDMACRO
MACRO MONVARY1
PURGE V=PJAN,PFEB,PMAR,PAPR,PMAY,PJUN,PJUL,PAUG,PSEP,POCT,PNOV,PDEC
GET PJAN A= B=partB C=parameter-P_category D= E=JAN F=pfalter file_index
GET PFEB A= B=partB C=parameter-P_category D= E=FEB F=pfalter file_index
GET PMAR A= B=partB C=parameter-P_category D= E=MAR F=pfalter file_index
GET PAPR A= B=partB C=parameter-P_category D= E=APR F=pfalter file_index
GET PMAY A= B=partB C=parameter-P_category D= E=MAY F=pfalter file_index
GET PJUN A= B=partB C=parameter-P_category D= E=JUN F=pfalter file_index
GET PJUL A= B=partB C=parameter-P_category D= E=JUL F=pfalter file_index
GET PAUG A= B=partB C=parameter-P_category D= E=AUG F=pfalter file_index
GET PSEP A= B=partB C=parameter-P_category D= E=SEP F=pfalter file_index
GET POCT A= B=partB C=parameter-P_category D= E=OCT F=pfalter file_index
GET PNOV A= B=partB C=parameter-P_category D= E=NOV F=pfalter file_index
GET PDEC A= B=partB C=parameter-P_category D= E=DEC F=pfalter file_index
98
HEC-PRM User's Manual Appendix E - MATHPK Macros
MACRO MONVARY3
MACRO MONVARY3 partB parameter category indep_var1 indep_var2 depend_var pfalter file_index
..Penalty function is stored in a separate path for each month with family of curves
.. indep_var1 is flow
.. indep_var2 is storage
..- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PURGE V=PJAN,PFEB,PMAR,PAPR,PMAY,PJUN,PJUL,PAUG,PSEP,POCT,PNOV,PDEC
GET PJAN A= B=partB C=parameter-P_category D= E=JAN F=pfalter file_index
GET PFEB A= B=partB C=parameter-P_category D= E=FEB F=pfalter file_index
GET PMAR A= B=partB C=parameter-P_category D= E=MAR F=pfalter file_index
GET PAPR A= B=partB C=parameter-P_category D= E=APR F=pfalter file_index
GET PMAY A= B=partB C=parameter-P_category D= E=MAY F=pfalter file_index
GET PJUN A= B=partB C=parameter-P_category D= E=JUN F=pfalter file_index
GET PJUL A= B=partB C=parameter-P_category D= E=JUL F=pfalter file_index
GET PAUG A= B=partB C=parameter-P_category D= E=AUG F=pfalter file_index
GET PSEP A= B=partB C=parameter-P_category D= E=SEP F=pfalter file_index
GET POCT A= B=partB C=parameter-P_category D= E=OCT F=pfalter file_index
GET PNOV A= B=partB C=parameter-P_category D= E=NOV F=pfalter file_index
GET PDEC A= B=partB C=parameter-P_category D= E=DEC F=pfalter file_index
.. ST.V4S
.. ST.T
99
Appendix E - MATHPK Macros HEC-PRM User's Manual
.. !IF('partB'.EQ.'BROWNLEE_P') THEN
.. SET.F TILN=1 TI=Computed data for partB
.. SET.F T=(F10.1)
.. TAB V=indep_var1 indep_var2 depend_var
.. SET.F P=(1X,I3,I8,15I10)
.. TAB V=PJAN PFEB PMAR PAPR PMAY PJUN PJUL PAUG PSEP POCT PNOV PDEC
.. !ENDIF
URGE V=PNLTY_FUNC_MAX, PNLTY_VALID
DEF.P V=PNLTY_FUNC_MAX(1,13)
COM PNLTY_FUNC_MAX(1, 2)=MAX(PJAN(,2))
COM PNLTY_FUNC_MAX(1, 3)=MAX(PFEB(,2))
COM PNLTY_FUNC_MAX(1, 4)=MAX(PMAR(,2))
COM PNLTY_FUNC_MAX(1, 5)=MAX(PAPR(,2))
COM PNLTY_FUNC_MAX(1, 6)=MAX(PMAY(,2))
COM PNLTY_FUNC_MAX(1, 7)=MAX(PJUN(,2))
COM PNLTY_FUNC_MAX(1, 8)=MAX(PJUL(,2))
COM PNLTY_FUNC_MAX(1, 9)=MAX(PAUG(,2))
COM PNLTY_FUNC_MAX(1,10)=MAX(PSEP(,2))
COM PNLTY_FUNC_MAX(1,11)=MAX(POCT(,2))
COM PNLTY_FUNC_MAX(1,12)=MAX(PNOV(,2))
COM PNLTY_FUNC_MAX(1,13)=MAX(PDEC(,2))
DEF.C V=PNLTY_VALID
COM PNLTY_VALID=0
COM IF(PNLTY_FUNC_MAX(, 2) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(, 3) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(, 4) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(, 5) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(, 6) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(, 7) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(, 8) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(, 9) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(,10) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(,11) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(,12) GT 0) PNLTY_VALID=1
COM IF(PNLTY_FUNC_MAX(,13) GT 0) PNLTY_VALID=1
.. ST.V4 V=PNLTY_VALID
.. TAB V=PNLTY_VALID
COM IF(PNLTY_VALID LT 0.5) depend_var=-903E30
ENDMACRO
MACRO HPA_NPD
PURGE V=depend_var
DEF.T E=1MON V=depend_var
COM depend_var=0
PURGE V=PJAN,PFEB,PMAR,PAPR,PMAY,PJUN,PJUL,PAUG,PSEP,POCT,PNOV,PDEC
GET PMAR A= B=partB C=parameter D= E=MAR_NOV F=pfalter file_index
GET PAPR A= B=partB C=parameter D= E=APR-MAY_OCT F=pfalter file_index
GET PJUN A= B=partB C=parameter D= E=JUN-SEP F=pfalter file_index
GET PDEC A= B=partB C=parameter D= E=DEC-FEB F=pfalter file_index
100
HEC-PRM User's Manual Appendix E - MATHPK Macros
.. ST.V4 V=PNLTY_VALID
.. TAB V=PNLTY_VALID
COM IF(PNLTY_VALID LT 0.5) depend_var=-903E30
ENDMACRO
MACRO MONSAME
PURGE V=PNLTY_FUNC
GET PNLTY_FUNC A= B=partB C=parameter-P_category D= E= F=pfalter file_index
COM depend_var=TABLE(indep_var,PNLTY_FUNC(,1),PNLTY_FUNC(,2))
COM IF(PNLTY_VALID LT 0.5) depend_var=-903E30
ENDMACRO
101
Appendix E - MATHPK Macros HEC-PRM User's Manual
MACRO CLASSDEF
102
HEC-PRM User's Manual Appendix E - MATHPK Macros
103
Appendix E - MATHPK Macros HEC-PRM User's Manual
MACRO DO_RES3
PUT FDA_POOL 1
PUT FDU_POOL 1
PUT FIS_POOL 1
PUT NAV_POOL 1
PUT REC_POOL 1
PUT WSP_POOL 1
PUT ACT_POOL 1
PUT EDT_POOL 1
PUT FDA_REL 1
PUT FDU_REL 1
PUT FIS_REL 1
PUT NAV_REL 1
PUT REC_REL 1
PUT WSP_REL 1
PUT ACT_REL 1
PUT EDT_REL 1
104
HEC-PRM User's Manual Appendix E - MATHPK Macros
PUT FDA_FLOW 1
PUT FDU_FLOW 1
PUT FIS_FLOW 1
PUT NAV_FLOW 1
PUT REC_FLOW 1
PUT WSP_FLOW 1
PUT ACT_FLOW 1
PUT EDT_FLOW 1
ENDMACRO
105
Appendix E - MATHPK Macros HEC-PRM User's Manual
106