Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Junctions and junction gates

Open in vLab iLab Assistant

This example illustrates how simple tunnel junctions can be modelled with the tunnel object, and can be an illustrative guide for how to replace the old junction and junction_gate objects in existing SHOP datasets.

The model setup for this example is available in the following format:

Run a simple junction model

First we build a new model with one plant below two reservoirs connected with three tunnels. Note that the main tunnel of the plant is explicitly modelled as a tunnel object, and the main_loss of the plant is therefore set to zero.

Loading...

The basic junction model is optimized and the objective function is saved for later comparison.

The plots below show the reservoir level of both reservoirs and the tunnel flow in all three tunnels. There is only equalizing flow between the two reservoirs in the beginning with no flow through the power station. Then the power station is turned on by the end of the optimization period and draws water from both reservoirs. Reservoir2 is completely drained by the end of the optimization horizon, while Reservoir1 still has water left. The market price is high compared to the water value of the reservoirs, so this behaviour is expected.

Loading...
Loading...

Optimizing a binary gate in the junction

The same model is built again, but now a binary gate is added to Tunnel2. The gate_opening_curve and initial_opening are the only required input for defining a binary gate. If the gate can be operated in a continuous fashion, the continuous_gate identifier can be set on the tunnel. Note that optimizing the gate position of binary gates can be a computationally heavy task, even for relatively simple systems. Continuous gates do not come with the same computational complexity, but the solution could be prone to flipping between similar states from one SHOP iteration to the next. Adding a gate_adjustment_cost will penalize the change of gate position from one time step to the next, and could help reduce calculation time for binary gates and the flipping of solutions for continuous gates, though its effectiveness is case-dependent. Another trick could be to set the CPLEX parameter “MIP Emphasis switch” (id 2058) to focus on creating a tighter best bound of the MIP solution (value 3). This is sometimes beneficial in gate optimization problems, and can be set with the generic cplex_int_params attribute on the global_settings object.

The old junction_gate object did not allow for optimizing the gate position but relied on gate schedules as input to decide which tunnel arms were open and closed. This can also be done for tunnels with gates by setting the gate_opening_schedule attribute, which will avoid the computational problems that comes with optimizing the gate position.

Improved net income when optimizing junction gate: 2591.10€

Allowing the gate on the tunnel between Reservoir2 and the junction to be opened and closed improved the objective function, as expected. The plant can now increase the amount of power produced by running for several additional hours in the beginning of the optimization. When Reservoir2 is completely drained, the gate is closed so that the plant can continue to drain Reservoir1. Both reservoirs are completely drained by the end of the optimization, unlike the first run without any gate control.

Loading...
Loading...
Loading...