Skip to content

Cycle lengths longer than the stage duration remove constraints without warning #159

Description

@erikfilias

Summary

When a cycle length is longer than the period being modelled, the corresponding constraints are
created with no rows. The model then solves and reports a lower cost, without any error or warning.
Two constraint groups are affected: the energy limits of a unit, and the energy outflows of a storage
unit.

Observed behaviour

Both cases below use the 7-day horizon of the existing test fixture, which is 84 load levels, and are
solved with Gurobi on 96c8d56a.

Case 1. The energy limit of a unit is ignored. Case 9n, with CCGT_4 limited to 100 MW through
VariableMaxEnergy.

Weekly cycle Monthly cycle
eMaximumEnergy rows 1 0
CCGT_4 output 16.8000 GWh 55.9730 GWh
Total cost 266.16022423 MEUR 238.51419065 MEUR

The limit is not applied, the unit produces 3.3 times the permitted energy, and the total cost is 10.4
per cent lower than it should be.

Case 2. The production requirement of an electrolyzer is ignored. Case 9n_H2, with the two
electrolyzers modelled as storage units with energy outflows of 9 MW each.

Weekly cycle Monthly cycle
eEnergyOutflows rows 2 0
Electricity consumed 3.0240 GWh 0.0000 GWh
Total cost 242.89492215 MEUR 238.51419065 MEUR

The electrolyzers stop consuming altogether, and the reported cost becomes that of a system without
them.

Expected behaviour

The condition is already documented in InputData.md, which states that the stage duration must be at
least as long as the shortest storage type, outflow type or energy type. A case that does not meet
this condition should therefore be rejected, or corrected, rather than solved with the affected
constraints absent.

Cause

Four cycle lengths are derived in openTEPES_DataConfiguration.py. Two are limited to the stage
duration and two are not.

Parameter Limited to stage duration Set Constraints
pStorageTimeStep Yes, line 514 nesc eESSInventory
pReservoirTimeStep Yes, line 541 Reservoir volume
pOutflowsTimeStep No neso, line 1239 eEnergyOutflows
pEnergyTimeStep No ngen, line 1240 eMinimumEnergy, eMaximumEnergy

Each set is formed from the condition ord(n) % <cycle> == 0. When the cycle exceeds the number of
load levels, no load level satisfies it, the set is empty, and the constraint is created with no rows.

Suggested resolution

Either apply the same limit to pOutflowsTimeStep and pEnergyTimeStep that lines 514 and 541 apply
to the other two, or raise an error when the documented condition is not met. An error is preferable,
since shortening the cycle silently replaces the requested cycle with a different one.

Reproduction

  1. Copy case 9n. Set VariableMaxEnergy for CCGT_4 to 100, and EnergyType to Monthly.
  2. Truncate Duration to the first 168 hours, as the test fixture does.
  3. Solve. The eMaximumEnergy constraint contains no rows and the limit has no effect.
  4. Repeat with EnergyType set to Weekly. The constraint contains one row and the limit applies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions