ExplanConstraints Class¶
The ExplanConstraints class defines constraints to be considered in the QuESt Planning optimization model. It contains methods for various constraints, including energy storage, thermal and renewable generation, policy constraints, transmission constraints, power balance, and investment constraints.
Authors: C. Newlun and W. Olis
Class Initialization¶
- class ExplanConstraints¶
Initializes the ExplanConstraints class.
- Parameters:
data_handler: An instance of the ExplanDataHandler class to provide data and configurations for the constraints.
- Attributes:
_scenario: The scenario defined in the data_handler.
data_handler: Reference to the data handler instance.
index: Index of the data loaded by the data handler.
start_hr, end_hr: Start and end hours for constraints.
ini_level: Initial energy storage state of charge.
year_gap, year_gap_array: Defines year gaps for weighting.
tax_credit_end_year, total_itc, total_ptc: Tax credit details.
system: System name from the data handler.
Tuples for various generator types (e.g., storage_tuple, thermal_tuple, etc.).
Public Methods¶
- set_expressions(model)¶
Sets expressions for the optimization model, grouping constraints by category.
- Parameters:
model: Pyomo optimization model instance.
- Example Usage:
>>> constraints.set_expressions(model)
- energy_storage_constraints(model)¶
Defines energy storage-related constraints for the optimization model.
- thermal_generator_constraints(model)¶
Defines thermal generation-related constraints for the optimization model.
- renewable_generator_constraints(model)¶
Defines renewable generation-related constraints for the optimization model.
- policy_constraints(model)¶
Defines policy-related constraints such as CO2 emissions and renewable portfolio standards.
- transmission_constraints(model)¶
Defines transmission-related constraints for the optimization model.
- power_balance_constraints(model)¶
Ensures power balance across the system in the optimization model.
- investment_constraints(model)¶
Enforces constraints on investments in generation and transmission capacity.
- reliability_and_resilience_constraints(model)¶
Defines reliability and resilience-related constraints.
- dr_and_ee_constraints(model)¶
Defines demand response and energy efficiency constraints.
- obj_and_cost_breakdown(model)¶
Defines the objective function and cost breakdown for the optimization model.
Constraint Rules¶
The ExplanConstraints class includes numerous constraint rules, such as:
Energy Storage: cSOC_old, cChDsch, cSOCmax, cSOCmin, cStoremax, cStoremin, etc.
Thermal Generators: cThermMax, cThermMin, cThermRup, cThermRdwn, etc.
Renewables: cPVExist, cPVCand, cWindExist, cWindCan, cCurtMax, etc.
Policy Constraints: cRPS, cCO2emm, cCO2emmLimit, etc.
Transmission: cTxFlwFw, cTxFlwBw, cDCPF, etc.
Power Balance: cPwrBal, cPwrBal_CopperSheet, etc.
Investment: cPCapTotal, cStoreCapTotal, cRetirements, etc.
Objective Function: cOBJ.
API Reference¶
For a detailed reference of all methods, attributes, and inherited properties, refer to the autodoc-generated content below.
QuESt Planning - explan constraints to be considered in the model Authors: C. Newlun and W. Olis
- class quest_planning.explan.explan_constraints.ExplanConstraints(data_handler)[source]
Bases:
object
- cBusInvMaxAnnual(model, b, g, y)[source]
Planning horizon investment constraints
- cBusInvMaxTotal(model, b, g)[source]
Maximum invested cumulative capacities of candidate technologies by bus
- cCO2emm(model, b, g, y)[source]
CO2 emission constraint - carbon intensity calculations
- cCO2emmLimit(model, y)[source]
CO2 emission-free generation (% of generation)
- cCO2int(model, y)[source]
CO2 emission constraint - carbon intensity calculations
- cCO2intLimit(model, y)[source]
CO2 emission constraint - carbon intensity calculations
- cChDsch(model, b, g, y, s, i)[source]
This enforces that the sum of the charge/discharge power and reserves does not exceed the cumulative invested power size of the ES
- cCurtMax(model, b, g, y, s, i)[source]
Limit curtailment to only renewable generators
- cDCPF(model, l, y, s, i)[source]
DC Power Flow Constraint Under construction; add self.mva_base
- cDRMax(model, b, g, y, s, i)[source]
Demand response limits
- cDRSystMax(model, b, g)[source]
Demand response limits TODO: fix constraint
- cDRgenMax(model, b, g, y, s, i)[source]
Demand response limits TODO: fix constraint
- cDRnoAnc(model, b, g, y, s, i)[source]
Demand response limits TODO: fix constraint
- cDRnoInv(model, b, g, y)[source]
Demand response limits TODO: fix constraint and remove hard code
- cDRopMax(model, b, g, y)[source]
Demand response limits TODO: fix constraint
- cESReplaceCost(model, b, g)[source]
Energy storage lifetime extension costs for each storage device
- cESReplaceCostSum(model)[source]
Total energy storage lifetime costs
- cFOMCostAnnual(model, y)[source]
Define annual fixed operating & maintenance costs
- cFuelCostAnnual(model, y)[source]
Define annual fuel costs
- cGenInvCostAnnual(model, y)[source]
Define annual generation investment costs
- cITCAnnual(model, y)[source]
Define investment tax credit incentives
- cLNSCostAnnual(model, y)[source]
Define load shed penalty cost
- cLNSMax(model, b, y, s, i)[source]
Ensure load shed does not exceed the demand for that time step
- cNGH2Costconv(model, y)[source]
Define hydrogen conversion costs Optional cost
- cNonES(model, b, g, y, s, i)[source]
Ensures ES has no P_gen and no gen has Pcha and Pdis Optional constraint
- cOBJ(model)[source]
Define objective function to mimimize
- cPCapTotal(model, b, g, y)[source]
Cumulative generation capacity TODO: address with lead times for technologies
- cPFlexMax(model, b, g, y, s, i)[source]
Ramping constraints - Flexibility – Upper Bound
- cPFlexMin(model, y, s, i)[source]
Ramping constraints - Flexibility – Lower Bound
- cPRM(model, y)[source]
Planning reserve margin constraint TODO: Add piecewise ELCC or dynamic elcc curves for PRM calculations OR Seasonal ELCC
- cPRegMax(model, b, g, y, s, i)[source]
Ramping constraints - Regulation - 5min – Upper Bound
- cPRegMin(model, y, s, i)[source]
Ramping constraints - Regulation - 5min – Lower Bound
- cPSpinMax(model, b, g, y, s, i)[source]
Ramping constraints - Spinning - 10min – Upper Bound
- cPSpinMin(model, y, s, i)[source]
Ramping constraints - Spinning - 10min – Lower Bound
- cPTCAnnual(model, y)[source]
Define production tax credit incentives
- cPVCand(model, b, g, y, s, i)[source]
Candidate PV generator dispatch
- cPVExist(model, b, g, y, s, i)[source]
Existing PV generator dispatch
- cPwrBal(model, b, y, s, i)[source]
Power Balance constraint TODO: remove for and if statements as they are expensive in pyomo
- cPwrBal_CopperSheet(model, y, s, i)[source]
Power Balance constraint - copper sheet
- cRPS(model, y)[source]
Renewable portfolio standard constraint
- cRenAnnual(model, b, g, y)[source]
Annual renewable generation calculation
- cResourceByBus(model, b, g)[source]
Custom constraint
- cRetirements(model, b, g, y)[source]
P_cap_total calculations & generation retirements
- cSOC_old(model, b, g, y, s, i)[source]
Energy Storage SOC calculation
TODO: add regulating reserves into this calculation
- cSOCmax(model, b, g, y, s, i)[source]
SOC has to be less than or equal to the battery’s upper limit- KEEP CJN
- cSOCmin(model, b, g, y, s, i)[source]
SOC has to be greater than or equal to the battery’s lower limit
- cSlackBus(model, b, y, s, i)[source]
Define slack bus TODO: define in data_handler
- cStoreCapTotal(model, b, g, y)[source]
Cumulative ES energy capacity TODO: address with lead times for technologies
- cStoremax(model, b, g, y)[source]
Define Max energy storage capacity
- cStoremin(model, b, g, y)[source]
Define minimum energy storage capacity
- cSystGasMax(model)[source]
Maximum system gas capacity
- cSystPVMax(model)[source]
Maximum system solar capacity
- cSystWindMax(model)[source]
Maximum system wind capacity
- cTechAvail(model, b, g, y)[source]
Ensure technology is not invested before its availability year
- cThermMax(model, b, g, y, s, i)[source]
Thermal generation limit - upper bound thermal_tuple is optional
- cThermMin(model, b, g, y, s, i)[source]
Enforce thermal generation minimum stable level
- cThermRdwn(model, b, g, y, s, i)[source]
Ramping constraint for each generator - ensures adequate ramp down - only valid for hourly simulation
- cThermRup(model, b, g, y, s, i)[source]
Ramping constraint for each generator - ensures adequate ramp up - only valid for hourly simulation
- cThetaDiffMax(model, l, y, s, i)[source]
Bounds on phase angle difference when running DC power flow
- cThetaDiffMin(model, l, y, s, i)[source]
Bounds on phase angle difference when running DC power flow
- cTotalCostAnnual(model, y)[source]
Define total annual costs
- cTxCapInvMax(model, l)[source]
Enforce candidate line investment capacity
- cTxCapSystMax(model)[source]
Enforce system-wide transmission investment capacity
- cTxCapTotalnoDelay(model, l, y, y1)[source]
Transmission total invested capacity calculation
- cTxCapTotalwDelay(model, l, y)[source]
TODO: Optional constraint
- cTxFlwBw(model, l, y, s, i)[source]
Backwards flow constraint
- cTxFlwFw(model, l, y, s, i)[source]
Transmission forward flow constraint with pipe and bubble OR DC-power flow
- cTxInvCostAnnual(model, y)[source]
Define annual transmission investment costs
- cVOMCostAnnual(model, y)[source]
Define annual variable operating & maintenance costs
- cWindCan(model, b, g, y, s, i)[source]
Candidate Wind generator dispatch
- cWindExist(model, b, g, y, s, i)[source]
Existing Wind generator dispatch
- constraint1_i(model, b, g, y)[source]
Define model.Store – the energy capacity Optional constraint
- dr_and_ee_constraints(model)[source]
Define the demand response and energy efficiency constraints of the optimization model
- energy_storage_constraints(model)[source]
Define the energy storage constraints of the optimization model
- investment_constraints(model)[source]
Define the investement constraints for generation and transmission of the optimization model
- obj_and_cost_breakdown(model)[source]
Define the objective and cost breakdown constraints of the optimization model
- policy_constraints(model)[source]
Define the policy constraints of the optimization model
- power_balance_constraints(model)[source]
Define the power balance constraints of the optimization model
- reliability_and_resilience_constraints(model)[source]
Define the reliability and resilience constraints of the optimization model
- renewable_generator_constraints(model)[source]
Define the renewable generation constraints of the optimization model
- property scenario
Define scenario - check if we need
- set_expressions(model)[source]
Set expressions for optimization model
- thermal_generator_constraints(model)[source]
Define the thermal generation constraints of the optimization model
- transmission_constraints(model)[source]
Define the transmission constraints of the optimization model