Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Inflow Non-Negativity Solution Methods

Purpose

This spec defines the four methods available for handling negative inflow realizations produced by the PAR(p) model, including their LP formulations, objective function modifications, and trade-offs.

1. Problem Statement

The PAR(p) model can generate negative inflow realizations:

When is sufficiently negative (e.g., ), the total can become negative, which is physically impossible.

2. Penalty Classification

The inflow non-negativity penalty is a Category 2 constraint violation penalty — it provides slack for a physical constraint (non-negative inflow) that may be impossible to satisfy under extreme noise realizations. Its position in the penalty hierarchy (see LP Formulation §1.5):

Since inflow is defined per stage (not per block), the inflow non-negativity penalty appears outside the block summation in the objective, alongside storage violation penalties:

where is the total stage duration in hours. The product converts the slack rate (m³/s) to an energy-equivalent dimension over the full stage.

3. Method: none

Configuration:

{ "modeling": { "inflow_non_negativity": { "method": "none" } } }

LP Formulation: Standard AR constraint (unchanged):

Implications:

  • LP may become infeasible when causes water balance violation
  • Useful only for debugging or when the AR model guarantees positive outputs
  • Not recommended for production

4. Method: penalty

Configuration:

{
  "modeling": {
    "inflow_non_negativity": {
      "method": "penalty",
      "penalty_cost": 1000.0
    }
  }
}

Additional Variables:

VariableDomainUnitsDescription
m³/sInflow non-negativity slack

Modified AR Constraint:

Interpretation: When the AR model produces negative , the slack absorbs the violation, making the effective inflow:

Objective Function Addition (outside block summation):

where is the penalty cost (default: 1000 $/(m³/s·h)) and is the total stage duration in hours.

Advantages:

  • LP always feasible
  • Clear cost signal for negative inflow events
  • Preserves AR dynamics for positive realizations

Disadvantages:

  • Adds variables and constraints
  • Slightly affects marginal water values

Recommended for most production cases.

5. Method: truncation

Configuration:

{ "modeling": { "inflow_non_negativity": { "method": "truncation" } } }

Scenario Generation:

LP Formulation: Standard AR constraint with the already-truncated value:

Advantages:

  • No additional LP variables or constraints
  • Straightforward formulation

Disadvantages:

  • Biases the distribution: Shifts mean upward
  • Breaks AR dynamics: When truncation occurs, temporal correlation is disrupted
  • May affect long-term storage dynamics

6. Method: truncation_with_penalty

Configuration:

{
  "modeling": {
    "inflow_non_negativity": {
      "method": "truncation_with_penalty",
      "penalty_cost": 1000.0
    }
  }
}

Description: Hybrid approach that truncates the final inflow but penalizes the statistical violation in the noise term. Based on the YP_FINF slack in SPARHTACUS/SPTcpp.

Additional Variables:

VariableDomainUnitsDescription
-Noise adjustment slack (dimensionless)

Modified AR Constraint (in two parts):

Part A — Modified noise term:

where is the original (possibly very negative) noise realization.

Part B — Inflow with adjusted noise:

Non-negativity constraint:

Interpretation: The optimizer chooses to be the minimum adjustment needed to make :

Objective Function Addition (outside block summation):

The penalty is proportional to , which is the actual inflow adjustment in m³/s. Note that varies by season, so the effective penalty for a given noise adjustment is larger in high-variability seasons and smaller in low-variability seasons. This is by design — a given noise adjustment represents a larger physical inflow correction when is large.

Advantages:

  • Preserves AR model structure better than pure truncation
  • Penalty signals statistical violation severity
  • Effective inflow is always non-negative

Disadvantages:

  • More complex formulation
  • Requires careful interaction with noise generation

Implementation variant: The implementation combines Truncation clamping with Penalty slack columns, matching SPTcpp’s truncamento_penalizacao mode. Specifically: the PAR(p) noise is clamped outside the LP (identical to the truncation method, so the inflow patched into the LP is never negative), and penalty slack columns are added to the LP (identical to the penalty method, allowing the solver to relax the non-negativity if cost-effective). This differs from the dimensionless formulation described above, which adjusts the noise term inside the LP. The formulation above is the reference design; the implementation uses the simpler clamping+slack approach because it reuses the existing Truncation and Penalty machinery without requiring a separate noise-adjustment constraint. The two approaches are economically equivalent when the penalty cost is set to the same value.

7. Comparison Summary

MethodLP SizeBiasAR PreservationFeasibilityRecommendation
noneBaseNoneFullMay failDebugging only
penalty+vars/consMinimalFullGuaranteedProduction
truncationBaseUpwardPartialGuaranteedQuick studies
truncation_with_penalty+vars/consMinimalFullGuaranteedRisk-averse

8. Reference

Larroyd, P.V., Pedrini, R., Beltran, F., Teixeira, G., Finardi, E.C., & Picarelli, L.B. (2022). “Dealing with Negative Inflows in the Long-Term Hydrothermal Scheduling Problem.” Energies, 15(3), 1115. https://doi.org/10.3390/en15031115

Cross-References

  • LP Formulation — Objective function structure and penalty taxonomy where is a Category 2 constraint violation penalty
  • PAR Inflow Model — Defines the PAR(p) model that produces the inflow realizations handled here
  • Penalty System — Penalty hierarchy and cascade resolution
  • Scenario Generation §2.3 — The noise term in the inflow equation comes from the fixed opening tree (pre-generated noise vectors), not from per-iteration random sampling
  • Notation Conventions — Defines the inflow slack variable and related notation
  • Configuration Reference — Runtime configuration for modeling.inflow_non_negativity