model¶
This module defines the PREP-SHOT model. The model is created using the pyoptinterface library.
- prepshot.model.create_model(params)[source]¶
Create the PREP-SHOT model.
- Parameters
params (dict) -- Dictionary of parameters for the model.
- Returns
Model object.
- Return type
object
- prepshot.model.define_active_zone_tech(model)[source]¶
Pull the sparse
(zone, tech)set frommodel.params(built once at file-read time byload_data.compute_active_zone_tech) and derive the time-indexed key lists used by the constraint builders.The (zone, tech) set itself is data-property (depends only on
existing_fleet+expansion_candidates), so we compute it inload_dataand reuse it unchanged across every PCM window. The (h, m, y, z, te) lists DO depend on the per-window time index sets, so they're materialised here.- Parameters
model (object) --
- Return type
None
- prepshot.model.define_basic_sets(model)[source]¶
Define sets for the model.
- Parameters
model (object) -- Model object to be solved.
- Return type
None
- prepshot.model.define_complex_sets(model)[source]¶
Pad
transmission_line_efficiencyfor the active line set.A few constraint rules read
efficiency[z1, z2]for every line inactive_lines; if the input CSV omits a line that DOES appear intransmission_existing(rare but possible), default its efficiency to 0. We no longer pad the densezone x zoneproduct -- the active-line set is sparse, so padding only touches the real lines.- Parameters
model (object) --
- Return type
None
- prepshot.model.define_constraints(model)[source]¶
Define constraints for the model.
- Parameters
model (object) -- Model to be solved.
- Return type
None
- prepshot.model.define_model(params)[source]¶
This function creates the model class depending on predefined solver.
- Parameters
params (dict) -- parameters for the model
- Returns
A pyoptinterface Model object depending on the solver
- Return type
object
- Raises
ValueError -- Unsupported or undefined solver