Info | ||
---|---|---|
| ||
This function is not available in Source (public version). |
Introduction
Linear programming techniques assume that the data used is perfect. In particular, when activating these features, you are assuming that the objective function and constraint coefficients are correct, rather than the best estimates available. If this assumption does not hold, the solutions found may be sub-optimal.
...
Solvers use arc-node networks as their inputs. Source creates arc-node networks automatically for each time-step from the node-link network in the Schematic Editorthe Schematic Editor. There may be differences between the solution found by the solver ("as predicted") and flows as modelled during the flow phase ("as released"). The flow distribution phase resolves these differences by considering the ordering phase as having provided a minimum target to aim for. The optimum flow for each arc is determined by the netLP so that water will flow along the least cost pathway.
About costs
The solvers use a scheme of costs to determine optimal flows. Costs can To choose network linear programming as the ordering algorithm, choose Edit » Scenario Options Ordering Algorithm. This opens the Ordering Algorithm section of Scenario Options (Figure 1). To configure netLP, choose Iterative solution to network linear program, this will make the rest of the display active and allow you to configure options for netLP.
Figure 1. Enabling ordering
About costs
The solvers use a scheme of costs to determine optimal flows. Costs can range from -1.1E13 through to +1.1E13. The larger the cost, the greater the disincentive for water to flow along an arc. Conversely, the smaller the cost, the greater the incentive for water to flow along an arc. For example, in the above list of solver priorities, satisfying evaporative and transmission losses have the lowest cost, and therefore the highest incentive, in any model. The question of relative costs becomes relevant when defining cost functions for storages that are being operated in harmony.
...
- RELAX-IV is generally faster than PPRN, particularly when PPRN is being run without side constraints. However, under certain circumstances, both PPRN without side constraints and RELAX-IV may become bogged down in excessive iteration;
- PPRN supports side constraints. RELAX-IV does not*. If side constraints are crucial to the correct outcome, or to avoid sub-optimal solutions, or to control excess iteration, RELAX-IV can not be used; and
- PPRN uses real numbers (at the precision of the underlying hardware) whereas RELAX-IV works with integers. Selecting the RELAX-IV algorithm implies integer conversion of the real numbers used internally by Source, during the optimisation process. Conversion implies rounding. Source scales values automatically before sending them to RELAX-IV to minimise loss of precision, and reconverts results returned by the solver to the proper range.
...
Info | ||
---|---|---|
| ||
Note: You should not change the solver algorithm once your model has been calibrated. Changing the solver algorithm will invalidate your calibration. |
About side constraints*
Side constraints are implemented by translating between requirements set in various nodes and links in the Schematic Editor to the arcs and nodes used by the solver. In other words, you do not need to do anything to configure side constraints. Simply choosing PPRN with side constraints activates the necessary translations. For example, a Loss node creates an arc with high incentive that forces the solver to accept a particular loss.
...
- Head versus outlet capacity relationships for storages, providing that the change in head across a single time-step does not also cause a change in the linear relationship (cross a control point in a piecewise linear function);
- Flow dependencies that cause excess iteration; and
- Circular constraints that prevent the solver from converging on an optimal solution.
Configuring optimisation
...
*side constraints have not yet been fully implemented and tested in Source
Anchor | ||||
---|---|---|---|---|
|
To configure optimised ordering, begin by choosing Edit » Ordering Network Costs... or click Configure Ordering on the Ordering toolbar and choose Network Costs.... This opens the Network costs dialog (Figure 1).
Figure 1. Network costs (summary)
Creating cost functions
...
Figure 2. Network Costs (Storage Break Points)
Note |
---|
Although you can define storage breakpoints for storage A in terms of storage B, you should avoid doing so because it can lead to infeasible solutions. |
...
A more formal specification of the cost calculation is:
Equation 1 |
---|
...
Recall that negative costs are incentives. Accordingly, in this table, the greatest incentive is to retain any water in the bottom-most 10% of the capacity of the storage (for carry-over to the next time-step), followed by the water in the next 40% of the capacity of the storage. By interleaving base costs and increment values, releases from multiple storages can be controlled quite precisely to maintain a desired balance.
...
Table 1. Storage breakpoints (data file format)
Row | Column (comma-separated) | |
---|---|---|
1 | 2 | |
1 | Carry over number | Active storage (%) |
2..n | n | point |
where:
n is an integer in the range 1..n representing the carry-over number.
...
Table 2. Storage cost functions (example)
Storage Carryover Arc | Storage 1 | Storage 2 | ||
---|---|---|---|---|
Base Cost | -11000 | Base Cost | -11001 | |
Increment | 2 | Increment | 2 | |
Storage % | Arc Cost | Storage % | Arc Cost | |
1 | 5.6 | -11000 | 7.4 | –11001 |
2 | 11.1 | -10998 | 14.8 | –10999 |
3 | 16.7 | –10996 | 22.2 | –10997 |
4 | 22.2 | –10994 | 29.6 | –10995 |
5 | 27.8 | –10992 | 37.0 | –10993 |
6 | 33.3 | –10990 | 44.4 | –10991 |
7 | 38.9 | –10988 | 51.9 | –10989 |
8 | 44.4 | –10986 | 59.3 | –10987 |
9 | 50.0 | –10984 | 66.7 | –10985 |
10 | 100.0 | –10982 | 100.0 | –10983 |
The result of the design intention is shown in Figure 3. Note that, in the absence of any inflows that replenish the storages, the X-axis can also be interpreted as expressing time.
Figure 3. Carryover Arc Costs vs Storage Volume
Applying cost functions
...
Figure 4. Network costs (Storage targets)
You can also import storage targets from a .CSV file. The format of the file is shown in Table 3. Note that the column ordering in the .CSV file does not match the display in Figure 4.
Table 3. Storage targets (data file format)
Row | Column (comma-separated) |
---|
1 | 2..13 | |
1 | Storage | month |
2..n | sname | cname |
Where
month is the first three characters of the month of the year (eg “Feb”)
...
Figure 5. Network costs (Demand priorities)
You can control the order in which shortfalls are satisfied. The Priority column in Figure 5 shows which demand component of the model has will receive water via its shortfall arcs.
...
Table 4. Demand priorities (data file format)
Row | Column (comma-separated) | ||
---|---|---|---|
1 | 2 | 3 | |
1 | Demand | Priority | Computation Sequence |
2..n | sname | pri | seq |
where:
sname is the name of the supply point
...
Table 5. Shortfall arc costs (example)
Scenario | Supply point | Priority | Computation sequence | Shortfall arc | Satisfaction order | |
---|---|---|---|---|---|---|
Number | Cost | |||||
A | 1 | 1 | 1 | 1 | 11000002 | 2 |
2 | 11000004 | 4 | ||||
3 | 11000006 | 6 | ||||
4 | 11000008 | 8 | ||||
2 | 1 | 2 | 1 | 11000001 | 1 | |
2 | 11000003 | 3 | ||||
3 | 11000005 | 5 | ||||
4 | 11000007 | 7 | ||||
B | 1 | 1 | 2 | 1 | 11000001 | 1 |
2 | 11000003 | 3 | ||||
3 | 11000005 | 5 | ||||
4 | 11000007 | 7 | ||||
2 | 1 | 1 | 1 | 11000002 | 2 | |
2 | 11000004 | 4 | ||||
3 | 11000006 | 6 | ||||
4 | 11000008 | 8 | ||||
C | 1 | 2 | 1 | 1 | 11000001 | 1 |
2 | 11000002 | 2 | ||||
3 | 11000003 | 3 | ||||
4 | 11000004 | 4 | ||||
2 | 1 | 1 | 1 | 11000005 | 5 | |
2 | 11000006 | 6 | ||||
3 | 11000007 | 7 | ||||
4 | 11000008 | 8 |
NetLP ordering at nodes
In Source, networks are composed of arcs which have maximum capacities and costs associated with them. These costs can either be positive (disincentive) or negative (incentive). The optimum flow for each arc is determined by the netLP so that water will flow along the least cost pathway.
Storage node
While the minimum and maximum order times have to be calculated upstream of each relevant node to the relevant storages, the system also has to calculate the downstream order time which is the timeframe time frame over which the node must forecast the downstream orders for in advance.For the splitter node, in the netLP order phase,
Info | ||
---|---|---|
| ||
Note: In a netLP system, refer to Operating targets when setting up a storage node. |
Controlled splitter node
For the splitter node, in the netLP order phase, the main stream has two parallel arcs - a forced flow arc and the natural flow arc. The capacity of the forced flow arc in the mainstream is the opposing flow volume of the maximum effluent flow. The maximum effluent flow is dependant on the inflow to the controlled splitter node. The effluent side of the controlled splitter also has a forced and a natural flow arc, with the capacity of the forced flow arc the minimum volume of flow down the effluent side.
...
To ensure that the above are met, you can configure each of the branches with a cost incentive. In a maximum flow constraint node that is immediately below the controlled splitter on one side of the stream, this will ensure that the flow rules are met. The maximum flow constraint should be configured with parallel arcs with either a cost for flowing water down the effluent or a cost incentive for flowing water down the main stream. The cost should be small, to ensure that the overall cost structure of the network is not impacted too much. Figure 12 shows 9 shows an example of this.
Inspecting an arc-node network (simple)
It is possible to inspect textual representations of the arc-node networks that are generated by Source for processing by the solver. The steps are:
- Select the active scenario in the Project Hierarchy (Project Explorer);
- Locate the Arc-Node Network entry in the Model Parameters list (also Project Explorer) and enable it for recording;
- Run the scenario; and
- In the Values column of the Recording Manager (Complex time series, summary), locate and open View Multiple Supply Path Setup. The window will be similar to Figure 6.
Figure 6 is a work in progress so most of the labels are inaccurate. The graph provides a measure of computational complexity (iterations to solve) at each time-step. Note that the peaks are clipped to the value of the Maximum Iterations parameter in this dialog.
Figure 6. Inspecting the generated arc-node model
Clicking any point in the time line causes a textual representation of the arc-node model for that time-step to be displayed in the upper part of the window. The text can be selected and placed on the clipboard for re-use.
Note that it is beyond the scope of this guide to explain the format of the arc-node model dump.
Inspecting an arc-node network (advanced)
It is also possible to visualise the arc-node networks that are generated by Source. However, you will first need to download and install a third-party software package called Graphviz. The home page for this application is:
Choose the current stable release in preference to any development snapshots. Consult your Windows system administrator if you need help installing Graphviz.
To enable debugging and visualisation support in Source:
- Choose Edit » Ordering Algorithm...;
- Enable Export iterations;
- If your model operates over a large number of time-steps, you may wish to restrict the date-range for which arc-node output is produced using the Start and End date controls in this dialog; and
- Click OK.
Next, run your model. Enabling Export iterations creates a folder on your Desktop with a name in the pattern:
MspNetworkOutput-yyyy-mm-dd
At the end of a run, this folder will contain three files per time-step:
- A visual representation (.DOT) of the arc-node network suitable for display in Graphviz;
- A textual representation of the arc-node network; and
- A textual representation of the test case for that time-step.
Info | ||
---|---|---|
| ||
Note: You should avoid double-clicking files with a .DOT extension. You may find that files with a .DOT extension will launch Microsoft Word rather than Graphviz. |
To visualise an arc-node network for a given time-step:
- Use the Windows Start menu to launch Gvedit, which is part of Graphviz;
- Choose File » Open and select the .DOT file of interest. Gvedit will respond by opening a textual representation of the arc-node network as shown in the central window in Figure 7; and
- Click the Run button on the Gvedit toolbar (Figure 7).
Figure 7. Gvedit (opening an arc-node network)
Graphviz always generates a graphical representation of your arc-node network in two forms. One is displayed on your screen and the other is saved as a file. By default, the version saved as a file is in .GIF format but you can change this using the Output File Type pop-up menu in Figure 8. Note that Graphviz can also generate high-resolution vector-based representations such as .SVG.
By default, the file is saved in the same folder as the original .DOT file. You can change this by clicking the ellipsis button (...) to the right of the Output File Name field in Figure 8.
Figure 8. Graphviz settings dialog
Once the settings have been configured to your requirements, click OK. Figure 9 is an excerpt from an arc-node network diagram produced by Graphviz. The elements inside the blue rectangle correspond with a Splitter node in the original Source schematic.
Figure 9. NetLP arc-node network for Splitter node
Info | ||
---|---|---|
| ||
Note: Ensure that the forecast supply is greater than the total order size. If this is not the case, the following error message will occur at the first node that this occurs at: Forecast supply greater than total order size in interpretation of network LP. Try checking inflow forecasts at inflow nodes, and that all confluence inputs are defined to be regulated. |
Troubleshooting It is possible to visualise the arc-node networks that are generated by Source using third party software. For more information please see: Troubleshooting and Debugging