From 4ba9e991a3dabc1b016f1e94a47245ce3a76d4ae Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Mon, 11 Nov 2024 12:23:35 +0000 Subject: [PATCH] build based on 7fba689 --- dev/.documenter-siteinfo.json | 2 +- dev/api/PowerSimulations/index.html | 164 ++++----- .../developer/index.html | 2 +- .../extending_powersimulations/index.html | 2 +- .../internal/index.html | 348 +++++++++--------- .../troubleshooting/index.html | 2 +- dev/formulation_library/Branch/index.html | 14 +- dev/formulation_library/DCModels/index.html | 2 +- .../Feedforward/index.html | 10 +- dev/formulation_library/General/index.html | 4 +- .../Introduction/index.html | 2 +- dev/formulation_library/Load/index.html | 6 +- dev/formulation_library/Network/index.html | 10 +- dev/formulation_library/Piecewise/index.html | 2 +- dev/formulation_library/README/index.html | 2 +- .../RenewableGen/index.html | 6 +- dev/formulation_library/Service/index.html | 10 +- dev/formulation_library/ThermalGen/index.html | 20 +- dev/index.html | 2 +- .../structure_of_operation_problem/index.html | 2 +- .../troubleshooting/index.html | 2 +- .../debugging_infeasible_models/index.html | 2 +- dev/modeler_guide/definitions/index.html | 2 +- dev/modeler_guide/logging/index.html | 2 +- dev/modeler_guide/modeling_faq/index.html | 2 +- .../parallel_simulations/index.html | 2 +- .../problem_templates/index.html | 6 +- dev/modeler_guide/psi_structure/index.html | 2 +- dev/modeler_guide/read_results/index.html | 2 +- .../running_a_simulation/index.html | 2 +- .../simulation_recorder/index.html | 2 +- dev/modeler_guide/tips_and_tricks/index.html | 2 +- dev/objects.inv | Bin 15384 -> 15384 bytes dev/quick_start_guide/index.html | 2 +- dev/search_index.js | 2 +- .../adding_new_device_formulation/index.html | 2 +- .../adding_new_problem_model/index.html | 2 +- .../basics_of_developing_models/index.html | 2 +- dev/tutorials/decision_problem/index.html | 52 +-- dev/tutorials/pcm_simulation/index.html | 88 ++--- 40 files changed, 395 insertions(+), 395 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index b073fb221..4677e68b2 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-08T23:19:57","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-11T12:23:00","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/api/PowerSimulations/index.html b/dev/api/PowerSimulations/index.html index 78b4b9388..de633bce0 100644 --- a/dev/api/PowerSimulations/index.html +++ b/dev/api/PowerSimulations/index.html @@ -8,53 +8,53 @@ duals::Vector{DataType}, services::Vector{ServiceModel} attributes::Dict{String, Any} -)

Establishes the model for a particular device specified by type. Uses the keyword argument feedforward to enable passing values between operation model at simulation time

Arguments

Example

thermal_gens = DeviceModel(ThermalStandard, ThermalBasicUnitCommitment)
source

Formulations

Refer to the Formulations Page for each Abstract Device Formulation.

Problem Templates

PowerSimulations.ProblemTemplateType
ProblemTemplate(::Type{T}) where {T<:PM.AbstractPowerFormulation}

Creates a model reference of the PowerSimulations Optimization Problem.

Arguments

  • model::Type{T<:PM.AbstractPowerFormulation}:

Example

template = ProblemTemplate(CopperPlatePowerModel)

source
PowerSimulations.set_device_model!Method
set_device_model!(
+)

Establishes the model for a particular device specified by type. Uses the keyword argument feedforward to enable passing values between operation model at simulation time

Arguments

  • ::Type{D} where D<:PSY.Device: Power System Device Type
  • ::Type{B} where B<:AbstractDeviceFormulation: Abstract Device Formulation
  • feedforward::Array{<:AbstractAffectFeedforward} = Vector{AbstractAffectFeedforward}() : use to pass parameters between models
  • use_slacks::Bool = false : Add slacks to the device model. Implementation is model dependent and not all models feature slacks
  • duals::Vector{DataType} = Vector{DataType}(): use to pass constraint type to calculate the duals. The DataType needs to be a valid ConstraintType
  • time_series_names::Dict{Type{<:TimeSeriesParameter}, String} = get_default_time_series_names(D, B) : use to specify time series names associated to the device`
  • attributes::Dict{String, Any} = get_default_attributes(D, B) : use to specify attributes to the device

Example

thermal_gens = DeviceModel(ThermalStandard, ThermalBasicUnitCommitment)
source

Formulations

Refer to the Formulations Page for each Abstract Device Formulation.

Problem Templates

PowerSimulations.ProblemTemplateType
ProblemTemplate(::Type{T}) where {T<:PM.AbstractPowerFormulation}

Creates a model reference of the PowerSimulations Optimization Problem.

Arguments

  • model::Type{T<:PM.AbstractPowerFormulation}:

Example

template = ProblemTemplate(CopperPlatePowerModel)

source
PowerSimulations.set_device_model!Method
set_device_model!(
     template::ProblemTemplate,
     model::DeviceModel
 )
-

Sets the device model in a template using a DeviceModel instance

source
PowerSimulations.set_device_model!Method
set_device_model!(
+

Sets the device model in a template using a DeviceModel instance

source
PowerSimulations.set_device_model!Method
set_device_model!(
     template::ProblemTemplate,
     component_type::Type{<:Device},
     formulation::Type{<:PowerSimulations.AbstractDeviceFormulation}
 )
-

Sets the device model in a template using the component type and formulation. Builds a default DeviceModel

source
PowerSimulations.set_network_model!Method
set_network_model!(
+

Sets the device model in a template using the component type and formulation. Builds a default DeviceModel

source
PowerSimulations.set_network_model!Method
set_network_model!(
     template::ProblemTemplate,
     model::NetworkModel
 )
-

Sets the network model in a template.

source
PowerSimulations.set_service_model!Method
set_service_model!(
+

Sets the network model in a template.

source
PowerSimulations.set_service_model!Method
set_service_model!(
     template::ProblemTemplate,
     service_name::String,
     service_type::Type{<:Service},
     formulation::Type{<:PowerSimulations.AbstractServiceFormulation}
 )
-

Sets the service model in a template using a name and the service type and formulation. Builds a default ServiceModel with useservicename set to true.

source
PowerSimulations.set_service_model!Method
set_service_model!(
+

Sets the service model in a template using a name and the service type and formulation. Builds a default ServiceModel with useservicename set to true.

source
PowerSimulations.set_service_model!Method
set_service_model!(
     template::ProblemTemplate,
     service_type::Type{<:Service},
     formulation::Type{<:PowerSimulations.AbstractServiceFormulation}
 )
-

Sets the service model in a template using a ServiceModel instance.

source
PowerSimulations.template_economic_dispatchMethod
template_economic_dispatch(; kwargs...) -> ProblemTemplate
+

Sets the service model in a template using a ServiceModel instance.

source
PowerSimulations.template_economic_dispatchMethod
template_economic_dispatch(; kwargs...) -> ProblemTemplate
 
template_economic_dispatch(; kwargs...)

Creates a ProblemTemplate with default DeviceModels for an Economic Dispatch problem.

Example

template = templateeconomicdispatch()


 # Accepted Key Words
 - `network::Type{<:PM.AbstractPowerModel}` : override default network model settings
 - `devices::Vector{DeviceModel}` : override default `DeviceModel` settings
-- `services::Vector{ServiceModel}` : override default `ServiceModel` settings
source
PowerSimulations.template_unit_commitmentMethod
template_unit_commitment(; kwargs...) -> ProblemTemplate
+- `services::Vector{ServiceModel}` : override default `ServiceModel` settings
source
PowerSimulations.template_unit_commitmentMethod
template_unit_commitment(; kwargs...) -> ProblemTemplate
 
template_unit_commitment(; kwargs...)

Creates a ProblemTemplate with default DeviceModels for a Unit Commitment problem.

Example

template = templateunitcommitment()


 # Accepted Key Words
 - `network::Type{<:PM.AbstractPowerModel}` : override default network model settings
 - `devices::Vector{DeviceModel}` : override default `DeviceModel` settings
-- `services::Vector{ServiceModel}` : override default `ServiceModel` settings
source
  +- `services::Vector{ServiceModel}` : override default `ServiceModel` settingssource   

Decision Models

PowerSimulations.DecisionModelMethod
DecisionModel(
     directory::AbstractString,
     optimizer::MathOptInterface.OptimizerWithAttributes;
     jump_model,
     system
 ) -> Any
-

Construct an DecisionProblem from a serialized file.

Arguments

  • directory::AbstractString: Directory containing a serialized model
  • jump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.
  • optimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.
  • system::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.
source
PowerSimulations.DecisionModelMethod
DecisionModel{M}(
+

Construct an DecisionProblem from a serialized file.

Arguments

  • directory::AbstractString: Directory containing a serialized model
  • jump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.
  • optimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.
  • system::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.
source
PowerSimulations.DecisionModelMethod
DecisionModel{M}(
     template::AbstractProblemTemplate,
     sys::PSY.System,
     jump_model::Union{Nothing, JuMP.Model}=nothing;
     kwargs...) where {M<:DecisionProblem}

Build the optimization problem of type M with the specific system and template.

Arguments

  • ::Type{M} where M<:DecisionProblem: The abstract operation model type
  • template::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.
  • sys::PSY.System: the system created using Power Systems
  • jump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care
  • name = nothing: name of model, string or symbol; defaults to the type of template converted to a symbol.
  • optimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing : The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.
  • horizon::Dates.Period = UNSET_HORIZON: Manually specify the length of the forecast Horizon
  • resolution::Dates.Period = UNSET_RESOLUTION: Manually specify the model's resolution
  • warm_start::Bool = true: True will use the current operation point in the system to initialize variable values. False initializes all variables to zero. Default is true
  • system_to_file::Bool = true:: True to create a copy of the system used in the model.
  • initialize_model::Bool = true: Option to decide to initialize the model or not.
  • initialization_file::String = "": This allows to pass pre-existing initialization values to avoid the solution of an optimization problem to find feasible initial conditions.
  • deserialize_initial_conditions::Bool = false: Option to deserialize conditions
  • export_pwl_vars::Bool = false: True to export all the pwl intermediate variables. It can slow down significantly the build and solve time.
  • allow_fails::Bool = false: True to allow the simulation to continue even if the optimization step fails. Use with care.
  • optimizer_solve_log_print::Bool = false: Uses JuMP.unset_silent() to print the optimizer's log. By default all solvers are set to MOI.Silent()
  • detailed_optimizer_stats::Bool = false: True to save detailed optimizer stats log.
  • calculate_conflict::Bool = false: True to use solver to calculate conflicts for infeasible problems. Only specific solvers are able to calculate conflicts.
  • direct_mode_optimizer::Bool = false: True to use the solver in direct mode. Creates a JuMP.direct_model.
  • store_variable_names::Bool = false: to store variable names in optimization model. Decreases the build times.
  • rebuild_model::Bool = false: It will force the rebuild of the underlying JuMP model with each call to update the model. It increases solution times, use only if the model can't be updated in memory.
  • initial_time::Dates.DateTime = UNSET_INI_TIME: Initial Time for the model solve.
  • time_series_cache_size::Int = IS.TIME_SERIES_CACHE_SIZE_BYTES: Size in bytes to cache for each time array. Default is 1 MiB. Set to 0 to disable.

Example

template = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)
-OpModel = DecisionModel(MockOperationProblem, template, system)
source
PowerSimulations.DecisionModelMethod
DecisionModel(
+OpModel = DecisionModel(MockOperationProblem, template, system)
source
PowerSimulations.DecisionModelMethod
DecisionModel(
     ::Type{M<:PowerSimulations.DecisionProblem},
     template::PowerSimulations.AbstractProblemTemplate,
     sys::System;
@@ -68,7 +68,7 @@
     kwargs...
 ) -> DecisionModel
 

Build the optimization problem of type M with the specific system and template

Arguments

  • ::Type{M} where M<:DecisionProblem: The abstract operation model type
  • template::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.
  • sys::PSY.System: the system created using Power Systems
  • jump_model::Union{Nothing, JuMP.Model} = nothing: Enables passing a custom JuMP model. Use with care.

Example

template = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)
-problem = DecisionModel(MyOpProblemType, template, system, optimizer)
source
PowerSimulations.DecisionModelMethod

Builds an empty decision model. This constructor is used for the implementation of custom decision models that do not require a template.

Arguments

  • ::Type{M} where M<:DecisionProblem: The abstract operation model type
  • sys::PSY.System: the system created using Power Systems
  • jump_model::Union{Nothing, JuMP.Model} = nothing: Enables passing a custom JuMP model. Use with care.

Example

problem = DecisionModel(system, optimizer)
source
PowerSimulations.GenericOpProblemType

Generic PowerSimulations Operation Problem Type for unspecified models

source
PowerSimulations.build!Method
build!(
+problem = DecisionModel(MyOpProblemType, template, system, optimizer)
source
PowerSimulations.DecisionModelMethod

Builds an empty decision model. This constructor is used for the implementation of custom decision models that do not require a template.

Arguments

  • ::Type{M} where M<:DecisionProblem: The abstract operation model type
  • sys::PSY.System: the system created using Power Systems
  • jump_model::Union{Nothing, JuMP.Model} = nothing: Enables passing a custom JuMP model. Use with care.

Example

problem = DecisionModel(system, optimizer)
source
PowerSimulations.GenericOpProblemType

Generic PowerSimulations Operation Problem Type for unspecified models

source
PowerSimulations.build!Method
build!(
     model::DecisionModel;
     output_dir,
     recorders,
@@ -76,7 +76,7 @@
     file_level,
     disable_timer_outputs
 )
-

Build the Decision Model based on the specified DecisionProblem.

Arguments

  • model::DecisionModel{<:DecisionProblem}: DecisionModel object
  • output_dir::String: Output directory for results
  • recorders::Vector{Symbol} = []: recorder names to register
  • console_level = Logging.Error:
  • file_level = Logging.Info:
  • disable_timer_outputs = false : Enable/Disable timing outputs
source
PowerSimulations.solve!Method
solve!(
+

Build the Decision Model based on the specified DecisionProblem.

Arguments

  • model::DecisionModel{<:DecisionProblem}: DecisionModel object
  • output_dir::String: Output directory for results
  • recorders::Vector{Symbol} = []: recorder names to register
  • console_level = Logging.Error:
  • file_level = Logging.Info:
  • disable_timer_outputs = false : Enable/Disable timing outputs
source
PowerSimulations.solve!Method
solve!(
     model::DecisionModel;
     export_problem_results,
     console_level,
@@ -86,20 +86,20 @@
     kwargs...
 ) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus
 

Default solve method for models that conform to the requirements of DecisionModel{<: DecisionProblem}.

This will call build! on the model if it is not already built. It will forward all keyword arguments to that function.

Arguments

  • model::OperationModel = model: operation model
  • export_problem_results::Bool = false: If true, export OptimizationProblemResults DataFrames to CSV files. Reduces solution times during simulation.
  • console_level = Logging.Error:
  • file_level = Logging.Info:
  • disable_timer_outputs = false : Enable/Disable timing outputs
  • export_optimization_problem::Bool = true: If true, serialize the model to a file to allow re-execution later.

Examples

results = solve!(OpModel)
-results = solve!(OpModel, export_problem_results = true)
source
PowerSimulations.solve!Method
solve!(
+results = solve!(OpModel, export_problem_results = true)
source
PowerSimulations.solve!Method
solve!(
     step::Int64,
     model::DecisionModel,
     start_time::Dates.DateTime,
     store::PowerSimulations.SimulationStore;
     exports
 ) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus
-

Default solve method for a DecisionModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}

Arguments

  • step::Int: Simulation Step
  • model::OperationModel: operation model
  • start_time::Dates.DateTime: Initial Time of the simulation step in Simulation time.
  • store::SimulationStore: Simulation output store

Accepted Key Words

  • exports: realtime export of output. Use wisely, it can have negative impacts in the simulation times
source
  +

Default solve method for a DecisionModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}

Arguments

Accepted Key Words

source   

Emulation Models

PowerSimulations.EmulationModelType
EmulationModel{M}(
     template::AbstractProblemTemplate,
     sys::PSY.System,
     jump_model::Union{Nothing, JuMP.Model}=nothing;
     kwargs...) where {M<:EmulationProblem}

Build the optimization problem of type M with the specific system and template.

Arguments

  • ::Type{M} where M<:EmulationProblem: The abstract Emulation model type
  • template::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.
  • sys::PSY.System: the system created using Power Systems
  • jump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care
  • name = nothing: name of model, string or symbol; defaults to the type of template converted to a symbol.
  • optimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing : The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.
  • warm_start::Bool = true: True will use the current operation point in the system to initialize variable values. False initializes all variables to zero. Default is true
  • system_to_file::Bool = true:: True to create a copy of the system used in the model.
  • initialize_model::Bool = true: Option to decide to initialize the model or not.
  • initialization_file::String = "": This allows to pass pre-existing initialization values to avoid the solution of an optimization problem to find feasible initial conditions.
  • deserialize_initial_conditions::Bool = false: Option to deserialize conditions
  • export_pwl_vars::Bool = false: True to export all the pwl intermediate variables. It can slow down significantly the build and solve time.
  • allow_fails::Bool = false: True to allow the simulation to continue even if the optimization step fails. Use with care.
  • calculate_conflict::Bool = false: True to use solver to calculate conflicts for infeasible problems. Only specific solvers are able to calculate conflicts.
  • optimizer_solve_log_print::Bool = false: Uses JuMP.unset_silent() to print the optimizer's log. By default all solvers are set to MOI.Silent()
  • detailed_optimizer_stats::Bool = false: True to save detailed optimizer stats log.
  • direct_mode_optimizer::Bool = false: True to use the solver in direct mode. Creates a JuMP.direct_model.
  • store_variable_names::Bool = false: True to store variable names in optimization model.
  • rebuild_model::Bool = false: It will force the rebuild of the underlying JuMP model with each call to update the model. It increases solution times, use only if the model can't be updated in memory.
  • initial_time::Dates.DateTime = UNSET_INI_TIME: Initial Time for the model solve.
  • time_series_cache_size::Int = IS.TIME_SERIES_CACHE_SIZE_BYTES: Size in bytes to cache for each time array. Default is 1 MiB. Set to 0 to disable.

Example

template = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)
-OpModel = EmulationModel(MockEmulationProblem, template, system)
source
PowerSimulations.EmulationModelMethod
EmulationModel(
+OpModel = EmulationModel(MockEmulationProblem, template, system)
source
PowerSimulations.EmulationModelMethod
EmulationModel(
     ::Type{M<:PowerSimulations.EmulationProblem},
     template::PowerSimulations.AbstractProblemTemplate,
     sys::System;
@@ -113,14 +113,14 @@
     kwargs...
 ) -> EmulationModel
 

Build the optimization problem of type M with the specific system and template

Arguments

  • ::Type{M} where M<:EmulationProblem: The abstract Emulation model type
  • template::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.
  • sys::PSY.System: the system created using Power Systems
  • jump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care

Example

template = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)
-problem = EmulationModel(MyEmProblemType, template, system, optimizer)
source
PowerSimulations.EmulationModelMethod
EmulationModel(
+problem = EmulationModel(MyEmProblemType, template, system, optimizer)
source
PowerSimulations.EmulationModelMethod
EmulationModel(
     directory::AbstractString,
     optimizer::MathOptInterface.OptimizerWithAttributes;
     jump_model,
     system,
     kwargs...
 ) -> Any
-

Construct an EmulationProblem from a serialized file.

Arguments

  • directory::AbstractString: Directory containing a serialized model.
  • optimizer::MOI.OptimizerWithAttributes: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.
  • jump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.
  • system::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.
source
PowerSimulations.build!Method
build!(
+

Construct an EmulationProblem from a serialized file.

Arguments

  • directory::AbstractString: Directory containing a serialized model.
  • optimizer::MOI.OptimizerWithAttributes: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.
  • jump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.
  • system::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.
source
PowerSimulations.build!Method
build!(
     model::EmulationModel;
     executions,
     output_dir,
@@ -129,7 +129,7 @@
     file_level,
     disable_timer_outputs
 )
-

Implementation of build for any EmulationProblem

source
PowerSimulations.run!Method
run!(
+

Implementation of build for any EmulationProblem

source
PowerSimulations.run!Method
run!(
     model::EmulationModel;
     export_problem_results,
     console_level,
@@ -139,16 +139,16 @@
     kwargs...
 ) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus
 

Default run method for problems that conform to the requirements of EmulationModel{<: EmulationProblem}

This will call build! on the model if it is not already built. It will forward all keyword arguments to that function.

Arguments

  • model::EmulationModel = model: Emulation model
  • optimizer::MOI.OptimizerWithAttributes: The optimizer that is used to solve the model
  • executions::Int: Number of executions for the emulator run
  • export_problem_results::Bool: If true, export OptimizationProblemResults DataFrames to CSV files.
  • output_dir::String: Required if the model is not already built, otherwise ignored
  • enable_progress_bar::Bool: Enables/Disable progress bar printing
  • export_optimization_model::Bool: If true, serialize the model to a file to allow re-execution later.

Examples

status = run!(model; optimizer = GLPK.Optimizer, executions = 10)
-status = run!(model; output_dir = ./model_output, optimizer = GLPK.Optimizer, executions = 10)
source
PowerSimulations.solve!Method
solve!(
+status = run!(model; output_dir = ./model_output, optimizer = GLPK.Optimizer, executions = 10)
source
PowerSimulations.solve!Method
solve!(
     step::Int64,
     model::EmulationModel,
     start_time::Dates.DateTime,
     store::PowerSimulations.SimulationStore;
     exports
 ) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus
-

Default solve method for an EmulationModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}

Arguments

  • step::Int: Simulation Step
  • model::OperationModel: operation model
  • start_time::Dates.DateTime: Initial Time of the simulation step in Simulation time.
  • store::SimulationStore: Simulation output store
  • exports = nothing: realtime export of output. Use wisely, it can have negative impacts in the simulation times
source
  - 

Service Models

List of structures and methods for Service models

PowerSimulations.ServiceModelType

Establishes the model for a particular services specified by type. Uses the keyword argument use_service_name to assign the model to a service with the same name as the name in the template. Uses the keyword argument feedforward to enable passing values between operation model at simulation time

Arguments

-::Type{D}: Power System Service Type -::Type{B}: Abstract Service Formulation

Accepted Key Words

  • feedforward::Array{<:AbstractAffectFeedforward} : use to pass parameters between models
  • use_service_name::Bool : use the name as the name for the service

Example

reserves = ServiceModel(PSY.VariableReserve{PSY.ReserveUp}, RangeReserve)

source
  - 

Simulation Models

Refer to the Simulations Page to explanations on how to setup a Simulation, with Sequencing and Feedforwards.

PowerSimulations.InitialConditionType

Container for the initial condition data

source
PowerSimulations.SimulationModelsType
SimulationModels(
+

Default solve method for an EmulationModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}

Arguments

  • step::Int: Simulation Step
  • model::OperationModel: operation model
  • start_time::Dates.DateTime: Initial Time of the simulation step in Simulation time.
  • store::SimulationStore: Simulation output store
  • exports = nothing: realtime export of output. Use wisely, it can have negative impacts in the simulation times
source
  + 

Service Models

List of structures and methods for Service models

PowerSimulations.ServiceModelType

Establishes the model for a particular services specified by type. Uses the keyword argument use_service_name to assign the model to a service with the same name as the name in the template. Uses the keyword argument feedforward to enable passing values between operation model at simulation time

Arguments

-::Type{D}: Power System Service Type -::Type{B}: Abstract Service Formulation

Accepted Key Words

  • feedforward::Array{<:AbstractAffectFeedforward} : use to pass parameters between models
  • use_service_name::Bool : use the name as the name for the service

Example

reserves = ServiceModel(PSY.VariableReserve{PSY.ReserveUp}, RangeReserve)

source
  + 

Simulation Models

Refer to the Simulations Page to explanations on how to setup a Simulation, with Sequencing and Feedforwards.

PowerSimulations.InitialConditionType

Container for the initial condition data

source
PowerSimulations.SimulationModelsType
SimulationModels(
     decision_models::Vector{<:DecisionModel},
     emulation_models::Union{Nothing, EmulationModel}
 )

Stores the OperationProblem definitions to be used in the simulation. When creating the SimulationModels, the order in which the models are created determines the order on which the simulation is executed.

Arguments

  • decision_models::Vector{<:DecisionModel}: Vector of decision models.
  • emulation_models::Union{Nothing, EmulationModel}: Optional argument to include

an EmulationModel in the Simulation

Example

template_uc = template_unit_commitment()
@@ -160,7 +160,7 @@
         my_decision_model_uc,
         my_decision_model_ed
     ]
-)
source
PowerSimulations.SimulationSequenceType
SimulationSequence(
+)
source
PowerSimulations.SimulationSequenceType
SimulationSequence(
     models::SimulationModels,
     feedforward::Dict{String, Vector{<:AbstractAffectFeedforward}}
     ini_cond_chronology::InitialConditionChronology
@@ -186,7 +186,7 @@
             ),
         ],
     ),
-)
source
PowerSimulations.SimulationType
Simulation(
+)
source
PowerSimulations.SimulationType
Simulation(
     sequence::SimulationSequence,
     name::String,
     steps::Int
@@ -223,8 +223,8 @@
     steps = 5,
     models = models,
     simulation_folder = mktempdir(cleanup=true),
-)
source
PowerSimulations.SimulationMethod
Simulation(directory::AbstractString, model_info::Dict)
-

Constructs Simulation from a serialized directory. Callers should pass any kwargs here that they passed to the original Simulation.

Arguments

  • directory::AbstractString: the directory returned from the call to serialize
  • model_info::Dict: Two-level dictionary containing model parameters that cannot be serialized. The outer dict should be keyed by the problem name. The inner dict must contain 'optimizer' and may contain 'jump_model'. These should be the same values used for the original simulation.
source
PowerSimulations.build!Method
build!(
+)
source
PowerSimulations.SimulationMethod
Simulation(directory::AbstractString, model_info::Dict)
+

Constructs Simulation from a serialized directory. Callers should pass any kwargs here that they passed to the original Simulation.

Arguments

  • directory::AbstractString: the directory returned from the call to serialize
  • model_info::Dict: Two-level dictionary containing model parameters that cannot be serialized. The outer dict should be keyed by the problem name. The inner dict must contain 'optimizer' and may contain 'jump_model'. These should be the same values used for the original simulation.
source
PowerSimulations.build!Method
build!(
     sim::Simulation;
     recorders,
     console_level,
@@ -233,13 +233,13 @@
     partitions,
     index
 ) -> InfrastructureSystems.Simulation.SimulationBuildStatusModule.SimulationBuildStatus
-

Build the Simulation, problems and the related folder structure.

Arguments

  • sim::Simulation: simulation object
  • recorders::Vector{Symbol} = []: recorder names to register
  • serialize::Bool = true: serializes the simulation objects in the simulation
  • console_level = Logging.Error:
  • file_level = Logging.Info:
source
PowerSimulations.execute!Method
execute!(
+

Build the Simulation, problems and the related folder structure.

Arguments

  • sim::Simulation: simulation object
  • recorders::Vector{Symbol} = []: recorder names to register
  • serialize::Bool = true: serializes the simulation objects in the simulation
  • console_level = Logging.Error:
  • file_level = Logging.Info:
source
PowerSimulations.execute!Method
execute!(
     sim::Simulation;
     kwargs...
 ) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus
 

Solves the simulation model for sequential Simulations.

Arguments

  • sim::Simulation=sim: simulation object created by Simulation()

The optional keyword argument exports controls exporting of results to CSV files as the simulation runs.

Example

sim = Simulation("Test", 7, problems, "/Users/folder")
-execute!(sim::Simulation; kwargs...)
source
PowerSimulations.SimulationPartitionsType

Defines how a simulation can be partition into partitions and run in parallel.

source
PowerSimulations.get_num_partitionsMethod
get_num_partitions(x::SimulationPartitions) -> Int64
-

Return the number of partitions in the simulation.

source
PowerSimulations.run_parallel_simulationMethod
run_parallel_simulation(
+execute!(sim::Simulation; kwargs...)
source
PowerSimulations.SimulationPartitionsType

Defines how a simulation can be partition into partitions and run in parallel.

source
PowerSimulations.get_num_partitionsMethod
get_num_partitions(x::SimulationPartitions) -> Int64
+

Return the number of partitions in the simulation.

source
PowerSimulations.run_parallel_simulationMethod
run_parallel_simulation(
     build_function,
     execute_function;
     script,
@@ -252,46 +252,46 @@
     exeflags,
     force
 )
-

Run a partitioned simulation in parallel on a local computer.

Arguments

  • build_function: Function reference that returns a built Simulation.
  • execute_function: Function reference that executes a Simulation.
  • script::AbstractString: Path to script that includes $build_function$ and $execute_function$.
  • output_dir::AbstractString: Path for simulation outputs
  • name::AbstractString: Simulation name
  • num_steps::Integer: Total number of steps in the simulation
  • period::Integer: Number of steps in each simulation partition
  • num_overlap_steps::Integer: Number of steps that each partition overlaps with the previous partition
  • num_parallel_processes: Number of partitions to run in parallel. If nothing, use the number of cores.
  • exeflags: Path to Julia project. Forwarded to Distributed.addprocs.
  • force: Overwrite the output directory if it already exists.
source
  - 

Chronology Models

PowerSimulations.InterProblemChronologyType
InterProblemChronology()

Type struct to select an information sharing model between stages that uses results from the most recent stage executed to calculate the initial conditions. This model takes into account solutions from stages defined with finer temporal resolutions

See also: IntraProblemChronology

source
PowerSimulations.IntraProblemChronologyType
IntraProblemChronology()

Type struct to select an information sharing model between stages that uses results from the same recent stage to calculate the initial conditions. This model ignores solutions from stages defined with finer temporal resolutions.

See also: InterProblemChronology

source

Variables

For a list of variables for each device refer to its Formulations page.

Common Variables

PowerSimulations.ActivePowerVariableType

Struct to dispatch the creation of Active Power Variables

Docs abbreviation: $p$

source
PowerSimulations.ReactivePowerVariableType

Struct to dispatch the creation of Reactive Power Variables

Docs abbreviation: $q$

source
PowerSimulations.PieceWiseLinearCostVariableType

Struct to dispatch the creation of piecewise linear cost variables for objective function

Docs abbreviation: $\delta$

source

Thermal Unit Variables

PowerSimulations.OnVariableType

Struct to dispatch the creation of a binary commitment status variable

Docs abbreviation: $u$

source
PowerSimulations.StartVariableType

Struct to dispatch the creation of Binary Start Variables

Docs abbreviation: $v$

source
PowerSimulations.StopVariableType

Struct to dispatch the creation of Binary Stop Variables

Docs abbreviation: $w$

source
PowerSimulations.TimeDurationOnType

Auxiliary Variable for Thermal Generation Models to keep track of time elapsed on

source
PowerSimulations.TimeDurationOffType

Auxiliary Variable for Thermal Generation Models to keep track of time elapsed off

source
PowerSimulations.HotStartVariableType

Struct to dispatch the creation of Hot Start Variable for Thermal units with temperature considerations

Docs abbreviation: $z^\text{th}$

source
PowerSimulations.WarmStartVariableType

Struct to dispatch the creation of Warm Start Variable for Thermal units with temperature considerations

Docs abbreviation: $y^\text{th}$

source
PowerSimulations.ColdStartVariableType

Struct to dispatch the creation of Cold Start Variable for Thermal units with temperature considerations

Docs abbreviation: $x^\text{th}$

source
PowerSimulations.PowerAboveMinimumVariableType

Struct to dispatch the creation of Active Power Variables above minimum power for Thermal Compact formulations

Docs abbreviation: $\Delta p$

source
PowerSimulations.PowerOutputType

Auxiliary Variable for Thermal Generation Models that solve for power above min

source

Storage Unit Variables

PowerSimulations.ReservationVariableType

Struct to dispatch the creation of binary storage charge reservation variable

Docs abbreviation: $u^\text{st}$

source
PowerSimulations.EnergyVariableType

Struct to dispatch the creation of a variable for energy storage level (state of charge)

Docs abbreviation: $e$

source
PowerSimulations.ActivePowerOutVariableType

Struct to dispatch the creation of Active Power Output Variables for 2-directional devices. For instance storage or pump-hydro

Docs abbreviation: $p^\text{out}$

source
PowerSimulations.ActivePowerInVariableType

Struct to dispatch the creation of Active Power Input Variables for 2-directional devices. For instance storage or pump-hydro

Docs abbreviation: $p^\text{in}$

source

Branches and Network Variables

PowerSimulations.FlowActivePowerVariableType

Struct to dispatch the creation of bidirectional Active Power Flow Variables

Docs abbreviation: $f$

source
PowerSimulations.FlowActivePowerSlackUpperBoundType

Struct to dispatch the creation of active power flow upper bound slack variables. Used when there is not enough flow through the branch in the forward direction.

Docs abbreviation: $f^\text{sl,up}$

source
PowerSimulations.FlowActivePowerSlackLowerBoundType

Struct to dispatch the creation of active power flow lower bound slack variables. Used when there is not enough flow through the branch in the reverse direction.

Docs abbreviation: $f^\text{sl,lo}$

source
PowerSimulations.FlowActivePowerFromToVariableType

Struct to dispatch the creation of unidirectional Active Power Flow Variables

Docs abbreviation: $f^\text{from-to}$

source
PowerSimulations.FlowActivePowerToFromVariableType

Struct to dispatch the creation of unidirectional Active Power Flow Variables

Docs abbreviation: $f^\text{to-from}$

source
PowerSimulations.FlowReactivePowerFromToVariableType

Struct to dispatch the creation of unidirectional Reactive Power Flow Variables

Docs abbreviation: $f^\text{q,from-to}$

source
PowerSimulations.FlowReactivePowerToFromVariableType

Struct to dispatch the creation of unidirectional Reactive Power Flow Variables

Docs abbreviation: $f^\text{q,to-from}$

source
PowerSimulations.PhaseShifterAngleType

Struct to dispatch the creation of Phase Shifters Variables

Docs abbreviation: $\theta^\text{shift}$

source
PowerSimulations.HVDCLossesType

Struct to dispatch the creation of HVDC Losses Auxiliary Variables

Docs abbreviation: $\ell$

source
PowerSimulations.HVDCFlowDirectionVariableType

Struct to dispatch the creation of HVDC Flow Direction Auxiliary Variables

Docs abbreviation: $u^\text{dir}$

source
PowerSimulations.VoltageMagnitudeType

Struct to dispatch the creation of Voltage Magnitude Variables for AC formulations

Docs abbreviation: $v$

source
PowerSimulations.VoltageAngleType

Struct to dispatch the creation of Voltage Angle Variables for AC/DC formulations

Docs abbreviation: $\theta$

source

Services Variables

PowerSimulations.ActivePowerReserveVariableType

Struct to dispatch the creation of Active Power Reserve Variables

Docs abbreviation: $r$

source
PowerSimulations.ServiceRequirementVariableType

Struct to dispatch the creation of Service Requirement Variables

Docs abbreviation: $\text{req}$

source
PowerSimulations.SystemBalanceSlackUpType

Struct to dispatch the creation of System-wide slack up variables. Used when there is not enough generation.

Docs abbreviation: $p^\text{sl,up}$

source
PowerSimulations.SystemBalanceSlackDownType

Struct to dispatch the creation of System-wide slack down variables. Used when there is not enough load curtailment.

Docs abbreviation: $p^\text{sl,dn}$

source
PowerSimulations.ReserveRequirementSlackType

Struct to dispatch the creation of Reserve requirement slack variables. Used when there is not reserves in the system to satisfy the requirement.

Docs abbreviation: $r^\text{sl}$

source
PowerSimulations.InterfaceFlowSlackUpType

Struct to dispatch the creation of Interface Flow Slack Up variables

Docs abbreviation: $f^\text{sl,up}$

source
PowerSimulations.InterfaceFlowSlackDownType

Struct to dispatch the creation of Interface Flow Slack Down variables

Docs abbreviation: $f^\text{sl,dn}$

source

Feedforward Variables

PowerSimulations.UpperBoundFeedForwardSlackType

Struct to dispatch the creation of Slack variables for UpperBoundFeedforward

Docs abbreviation: $p^\text{ff,ubsl}$

source
PowerSimulations.LowerBoundFeedForwardSlackType

Struct to dispatch the creation of Slack variables for LowerBoundFeedforward

Docs abbreviation: $p^\text{ff,lbsl}$

source
  - 

Constraints

Common Constraints

PowerSimulations.PieceWiseLinearCostConstraintType

Struct to create the PieceWiseLinearCostConstraint associated with a specified variable.

See Piecewise linear cost functions for more information.

source

Network Constraints

PowerSimulations.CopperPlateBalanceConstraintType

Struct to create the constraint to balance power in the copperplate model. For more information check Network Formulations.

The specified constraint is generally formulated as:

\[\sum_{c \in \text{components}} p_t^c = 0, \quad \forall t \in \{1, \dots, T\}\]

source
PowerSimulations.NodalBalanceActiveConstraintType

Struct to create the constraint to balance active power in nodal formulation. For more information check Network Formulations.

The specified constraint depends on the network model chosen.

source
PowerSimulations.NodalBalanceReactiveConstraintType

Struct to create the constraint to balance reactive power in nodal formulation. For more information check Network Formulations.

The specified constraint depends on the network model chosen.

source
PowerSimulations.AreaParticipationAssignmentConstraintType

Struct to create the constraint to balance power across specified areas. For more information check Network Formulations.

The specified constraint is generally formulated as:

\[\sum_{c \in \text{components}_a} p_t^c = 0, \quad \forall a\in \{1,\dots, A\}, t \in \{1, \dots, T\}\]

source

Power Variable Limit Constraints

PowerSimulations.ActivePowerVariableLimitsConstraintType

Struct to create the constraint to limit active power expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[P^\text{min} \le p_t \le P^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.ReactivePowerVariableLimitsConstraintType

Struct to create the constraint to limit reactive power expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[Q^\text{min} \le q_t \le Q^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.ActivePowerVariableTimeSeriesLimitsConstraintType

Struct to create the constraint to limit active power expressions by a time series parameter. For more information check Device Formulations.

The specified constraint depends on the UpperBound expressions, but in its most basic formulation is of the form:

\[p_t \le \text{ActivePowerTimeSeriesParameter}_t, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.InputActivePowerVariableLimitsConstraintType

Struct to create the constraint to limit active power input expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[P^\text{min} \le p_t^\text{in} \le P^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.OutputActivePowerVariableLimitsConstraintType

Struct to create the constraint to limit active power output expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[P^\text{min} \le p_t^\text{out} \le P^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source

Services Constraints

PowerSimulations.RequirementConstraintType

Struct to create the constraint for satisfying active power reserve requirements. For more information check Service Formulations.

The constraint is as follows:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{Req},\quad \forall t\in \{1,\dots, T\} \quad \text{(for a ConstantReserve)} \\ -\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{RequirementTimeSeriesParameter}_{t},\quad \forall t\in \{1,\dots, T\} \quad \text{(for a VariableReserve)}\]

source
PowerSimulations.ParticipationFractionConstraintType

Struct to create the constraint to participation assignments limits in the active power reserves. For more information check Service Formulations.

The constraint is as follows:

\[r_{d,t} \le \text{Req} \cdot \text{PF} ,\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\} \quad \text{(for a ConstantReserve)} \\ -r_{d,t} \le \text{RequirementTimeSeriesParameter}_{t} \cdot \text{PF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for a VariableReserve)}\]

source
PowerSimulations.ReservePowerConstraintType

Struct to create the constraint for ensuring that NonSpinning Reserve can be delivered from turn-off thermal units.

For more information check Service Formulations for NonSpinningReserve.

The constraint is as follows:

\[r_{d,t} \le (1 - u_{d,t}^\text{th}) \cdot R^\text{limit}_d, \quad \forall d \in \mathcal{D}_s, \forall t \in \{1,\dots, T\}\]

source

Thermal Unit Constraints

PowerSimulations.ActiveRangeICConstraintType

Struct to create the constraint for starting up ThermalMultiStart units. For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.

The specified constraint is formulated as:

\[\max\{P^\text{th,max} - P^\text{th,shdown}, 0\} \cdot w_1^\text{th} \le u^\text{th,init} (P^\text{th,max} - P^\text{th,min}) - P^\text{th,init}\]

source
PowerSimulations.CommitmentConstraintType

Struct to create the commitment constraint between the on, start, and stop variables. For more information check ThermalGen Formulations.

The specified constraints are formulated as:

\[u_1^\text{th} = u^\text{th,init} + v_1^\text{th} - w_1^\text{th} \\ +

Run a partitioned simulation in parallel on a local computer.

Arguments

  • build_function: Function reference that returns a built Simulation.
  • execute_function: Function reference that executes a Simulation.
  • script::AbstractString: Path to script that includes $build_function$ and $execute_function$.
  • output_dir::AbstractString: Path for simulation outputs
  • name::AbstractString: Simulation name
  • num_steps::Integer: Total number of steps in the simulation
  • period::Integer: Number of steps in each simulation partition
  • num_overlap_steps::Integer: Number of steps that each partition overlaps with the previous partition
  • num_parallel_processes: Number of partitions to run in parallel. If nothing, use the number of cores.
  • exeflags: Path to Julia project. Forwarded to Distributed.addprocs.
  • force: Overwrite the output directory if it already exists.
source
  + 

Chronology Models

PowerSimulations.InterProblemChronologyType
InterProblemChronology()

Type struct to select an information sharing model between stages that uses results from the most recent stage executed to calculate the initial conditions. This model takes into account solutions from stages defined with finer temporal resolutions

See also: IntraProblemChronology

source
PowerSimulations.IntraProblemChronologyType
IntraProblemChronology()

Type struct to select an information sharing model between stages that uses results from the same recent stage to calculate the initial conditions. This model ignores solutions from stages defined with finer temporal resolutions.

See also: InterProblemChronology

source

Variables

For a list of variables for each device refer to its Formulations page.

Common Variables

PowerSimulations.ActivePowerVariableType

Struct to dispatch the creation of Active Power Variables

Docs abbreviation: $p$

source
PowerSimulations.ReactivePowerVariableType

Struct to dispatch the creation of Reactive Power Variables

Docs abbreviation: $q$

source
PowerSimulations.PieceWiseLinearCostVariableType

Struct to dispatch the creation of piecewise linear cost variables for objective function

Docs abbreviation: $\delta$

source

Thermal Unit Variables

PowerSimulations.OnVariableType

Struct to dispatch the creation of a binary commitment status variable

Docs abbreviation: $u$

source
PowerSimulations.StartVariableType

Struct to dispatch the creation of Binary Start Variables

Docs abbreviation: $v$

source
PowerSimulations.StopVariableType

Struct to dispatch the creation of Binary Stop Variables

Docs abbreviation: $w$

source
PowerSimulations.TimeDurationOnType

Auxiliary Variable for Thermal Generation Models to keep track of time elapsed on

source
PowerSimulations.TimeDurationOffType

Auxiliary Variable for Thermal Generation Models to keep track of time elapsed off

source
PowerSimulations.HotStartVariableType

Struct to dispatch the creation of Hot Start Variable for Thermal units with temperature considerations

Docs abbreviation: $z^\text{th}$

source
PowerSimulations.WarmStartVariableType

Struct to dispatch the creation of Warm Start Variable for Thermal units with temperature considerations

Docs abbreviation: $y^\text{th}$

source
PowerSimulations.ColdStartVariableType

Struct to dispatch the creation of Cold Start Variable for Thermal units with temperature considerations

Docs abbreviation: $x^\text{th}$

source
PowerSimulations.PowerAboveMinimumVariableType

Struct to dispatch the creation of Active Power Variables above minimum power for Thermal Compact formulations

Docs abbreviation: $\Delta p$

source
PowerSimulations.PowerOutputType

Auxiliary Variable for Thermal Generation Models that solve for power above min

source

Storage Unit Variables

PowerSimulations.ReservationVariableType

Struct to dispatch the creation of binary storage charge reservation variable

Docs abbreviation: $u^\text{st}$

source
PowerSimulations.EnergyVariableType

Struct to dispatch the creation of a variable for energy storage level (state of charge)

Docs abbreviation: $e$

source
PowerSimulations.ActivePowerOutVariableType

Struct to dispatch the creation of Active Power Output Variables for 2-directional devices. For instance storage or pump-hydro

Docs abbreviation: $p^\text{out}$

source
PowerSimulations.ActivePowerInVariableType

Struct to dispatch the creation of Active Power Input Variables for 2-directional devices. For instance storage or pump-hydro

Docs abbreviation: $p^\text{in}$

source

Branches and Network Variables

PowerSimulations.FlowActivePowerVariableType

Struct to dispatch the creation of bidirectional Active Power Flow Variables

Docs abbreviation: $f$

source
PowerSimulations.FlowActivePowerSlackUpperBoundType

Struct to dispatch the creation of active power flow upper bound slack variables. Used when there is not enough flow through the branch in the forward direction.

Docs abbreviation: $f^\text{sl,up}$

source
PowerSimulations.FlowActivePowerSlackLowerBoundType

Struct to dispatch the creation of active power flow lower bound slack variables. Used when there is not enough flow through the branch in the reverse direction.

Docs abbreviation: $f^\text{sl,lo}$

source
PowerSimulations.FlowActivePowerFromToVariableType

Struct to dispatch the creation of unidirectional Active Power Flow Variables

Docs abbreviation: $f^\text{from-to}$

source
PowerSimulations.FlowActivePowerToFromVariableType

Struct to dispatch the creation of unidirectional Active Power Flow Variables

Docs abbreviation: $f^\text{to-from}$

source
PowerSimulations.FlowReactivePowerFromToVariableType

Struct to dispatch the creation of unidirectional Reactive Power Flow Variables

Docs abbreviation: $f^\text{q,from-to}$

source
PowerSimulations.FlowReactivePowerToFromVariableType

Struct to dispatch the creation of unidirectional Reactive Power Flow Variables

Docs abbreviation: $f^\text{q,to-from}$

source
PowerSimulations.PhaseShifterAngleType

Struct to dispatch the creation of Phase Shifters Variables

Docs abbreviation: $\theta^\text{shift}$

source
PowerSimulations.HVDCLossesType

Struct to dispatch the creation of HVDC Losses Auxiliary Variables

Docs abbreviation: $\ell$

source
PowerSimulations.HVDCFlowDirectionVariableType

Struct to dispatch the creation of HVDC Flow Direction Auxiliary Variables

Docs abbreviation: $u^\text{dir}$

source
PowerSimulations.VoltageMagnitudeType

Struct to dispatch the creation of Voltage Magnitude Variables for AC formulations

Docs abbreviation: $v$

source
PowerSimulations.VoltageAngleType

Struct to dispatch the creation of Voltage Angle Variables for AC/DC formulations

Docs abbreviation: $\theta$

source

Services Variables

PowerSimulations.ActivePowerReserveVariableType

Struct to dispatch the creation of Active Power Reserve Variables

Docs abbreviation: $r$

source
PowerSimulations.ServiceRequirementVariableType

Struct to dispatch the creation of Service Requirement Variables

Docs abbreviation: $\text{req}$

source
PowerSimulations.SystemBalanceSlackUpType

Struct to dispatch the creation of System-wide slack up variables. Used when there is not enough generation.

Docs abbreviation: $p^\text{sl,up}$

source
PowerSimulations.SystemBalanceSlackDownType

Struct to dispatch the creation of System-wide slack down variables. Used when there is not enough load curtailment.

Docs abbreviation: $p^\text{sl,dn}$

source
PowerSimulations.ReserveRequirementSlackType

Struct to dispatch the creation of Reserve requirement slack variables. Used when there is not reserves in the system to satisfy the requirement.

Docs abbreviation: $r^\text{sl}$

source
PowerSimulations.InterfaceFlowSlackUpType

Struct to dispatch the creation of Interface Flow Slack Up variables

Docs abbreviation: $f^\text{sl,up}$

source
PowerSimulations.InterfaceFlowSlackDownType

Struct to dispatch the creation of Interface Flow Slack Down variables

Docs abbreviation: $f^\text{sl,dn}$

source

Feedforward Variables

PowerSimulations.UpperBoundFeedForwardSlackType

Struct to dispatch the creation of Slack variables for UpperBoundFeedforward

Docs abbreviation: $p^\text{ff,ubsl}$

source
PowerSimulations.LowerBoundFeedForwardSlackType

Struct to dispatch the creation of Slack variables for LowerBoundFeedforward

Docs abbreviation: $p^\text{ff,lbsl}$

source
  + 

Constraints

Common Constraints

PowerSimulations.PieceWiseLinearCostConstraintType

Struct to create the PieceWiseLinearCostConstraint associated with a specified variable.

See Piecewise linear cost functions for more information.

source

Network Constraints

PowerSimulations.CopperPlateBalanceConstraintType

Struct to create the constraint to balance power in the copperplate model. For more information check Network Formulations.

The specified constraint is generally formulated as:

\[\sum_{c \in \text{components}} p_t^c = 0, \quad \forall t \in \{1, \dots, T\}\]

source
PowerSimulations.NodalBalanceActiveConstraintType

Struct to create the constraint to balance active power in nodal formulation. For more information check Network Formulations.

The specified constraint depends on the network model chosen.

source
PowerSimulations.NodalBalanceReactiveConstraintType

Struct to create the constraint to balance reactive power in nodal formulation. For more information check Network Formulations.

The specified constraint depends on the network model chosen.

source
PowerSimulations.AreaParticipationAssignmentConstraintType

Struct to create the constraint to balance power across specified areas. For more information check Network Formulations.

The specified constraint is generally formulated as:

\[\sum_{c \in \text{components}_a} p_t^c = 0, \quad \forall a\in \{1,\dots, A\}, t \in \{1, \dots, T\}\]

source

Power Variable Limit Constraints

PowerSimulations.ActivePowerVariableLimitsConstraintType

Struct to create the constraint to limit active power expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[P^\text{min} \le p_t \le P^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.ReactivePowerVariableLimitsConstraintType

Struct to create the constraint to limit reactive power expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[Q^\text{min} \le q_t \le Q^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.ActivePowerVariableTimeSeriesLimitsConstraintType

Struct to create the constraint to limit active power expressions by a time series parameter. For more information check Device Formulations.

The specified constraint depends on the UpperBound expressions, but in its most basic formulation is of the form:

\[p_t \le \text{ActivePowerTimeSeriesParameter}_t, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.InputActivePowerVariableLimitsConstraintType

Struct to create the constraint to limit active power input expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[P^\text{min} \le p_t^\text{in} \le P^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.OutputActivePowerVariableLimitsConstraintType

Struct to create the constraint to limit active power output expressions. For more information check Device Formulations.

The specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:

\[P^\text{min} \le p_t^\text{out} \le P^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source

Services Constraints

PowerSimulations.RequirementConstraintType

Struct to create the constraint for satisfying active power reserve requirements. For more information check Service Formulations.

The constraint is as follows:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{Req},\quad \forall t\in \{1,\dots, T\} \quad \text{(for a ConstantReserve)} \\ +\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{RequirementTimeSeriesParameter}_{t},\quad \forall t\in \{1,\dots, T\} \quad \text{(for a VariableReserve)}\]

source
PowerSimulations.ParticipationFractionConstraintType

Struct to create the constraint to participation assignments limits in the active power reserves. For more information check Service Formulations.

The constraint is as follows:

\[r_{d,t} \le \text{Req} \cdot \text{PF} ,\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\} \quad \text{(for a ConstantReserve)} \\ +r_{d,t} \le \text{RequirementTimeSeriesParameter}_{t} \cdot \text{PF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for a VariableReserve)}\]

source
PowerSimulations.ReservePowerConstraintType

Struct to create the constraint for ensuring that NonSpinning Reserve can be delivered from turn-off thermal units.

For more information check Service Formulations for NonSpinningReserve.

The constraint is as follows:

\[r_{d,t} \le (1 - u_{d,t}^\text{th}) \cdot R^\text{limit}_d, \quad \forall d \in \mathcal{D}_s, \forall t \in \{1,\dots, T\}\]

source

Thermal Unit Constraints

PowerSimulations.ActiveRangeICConstraintType

Struct to create the constraint for starting up ThermalMultiStart units. For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.

The specified constraint is formulated as:

\[\max\{P^\text{th,max} - P^\text{th,shdown}, 0\} \cdot w_1^\text{th} \le u^\text{th,init} (P^\text{th,max} - P^\text{th,min}) - P^\text{th,init}\]

source
PowerSimulations.CommitmentConstraintType

Struct to create the commitment constraint between the on, start, and stop variables. For more information check ThermalGen Formulations.

The specified constraints are formulated as:

\[u_1^\text{th} = u^\text{th,init} + v_1^\text{th} - w_1^\text{th} \\ u_t^\text{th} = u_{t-1}^\text{th} + v_t^\text{th} - w_t^\text{th}, \quad \forall t \in \{2,\dots,T\} \\ -v_t^\text{th} + w_t^\text{th} \le 1, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.DurationConstraintType

Struct to create the duration constraint for commitment formulations, i.e. min-up and min-down.

For more information check ThermalGen Formulations.

source
PowerSimulations.RampConstraintType

Struct to create the RampConstraint associated with a specified thermal device or reserve service.

For thermal units, see more information in Thermal Formulations. The constraint is as follows:

\[-R^\text{th,dn} \le p_t^\text{th} - p_{t-1}^\text{th} \le R^\text{th,up}, \quad \forall t\in \{1, \dots, T\}\]

For Ramp Reserve, see more information in Service Formulations. The constraint is as follows:

\[r_{d,t} \le R^\text{th,up} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveUp)} \\ -r_{d,t} \le R^\text{th,dn} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveDown)}\]

source
PowerSimulations.StartupInitialConditionConstraintType

Struct to create the start-up initial condition constraints for ThermalMultiStart.

For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.

source
PowerSimulations.StartupTimeLimitTemperatureConstraintType

Struct to create the start-up time limit constraints for ThermalMultiStart.

For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.

source

Renewable Unit Constraints

PowerSimulations.EqualityConstraintType

Struct to create the constraint that sets the reactive power to the power factor in the RenewableConstantPowerFactor formulation for renewable units.

For more information check RenewableGen Formulations.

The specified constraint is formulated as:

\[q_t^\text{re} = \text{pf} \cdot p_t^\text{re}, \quad \forall t \in \{1,\dots, T\}\]

source

Branches Constraints

PowerSimulations.FlowLimitConstraintType

Struct to create the constraint that set the flow limits through a PhaseShiftingTransformer.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[-R^\text{max} \le f_t \le R^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.FlowRateConstraintType

Struct to create the constraint that set the flow limits through an HVDC two-terminal branch.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[R^\text{min} \le f_t \le R^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.FlowRateConstraintFromToType

Struct to create the constraint that set the flow from-to limits through an HVDC two-terminal branch.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[R^\text{from,min} \le f_t^\text{from-to} \le R^\text{from,max}, \forall t \in \{1,\dots, T\}\]

source
PowerSimulations.FlowRateConstraintToFromType

Struct to create the constraint that set the flow to-from limits through an HVDC two-terminal branch.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[R^\text{to,min} \le f_t^\text{to-from} \le R^\text{to,max},\quad \forall t \in \{1,\dots, T\}\]

source
PowerSimulations.HVDCPowerBalanceType

Struct to create the constraints that set the power balance across a lossy HVDC two-terminal line.

For more information check Branch Formulations.

The specified constraints are formulated as:

\[\begin{align*} +v_t^\text{th} + w_t^\text{th} \le 1, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.DurationConstraintType

Struct to create the duration constraint for commitment formulations, i.e. min-up and min-down.

For more information check ThermalGen Formulations.

source
PowerSimulations.RampConstraintType

Struct to create the RampConstraint associated with a specified thermal device or reserve service.

For thermal units, see more information in Thermal Formulations. The constraint is as follows:

\[-R^\text{th,dn} \le p_t^\text{th} - p_{t-1}^\text{th} \le R^\text{th,up}, \quad \forall t\in \{1, \dots, T\}\]

For Ramp Reserve, see more information in Service Formulations. The constraint is as follows:

\[r_{d,t} \le R^\text{th,up} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveUp)} \\ +r_{d,t} \le R^\text{th,dn} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveDown)}\]

source
PowerSimulations.StartupInitialConditionConstraintType

Struct to create the start-up initial condition constraints for ThermalMultiStart.

For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.

source
PowerSimulations.StartupTimeLimitTemperatureConstraintType

Struct to create the start-up time limit constraints for ThermalMultiStart.

For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.

source

Renewable Unit Constraints

PowerSimulations.EqualityConstraintType

Struct to create the constraint that sets the reactive power to the power factor in the RenewableConstantPowerFactor formulation for renewable units.

For more information check RenewableGen Formulations.

The specified constraint is formulated as:

\[q_t^\text{re} = \text{pf} \cdot p_t^\text{re}, \quad \forall t \in \{1,\dots, T\}\]

source

Branches Constraints

PowerSimulations.FlowLimitConstraintType

Struct to create the constraint that set the flow limits through a PhaseShiftingTransformer.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[-R^\text{max} \le f_t \le R^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.FlowRateConstraintType

Struct to create the constraint that set the flow limits through an HVDC two-terminal branch.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[R^\text{min} \le f_t \le R^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source
PowerSimulations.FlowRateConstraintFromToType

Struct to create the constraint that set the flow from-to limits through an HVDC two-terminal branch.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[R^\text{from,min} \le f_t^\text{from-to} \le R^\text{from,max}, \forall t \in \{1,\dots, T\}\]

source
PowerSimulations.FlowRateConstraintToFromType

Struct to create the constraint that set the flow to-from limits through an HVDC two-terminal branch.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[R^\text{to,min} \le f_t^\text{to-from} \le R^\text{to,max},\quad \forall t \in \{1,\dots, T\}\]

source
PowerSimulations.HVDCPowerBalanceType

Struct to create the constraints that set the power balance across a lossy HVDC two-terminal line.

For more information check Branch Formulations.

The specified constraints are formulated as:

\[\begin{align*} & f_t^\text{to-from} - f_t^\text{from-to} \le L_1 \cdot f_t^\text{to-from} - L_0,\quad \forall t \in \{1,\dots, T\} \\ & f_t^\text{from-to} - f_t^\text{to-from} \ge L_1 \cdot f_t^\text{from-to} + L_0,\quad \forall t \in \{1,\dots, T\} \\ & f_t^\text{from-to} - f_t^\text{to-from} \ge - M^\text{big} (1 - u^\text{dir}_t),\quad \forall t \in \{1,\dots, T\} \\ & f_t^\text{to-from} - f_t^\text{from-to} \ge - M^\text{big} u^\text{dir}_t,\quad \forall t \in \{1,\dots, T\} \\ -\end{align*}\]

source
PowerSimulations.NetworkFlowConstraintType

Struct to create the constraint the AC branch flows depending on the network model. For more information check Branch Formulations.

The specified constraint depends on the network model chosen. The most common application is the StaticBranch in a PTDF Network Model:

\[f_t = \sum_{i=1}^N \text{PTDF}_{i,b} \cdot \text{Bal}_{i,t}, \quad \forall t \in \{1,\dots, T\}\]

source
PowerSimulations.RateLimitConstraintType

Struct to create the constraint that set the AC flow limits through branches.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[\begin{align*} +\end{align*}\]

source
PowerSimulations.NetworkFlowConstraintType

Struct to create the constraint the AC branch flows depending on the network model. For more information check Branch Formulations.

The specified constraint depends on the network model chosen. The most common application is the StaticBranch in a PTDF Network Model:

\[f_t = \sum_{i=1}^N \text{PTDF}_{i,b} \cdot \text{Bal}_{i,t}, \quad \forall t \in \{1,\dots, T\}\]

source
PowerSimulations.RateLimitConstraintType

Struct to create the constraint that set the AC flow limits through branches.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[\begin{align*} & f_t - f_t^\text{sl,up} \le R^\text{max},\quad \forall t \in \{1,\dots, T\} \\ & f_t + f_t^\text{sl,lo} \ge -R^\text{max},\quad \forall t \in \{1,\dots, T\} -\end{align*}\]

source
PowerSimulations.PhaseAngleControlLimitType

Struct to create the constraint that set the angle limits through a PhaseShiftingTransformer.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[\Theta^\text{min} \le \theta^\text{shift}_t \le \Theta^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source

Feedforward Constraints

PowerSimulations.FeedforwardSemiContinuousConstraintType

Struct to create the constraint for semicontinuous feedforward limits.

For more information check Feedforward Formulations.

The specified constraint is formulated as:

\[\begin{align*} +\end{align*}\]

source
PowerSimulations.PhaseAngleControlLimitType

Struct to create the constraint that set the angle limits through a PhaseShiftingTransformer.

For more information check Branch Formulations.

The specified constraint is formulated as:

\[\Theta^\text{min} \le \theta^\text{shift}_t \le \Theta^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

source

Feedforward Constraints

PowerSimulations.FeedforwardSemiContinuousConstraintType

Struct to create the constraint for semicontinuous feedforward limits.

For more information check Feedforward Formulations.

The specified constraint is formulated as:

\[\begin{align*} & \text{ActivePowerRangeExpressionUB}_t := p_t^\text{th} - \text{on}_t^\text{th}P^\text{th,max} \le 0, \quad \forall t\in \{1, \dots, T\} \\ & \text{ActivePowerRangeExpressionLB}_t := p_t^\text{th} - \text{on}_t^\text{th}P^\text{th,min} \ge 0, \quad \forall t\in \{1, \dots, T\} -\end{align*}\]

source
PowerSimulations.FeedforwardUpperBoundConstraintType

Struct to create the constraint for upper bound feedforward limits.

For more information check Feedforward Formulations.

The specified constraint is formulated as:

\[\begin{align*} +\end{align*}\]

source
PowerSimulations.FeedforwardUpperBoundConstraintType

Struct to create the constraint for upper bound feedforward limits.

For more information check Feedforward Formulations.

The specified constraint is formulated as:

\[\begin{align*} & \text{AffectedVariable}_t - p_t^\text{ff,ubsl} \le \text{SourceVariableParameter}_t, \quad \forall t \in \{1,\dots, T\} -\end{align*}\]

source
PowerSimulations.FeedforwardLowerBoundConstraintType

Struct to create the constraint for lower bound feedforward limits.

For more information check Feedforward Formulations.

The specified constraint is formulated as:

\[\begin{align*} +\end{align*}\]

source
PowerSimulations.FeedforwardLowerBoundConstraintType

Struct to create the constraint for lower bound feedforward limits.

For more information check Feedforward Formulations.

The specified constraint is formulated as:

\[\begin{align*} & \text{AffectedVariable}_t + p_t^\text{ff,lbsl} \ge \text{SourceVariableParameter}_t, \quad \forall t \in \{1,\dots, T\} -\end{align*}\]

source
  - 

Parameters

Time Series Parameters

PowerSimulations.ActivePowerTimeSeriesParameterType

Parameter to define active power time series

source
PowerSimulations.ReactivePowerTimeSeriesParameterType

Parameter to define reactive power time series

source
PowerSimulations.RequirementTimeSeriesParameterType

Parameter to define requirement time series

source

Variable Value Parameters

PowerSimulations.UpperBoundValueParameterType

Parameter to define variable upper bound

source
PowerSimulations.LowerBoundValueParameterType

Parameter to define variable lower bound

source
PowerSimulations.OnStatusParameterType

Parameter to define unit commitment status

source
PowerSimulations.FixValueParameterType

Parameter to FixValueParameter

source

Objective Function Parameters

PowerSimulations.CostFunctionParameterType

Parameter to define cost function coefficient

source

Results

Acessing Optimization Model

PowerSimulations.serialize_optimization_modelMethod
serialize_optimization_model(
+\end{align*}\]

source
  + 

Parameters

Time Series Parameters

Variable Value Parameters

Objective Function Parameters

Results

Acessing Optimization Model

PowerSimulations.get_all_constraint_indexMethod
get_all_constraint_index(
     model::PowerSimulations.OperationModel
 ) -> Vector{Tuple{InfrastructureSystems.Optimization.ConstraintKey, Int64, Int64}}
-

Each Tuple corresponds to (conname, internalindex, moi_index)

source

Accessing Problem Results

Accessing Problem Results

Accessing Simulation Results

Accessing Simulation Results

PowerSimulations.SimulationResultsType
SimulationResults(
     path::AbstractString,
     name::AbstractString;
     ...
@@ -302,12 +302,12 @@
     execution;
     ignore_status
 ) -> SimulationResults
-

Construct SimulationResults from a simulation output directory.

Arguments

  • path::AbstractString: Simulation output directory
  • name::AbstractString: Simulation name
  • execution::AbstractString: Execution number. Default is the most recent.
  • ignore_status::Bool: If true, return results even if the simulation failed.
source
PowerSimulations.SimulationResultsMethod
SimulationResults(
+

Construct SimulationResults from a simulation output directory.

Arguments

  • path::AbstractString: Simulation output directory
  • name::AbstractString: Simulation name
  • execution::AbstractString: Execution number. Default is the most recent.
  • ignore_status::Bool: If true, return results even if the simulation failed.
source
InfrastructureSystems.Optimization.export_resultsMethod
export_results(results::SimulationResults, exports)
 

Export results to files in the results directory.

Arguments

  • results::SimulationResults: simulation results
  • exports: SimulationResultsExport or anything that can be passed to its constructor. (such as Dict or path to JSON file)

An example JSON file demonstrating possible options is below. Note that start_time, end_time, path, and format are optional.

{
   "decision_models": [
     {
@@ -337,35 +337,35 @@
   "path": null,
   "format": "csv"
 }
-
source
InfrastructureSystems.Optimization.read_aux_variableMethod
read_aux_variable(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},
     args...;
     initial_time,
     count,
     store
 ) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}
-

Return the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_aux_variable_names or args that can be splatted into a AuxVarKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
source
InfrastructureSystems.Optimization.read_dualMethod
read_dual(
+

Return the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_aux_variable_names or args that can be splatted into a AuxVarKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
source
InfrastructureSystems.Optimization.read_dualMethod
read_dual(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},
     args...;
     initial_time,
     count,
     store
 ) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}
-

Return the values for the requested dual. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_dual_names or args that can be splatted into a ConstraintKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
  • store::SimulationStore: a store that has been opened for reading
source
InfrastructureSystems.Optimization.read_expressionMethod
read_expression(
+

Return the values for the requested dual. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_dual_names or args that can be splatted into a ConstraintKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
  • store::SimulationStore: a store that has been opened for reading
source
InfrastructureSystems.Optimization.read_expressionMethod
read_expression(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},
     args...;
     initial_time,
     count,
     store
 ) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}
-

Return the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_expression_names or args that can be splatted into a ExpressionKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
source
InfrastructureSystems.Optimization.read_parameterMethod
read_parameter(
+

Return the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_expression_names or args that can be splatted into a ExpressionKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
source
InfrastructureSystems.Optimization.read_parameterMethod
read_parameter(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},
     args...;
     initial_time,
     count,
     store
 ) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}
-

Return the values for the requested parameter. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_parameter_names or args that can be splatted into a ParameterKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
source
InfrastructureSystems.Optimization.read_variableMethod
read_variable(
+

Return the values for the requested parameter. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_parameter_names or args that can be splatted into a ParameterKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
source
InfrastructureSystems.Optimization.read_variableMethod
read_variable(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},
     args...;
     initial_time,
@@ -373,10 +373,10 @@
     store
 ) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}
 

Return the values for the requested variable. It keeps requests when performing multiple retrievals.

Arguments

  • args: Can be a string returned from list_variable_names or args that can be splatted into a VariableKey.
  • initial_time::Dates.DateTime : initial of the requested results
  • count::Int: Number of results
  • store::SimulationStore: a store that has been opened for reading

Examples

read_variable(results, ActivePowerVariable, ThermalStandard)
-read_variable(results, "ActivePowerVariable__ThermalStandard")
source
PowerSimulations.load_results!Method
load_results!(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},
     count::Int64;
     initial_time,
@@ -387,7 +387,7 @@
     expressions,
     store
 )
-

Load the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections, when reading the same data very many times, etc. Multiple calls augment the cache according to these rules, where "variable" means "variable, expression, etc.":

  • Requests for an already cached variable at a lesser count than already cached do not decrease the count of the cached variable
  • Requests for an already cached variable at a greater count than already cached do increase the count of the cached variable
  • Requests for new variables are fulfilled without evicting existing variables

Note that count is global across all variables, so increasing the count re-reads already cached variables. For each variable, each element must be the name encoded as a string, like "ActivePowerVariable__ThermalStandard" or a Tuple with its constituent types, like (ActivePowerVariable, ThermalStandard). To clear the cache, use Base.empty!.

Arguments

  • count::Int: Number of windows to load.
  • initial_time::Dates.DateTime : Initial time of first window to load. Defaults to first.
  • aux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.
  • duals::Vector{Union{String, Tuple}}: Optional list of duals to load.
  • expressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.
  • parameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.
  • variables::Vector{Union{String, Tuple}}: Optional list of variables to load.
source
PowerSimulations.load_results!Method
load_results!(
+

Load the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections, when reading the same data very many times, etc. Multiple calls augment the cache according to these rules, where "variable" means "variable, expression, etc.":

  • Requests for an already cached variable at a lesser count than already cached do not decrease the count of the cached variable
  • Requests for an already cached variable at a greater count than already cached do increase the count of the cached variable
  • Requests for new variables are fulfilled without evicting existing variables

Note that count is global across all variables, so increasing the count re-reads already cached variables. For each variable, each element must be the name encoded as a string, like "ActivePowerVariable__ThermalStandard" or a Tuple with its constituent types, like (ActivePowerVariable, ThermalStandard). To clear the cache, use Base.empty!.

Arguments

  • count::Int: Number of windows to load.
  • initial_time::Dates.DateTime : Initial time of first window to load. Defaults to first.
  • aux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.
  • duals::Vector{Union{String, Tuple}}: Optional list of duals to load.
  • expressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.
  • parameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.
  • variables::Vector{Union{String, Tuple}}: Optional list of variables to load.
source
PowerSimulations.load_results!Method
load_results!(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.EmulationModelSimulationResults};
     aux_variables,
     duals,
@@ -395,75 +395,75 @@
     parameters,
     variables
 )
-

Load the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections.

For each variable/parameter/dual, etc., each element must be the name encoded as a string, like "ActivePowerVariable__ThermalStandard"or a Tuple with its constituent types, like(ActivePowerVariable, ThermalStandard)`.

Arguments

  • aux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.
  • duals::Vector{Union{String, Tuple}}: Optional list of duals to load.
  • expressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.
  • parameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.
  • variables::Vector{Union{String, Tuple}}: Optional list of variables to load.
source
InfrastructureSystems.Optimization.get_timestampsMethod
get_timestamps(
+

Load the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections.

For each variable/parameter/dual, etc., each element must be the name encoded as a string, like "ActivePowerVariable__ThermalStandard"or a Tuple with its constituent types, like(ActivePowerVariable, ThermalStandard)`.

Arguments

  • aux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.
  • duals::Vector{Union{String, Tuple}}: Optional list of duals to load.
  • expressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.
  • parameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.
  • variables::Vector{Union{String, Tuple}}: Optional list of variables to load.
source
PowerSimulations.get_system!Method
get_system!(
+

Return the optimizer stats for the problem as a DataFrame.

Accepted keywords

  • store::SimulationStore: a store that has been opened for reading
source
PowerSimulations.get_system!Method
get_system!(
     results::Union{OptimizationProblemResults, PowerSimulations.SimulationProblemResults};
     kwargs...
 ) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsType}
-

Return the system used for the problem. If the system hasn't already been deserialized or set with set_system! then deserialize and store it.

If the simulation was configured to serialize all systems to file then the returned system will include all data. If that was not configured then the returned system will include all data except time series data.

source
PowerSimulations.read_realized_aux_variableMethod
read_realized_aux_variable(
+

Return the system used for the problem. If the system hasn't already been deserialized or set with set_system! then deserialize and store it.

If the simulation was configured to serialize all systems to file then the returned system will include all data. If that was not configured then the returned system will include all data except time series data.

source
PowerSimulations.read_realized_variableMethod
read_realized_variable(
     res::PowerSimulations.SimulationProblemResults,
     variable::AbstractString;
     kwargs...
 ) -> Any
 

Return the final values for the requested variable for each time step for a problem.

Decision problem results are returned in a Dict{DateTime, DataFrame}.

Emulation problem results are returned in a DataFrame.

Limit the data sizes returned by specifying initial_time and count for decision problems or start_time and len for emulation problems.

See also load_results! to preload data into memory.

Arguments

  • variable::Union{String, Tuple}: Variable name as a string or a Tuple with variable type and device type.
  • initial_time::Dates.DateTime: Initial time of the requested results. Decision problems only.
  • count::Int: Number of results. Decision problems only.
  • start_time::Dates.DateTime: Start time of the requested results. Emulation problems only.
  • len::Int: Number of rows in each DataFrame. Emulation problems only.

Examples

julia > read_realized_variable(results, "ActivePowerVariable__ThermalStandard")
-julia > read_realized_variable(results, (ActivePowerVariable, ThermalStandard))
source
PowerSimulations.read_realized_variablesMethod
read_realized_variables(
     res::PowerSimulations.SimulationProblemResults;
     kwargs...
 ) -> Dict
@@ -472,21 +472,21 @@
 julia > variables_as_types =
     [(ActivePowerVariable, ThermalStandard), (ActivePowerVariable, RenewableDispatch)]
 julia > read_realized_variables(results, variables_as_strings)
-julia > read_realized_variables(results, variables_as_types)
source
PowerSimulations.set_system!Method
set_system!(
     results::PowerSimulations.SimulationProblemResults,
     system::AbstractString
 )
-

Set the system in the results instance.

Throws InvalidValue if the system UUID is incorrect.

Arguments

  • results::SimulationProblemResults: Results object
  • system::AbstractString: Path to the system json file

Examples

julia > set_system!(res, "my_path/system_data.json")
source
InfrastructureSystems.Optimization.read_optimizer_statsMethod
read_optimizer_stats(
+

Set the system in the results instance.

Throws InvalidValue if the system UUID is incorrect.

Arguments

  • results::SimulationProblemResults: Results object
  • system::AbstractString: Path to the system json file

Examples

julia > set_system!(res, "my_path/system_data.json")
source

Simulation Recorder

Simulation Recorder

PowerSimulations.list_simulation_eventsMethod
list_simulation_events(
     ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},
     output_dir::AbstractString;
     ...
@@ -504,7 +504,7 @@
     filter_func::Union{Nothing, Function} = nothing;
     step = nothing,
     model = nothing,
-) where {T <: IS.AbstractRecorderEvent}

List simulation events of type T in a simulation output directory.

Arguments

  • output_dir::AbstractString: Simulation output directory
  • filter_func::Union{Nothing, Function} = nothing: Refer to show_simulation_events.
  • step::Int = nothing: Filter events by step. Required if model is passed.
  • model::Int = nothing: Filter events by model.
source
PowerSimulations.show_recorder_eventsMethod
show_recorder_events(
+) where {T <: IS.AbstractRecorderEvent}

List simulation events of type T in a simulation output directory.

Arguments

  • output_dir::AbstractString: Simulation output directory
  • filter_func::Union{Nothing, Function} = nothing: Refer to show_simulation_events.
  • step::Int = nothing: Filter events by step. Required if model is passed.
  • model::Int = nothing: Filter events by model.
source
PowerSimulations.show_recorder_eventsMethod
show_recorder_events(
     ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},
     filename::AbstractString;
     ...
@@ -522,7 +522,7 @@
     filter_func::Union{Nothing, Function} = nothing;
     wall_time = false,
     kwargs...,
-) where {T <: IS.AbstractRecorderEvent}

Show the events of type T in a recorder file.

Arguments

  • ::Type{T}: Recorder event type
  • filename::AbstractString: recorder filename
  • filter_func::Union{Nothing, Function} = nothing: Optional function that accepts an event of type T and returns a Bool. Apply this function to each event and only return events where the result is true.
  • wall_time = false: If true, show the wall_time timestamp.
source
PowerSimulations.show_simulation_eventsMethod
show_simulation_events(
+) where {T <: IS.AbstractRecorderEvent}

Show the events of type T in a recorder file.

Arguments

  • ::Type{T}: Recorder event type
  • filename::AbstractString: recorder filename
  • filter_func::Union{Nothing, Function} = nothing: Optional function that accepts an event of type T and returns a Bool. Apply this function to each event and only return events where the result is true.
  • wall_time = false: If true, show the wall_time timestamp.
source
PowerSimulations.show_simulation_eventsMethod
show_simulation_events(
     ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},
     output_dir::AbstractString;
     ...
@@ -544,4 +544,4 @@
     model = nothing,
     wall_time = false,
     kwargs...,
-) where { T <: IS.AbstractRecorderEvent}

Show all simulation events of type T in a simulation output directory.

Arguments

  • ::Type{T}: Recorder event type
  • output_dir::AbstractString: Simulation output directory
  • filter_func::Union{Nothing, Function} = nothing: Refer to show_recorder_events.
  • step::Int = nothing: Filter events by step. Required if model is passed.
  • model::Int = nothing: Filter events by model.
  • wall_time = false: If true, show the wall_time timestamp.
source
+) where { T <: IS.AbstractRecorderEvent}

Show all simulation events of type T in a simulation output directory.

Arguments

source diff --git a/dev/code_base_developer_guide/developer/index.html b/dev/code_base_developer_guide/developer/index.html index e7621e24a..ffd6bde16 100644 --- a/dev/code_base_developer_guide/developer/index.html +++ b/dev/code_base_developer_guide/developer/index.html @@ -1,2 +1,2 @@ -Developer Guide · PowerSimulations.jl
+Developer Guide · PowerSimulations.jl
diff --git a/dev/code_base_developer_guide/extending_powersimulations/index.html b/dev/code_base_developer_guide/extending_powersimulations/index.html index 18ff3eb7d..5c742ae45 100644 --- a/dev/code_base_developer_guide/extending_powersimulations/index.html +++ b/dev/code_base_developer_guide/extending_powersimulations/index.html @@ -33,4 +33,4 @@ │ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Alta │ 1.0 │ 1 │ │ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Brighton │ 1.0 │ 1 │ │ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Sundance │ 0.0 │ 1 │ -└─────────────────────────┴─────────────────────────────┴─────────────────────┴────────────────────────┴─────────────────┴─────────────┴─────┴──────────────┘ +└─────────────────────────┴─────────────────────────────┴─────────────────────┴────────────────────────┴─────────────────┴─────────────┴─────┴──────────────┘ diff --git a/dev/code_base_developer_guide/internal/index.html b/dev/code_base_developer_guide/internal/index.html index 9cce589e0..556f96f84 100644 --- a/dev/code_base_developer_guide/internal/index.html +++ b/dev/code_base_developer_guide/internal/index.html @@ -1,16 +1,16 @@ -Internals · PowerSimulations.jl

Internal API

PowerSimulations.OperationModelType

Abstract type for Decision Model and Emulation Model. OperationModel structs are parameterized with DecisionProblem or Emulation Problem structs

source
InfrastructureSystems.Optimization.read_results_with_keysMethod
read_results_with_keys(
+Internals · PowerSimulations.jl

Internal API

PowerSimulations.OperationModelType

Abstract type for Decision Model and Emulation Model. OperationModel structs are parameterized with DecisionProblem or Emulation Problem structs

source
InfrastructureSystems.Optimization.read_results_with_keysMethod
read_results_with_keys(
     res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},
     result_keys::Vector{<:InfrastructureSystems.Optimization.OptimizationContainerKey};
     start_time,
     len,
     cols
 ) -> Dict{InfrastructureSystems.Optimization.OptimizationContainerKey, DataFrames.DataFrame}
-

High-level function to read a DataFrame of results.

Arguments

  • res: the results to read.
  • result_keys::Vector{<:OptimizationContainerKey}: the keys to read. Output will be a Dict{OptimizationContainerKey, DataFrame} with these as the keys
  • start_time::Union{Nothing, Dates.DateTime} = nothing: the time at which the resulting time series should begin; nothing indicates the first time in the results
  • len::Union{Int, Nothing} = nothing: the number of steps in the resulting time series; nothing indicates up to the end of the results
  • cols::Union{Colon, Vector{String}} = (:): which columns to fetch; defaults to :, i.e., all the columns
source
PowerSimulations._add_pwl_constraint!Method
_add_pwl_constraint!(
+

High-level function to read a DataFrame of results.

Arguments

  • res: the results to read.
  • result_keys::Vector{<:OptimizationContainerKey}: the keys to read. Output will be a Dict{OptimizationContainerKey, DataFrame} with these as the keys
  • start_time::Union{Nothing, Dates.DateTime} = nothing: the time at which the resulting time series should begin; nothing indicates the first time in the results
  • len::Union{Int, Nothing} = nothing: the number of steps in the resulting time series; nothing indicates up to the end of the results
  • cols::Union{Colon, Vector{String}} = (:): which columns to fetch; defaults to :, i.e., all the columns
source
PowerSimulations._add_pwl_constraint!Method
_add_pwl_constraint!(
     container::PowerSimulations.OptimizationContainer,
     component::Component,
     _::InfrastructureSystems.Optimization.VariableType,
@@ -18,7 +18,7 @@
     period::Int64
 )
 

Implement the constraints for PWL Block Offer variables. That is:

\[\sum_{k\in\mathcal{K}} \delta_{k,t} = p_t \\ -\sum_{k\in\mathcal{K}} \delta_{k,t} <= P_{k+1,t}^{max} - P_{k,t}^{max}\]

source
PowerSimulations._add_pwl_constraint!Method
_add_pwl_constraint!(
     container::PowerSimulations.OptimizationContainer,
     component::Component,
     _::InfrastructureSystems.Optimization.VariableType,
@@ -27,7 +27,7 @@
     period::Int64
 )
 

Implement the constraints for PWL variables. That is:

\[\sum_{k\in\mathcal{K}} P_k^{max} \delta_{k,t} = p_t \\ -\sum_{k\in\mathcal{K}} \delta_{k,t} = on_t\]

source
PowerSimulations._add_pwl_constraint!Method
_add_pwl_constraint!(
     container::PowerSimulations.OptimizationContainer,
     component::Component,
     _::PowerAboveMinimumVariable,
@@ -36,7 +36,7 @@
     period::Int64
 )
 

Implement the constraints for PWL variables for Compact form. That is:

\[\sum_{k\in\mathcal{K}} P_k^{max} \delta_{k,t} = p_t + P_min * u_t \\ -\sum_{k\in\mathcal{K}} \delta_{k,t} = on_t\]

source
PowerSimulations._add_pwl_constraint!Method
_add_pwl_constraint!(
     container::PowerSimulations.OptimizationContainer,
     component::ReserveDemandCurve,
     _::ServiceRequirementVariable,
@@ -45,7 +45,7 @@
     period::Int64
 )
 

Implement the constraints for PWL Block Offer variables for ORDC. That is:

\[\sum_{k\in\mathcal{K}} \delta_{k,t} = p_t \\ -\sum_{k\in\mathcal{K}} \delta_{k,t} <= P_{k+1,t}^{max} - P_{k,t}^{max}\]

source
PowerSimulations._add_pwl_sos_constraint!Method
_add_pwl_sos_constraint!(
     container::PowerSimulations.OptimizationContainer,
     component::Component,
     _::InfrastructureSystems.Optimization.VariableType,
@@ -53,7 +53,7 @@
     sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,
     period::Int64
 )
-

Implement the SOS for PWL variables. That is:

\[\{\delta_{i,t}, ..., \delta_{k,t}\} \in \text{SOS}_2\]

source
PowerSimulations._add_pwl_term!Method
_add_pwl_term!(
     container::PowerSimulations.OptimizationContainer,
     component::Component,
     cost_function::MarketBidCost,
@@ -61,220 +61,220 @@
     _::InfrastructureSystems.Optimization.VariableType,
     _::PowerSimulations.AbstractDeviceFormulation
 ) -> Vector{JuMP.AffExpr}
-

Add PWL cost terms for data coming from the MarketBidCost with a fixed incremental offer curve

source
PowerSimulations._add_pwl_term!Method
_add_pwl_term!(
     container::PowerSimulations.OptimizationContainer,
     component::Component,
     cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},
     _::InfrastructureSystems.Optimization.VariableType,
     _::PowerSimulations.AbstractDeviceFormulation
 ) -> Vector{JuMP.AffExpr}
-

Add PWL cost terms for data coming from a PiecewisePointCurve

source
PowerSimulations._add_pwl_term!Method
_add_pwl_term!(
     container::PowerSimulations.OptimizationContainer,
     component::ThermalGen,
     cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},
     _::InfrastructureSystems.Optimization.VariableType,
     _::ThermalDispatchNoMin
 ) -> Vector{JuMP.AffExpr}
-

Add PWL cost terms for data coming from a PiecewisePointCurve for ThermalDispatchNoMin formulation

source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::CostCurve{LinearCurve},
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.CostCurve{PSY.LinearCurve} : container for cost to be associated with variable
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
+

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.CostCurve{PSY.LinearCurve} : container for cost to be associated with variable
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::CostCurve{QuadraticCurve},
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Equation

gen_cost = dt*sign*(sum(variable.^2)*cost_data[1] + sum(variable)*cost_data[2])

LaTeX

$cost = dt\times sign (sum_{i\in I} c_1 v_i^2 + sum_{i\in I} c_2 v_i )$

for quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.CostCurve{PSY.QuadraticCurve} : container for quadratic factors
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
+

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Equation

gen_cost = dt*sign*(sum(variable.^2)*cost_data[1] + sum(variable)*cost_data[2])

LaTeX

$cost = dt\times sign (sum_{i\in I} c_1 v_i^2 + sum_{i\in I} c_2 v_i )$

for quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.CostCurve{PSY.QuadraticCurve} : container for quadratic factors
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::FuelCurve{LinearCurve},
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.FuelCurve{PSY.LinearCurve} : container for cost to be associated with variable
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
+

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.FuelCurve{PSY.LinearCurve} : container for cost to be associated with variable
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::FuelCurve{QuadraticCurve},
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Equation

gen_cost = dt*(sum(variable.^2)*cost_data[1]*fuel_cost + sum(variable)*cost_data[2]*fuel_cost)

LaTeX

$cost = dt\times (sum_{i\in I} c_f c_1 v_i^2 + sum_{i\in I} c_f c_2 v_i )$

for quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.FuelCurve{PSY.QuadraticCurve} : container for quadratic factors
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
+

Adds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.

Equation

gen_cost = dt*(sum(variable.^2)*cost_data[1]*fuel_cost + sum(variable)*cost_data[2]*fuel_cost)

LaTeX

$cost = dt\times (sum_{i\in I} c_f c_1 v_i^2 + sum_{i\in I} c_f c_2 v_i )$

for quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_component::PSY.FuelCurve{PSY.QuadraticCurve} : container for quadratic factors
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::MarketBidCost,
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Creates piecewise linear market bid function using a sum of variables and expression for market participants. Decremental offers are not accepted for most components, except Storage systems and loads.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::MarketBidCost : container for market bid cost
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
+

Creates piecewise linear market bid function using a sum of variables and expression for market participants. Decremental offers are not accepted for most components, except Storage systems and loads.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::MarketBidCost : container for market bid cost
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Creates piecewise linear cost function using a sum of variables and expression with sign and time step included.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::PSY.CostCurve{PSY.PiecewisePointCurve}: container for piecewise linear cost
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
+

Creates piecewise linear cost function using a sum of variables and expression with sign and time step included.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::PSY.CostCurve{PSY.PiecewisePointCurve}: container for piecewise linear cost
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::Union{CostCurve{PiecewiseAverageCurve}, CostCurve{PiecewiseIncrementalCurve}},
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Creates piecewise linear cost function using a sum of variables and expression with sign and time step included.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::PSY.Union{PSY.CostCurve{PSY.PiecewiseIncrementalCurve}, PSY.CostCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
+

Creates piecewise linear cost function using a sum of variables and expression with sign and time step included.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::PSY.Union{PSY.CostCurve{PSY.PiecewiseIncrementalCurve}, PSY.CostCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost
source
PowerSimulations._add_variable_cost_to_objective!Method
_add_variable_cost_to_objective!(
     container::PowerSimulations.OptimizationContainer,
     _::InfrastructureSystems.Optimization.VariableType,
     component::Component,
     cost_function::Union{FuelCurve{PiecewiseAverageCurve}, FuelCurve{PiecewiseIncrementalCurve}},
     _::PowerSimulations.AbstractDeviceFormulation
 )
-

Creates piecewise linear fuel cost function using a sum of variables and expression with sign and time step included.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::PSY.Union{PSY.FuelCurve{PSY.PiecewiseIncrementalCurve}, PSY.FuelCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost
source
PowerSimulations._allocate_execution_orderMethod
_allocate_execution_order(
+

Creates piecewise linear fuel cost function using a sum of variables and expression with sign and time step included.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • var_key::VariableKey: The variable name
  • componentname::String: The componentname of the variable container
  • cost_function::PSY.Union{PSY.FuelCurve{PSY.PiecewiseIncrementalCurve}, PSY.FuelCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost
source
PowerSimulations._allocate_execution_orderMethod
_allocate_execution_order(
     interval_run_counts::Vector{Int64}
 ) -> Vector{Int64}
-

Function calculates the total number of problem executions in the simulation and allocates the appropiate vector

source
PowerSimulations._calculate_interval_inner_countsMethod
_calculate_interval_inner_counts(
     intervals::OrderedDict{Symbol, Dates.Millisecond}
 ) -> Vector{Int64}
-

calculateintervalinnercounts(intervals::OrderedDict{String,<:Dates.TimePeriod})

Calculates how many times a problem is executed for every interval of the previous problem

source
PowerSimulations._create_time_series_multiplier_indexMethod
_create_time_series_multiplier_index(
     model,
     _::Type{T<:InfrastructureSystems.Optimization.TimeSeriesParameter}
 ) -> Union{Nothing, Int64}
-

Function to create a unique index of time series names for each device model. For example, if two parameters each reference the same time series name, this function will return a different value for each parameter entry

source
PowerSimulations._get_data_for_tdcMethod
_get_data_for_tdc(
+

Function to create a unique index of time series names for each device model. For example, if two parameters each reference the same time series name, this function will return a different value for each parameter entry

source
PowerSimulations._get_data_for_tdcMethod
_get_data_for_tdc(
     initial_conditions_on::Array{T<:InitialCondition, 1},
     initial_conditions_off::Array{U<:InitialCondition, 1},
     resolution::Dates.TimePeriod
 ) -> Tuple{Matrix{InitialCondition}, Vector{@NamedTuple{up::Float64, down::Float64}}}
-

If the fraction of hours that a generator has a duration constraint is less than the fraction of hours that a single time_step represents then it is not binding.

source
PowerSimulations._get_initial_condition_typeMethod
_get_initial_condition_type(
+

If the fraction of hours that a generator has a duration constraint is less than the fraction of hours that a single time_step represents then it is not binding.

source
PowerSimulations._get_initial_condition_typeMethod
_get_initial_condition_type(
     _::Type{RampConstraint},
     _::Type{<:ThermalGen},
     _::Type{<:PowerSimulations.AbstractThermalFormulation}
 ) -> Type{PowerSimulations.DeviceAboveMinPower}
-

This function gets the data for the generators for ramping constraints of thermal generators

source
PowerSimulations._get_pwl_cost_expressionMethod
_get_pwl_cost_expression(
     container::PowerSimulations.OptimizationContainer,
     component::ReserveDemandCurve,
     time_period::Int64,
     cost_data::PiecewiseStepData,
     multiplier::Float64
 ) -> JuMP.AffExpr
-

Get cost expression for StepwiseCostReserve

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{NetworkFlowConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},
     model::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},
     network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}
 )
-

Add network flow constraints for ACBranch and NetworkModel with <: AbstractPTDFModel

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{RequirementConstraint},
     service::ConstantReserveGroup,
     contributing_services::Vector{<:Service},
     model::ServiceModel{SR<:ConstantReserveGroup, GroupReserve}
 )
-

This function creates the requirement constraint that will be attained by the appropriate services

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     cons_type::Type{RateLimitConstraintFromTo},
     devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},
     device_model::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},
     network_model::NetworkModel{T<:PowerModels.AbstractPowerModel}
 )
-

Add rate limit from to constraints for ACBranch with AbstractPowerModel

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     cons_type::Type{RateLimitConstraintToFrom},
     devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},
     _::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},
     network_model::NetworkModel{T<:PowerModels.AbstractPowerModel}
 )
-

Add rate limit to from constraints for ACBranch with AbstractPowerModel

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{FlowLimitConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{AreaInterchange},
     model::DeviceModel{AreaInterchange, StaticBranch},
     _::NetworkModel{T<:PowerModels.AbstractActivePowerModel}
 )
-

Add flow constraints for area interchanges

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{NetworkFlowConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},
     model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},
     network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}
 )
-

Add network flow constraints for PhaseShiftingTransformer and NetworkModel with <: AbstractPTDFModel

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{NetworkFlowConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},
     model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},
     _::NetworkModel{DCPPowerModel}
 )
-

Add network flow constraints for PhaseShiftingTransformer and NetworkModel with PM.DCPPowerModel

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{StartTypeConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},
     model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},
     _::NetworkModel
 )
-

Constructs contraints that restricts devices to one type of start at a time

Equations

sum(var_starts[name, s, t] for s in starts) = var_start[name, t]

LaTeX

$\sum^{S_g}_{s=1} δ^{s}(t) \eq x^{start}(t)$

source
PowerSimulations.add_constraints!Method
add_constraints!(
+

Constructs contraints that restricts devices to one type of start at a time

Equations

sum(var_starts[name, s, t] for s in starts) = var_start[name, t]

LaTeX

$\sum^{S_g}_{s=1} δ^{s}(t) \eq x^{start}(t)$

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{StartupInitialConditionConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},
     model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},
     _::NetworkModel
 )
-

Constructs contraints that restricts devices to one type of start at a time

Equations

ub: (time_limits[st+1]-1)*δ^{s}(t) + (1 - δ^{s}(t)) * M_VALUE >= sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime lb: (time_limits[st]-1)*δ^{s}(t) =< sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime

LaTeX

$TS^{s+1}_{g} δ^{s}(t) + (1-δ^{s}(t)) M_VALUE \geq \sum^{t}_{i=1} x^{status}(i) + DT_{g}^{0} \forall t in \{1, \ldots, TS^{s+1}_{g}$

$TS^{s}_{g} δ^{s}(t) \leq \sum^{t}_{i=1} x^{status}(i) + DT_{g}^{0} \forall t in \{1, \ldots, TS^{s+1}_{g}$

source
PowerSimulations.add_constraints!Method
add_constraints!(
+

Constructs contraints that restricts devices to one type of start at a time

Equations

ub: (time_limits[st+1]-1)*δ^{s}(t) + (1 - δ^{s}(t)) * M_VALUE >= sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime lb: (time_limits[st]-1)*δ^{s}(t) =< sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime

LaTeX

$TS^{s+1}_{g} δ^{s}(t) + (1-δ^{s}(t)) M_VALUE \geq \sum^{t}_{i=1} x^{status}(i) + DT_{g}^{0} \forall t in \{1, \ldots, TS^{s+1}_{g}$

$TS^{s}_{g} δ^{s}(t) \leq \sum^{t}_{i=1} x^{status}(i) + DT_{g}^{0} \forall t in \{1, \ldots, TS^{s+1}_{g}$

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{StartupTimeLimitTemperatureConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},
     model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},
     _::NetworkModel
 )
-

Constructs contraints for different types of starts based on generator down-time

Equations

for t in time_limits[s+1]:T

var_starts[name, s, t] <= sum( var_stop[name, t-i] for i in time_limits[s]:(time_limits[s+1]-1)

LaTeX

$δ^{s}(t) \leq \sum_{i=TS^{s}_{g}}^{TS^{s+1}_{g}} x^{stop}(t-i)$

source
PowerSimulations.add_constraints!Method
add_constraints!(
+

Constructs contraints for different types of starts based on generator down-time

Equations

for t in time_limits[s+1]:T

var_starts[name, s, t] <= sum( var_stop[name, t-i] for i in time_limits[s]:(time_limits[s+1]-1)

LaTeX

$δ^{s}(t) \leq \sum_{i=TS^{s}_{g}}^{TS^{s+1}_{g}} x^{stop}(t-i)$

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{PhaseAngleControlLimit},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},
     model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},
     _::NetworkModel{U<:PowerModels.AbstractActivePowerModel}
 )
-

Add phase angle limits for phase shifters

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{FlowLimitConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Union{MonitoredLine, PhaseShiftingTransformer}},
     model::DeviceModel{T<:Union{MonitoredLine, PhaseShiftingTransformer}, U<:PowerSimulations.AbstractBranchFormulation},
     _::NetworkModel{V<:PowerModels.AbstractDCPModel}
 )
-

Add branch flow constraints for monitored lines with DC Power Model

source
PowerSimulations.add_constraints!Method
add_constraints!(
     _::PowerSimulations.OptimizationContainer,
     _::Type{FlowLimitToFromConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:MonitoredLine},
     model::DeviceModel{T<:MonitoredLine, U<:StaticBranchUnbounded},
     _::NetworkModel{V<:PowerModels.AbstractActivePowerModel}
 )
-

Don't add branch flow constraints for monitored lines if formulation is StaticBranchUnbounded

source
PowerSimulations.add_constraints!Method
add_constraints!(
     _::PowerSimulations.OptimizationContainer,
     _::Type{RateLimitConstraintFromTo},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:MonitoredLine},
     model::DeviceModel{T<:MonitoredLine, U<:StaticBranchUnbounded},
     _::NetworkModel{V<:PowerModels.AbstractActivePowerModel}
 )
-

Don't add branch flow constraints for monitored lines if formulation is StaticBranchUnbounded

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     cons_type::Type{RateLimitConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ACBranch},
     device_model::DeviceModel{T<:ACBranch, U<:PowerSimulations.AbstractBranchFormulation},
     network_model::NetworkModel{V<:PowerModels.AbstractActivePowerModel}
 )
-

Add branch rate limit constraints for ACBranch with AbstractActivePowerModel

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{RampConstraint},
     devices::InfrastructureSystems.FlattenIteratorWrapper{U<:ThermalGen},
     model::DeviceModel{U<:ThermalGen, V<:PowerSimulations.AbstractThermalUnitCommitment},
     _::NetworkModel{W<:PowerModels.AbstractPowerModel}
 )
-

This function adds the ramping limits of generators when there are CommitmentVariables

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{<:ActivePowerVariableLimitsConstraint},
     U::Type{<:InfrastructureSystems.Optimization.VariableType},
@@ -282,7 +282,7 @@
     _::DeviceModel{V<:ThermalMultiStart, W<:ThermalMultiStartUnitCommitment},
     _::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

This function adds range constraint for the first time period. Constraint (10) from PGLIB formulation

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},
     U::Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}},
@@ -290,7 +290,7 @@
     model::DeviceModel{V<:ThermalGen, W<:PowerSimulations.AbstractThermalDispatchFormulation},
     _::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Semicontinuous range constraints for thermal dispatch formulations

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},
     U::Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}},
@@ -298,7 +298,7 @@
     model::DeviceModel{V<:ThermalGen, W<:PowerSimulations.AbstractThermalUnitCommitment},
     _::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Semicontinuous range constraints for unit commitment formulations

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},
     U::Type{<:Union{PowerAboveMinimumVariable, InfrastructureSystems.Optimization.ExpressionType}},
@@ -306,7 +306,7 @@
     model::DeviceModel{V<:ThermalGen, W<:ThermalCompactDispatch},
     network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Range constraints for thermal compact dispatch

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{<:ReactivePowerVariableLimitsConstraint},
     U::Type{<:ReactivePowerVariable},
@@ -314,7 +314,7 @@
     _::DeviceModel{V<:ElectricLoad, W<:PowerSimulations.AbstractControllablePowerLoadFormulation},
     network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Reactive Power Constraints on Controllable Loads Assume Constant power_factor

source
PowerSimulations.add_constraints!Method
add_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{<:ReactivePowerVariableLimitsConstraint},
     _::Type{<:ReactivePowerVariable},
@@ -322,7 +322,7 @@
     _::DeviceModel{V<:RenewableGen, W<:RenewableConstantPowerFactor},
     _::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Reactive Power Constraints on Renewable Gen Constant power_factor

source
PowerSimulations.add_feedforward_constraints!Method
add_feedforward_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::DeviceModel,
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Component},
@@ -332,7 +332,7 @@
           cons_name::Symbol,
           constraint_infos,
           param_reference,
-          var_key::VariableKey)

Constructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.

variable[var_name, t] <= param_reference[var_name]

LaTeX

$x \leq param^{max}$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • cons_name::Symbol : name of the constraint
  • param_reference : Reference to the JuMP.VariableRef used to determine the upperbound
  • var_key::VariableKey : the name of the continuous variable
source
PowerSimulations.add_feedforward_constraints!Method
add_feedforward_constraints!(
+          var_key::VariableKey)

Constructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.

variable[var_name, t] <= param_reference[var_name]

LaTeX

$x \leq param^{max}$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • cons_name::Symbol : name of the constraint
  • param_reference : Reference to the JuMP.VariableRef used to determine the upperbound
  • var_key::VariableKey : the name of the continuous variable
source
PowerSimulations.add_feedforward_constraints!Method
add_feedforward_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::DeviceModel,
     devices::Union{Array{T<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{T<:Component}},
@@ -343,7 +343,7 @@
         ::DeviceModel,
         devices::IS.FlattenIteratorWrapper{T},
         ff::FixValueFeedforward,
-    ) where {T <: PSY.Component}

Constructs a equality constraint to a fix a variable in one model using the variable value from other model results.

variable[var_name, t] == param[var_name, t]

LaTeX

$x == param$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • model::DeviceModel : the device model
  • devices::IS.FlattenIteratorWrapper{T} : list of devices
  • ff::FixValueFeedforward : a instance of the FixValue Feedforward
source
PowerSimulations.add_feedforward_constraints!Method
add_feedforward_constraints!(
+    ) where {T <: PSY.Component}

Constructs a equality constraint to a fix a variable in one model using the variable value from other model results.

variable[var_name, t] == param[var_name, t]

LaTeX

$x == param$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • model::DeviceModel : the device model
  • devices::IS.FlattenIteratorWrapper{T} : list of devices
  • ff::FixValueFeedforward : a instance of the FixValue Feedforward
source
PowerSimulations.add_feedforward_constraints!Method
add_feedforward_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::DeviceModel{T<:Component, U<:PowerSimulations.AbstractDeviceFormulation},
     devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Component},
@@ -353,7 +353,7 @@
           cons_name::Symbol,
           constraint_infos,
           param_reference,
-          var_key::VariableKey)

Constructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.

variable[var_name, t] <= param_reference[var_name]

LaTeX

$x \leq param^{max}$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • cons_name::Symbol : name of the constraint
  • param_reference : Reference to the JuMP.VariableRef used to determine the upperbound
  • var_key::VariableKey : the name of the continuous variable
source
PowerSimulations.add_linear_ramp_constraints!Method
add_linear_ramp_constraints!(
+          var_key::VariableKey)

Constructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.

variable[var_name, t] <= param_reference[var_name]

LaTeX

$x \leq param^{max}$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • cons_name::Symbol : name of the constraint
  • param_reference : Reference to the JuMP.VariableRef used to determine the upperbound
  • var_key::VariableKey : the name of the continuous variable
source
PowerSimulations.add_linear_ramp_constraints!Method
add_linear_ramp_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{<:InfrastructureSystems.Optimization.ConstraintType},
     U::Type{S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}},
@@ -361,7 +361,7 @@
     model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},
     _::Type{<:PowerModels.AbstractPowerModel}
 )
-

Constructs allowed rate-of-change constraints from variables, initial condtions, and rate data.

If t = 1:

variable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up

initial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down

If t > 1:

variable[name, t] - variable[name, t-1] <= rate_data[1][ix].up

variable[name, t-1] - variable[name, t] <= rate_data[1][ix].down

LaTeX

$r^{down} \leq x_1 - x_{init} \leq r^{up}, \text{ for } t = 1$

$r^{down} \leq x_t - x_{t-1} \leq r^{up}, \forall t \geq 2$

source
PowerSimulations.add_range_constraints!Method
add_range_constraints!(
+

Constructs allowed rate-of-change constraints from variables, initial condtions, and rate data.

If t = 1:

variable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up

initial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down

If t > 1:

variable[name, t] - variable[name, t-1] <= rate_data[1][ix].up

variable[name, t-1] - variable[name, t] <= rate_data[1][ix].down

LaTeX

$r^{down} \leq x_1 - x_{init} \leq r^{up}, \text{ for } t = 1$

$r^{down} \leq x_t - x_{t-1} \leq r^{up}, \forall t \geq 2$

source
PowerSimulations.add_range_constraints!Method
add_range_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:InfrastructureSystems.Optimization.ConstraintType},
     _::Type{U<:InfrastructureSystems.Optimization.VariableType},
@@ -369,7 +369,7 @@
     model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},
     _::Type{X<:PowerModels.AbstractPowerModel}
 )
-

Constructs min/max range constraint from device variable.

If min and max within an epsilon width:

variable[name, t] == limits.max

Otherwise:

limits.min <= variable[name, t] <= limits.max

where limits in constraint_infos.

LaTeX

$x = limits^{max}, \text{ for } |limits^{max} - limits^{min}| < \varepsilon$

$limits^{min} \leq x \leq limits^{max}, \text{ otherwise }$

source
PowerSimulations.add_reserve_range_constraints!Method
add_reserve_range_constraints!(
+

Constructs min/max range constraint from device variable.

If min and max within an epsilon width:

variable[name, t] == limits.max

Otherwise:

limits.min <= variable[name, t] <= limits.max

where limits in constraint_infos.

LaTeX

$x = limits^{max}, \text{ for } |limits^{max} - limits^{min}| < \varepsilon$

$limits^{min} \leq x \leq limits^{max}, \text{ otherwise }$

source
PowerSimulations.add_reserve_range_constraints!Method
add_reserve_range_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:InputActivePowerVariableLimitsConstraint},
     _::Type{U<:InfrastructureSystems.Optimization.VariableType},
@@ -377,7 +377,7 @@
     model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},
     _::Type{X<:PowerModels.AbstractPowerModel}
 )
-

Constructs min/max range constraint from device variable and reservation decision variable.

varcts[name, t] <= limits.max * (1 - varbin[name, t])

varcts[name, t] >= limits.min * (1 - varbin[name, t])

where limits in constraint_infos.

LaTeX

$0 \leq x^{cts} \leq limits^{max} (1 - x^{bin}), \text{ for } limits^{min} = 0$

$limits^{min} (1 - x^{bin}) \leq x^{cts} \leq limits^{max} (1 - x^{bin}), \text{ otherwise }$

source
PowerSimulations.add_reserve_range_constraints!Method
add_reserve_range_constraints!(
+

Constructs min/max range constraint from device variable and reservation decision variable.

varcts[name, t] <= limits.max * (1 - varbin[name, t])

varcts[name, t] >= limits.min * (1 - varbin[name, t])

where limits in constraint_infos.

LaTeX

$0 \leq x^{cts} \leq limits^{max} (1 - x^{bin}), \text{ for } limits^{min} = 0$

$limits^{min} (1 - x^{bin}) \leq x^{cts} \leq limits^{max} (1 - x^{bin}), \text{ otherwise }$

source
PowerSimulations.add_reserve_range_constraints!Method
add_reserve_range_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}},
     _::Type{U<:InfrastructureSystems.Optimization.ExpressionType},
@@ -385,7 +385,7 @@
     model::DeviceModel{W<:Component, X<:PowerSimulations.AbstractDeviceFormulation},
     _::Type{Y<:PowerModels.AbstractPowerModel}
 )
-

Constructs min/max range constraint from device variable and reservation decision variable.

varcts[name, t] <= limits.max * varbin[name, t]

varcts[name, t] >= limits.min * varbin[name, t]

where limits in constraint_infos.

LaTeX

$limits^{min} x^{bin} \leq x^{cts} \leq limits^{max} x^{bin},$

source
PowerSimulations.add_reserve_range_constraints!Method
add_reserve_range_constraints!(
+

Constructs min/max range constraint from device variable and reservation decision variable.

varcts[name, t] <= limits.max * varbin[name, t]

varcts[name, t] >= limits.min * varbin[name, t]

where limits in constraint_infos.

LaTeX

$limits^{min} x^{bin} \leq x^{cts} \leq limits^{max} x^{bin},$

source
PowerSimulations.add_reserve_range_constraints!Method
add_reserve_range_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}},
     _::Type{U<:InfrastructureSystems.Optimization.VariableType},
@@ -393,13 +393,13 @@
     model::DeviceModel{W<:Component, X<:PowerSimulations.AbstractDeviceFormulation},
     _::Type{Y<:PowerModels.AbstractPowerModel}
 )
-

Constructs min/max range constraint from device variable and reservation decision variable.

varcts[name, t] <= limits.max * varbin[name, t]

varcts[name, t] >= limits.min * varbin[name, t]

where limits in constraint_infos.

LaTeX

$limits^{min} x^{bin} \leq x^{cts} \leq limits^{max} x^{bin},$

source
PowerSimulations.add_result!Method
add_result!(
+

Constructs min/max range constraint from device variable and reservation decision variable.

varcts[name, t] <= limits.max * varbin[name, t]

varcts[name, t] >= limits.min * varbin[name, t]

where limits in constraint_infos.

LaTeX

$limits^{min} x^{bin} \leq x^{cts} \leq limits^{max} x^{bin},$

source
PowerSimulations.add_result!Method
add_result!(
     cache::PowerSimulations.OptimizationOutputCache,
     timestamp::Dates.DateTime,
     array::Array{Float64},
     system_cache_is_full::Bool
 ) -> Int64
-

Add result to the cache.

source
PowerSimulations.add_semicontinuous_ramp_constraints!Method
add_semicontinuous_ramp_constraints!(
     container::PowerSimulations.OptimizationContainer,
     T::Type{<:InfrastructureSystems.Optimization.ConstraintType},
     U::Type{S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}},
@@ -407,7 +407,7 @@
     _::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},
     _::Type{<:PowerModels.AbstractPowerModel}
 )
-

Constructs allowed rate-of-change constraints from variables, initial condtions, start/stop status, and rate data

Equations

If t = 1:

variable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, 1]

initial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, 1]

If t > 1:

variable[name, t] - variable[name, t-1] <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, t]

variable[name, t-1] - variable[name, t] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, t]

LaTeX

$r^{down} + r^{min} x^{stop}_1 \leq x_1 - x_{init} \leq r^{up} + r^{max} x^{start}_1, \text{ for } t = 1$

$r^{down} + r^{min} x^{stop}_t \leq x_t - x_{t-1} \leq r^{up} + r^{max} x^{start}_t, \forall t \geq 2$

source
PowerSimulations.add_semicontinuous_range_constraints!Method
add_semicontinuous_range_constraints!(
+

Constructs allowed rate-of-change constraints from variables, initial condtions, start/stop status, and rate data

Equations

If t = 1:

variable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, 1]

initial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, 1]

If t > 1:

variable[name, t] - variable[name, t-1] <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, t]

variable[name, t-1] - variable[name, t] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, t]

LaTeX

$r^{down} + r^{min} x^{stop}_1 \leq x_1 - x_{init} \leq r^{up} + r^{max} x^{start}_1, \text{ for } t = 1$

$r^{down} + r^{min} x^{stop}_t \leq x_t - x_{t-1} \leq r^{up} + r^{max} x^{start}_t, \forall t \geq 2$

source
PowerSimulations.add_semicontinuous_range_constraints!Method
add_semicontinuous_range_constraints!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:InfrastructureSystems.Optimization.ConstraintType},
     _::Type{U<:InfrastructureSystems.Optimization.VariableType},
@@ -415,7 +415,7 @@
     model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},
     _::Type{X<:PowerModels.AbstractPowerModel}
 )
-

Constructs min/max range constraint from device variable and on/off decision variable.

If device min = 0:

varcts[name, t] <= limits.max*varbin[name, t])

varcts[name, t] >= 0.0

Otherwise:

varcts[name, t] <= limits.max*varbin[name, t]

varcts[name, t] >= limits.min*varbin[name, t]

where limits in constraint_infos.

LaTeX

$0 \leq x^{cts} \leq limits^{max} x^{bin}, \text{ for } limits^{min} = 0$

$limits^{min} x^{bin} \leq x^{cts} \leq limits^{max} x^{bin}, \text{ otherwise }$

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
+

Constructs min/max range constraint from device variable and on/off decision variable.

If device min = 0:

varcts[name, t] <= limits.max*varbin[name, t])

varcts[name, t] >= 0.0

Otherwise:

varcts[name, t] <= limits.max*varbin[name, t]

varcts[name, t] >= limits.min*varbin[name, t]

where limits in constraint_infos.

LaTeX

$0 \leq x^{cts} \leq limits^{max} x^{bin}, \text{ for } limits^{min} = 0$

$limits^{min} x^{bin} \leq x^{cts} \leq limits^{max} x^{bin}, \text{ otherwise }$

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:PhaseShifterAngle},
@@ -423,7 +423,7 @@
     _::DeviceModel{PhaseShiftingTransformer, V<:PhaseAngleControl},
     network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}
 )
-

Implementation of addtoexpression! for lossless branch/network models

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerVariable},
@@ -431,7 +431,7 @@
     _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},
     network_model::NetworkModel{CopperPlatePowerModel}
 )
-

Implementation of addtoexpression! for lossless branch/network models

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:InfrastructureSystems.Optimization.VariableType},
@@ -439,7 +439,7 @@
     device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{CopperPlatePowerModel}
 )
-

Default implementation to add variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerToFromVariable},
@@ -447,7 +447,7 @@
     _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},
     network_model::NetworkModel{PTDFPowerModel}
 )
-

Default implementation to add branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerVariable},
@@ -455,7 +455,7 @@
     _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},
     network_model::NetworkModel{PTDFPowerModel}
 )
-

Implementation of addtoexpression! for lossless branch/network models

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:InfrastructureSystems.Optimization.VariableType},
@@ -463,7 +463,7 @@
     device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{PTDFPowerModel}
 )
-

Default implementation to add variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerFromToVariable},
@@ -471,7 +471,7 @@
     _::DeviceModel{V<:Branch, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Default implementation to add branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerFromToVariable},
@@ -479,7 +479,7 @@
     _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},
     network_model::NetworkModel{X<:CopperPlatePowerModel}
 )
-

Default implementation to add branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerFromToVariable},
@@ -487,7 +487,7 @@
     _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},
     network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}
 )
-

Default implementation to add branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerToFromVariable},
@@ -495,7 +495,7 @@
     _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Default implementation to add branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerToFromVariable},
@@ -503,7 +503,7 @@
     _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},
     network_model::NetworkModel{X<:CopperPlatePowerModel}
 )
-

Default implementation to add branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:FlowActivePowerVariable},
@@ -511,7 +511,7 @@
     _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},
     network_model::NetworkModel{X<:PowerModels.AbstractActivePowerModel}
 )
-

Implementation of addtoexpression! for lossless branch/network models

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:HVDCLosses},
@@ -519,7 +519,7 @@
     _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:HVDCTwoTerminalDispatch},
     network_model::NetworkModel{X<:Union{CopperPlatePowerModel, PTDFPowerModel}}
 )
-

Default implementation to add branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:PowerSimulations.HVDCActivePowerReceivedFromVariable},
@@ -527,7 +527,7 @@
     _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss},
     network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}
 )
-

PWL implementation to add FromTo branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:ActivePowerBalance},
     _::Type{U<:PowerSimulations.HVDCActivePowerReceivedToVariable},
@@ -535,7 +535,7 @@
     _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss},
     network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}
 )
-

PWL implementation to add FromTo branch variables to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:SystemBalanceExpressions},
     _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},
@@ -543,7 +543,7 @@
     model::DeviceModel{V<:Device, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Default implementation to add parameters to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:SystemBalanceExpressions},
     _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},
@@ -551,7 +551,7 @@
     device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{X<:CopperPlatePowerModel}
 )
-

Default implementation to add parameters to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:SystemBalanceExpressions},
     _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},
@@ -559,7 +559,7 @@
     device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}
 )
-

Default implementation to add parameters to SystemBalanceExpressions

source
PowerSimulations.add_to_expression!Method
add_to_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:SystemBalanceExpressions},
     _::Type{U<:InfrastructureSystems.Optimization.VariableType},
@@ -567,143 +567,143 @@
     _::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},
     network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}
 )
-

Default implementation to add device variables to SystemBalanceExpressions

source
PowerSimulations.add_variable!Method
add_variable!(
     container::PowerSimulations.OptimizationContainer,
     variable_type::ServiceRequirementVariable,
     service::ReserveDemandCurve,
     formulation
 )
-

Add variables for ServiceRequirementVariable for StepWiseCostReserve

source
PowerSimulations.add_variable!Method
add_variable!(
     container::PowerSimulations.OptimizationContainer,
     var_type::InfrastructureSystems.Optimization.AuxVariableType,
     devices::Union{Array{D<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:Component}},
     formulation
 )
-

Default implementation of adding auxiliary variable to the model.

source
PowerSimulations.add_variable!Method
add_variable!(
     container::PowerSimulations.OptimizationContainer,
     variable_type::InfrastructureSystems.Optimization.VariableType,
     devices::Union{Array{D<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:Component}},
     formulation
 )
-

Adds a variable to the optimization model and to the affine expressions contained in the optimization_container model according to the specified sign. Based on the inputs, the variable can be specified as binary.

Bounds

lb_value_function <= varstart[name, t] <= ub_value_function

If binary = true:

varstart[name, t] in {0,1}

LaTeX

$lb \ge x^{device}_t \le ub \forall t$

$x^{device}_t \in {0,1} \forall t iff \text{binary = true}$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • devices : Vector or Iterator with the devices
  • var_key::VariableKey : Base Name for the variable
  • binary::Bool : Select if the variable is binary
  • expressionname::Symbol : Expressionname name stored in container.expressions to add the variable
  • sign::Float64 : sign of the addition of the variable to the expression_name. Default Value is 1.0

Accepted Keyword Arguments

  • ubvalue : Provides the function over device to obtain the value for a upperbound
  • lbvalue : Provides the function over device to obtain the value for a lowerbound. If the variable is meant to be positive define lb = x -> 0.0
  • initial_value : Provides the function over device to obtain the warm start value
source
PowerSimulations.add_variable!Method
add_variable!(
+

Adds a variable to the optimization model and to the affine expressions contained in the optimization_container model according to the specified sign. Based on the inputs, the variable can be specified as binary.

Bounds

lb_value_function <= varstart[name, t] <= ub_value_function

If binary = true:

varstart[name, t] in {0,1}

LaTeX

$lb \ge x^{device}_t \le ub \forall t$

$x^{device}_t \in {0,1} \forall t iff \text{binary = true}$

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • devices : Vector or Iterator with the devices
  • var_key::VariableKey : Base Name for the variable
  • binary::Bool : Select if the variable is binary
  • expressionname::Symbol : Expressionname name stored in container.expressions to add the variable
  • sign::Float64 : sign of the addition of the variable to the expression_name. Default Value is 1.0

Accepted Keyword Arguments

  • ubvalue : Provides the function over device to obtain the value for a upperbound
  • lbvalue : Provides the function over device to obtain the value for a lowerbound. If the variable is meant to be positive define lb = x -> 0.0
  • initial_value : Provides the function over device to obtain the warm start value
source
PowerSimulations.add_variable!Method
add_variable!(
     container::PowerSimulations.OptimizationContainer,
     variable_type::Union{OnVariable, StartVariable, StopVariable},
     devices::Union{Array{D<:ThermalGen, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:ThermalGen}},
     formulation::PowerSimulations.AbstractThermalFormulation
 )
-

Adds a variable to the optimization model for the OnVariable of Thermal Units

source
PowerSimulations.add_variables!Method
add_variables!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:InfrastructureSystems.Optimization.AuxVariableType},
     devices::Union{Array{U<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{U<:Component}},
     formulation::Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}
 )
-

Add variables to the OptimizationContainer for any component.

source
PowerSimulations.add_variables!Method
add_variables!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:InfrastructureSystems.Optimization.VariableType},
     devices::Union{Array{U<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{U<:Component}},
     formulation::Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}
 )
-

Add variables to the OptimizationContainer for any component.

source
PowerSimulations.add_variables!Method
add_variables!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{T<:InfrastructureSystems.Optimization.VariableType},
     service::AbstractReserve,
     contributing_devices::Union{Array{V<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{V<:Component}},
     formulation::PowerSimulations.AbstractReservesFormulation
 )
-

Add variables to the OptimizationContainer for a service.

source
PowerSimulations.build_model!Method
build_model!(
     model::DecisionModel{<:PowerSimulations.DefaultDecisionProblem}
 )
-

Default implementation of build method for Operational Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method

source
PowerSimulations.build_model!Method
build_model!(model::EmulationModel)
-

Default implementation of build method for Emulation Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method

source
PowerSimulations.check_activeservice_variablesMethod
check_activeservice_variables(
+

Default implementation of build method for Operational Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method

source
PowerSimulations.build_model!Method
build_model!(model::EmulationModel)
+

Default implementation of build method for Emulation Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method

source
PowerSimulations.check_file_integrityMethod
check_file_integrity(path::String)
-
check_file_integrity(path::String)

Checks the hash value for each file made with the file is written with the new hash_value to verify the file hasn't been tampered with since written

Arguments

  • path::String: this is the folder path that contains the results and the check.sha256 file
source
PowerSimulations.check_file_integrityMethod
check_file_integrity(path::String)
+
check_file_integrity(path::String)

Checks the hash value for each file made with the file is written with the new hash_value to verify the file hasn't been tampered with since written

Arguments

  • path::String: this is the folder path that contains the results and the check.sha256 file
source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ArgumentConstructStage,
     model::DeviceModel{T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment},
     network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}
 )
-

This function creates the arguments model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the arguments model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ArgumentConstructStage,
     model::DeviceModel{T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment},
     network_model::NetworkModel
 )
-

This function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ArgumentConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},
     network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}
 )
-

This function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ArgumentConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},
     network_model::NetworkModel
 )
-

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ArgumentConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},
     network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}
 )
-

This function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ArgumentConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},
     network_model::NetworkModel
 )
-

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ModelConstructStage,
     model::DeviceModel{T<:ThermalGen, <:PowerSimulations.AbstractStandardUnitCommitment},
     network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}
 )
-

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ModelConstructStage,
     model::DeviceModel{T<:ThermalGen, <:PowerSimulations.AbstractStandardUnitCommitment},
     network_model::NetworkModel
 )
-

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ModelConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},
     network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}
 )
-

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ModelConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},
     network_model::NetworkModel
 )
-

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ModelConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},
     network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}
 )
-

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
+

This function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_device!Method
construct_device!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ModelConstructStage,
     model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},
     network_model::NetworkModel
 )
-

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_service!Method
construct_service!(
+

This function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation

source
PowerSimulations.construct_service!Method
construct_service!(
     container::PowerSimulations.OptimizationContainer,
     sys::System,
     _::InfrastructureSystems.Optimization.ArgumentConstructStage,
@@ -712,15 +712,15 @@
     _::Set{<:DataType},
     _::NetworkModel
 )
-
Constructs a service for ConstantReserveGroup.
source
PowerSimulations.container_specMethod
container_spec(
     _::Type{Float64},
     axs...
 ) -> JuMP.Containers.DenseAxisArray
-

Returns the correct container specification for the selected type of JuMP Model

source
PowerSimulations.container_specMethod
container_spec(
     _::Type{T},
     axs...
 ) -> JuMP.Containers.DenseAxisArray
-

Returns the correct container specification for the selected type of JuMP Model

source
PowerSimulations.device_duration_compact_retrospective!Method
device_duration_compact_retrospective!(
     container::PowerSimulations.OptimizationContainer,
     duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},
     initial_duration::Matrix{InitialCondition},
@@ -728,7 +728,7 @@
     var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},
     _::Type{T<:Component}
 )
-

This formulation of the duration constraints adds over the start times looking backwards.

LaTeX

  • Minimum up-time constraint:

$\sum_{i=t-min(d_{min}^{up}, T)+ 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

$\sum_{i=t-min(d_{min}^{down}, T) + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.device_duration_look_ahead!Method
device_duration_look_ahead!(
+

This formulation of the duration constraints adds over the start times looking backwards.

LaTeX

  • Minimum up-time constraint:

$\sum_{i=t-min(d_{min}^{up}, T)+ 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

$\sum_{i=t-min(d_{min}^{down}, T) + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.device_duration_look_ahead!Method
device_duration_look_ahead!(
     container::PowerSimulations.OptimizationContainer,
     duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},
     initial_duration::Matrix{InitialCondition},
@@ -737,7 +737,7 @@
     var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},
     _::Type{T<:Component}
 )
-

This formulation of the duration constraints looks ahead in the time frame of the model.

LaTeX

  • Minimum up-time constraint:

If $t \leq d_{min}^{up}$

$d_{min}^{down}x_t^{stop} - \sum_{i=t-d_{min}^{up} + 1}^t x_i^{on} - x_{init}^{up} \leq 0$

for i in the set of time steps. Otherwise:

$d_{min}^{down}x_t^{stop} - \sum_{i=t-d_{min}^{up} + 1}^t x_i^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

If $t \leq d_{min}^{down}$

$d_{min}^{up}x_t^{start} - \sum_{i=t-d_{min^{down} + 1}^t (1 - x_i^{on}) - x_{init}^{down} \leq 0$

for i in the set of time steps. Otherwise:

$d_{min}^{up}x_t^{start} - \sum_{i=t-d_{min^{down} + 1}^t (1 - x_i^{on}) \leq 0$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.device_duration_parameters!Method
device_duration_parameters!(
+

This formulation of the duration constraints looks ahead in the time frame of the model.

LaTeX

  • Minimum up-time constraint:

If $t \leq d_{min}^{up}$

$d_{min}^{down}x_t^{stop} - \sum_{i=t-d_{min}^{up} + 1}^t x_i^{on} - x_{init}^{up} \leq 0$

for i in the set of time steps. Otherwise:

$d_{min}^{down}x_t^{stop} - \sum_{i=t-d_{min}^{up} + 1}^t x_i^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

If $t \leq d_{min}^{down}$

$d_{min}^{up}x_t^{start} - \sum_{i=t-d_{min^{down} + 1}^t (1 - x_i^{on}) - x_{init}^{down} \leq 0$

for i in the set of time steps. Otherwise:

$d_{min}^{up}x_t^{start} - \sum_{i=t-d_{min^{down} + 1}^t (1 - x_i^{on}) \leq 0$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.device_duration_parameters!Method
device_duration_parameters!(
     container::PowerSimulations.OptimizationContainer,
     duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},
     initial_duration::Matrix{InitialCondition},
@@ -745,7 +745,7 @@
     var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},
     _::Type{T<:Component}
 )
-

This formulation of the duration constraints considers parameters.

LaTeX

  • Minimum up-time constraint:

If $t \leq d_{min}^{up}$

$d_{min}^{down}x_t^{stop} - \sum_{i=t-d_{min}^{up} + 1}^t x_i^{on} - x_{init}^{up} \leq 0$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{up} + 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

If $t \leq d_{min}^{down}$

$d_{min}^{up}x_t^{start} - \sum_{i=t-d_{min^{down} + 1}^t (1 - x_i^{on}) - x_{init}^{down} \leq 0$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{down} + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initialdurationon::Vector{InitialCondition} : gives initial number of time steps variable is up
  • initialdurationoff::Vector{InitialCondition} : gives initial number of time steps variable is down
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.device_duration_retrospective!Method
device_duration_retrospective!(
+

This formulation of the duration constraints considers parameters.

LaTeX

  • Minimum up-time constraint:

If $t \leq d_{min}^{up}$

$d_{min}^{down}x_t^{stop} - \sum_{i=t-d_{min}^{up} + 1}^t x_i^{on} - x_{init}^{up} \leq 0$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{up} + 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

If $t \leq d_{min}^{down}$

$d_{min}^{up}x_t^{start} - \sum_{i=t-d_{min^{down} + 1}^t (1 - x_i^{on}) - x_{init}^{down} \leq 0$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{down} + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initialdurationon::Vector{InitialCondition} : gives initial number of time steps variable is up
  • initialdurationoff::Vector{InitialCondition} : gives initial number of time steps variable is down
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.device_duration_retrospective!Method
device_duration_retrospective!(
     container::PowerSimulations.OptimizationContainer,
     duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},
     initial_duration::Matrix{InitialCondition},
@@ -753,177 +753,177 @@
     var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},
     _::Type{T<:Component}
 )
-

This formulation of the duration constraints adds over the start times looking backwards.

LaTeX

  • Minimum up-time constraint:

If $t \leq d_{min}^{up} - d_{init}^{up}$ and $d_{init}^{up} > 0$

$1 + \sum_{i=t-d_{min}^{up} + 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{up} + 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

If $t \leq d_{min}^{down} - d_{init}^{down}$ and $d_{init}^{down} > 0$

$1 + \sum_{i=t-d_{min}^{down} + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{down} + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.find_timestamp_indexMethod
find_timestamp_index(
+

This formulation of the duration constraints adds over the start times looking backwards.

LaTeX

  • Minimum up-time constraint:

If $t \leq d_{min}^{up} - d_{init}^{up}$ and $d_{init}^{up} > 0$

$1 + \sum_{i=t-d_{min}^{up} + 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{up} + 1}^t x_i^{start} - x_t^{on} \leq 0$

for i in the set of time steps.

  • Minimum down-time constraint:

If $t \leq d_{min}^{down} - d_{init}^{down}$ and $d_{init}^{down} > 0$

$1 + \sum_{i=t-d_{min}^{down} + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps. Otherwise:

$\sum_{i=t-d_{min}^{down} + 1}^t x_i^{stop} + x_t^{on} \leq 1$

for i in the set of time steps.

Arguments

  • container::OptimizationContainer : the optimization_container model built in PowerSimulations
  • duration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down
  • initial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)
  • cons_name::Symbol : name of the constraint
  • var_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables
  • : var_keys[1] : varon
  • : var_keys[2] : varstart
  • : var_keys[3] : varstop
source
PowerSimulations.find_timestamp_indexMethod
find_timestamp_index(
     dates::Union{StepRange{Dates.DateTime, Dates.Millisecond}, Vector{Dates.DateTime}},
     date::Dates.DateTime
 ) -> Int64
-

calculates the index in the time series corresponding to the data. Assumes that the dates vector is sorted.

source
PowerSimulations.generate_formulation_combinationsFunction
generate_formulation_combinations(
 
 ) -> Dict{String, Vector{Any}}
 generate_formulation_combinations(
     sys
 ) -> Dict{String, Vector{Any}}
-

Generate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types.

Arguments

  • sys::Union{Nothing, System}: If set, only include component types present in the system.
source
PowerSimulations.get_absolute_step_rangeMethod
get_absolute_step_range(
+

Generate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types.

Arguments

  • sys::Union{Nothing, System}: If set, only include component types present in the system.
source
PowerSimulations.get_absolute_step_rangeMethod
get_absolute_step_range(
     partitions::SimulationPartitions,
     index::Int64
 ) -> UnitRange{Int64}
-

Return a UnitRange for the steps in the partition with the given index. Includes overlap.

source
PowerSimulations.get_dirty_data_to_flush!Method
get_dirty_data_to_flush!(
     cache::PowerSimulations.OptimizationOutputCache
 ) -> Tuple{Vector{Dates.DateTime}, Any}
-

Return all dirty data from the cache. Mark the timestamps as clean.

source
PowerSimulations.get_last_updated_timestampMethod
get_last_updated_timestamp(
     container::PowerSimulations.DatasetContainer,
     key::InfrastructureSystems.Optimization.OptimizationContainerKey
 ) -> Dates.DateTime
-

Return the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp

source
PowerSimulations.get_last_updated_timestampMethod
get_last_updated_timestamp(
     s::PowerSimulations.HDF5Dataset
 ) -> Dates.DateTime
-

Return the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp

source
PowerSimulations.get_last_updated_timestampMethod
get_last_updated_timestamp(
     s::PowerSimulations.InMemoryDataset
 ) -> Dates.DateTime
-

Return the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
+

Return the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device::ACBranch,
     _::Type{<:InfrastructureSystems.Optimization.ConstraintType},
     _::Type{<:PowerSimulations.AbstractBranchFormulation}
-) -> @NamedTuple{min::Float64, max::Float64}
-

Min and max limits for Abstract Branch Formulation

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{<:PowerSimulations.AbstractCompactUnitCommitment}
 ) -> Any
-

Min and Max active power limits for Compact Unit Commitment

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{<:PowerSimulations.AbstractThermalDispatchFormulation}
 ) -> Any
-

Min and max active power limits of generators for thermal dispatch formulations

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{<:PowerSimulations.AbstractThermalUnitCommitment}
 ) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}
-

Min and max active power limits of generators for thermal unit commitment formulations

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{ThermalCompactDispatch}
 ) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}
-

Min and max active power limits of generators for thermal dispatch compact formulations

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{ThermalDispatchNoMin}
 ) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}
-

Min and max active power limits of generators for thermal dispatch no minimum formulations

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{ThermalMultiStartUnitCommitment}
 ) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}
-

Min and max active power limits for multi-start unit commitment formulations

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ReactivePowerVariableLimitsConstraint},
     _::Type{<:PowerSimulations.AbstractThermalDispatchFormulation}
 ) -> Any
-

Reactive power limits of generators for all dispatch formulations

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device,
     _::Type{ReactivePowerVariableLimitsConstraint},
     _::Type{<:PowerSimulations.AbstractThermalUnitCommitment}
 ) -> Any
-

Reactive power limits of generators when there CommitmentVariables

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device::MonitoredLine,
     _::Type{<:InfrastructureSystems.Optimization.ConstraintType},
     _::Type{<:PowerSimulations.AbstractBranchFormulation}
 ) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}
-

Min and max limits for monitored line

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device::MonitoredLine,
     _::Type{FlowLimitFromToConstraint},
     _::Type{<:PowerSimulations.AbstractBranchFormulation}
 ) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}
-

Min and max limits for flow limit from-to constraint

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     device::MonitoredLine,
     _::Type{FlowLimitToFromConstraint},
     _::Type{<:PowerSimulations.AbstractBranchFormulation}
 ) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}
-

Min and max limits for flow limit to-from constraint

source
PowerSimulations.get_min_max_limitsMethod
get_min_max_limits(
     _::PhaseShiftingTransformer,
     _::Type{PhaseAngleControlLimit},
     _::Type{PhaseAngleControl}
 ) -> @NamedTuple{min::Float64, max::Float64}
-

Min and max limits for Abstract Branch Formulation

source
PowerSimulations.get_piecewise_incrementalcurve_per_system_unitMethod
get_piecewise_incrementalcurve_per_system_unit(
     cost_component::PiecewiseStepData,
     unit_system::UnitSystem,
     system_base_power::Float64,
     device_base_power::Float64
 ) -> PiecewiseStepData
-

Obtain the normalized PiecewiseStep cost data in system base per unit depending on the specified power units.

Note that the costs (y-axis) are in /MWh, /(sys pu h) or /(device pu h), so they also require transformation.

source
PowerSimulations.get_piecewise_pointcurve_per_system_unitMethod
get_piecewise_pointcurve_per_system_unit(
+

Obtain the normalized PiecewiseStep cost data in system base per unit depending on the specified power units.

Note that the costs (y-axis) are in /MWh, /(sys pu h) or /(device pu h), so they also require transformation.

source
PowerSimulations.get_piecewise_pointcurve_per_system_unitMethod
get_piecewise_pointcurve_per_system_unit(
     cost_component::PiecewiseLinearData,
     unit_system::UnitSystem,
     system_base_power::Float64,
     device_base_power::Float64
 ) -> PiecewiseLinearData
-

Obtain the normalized PiecewiseLinear cost data in system base per unit depending on the specified power units.

Note that the costs (y-axis) are always in /h so they do not require transformation

source
PowerSimulations.get_proportional_cost_per_system_unitMethod
get_proportional_cost_per_system_unit(
+

Obtain the normalized PiecewiseLinear cost data in system base per unit depending on the specified power units.

Note that the costs (y-axis) are always in /h so they do not require transformation

source
PowerSimulations.get_proportional_cost_per_system_unitMethod
get_proportional_cost_per_system_unit(
     cost_term::Float64,
     unit_system::UnitSystem,
     system_base_power::Float64,
     device_base_power::Float64
 ) -> Float64
-

Obtain proportional (marginal or slope) cost data in system base per unit depending on the specified power units

source
PowerSimulations.get_quadratic_cost_per_system_unitMethod
get_quadratic_cost_per_system_unit(
     cost_term::Float64,
     unit_system::UnitSystem,
     system_base_power::Float64,
     device_base_power::Float64
 ) -> Float64
-

Obtain quadratic cost data in system base per unit depending on the specified power units

source
PowerSimulations.get_startup_shutdown_limitsMethod
get_startup_shutdown_limits(
     device,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{<:PowerSimulations.AbstractCompactUnitCommitment}
 ) -> NamedTuple{(:startup, :shutdown), <:Tuple{Any, Any}}
-

Startup shutdown limits for Compact Unit Commitment

source
PowerSimulations.get_startup_shutdown_limitsMethod
get_startup_shutdown_limits(
     device::ThermalMultiStart,
     _::Type{ActivePowerVariableLimitsConstraint},
     _::Type{ThermalMultiStartUnitCommitment}
 ) -> NamedTuple{(:startup, :shutdown), <:Tuple{Any, Any}}
-

Startup and shutdown active power limits for Compact Unit Commitment

source
PowerSimulations.get_update_timestampMethod
get_update_timestamp(
     container::PowerSimulations.DatasetContainer,
     key::InfrastructureSystems.Optimization.OptimizationContainerKey
 ) -> Any
-

Return the timestamp from the data used in the last update

source
PowerSimulations.has_dirtyMethod
has_dirty(
     cache::PowerSimulations.OptimizationOutputCaches
 ) -> Bool
-

Return true if the cache has data that has not been flushed to storage.

source
PowerSimulations.is_cachedMethod
is_cached(
     cache::PowerSimulations.OptimizationOutputCaches,
     model_name,
     key,
     index
 ) -> Bool
-

Return true if the data for timestamp is stored in cache.

source
PowerSimulations.list_decision_model_keysMethod
list_decision_model_keys(
     store::PowerSimulations.HdfSimulationStore,
     model::Symbol,
     container_type::Symbol
 ) -> Vector
-

Return the fields stored for the problem and container_type (duals/parameters/variables).

source
PowerSimulations.list_decision_modelsMethod
list_decision_models(
     store::PowerSimulations.HdfSimulationStore
 ) -> Base.KeySet{Symbol, OrderedDict{Symbol, PowerSimulations.DatasetContainer{PowerSimulations.HDF5Dataset}}}
-

Return the problem names in order of execution.

source
PowerSimulations.onvar_costMethod
onvar_cost(
     cost::ThermalGenerationCost,
     S::OnVariable,
     d::ThermalGen,
     U::PowerSimulations.AbstractThermalFormulation
 ) -> Any
-

Theoretical Cost at power output zero. Mathematically is the intercept with the y-axis

source
PowerSimulations.open_storeFunction
open_store(
     ::Type{PowerSimulations.HdfSimulationStore},
     directory::AbstractString;
     ...
@@ -940,93 +940,93 @@
 var_name = :P__ThermalStandard
 timestamp = DateTime("2020-01-01T05:00:00")
 store = open_store(HdfSimulationStore, path)
-df = PowerSimulations.read_result(DataFrame, store, model, :variables, var_name, timestamp)
source
PowerSimulations.read_jsonMethod
read_json(
     filename::AbstractString
 ) -> Union{Nothing, Bool, Float64, Int64, String, JSON3.Array, JSON3.Object}
-

Return a decoded JSON file.

source
PowerSimulations.read_resultMethod
read_result(
     cache::PowerSimulations.OptimizationOutputCaches,
     model_name,
     key,
     timestamp
 ) -> Array
-

Read the result from cache. Callers must first call is_cached to check if the timestamp is present.

source
PowerSimulations.read_resultMethod
read_result(
     _::Type{DataFrames.DataFrame},
     store::PowerSimulations.HdfSimulationStore,
     model_name::Symbol,
     key::InfrastructureSystems.Optimization.OptimizationContainerKey,
     index::Union{Int64, Dates.DateTime}
 ) -> DataFrames.DataFrame
-

Return DataFrame, DenseAxisArray, or Array for a model result at a timestamp.

source
PowerSimulations.serialize_formulation_combinationsFunction
serialize_formulation_combinations(
 
 ) -> Dict{String, Vector{Any}}
 serialize_formulation_combinations(
     sys
 ) -> Dict{String, Vector{Any}}
-

Generate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types encoded as strings.

Arguments

  • sys::Union{Nothing, System}: If set, only include component types present in the system.
source
PowerSimulations.serialize_jump_optimization_modelMethod
serialize_jump_optimization_model(
+

Generate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types encoded as strings.

Arguments

  • sys::Union{Nothing, System}: If set, only include component types present in the system.
source
PowerSimulations.serialize_simulationMethod
serialize_simulation(sim::Simulation; path, force) -> String
-
serialize_simulation(sim::Simulation, path = ".")

Serialize the simulation to a directory in path.

Return the serialized simulation directory name that is created.

Arguments

  • sim::Simulation: simulation to serialize
  • path = ".": path in which to create the serialzed directory
  • force = false: If true, delete the directory if it already exists. Otherwise, it will throw an exception.
source
PowerSimulations.serialize_simulationMethod
serialize_simulation(sim::Simulation; path, force) -> String
+
serialize_simulation(sim::Simulation, path = ".")

Serialize the simulation to a directory in path.

Return the serialized simulation directory name that is created.

Arguments

  • sim::Simulation: simulation to serialize
  • path = ".": path in which to create the serialzed directory
  • force = false: If true, delete the directory if it already exists. Otherwise, it will throw an exception.
source
PowerSimulations.set_expression!Method
set_expression!(
     container::PowerSimulations.OptimizationContainer,
     _::Type{S<:CostExpressions},
     cost_expression::JuMP.AbstractJuMPScalar,
     component::Component,
     time_period::Int64
 )
-

Replaces an expression value in the expression container if the key exists

source
PowerSimulations.set_ic_quantity!Method
set_ic_quantity!(
     ic::InitialCondition{T<:InfrastructureSystems.Optimization.InitialConditionType, Float64},
     var_value::Float64
 )
-

Default implementation of setinitialcondition_value

source
PowerSimulations.set_ic_quantity!Method
set_ic_quantity!(
     ic::InitialCondition{T<:InfrastructureSystems.Optimization.InitialConditionType, JuMP.VariableRef},
     var_value::Float64
 )
-

Default implementation of setinitialcondition_value

source
PowerSimulations.solve_impl!Method
solve_impl!(
     container::PowerSimulations.OptimizationContainer,
     system::System
 ) -> Any
-

Default solve method for OptimizationContainer

source
PowerSimulations.sparse_container_specMethod
sparse_container_spec(
     _::Type{T<:JuMP.AbstractJuMPScalar},
     axs...
 ) -> JuMP.Containers.SparseAxisArray
-

Returns the correct container specification for the selected type of JuMP Model

source
PowerSimulations.to_dataframeMethod
to_dataframe(
     array::JuMP.Containers.DenseAxisArray{T<:Number, 2, Ax, L} where {Ax, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}},
     key::InfrastructureSystems.Optimization.OptimizationContainerKey
 ) -> DataFrames.DataFrame
-

Creates a DataFrame from a JuMP DenseAxisArray or SparseAxisArray.

Arguments

  • array: JuMP DenseAxisArray or SparseAxisArray to convert
  • key::OptimizationContainerKey:
source
PowerSimulations.update_container_parameter_values!Method
update_container_parameter_values!(
     optimization_container::PowerSimulations.OptimizationContainer,
     model::PowerSimulations.OperationModel,
     key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},
     input::PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}
 )
-

Update parameter function an OperationModel

source
PowerSimulations.update_model!Method
update_model!(
     model::PowerSimulations.OperationModel,
     sim::Simulation
 )
-

Default problem update function for most problems with no customization

source
PowerSimulations.update_parameter_values!Method
update_parameter_values!(
     model::EmulationModel,
     key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},
     input::PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}
 )
-

Update parameter function an OperationModel

source
PowerSimulations.update_parameter_values!Method
update_parameter_values!(
     model::PowerSimulations.OperationModel,
     key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},
     simulation_state::PowerSimulations.SimulationState
 )
-

Update parameter function an OperationModel

source
PowerSimulations.write_formulation_combinationsFunction
write_formulation_combinations(filename::AbstractString)
 write_formulation_combinations(
     filename::AbstractString,
     sys
 )
-

Generate valid combinations of devicetype/formulation and servicetype/formulation and write the result to a JSON file.

Arguments

  • sys::Union{Nothing, System}: If set, only include component types present in the system.
source
PowerSimulations.write_result!Method
write_result!(
+

Generate valid combinations of devicetype/formulation and servicetype/formulation and write the result to a JSON file.

Arguments

  • sys::Union{Nothing, System}: If set, only include component types present in the system.
source
PowerSimulations.write_result!Method
write_result!(
     store::PowerSimulations.HdfSimulationStore,
     model_name::Symbol,
     key::InfrastructureSystems.Optimization.OptimizationContainerKey,
@@ -1034,7 +1034,7 @@
     _::Dates.DateTime,
     data::JuMP.Containers.DenseAxisArray{Float64, 3, var"#s547", L} where {var"#s547"<:Tuple{Any, Any, Any}, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}}
 )
-

Write a decision model result for a timestamp to the store.

source
PowerSimulations.write_result!Method
write_result!(
     store::PowerSimulations.HdfSimulationStore,
     _::Symbol,
     key::InfrastructureSystems.Optimization.OptimizationContainerKey,
@@ -1042,7 +1042,7 @@
     simulation_time::Dates.DateTime,
     data::JuMP.Containers.DenseAxisArray
 )
-

Write an emulation model result for an execution index value and the timestamp of the update

source
PowerSimulations.write_result!Method
write_result!(
     store::PowerSimulations.HdfSimulationStore,
     model_name::Symbol,
     key::InfrastructureSystems.Optimization.OptimizationContainerKey,
@@ -1050,4 +1050,4 @@
     _::Dates.DateTime,
     data::JuMP.Containers.DenseAxisArray{Float64, N, var"#s547", L} where {var"#s547"<:NTuple{N, Any}, L<:NTuple{N, JuMP.Containers._AxisLookup}}
 )
-

Write a decision model result for a timestamp to the store.

source
+

Write a decision model result for a timestamp to the store.

source
diff --git a/dev/code_base_developer_guide/troubleshooting/index.html b/dev/code_base_developer_guide/troubleshooting/index.html index bd371e1cf..c09cdfdc5 100644 --- a/dev/code_base_developer_guide/troubleshooting/index.html +++ b/dev/code_base_developer_guide/troubleshooting/index.html @@ -1,2 +1,2 @@ -Troubleshooting · PowerSimulations.jl +Troubleshooting · PowerSimulations.jl diff --git a/dev/formulation_library/Branch/index.html b/dev/formulation_library/Branch/index.html index 192f6677e..caf11c4ba 100644 --- a/dev/formulation_library/Branch/index.html +++ b/dev/formulation_library/Branch/index.html @@ -1,13 +1,13 @@ -Branch · PowerSimulations.jl

PowerSystems.Branch Formulations

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Table of contents

  1. StaticBranch
  2. StaticBranchBounds
  3. StaticBranchUnbounded
  4. HVDCTwoTerminalUnbounded
  5. HVDCTwoTerminalLossless
  6. HVDCTwoTerminalDispatch
  7. PhaseAngleControl
  8. Valid configurations

StaticBranch

Formulation valid for PTDFPowerModel Network model

Variables:

Static Parameters

  • $R^\text{max}$ = PowerSystems.get_rating(branch)

Objective:

Add a large proportional cost to the objective function if rate constraint slack variables are used $+ (f^\text{sl,up} + f^\text{sl,lo}) \cdot 2 \cdot 10^5$

Expressions:

No expressions are used.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} +Branch · PowerSimulations.jl

PowerSystems.Branch Formulations

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Table of contents

  1. StaticBranch
  2. StaticBranchBounds
  3. StaticBranchUnbounded
  4. HVDCTwoTerminalUnbounded
  5. HVDCTwoTerminalLossless
  6. HVDCTwoTerminalDispatch
  7. PhaseAngleControl
  8. Valid configurations

StaticBranch

Formulation valid for PTDFPowerModel Network model

Variables:

Static Parameters

  • $R^\text{max}$ = PowerSystems.get_rating(branch)

Objective:

Add a large proportional cost to the objective function if rate constraint slack variables are used $+ (f^\text{sl,up} + f^\text{sl,lo}) \cdot 2 \cdot 10^5$

Expressions:

No expressions are used.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} & f_t = \sum_{i=1}^N \text{PTDF}_{i,b} \cdot \text{Bal}_{i,t}, \quad \forall t \in \{1,\dots, T\}\\ & f_t - f_t^\text{sl,up} \le R^\text{max},\quad \forall t \in \{1,\dots, T\} \\ & f_t + f_t^\text{sl,lo} \ge -R^\text{max},\quad \forall t \in \{1,\dots, T\} -\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

StaticBranchBounds

Formulation valid for PTDFPowerModel Network model

Variables:

Static Parameters

  • $R^\text{max}$ = PowerSystems.get_rating(branch)

Objective:

No cost is added to the objective function.

Expressions:

No expressions are used.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} +\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

StaticBranchBounds

Formulation valid for PTDFPowerModel Network model

Variables:

Static Parameters

  • $R^\text{max}$ = PowerSystems.get_rating(branch)

Objective:

No cost is added to the objective function.

Expressions:

No expressions are used.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} & f_t = \sum_{i=1}^N \text{PTDF}_{i,b} \cdot \text{Bal}_{i,t}, \quad \forall t \in \{1,\dots, T\} -\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

StaticBranchUnbounded

Formulation valid for PTDFPowerModel Network model

Objective:

No cost is added to the objective function.

Expressions:

No expressions are used.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} +\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

StaticBranchUnbounded

Formulation valid for PTDFPowerModel Network model

Objective:

No cost is added to the objective function.

Expressions:

No expressions are used.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} & f_t = \sum_{i=1}^N \text{PTDF}_{i,b} \cdot \text{Bal}_{i,t}, \quad \forall t \in \{1,\dots, T\} -\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

HVDCTwoTerminalUnbounded

Formulation valid for PTDFPowerModel Network model

This model assumes that it can transfer power from two AC buses without losses and no limits.

Variables:

Objective:

No cost is added to the objective function.

Expressions:

The variable FlowActivePowerVariable $f$ is added to the nodal balance expression ActivePowerBalance, by adding the flow $f$ in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.

Constraints:

No constraints are added.

HVDCTwoTerminalLossless

Formulation valid for PTDFPowerModel Network model

This model assumes that it can transfer power from two AC buses without losses.

Variables:

Static Parameters

  • $R^\text{from,min}$ = PowerSystems.get_active_power_limits_from(branch).min
  • $R^\text{from,max}$ = PowerSystems.get_active_power_limits_from(branch).max
  • $R^\text{to,min}$ = PowerSystems.get_active_power_limits_to(branch).min
  • $R^\text{to,max}$ = PowerSystems.get_active_power_limits_to(branch).max

Objective:

No cost is added to the objective function.

Expressions:

The variable FlowActivePowerVariable $f$ is added to the nodal balance expression ActivePowerBalance, by adding the flow $f$ in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.

Constraints:

\[\begin{align*} +\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

HVDCTwoTerminalUnbounded

Formulation valid for PTDFPowerModel Network model

This model assumes that it can transfer power from two AC buses without losses and no limits.

Variables:

Objective:

No cost is added to the objective function.

Expressions:

The variable FlowActivePowerVariable $f$ is added to the nodal balance expression ActivePowerBalance, by adding the flow $f$ in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.

Constraints:

No constraints are added.

HVDCTwoTerminalLossless

Formulation valid for PTDFPowerModel Network model

This model assumes that it can transfer power from two AC buses without losses.

Variables:

Static Parameters

  • $R^\text{from,min}$ = PowerSystems.get_active_power_limits_from(branch).min
  • $R^\text{from,max}$ = PowerSystems.get_active_power_limits_from(branch).max
  • $R^\text{to,min}$ = PowerSystems.get_active_power_limits_to(branch).min
  • $R^\text{to,max}$ = PowerSystems.get_active_power_limits_to(branch).max

Objective:

No cost is added to the objective function.

Expressions:

The variable FlowActivePowerVariable $f$ is added to the nodal balance expression ActivePowerBalance, by adding the flow $f$ in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.

Constraints:

\[\begin{align*} & R^\text{min} \le f_t \le R^\text{max},\quad \forall t \in \{1,\dots, T\} \\ \end{align*}\]

where:

\[\begin{align*} & R^\text{min} = \begin{cases} @@ -23,7 +23,7 @@ R^\text{from,max},& \text{if } R^\text{from,max} \le 0 \text{ and } R^\text{to,max} \ge 0 \\ R^\text{to,max},& \text{if } R^\text{from,max} \ge 0 \text{ and } R^\text{to,max} \le 0 \end{cases} -\end{align*}\]

HVDCTwoTerminalDispatch

Formulation valid for PTDFPowerModel Network model

Variables

Static Parameters

  • $R^\text{from,min}$ = PowerSystems.get_active_power_limits_from(branch).min
  • $R^\text{from,max}$ = PowerSystems.get_active_power_limits_from(branch).max
  • $R^\text{to,min}$ = PowerSystems.get_active_power_limits_to(branch).min
  • $R^\text{to,max}$ = PowerSystems.get_active_power_limits_to(branch).max
  • $L_0$ = PowerSystems.get_loss(branch).l0
  • $L_1$ = PowerSystems.get_loss(branch).l1

Objective:

No cost is added to the objective function.

Expressions:

Each FlowActivePowerToFromVariable $f^\text{to-from}$ and FlowActivePowerFromToVariable $f^\text{from-to}$ is added to the nodal balance expression ActivePowerBalance, by adding the respective flow in the receiving bus and subtracting it from the sending bus. That is, $f^\text{to-from}$ adds the flow to the from bus, and subtracts the flow from the to bus, while $f^\text{from-to}$ adds the flow to the to bus, and subtracts the flow from the from bus This is used then to compute the AC flows using the PTDF equation.

In addition, the HVDCLosses are subtracted to the from bus in the ActivePowerBalance expression.

Constraints:

\[\begin{align*} +\end{align*}\]

HVDCTwoTerminalDispatch

Formulation valid for PTDFPowerModel Network model

Variables

Static Parameters

  • $R^\text{from,min}$ = PowerSystems.get_active_power_limits_from(branch).min
  • $R^\text{from,max}$ = PowerSystems.get_active_power_limits_from(branch).max
  • $R^\text{to,min}$ = PowerSystems.get_active_power_limits_to(branch).min
  • $R^\text{to,max}$ = PowerSystems.get_active_power_limits_to(branch).max
  • $L_0$ = PowerSystems.get_loss(branch).l0
  • $L_1$ = PowerSystems.get_loss(branch).l1

Objective:

No cost is added to the objective function.

Expressions:

Each FlowActivePowerToFromVariable $f^\text{to-from}$ and FlowActivePowerFromToVariable $f^\text{from-to}$ is added to the nodal balance expression ActivePowerBalance, by adding the respective flow in the receiving bus and subtracting it from the sending bus. That is, $f^\text{to-from}$ adds the flow to the from bus, and subtracts the flow from the to bus, while $f^\text{from-to}$ adds the flow to the to bus, and subtracts the flow from the from bus This is used then to compute the AC flows using the PTDF equation.

In addition, the HVDCLosses are subtracted to the from bus in the ActivePowerBalance expression.

Constraints:

\[\begin{align*} & R^\text{from,min} \le f_t^\text{from-to} \le R^\text{from,max}, \forall t \in \{1,\dots, T\} \\ & R^\text{to,min} \le f_t^\text{to-from} \le R^\text{to,max},\quad \forall t \in \{1,\dots, T\} \\ & f_t^\text{to-from} - f_t^\text{from-to} \le L_1 \cdot f_t^\text{to-from} - L_0,\quad \forall t \in \{1,\dots, T\} \\ @@ -32,7 +32,7 @@ & f_t^\text{to-from} - f_t^\text{from-to} \ge - M^\text{big} u^\text{dir}_t,\quad \forall t \in \{1,\dots, T\} \\ & f_t^\text{to-from} - f_t^\text{from-to} \le \ell_t,\quad \forall t \in \{1,\dots, T\} \\ & f_t^\text{from-to} - f_t^\text{to-from} \le \ell_t,\quad \forall t \in \{1,\dots, T\} -\end{align*}\]

PhaseAngleControl

Formulation valid for PTDFPowerModel Network model

Variables:

Static Parameters

  • $R^\text{max}$ = PowerSystems.get_rating(branch)
  • $\Theta^\text{min}$ = PowerSystems.get_phase_angle_limits(branch).min
  • $\Theta^\text{max}$ = PowerSystems.get_phase_angle_limits(branch).max
  • $X$ = PowerSystems.get_x(branch) (series reactance)

Objective:

No changes to objective function

Expressions:

Adds to the ActivePowerBalance expression the term $-\theta^\text{shift} /X$ to the from bus and $+\theta^\text{shift} /X$ to the to bus, that the PhaseShiftingTransformer is connected.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} +\end{align*}\]

PhaseAngleControl

Formulation valid for PTDFPowerModel Network model

Variables:

Static Parameters

  • $R^\text{max}$ = PowerSystems.get_rating(branch)
  • $\Theta^\text{min}$ = PowerSystems.get_phase_angle_limits(branch).min
  • $\Theta^\text{max}$ = PowerSystems.get_phase_angle_limits(branch).max
  • $X$ = PowerSystems.get_x(branch) (series reactance)

Objective:

No changes to objective function

Expressions:

Adds to the ActivePowerBalance expression the term $-\theta^\text{shift} /X$ to the from bus and $+\theta^\text{shift} /X$ to the to bus, that the PhaseShiftingTransformer is connected.

Constraints:

For each branch $b \in \{1,\dots, B\}$ (in a system with $N$ buses) the constraints are given by:

\[\begin{aligned} & f_t = \sum_{i=1}^N \text{PTDF}_{i,b} \cdot \text{Bal}_{i,t} + \frac{\theta^\text{shift}_t}{X}, \quad \forall t \in \{1,\dots, T\}\\ & -R^\text{max} \le f_t \le R^\text{max},\quad \forall t \in \{1,\dots, T\} -\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

Valid configurations

Valid DeviceModels for subtypes of Branch include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(PhaseShiftingTransformer, PhaseAngleControl)PhaseShiftingTransformerPhaseAngleControl
DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalDispatch)TwoTerminalHVDCLineHVDCTwoTerminalDispatch
DeviceModel(TwoTerminalVSCDCLine, HVDCTwoTerminalDispatch)TwoTerminalVSCDCLineHVDCTwoTerminalDispatch
DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalLossless)TwoTerminalHVDCLineHVDCTwoTerminalLossless
DeviceModel(TwoTerminalVSCDCLine, HVDCTwoTerminalLossless)TwoTerminalVSCDCLineHVDCTwoTerminalLossless
DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalUnbounded)TwoTerminalHVDCLineHVDCTwoTerminalUnbounded
DeviceModel(TwoTerminalVSCDCLine, HVDCTwoTerminalUnbounded)TwoTerminalVSCDCLineHVDCTwoTerminalUnbounded
DeviceModel(TwoTerminalHVDCLine, PowerSimulations.HVDCTwoTerminalPiecewiseLoss)TwoTerminalHVDCLinePowerSimulations.HVDCTwoTerminalPiecewiseLoss
DeviceModel(TwoTerminalVSCDCLine, PowerSimulations.HVDCTwoTerminalPiecewiseLoss)TwoTerminalVSCDCLinePowerSimulations.HVDCTwoTerminalPiecewiseLoss
DeviceModel(Line, StaticBranch)LineStaticBranch
DeviceModel(MonitoredLine, StaticBranch)MonitoredLineStaticBranch
DeviceModel(PhaseShiftingTransformer, StaticBranch)PhaseShiftingTransformerStaticBranch
DeviceModel(TapTransformer, StaticBranch)TapTransformerStaticBranch
DeviceModel(Transformer2W, StaticBranch)Transformer2WStaticBranch
DeviceModel(TwoTerminalHVDCLine, StaticBranch)TwoTerminalHVDCLineStaticBranch
DeviceModel(TwoTerminalVSCDCLine, StaticBranch)TwoTerminalVSCDCLineStaticBranch
DeviceModel(AreaInterchange, StaticBranch)AreaInterchangeStaticBranch
DeviceModel(Line, StaticBranchBounds)LineStaticBranchBounds
DeviceModel(MonitoredLine, StaticBranchBounds)MonitoredLineStaticBranchBounds
DeviceModel(PhaseShiftingTransformer, StaticBranchBounds)PhaseShiftingTransformerStaticBranchBounds
DeviceModel(TapTransformer, StaticBranchBounds)TapTransformerStaticBranchBounds
DeviceModel(Transformer2W, StaticBranchBounds)Transformer2WStaticBranchBounds
DeviceModel(TwoTerminalHVDCLine, StaticBranchBounds)TwoTerminalHVDCLineStaticBranchBounds
DeviceModel(TwoTerminalVSCDCLine, StaticBranchBounds)TwoTerminalVSCDCLineStaticBranchBounds
DeviceModel(Line, StaticBranchUnbounded)LineStaticBranchUnbounded
DeviceModel(MonitoredLine, StaticBranchUnbounded)MonitoredLineStaticBranchUnbounded
DeviceModel(PhaseShiftingTransformer, StaticBranchUnbounded)PhaseShiftingTransformerStaticBranchUnbounded
DeviceModel(TapTransformer, StaticBranchUnbounded)TapTransformerStaticBranchUnbounded
DeviceModel(Transformer2W, StaticBranchUnbounded)Transformer2WStaticBranchUnbounded
DeviceModel(TwoTerminalHVDCLine, StaticBranchUnbounded)TwoTerminalHVDCLineStaticBranchUnbounded
DeviceModel(TwoTerminalVSCDCLine, StaticBranchUnbounded)TwoTerminalVSCDCLineStaticBranchUnbounded
DeviceModel(AreaInterchange, StaticBranchUnbounded)AreaInterchangeStaticBranchUnbounded
+\end{aligned}\]

on which $\text{PTDF}$ is the $N \times B$ system Power Transfer Distribution Factors (PTDF) matrix, and $\text{Bal}_{i,t}$ is the active power bus balance expression (i.e. $\text{Generation}_{i,t} - \text{Demand}_{i,t}$) at bus $i$ at time-step $t$.

Valid configurations

Valid DeviceModels for subtypes of Branch include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(PhaseShiftingTransformer, PhaseAngleControl)PhaseShiftingTransformerPhaseAngleControl
DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalDispatch)TwoTerminalHVDCLineHVDCTwoTerminalDispatch
DeviceModel(TwoTerminalVSCDCLine, HVDCTwoTerminalDispatch)TwoTerminalVSCDCLineHVDCTwoTerminalDispatch
DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalLossless)TwoTerminalHVDCLineHVDCTwoTerminalLossless
DeviceModel(TwoTerminalVSCDCLine, HVDCTwoTerminalLossless)TwoTerminalVSCDCLineHVDCTwoTerminalLossless
DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalUnbounded)TwoTerminalHVDCLineHVDCTwoTerminalUnbounded
DeviceModel(TwoTerminalVSCDCLine, HVDCTwoTerminalUnbounded)TwoTerminalVSCDCLineHVDCTwoTerminalUnbounded
DeviceModel(TwoTerminalHVDCLine, PowerSimulations.HVDCTwoTerminalPiecewiseLoss)TwoTerminalHVDCLinePowerSimulations.HVDCTwoTerminalPiecewiseLoss
DeviceModel(TwoTerminalVSCDCLine, PowerSimulations.HVDCTwoTerminalPiecewiseLoss)TwoTerminalVSCDCLinePowerSimulations.HVDCTwoTerminalPiecewiseLoss
DeviceModel(Line, StaticBranch)LineStaticBranch
DeviceModel(MonitoredLine, StaticBranch)MonitoredLineStaticBranch
DeviceModel(PhaseShiftingTransformer, StaticBranch)PhaseShiftingTransformerStaticBranch
DeviceModel(TapTransformer, StaticBranch)TapTransformerStaticBranch
DeviceModel(Transformer2W, StaticBranch)Transformer2WStaticBranch
DeviceModel(TwoTerminalHVDCLine, StaticBranch)TwoTerminalHVDCLineStaticBranch
DeviceModel(TwoTerminalVSCDCLine, StaticBranch)TwoTerminalVSCDCLineStaticBranch
DeviceModel(AreaInterchange, StaticBranch)AreaInterchangeStaticBranch
DeviceModel(Line, StaticBranchBounds)LineStaticBranchBounds
DeviceModel(MonitoredLine, StaticBranchBounds)MonitoredLineStaticBranchBounds
DeviceModel(PhaseShiftingTransformer, StaticBranchBounds)PhaseShiftingTransformerStaticBranchBounds
DeviceModel(TapTransformer, StaticBranchBounds)TapTransformerStaticBranchBounds
DeviceModel(Transformer2W, StaticBranchBounds)Transformer2WStaticBranchBounds
DeviceModel(TwoTerminalHVDCLine, StaticBranchBounds)TwoTerminalHVDCLineStaticBranchBounds
DeviceModel(TwoTerminalVSCDCLine, StaticBranchBounds)TwoTerminalVSCDCLineStaticBranchBounds
DeviceModel(Line, StaticBranchUnbounded)LineStaticBranchUnbounded
DeviceModel(MonitoredLine, StaticBranchUnbounded)MonitoredLineStaticBranchUnbounded
DeviceModel(PhaseShiftingTransformer, StaticBranchUnbounded)PhaseShiftingTransformerStaticBranchUnbounded
DeviceModel(TapTransformer, StaticBranchUnbounded)TapTransformerStaticBranchUnbounded
DeviceModel(Transformer2W, StaticBranchUnbounded)Transformer2WStaticBranchUnbounded
DeviceModel(TwoTerminalHVDCLine, StaticBranchUnbounded)TwoTerminalHVDCLineStaticBranchUnbounded
DeviceModel(TwoTerminalVSCDCLine, StaticBranchUnbounded)TwoTerminalVSCDCLineStaticBranchUnbounded
DeviceModel(AreaInterchange, StaticBranchUnbounded)AreaInterchangeStaticBranchUnbounded
diff --git a/dev/formulation_library/DCModels/index.html b/dev/formulation_library/DCModels/index.html index e487085b5..42cf112b1 100644 --- a/dev/formulation_library/DCModels/index.html +++ b/dev/formulation_library/DCModels/index.html @@ -1,2 +1,2 @@ -DC Models formulations · PowerSimulations.jl

DC Models formulations

Note

Multi-terminal DC models are still in early stages of development and future versions will add a more comprehensive list of formulations

LossLessLine

LossLessLine models are used with PSY.DCBranch models.

Variables:

Static Parameters

  • $R^\text{from,min}$ = PowerSystems.get_active_power_limits_from(branch).min
  • $R^\text{from,max}$ = PowerSystems.get_active_power_limits_from(branch).max
  • $R^\text{to,min}$ = PowerSystems.get_active_power_limits_to(branch).min
  • $R^\text{to,max}$ = PowerSystems.get_active_power_limits_to(branch).max

Then, the minimum and maximum are computed as R^\text{min} = \min(R^\text{from,min}, R^\text{to,min}) and R^\text{max} = \min(R^\text{from,max}, R^\text{to,max})

Objective:

No cost is added to the objective function.

Expressions:

The variable FlowActivePowerVariable $f$ is added to the nodal balance expression ActivePowerBalance for DC Buses, by adding the flow $f$ in the receiving DC bus and subtracting it from the sending DC bus.

Constraints:

No constraints are added to the function.

LossLessConverter

Converters are used to interface the AC Buses with DC Buses.

Variables:

Static Parameters:

  • $P^\text{min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{max}$ = PowerSystems.get_active_power_limits(device).max

Objective:

No cost is added to the objective function.

Expressions:

The variable ActivePowerVariable $p$ is added positive to the AC balance expression ActivePowerBalance for AC Buses, and added negative to ActivePowerBalance for DC Buses, balancing both sides.

Constraints:

No constraints are added to the function.

+DC Models formulations · PowerSimulations.jl

DC Models formulations

Note

Multi-terminal DC models are still in early stages of development and future versions will add a more comprehensive list of formulations

LossLessLine

LossLessLine models are used with PSY.DCBranch models.

Variables:

Static Parameters

  • $R^\text{from,min}$ = PowerSystems.get_active_power_limits_from(branch).min
  • $R^\text{from,max}$ = PowerSystems.get_active_power_limits_from(branch).max
  • $R^\text{to,min}$ = PowerSystems.get_active_power_limits_to(branch).min
  • $R^\text{to,max}$ = PowerSystems.get_active_power_limits_to(branch).max

Then, the minimum and maximum are computed as R^\text{min} = \min(R^\text{from,min}, R^\text{to,min}) and R^\text{max} = \min(R^\text{from,max}, R^\text{to,max})

Objective:

No cost is added to the objective function.

Expressions:

The variable FlowActivePowerVariable $f$ is added to the nodal balance expression ActivePowerBalance for DC Buses, by adding the flow $f$ in the receiving DC bus and subtracting it from the sending DC bus.

Constraints:

No constraints are added to the function.

LossLessConverter

Converters are used to interface the AC Buses with DC Buses.

Variables:

Static Parameters:

  • $P^\text{min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{max}$ = PowerSystems.get_active_power_limits(device).max

Objective:

No cost is added to the objective function.

Expressions:

The variable ActivePowerVariable $p$ is added positive to the AC balance expression ActivePowerBalance for AC Buses, and added negative to ActivePowerBalance for DC Buses, balancing both sides.

Constraints:

No constraints are added to the function.

diff --git a/dev/formulation_library/Feedforward/index.html b/dev/formulation_library/Feedforward/index.html index 8203be6d5..41294df89 100644 --- a/dev/formulation_library/Feedforward/index.html +++ b/dev/formulation_library/Feedforward/index.html @@ -4,7 +4,7 @@ source::Type{T}, affected_values::Vector{DataType}, meta = CONTAINER_KEY_EMPTY_META -) where {T}

It allows to enable/disable bounds to 0.0 for a specified variable. Commonly used to limit the ActivePowerVariable in an Economic Dispatch problem by the commitment decision taken in an another problem (typically a Unit Commitment problem).

Arguments:

source

Variables:

No variables are created

Parameters:

Objective:

No changes to the objective function.

Expressions:

Adds $-\text{on}^\text{th}P^\text{th,max}$ to the ActivePowerRangeExpressionUB expression and $-\text{on}^\text{th}P^\text{th,min}$ to the ActivePowerRangeExpressionLB expression.

Constraints:

Limits the ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB by zero as:

\[\begin{align*} +) where {T}

It allows to enable/disable bounds to 0.0 for a specified variable. Commonly used to limit the ActivePowerVariable in an Economic Dispatch problem by the commitment decision taken in an another problem (typically a Unit Commitment problem).

Arguments:

source

Variables:

No variables are created

Parameters:

Objective:

No changes to the objective function.

Expressions:

Adds $-\text{on}^\text{th}P^\text{th,max}$ to the ActivePowerRangeExpressionUB expression and $-\text{on}^\text{th}P^\text{th,min}$ to the ActivePowerRangeExpressionLB expression.

Constraints:

Limits the ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB by zero as:

\[\begin{align*} & \text{ActivePowerRangeExpressionUB}_t := p_t^\text{th} - \text{on}_t^\text{th}P^\text{th,max} \le 0, \quad \forall t\in \{1, \dots, T\} \\ & \text{ActivePowerRangeExpressionLB}_t := p_t^\text{th} - \text{on}_t^\text{th}P^\text{th,min} \ge 0, \quad \forall t\in \{1, \dots, T\} \end{align*}\]

Thus, if the commitment parameter is zero, the dispatch is limited to zero, forcing to turn off the generator without introducing binary variables in the economic dispatch problem.

FixValueFeedforward

PowerSimulations.FixValueFeedforwardType
FixValueFeedforward(
@@ -12,7 +12,7 @@
     source::Type{T},
     affected_values::Vector{DataType},
     meta = CONTAINER_KEY_EMPTY_META
-) where {T}

Fixes a Variable or Parameter Value in the model from another problem. Is the only Feed Forward that can be used with a Parameter or a Variable as the affected value.

Arguments:

  • component_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied
  • source::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward
  • affected_values::Vector{DataType} : Specify the variable on which the fix value will be applied using the source values
source

Variables:

No variables are created

Parameters:

The parameter FixValueParameter is used to match the result obtained from the source variable (from the simulation state).

Objective:

No changes to the objective function.

Expressions:

No changes on expressions.

Constraints:

Set the VariableType from the affected_values to be equal to the source parameter store in FixValueParameter

\[\begin{align*} +) where {T}

Fixes a Variable or Parameter Value in the model from another problem. Is the only Feed Forward that can be used with a Parameter or a Variable as the affected value.

Arguments:

source

Variables:

No variables are created

Parameters:

The parameter FixValueParameter is used to match the result obtained from the source variable (from the simulation state).

Objective:

No changes to the objective function.

Expressions:

No changes on expressions.

Constraints:

Set the VariableType from the affected_values to be equal to the source parameter store in FixValueParameter

\[\begin{align*} & \text{AffectedVariable}_t = \text{SourceVariableParameter}_t, \quad \forall t \in \{1,\dots, T\} \end{align*}\]

UpperBoundFeedforward

PowerSimulations.UpperBoundFeedforwardType
UpperBoundFeedforward(
     component_type::Type{<:PSY.Component},
@@ -20,7 +20,7 @@
     affected_values::Vector{DataType},
     add_slacks::Bool = false,
     meta = CONTAINER_KEY_EMPTY_META
-) where {T}

Constructs a parameterized upper bound constraint to implement feedforward from other models.

Arguments:

  • component_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied
  • source::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward
  • affected_values::Vector{DataType} : Specify the variable on which the upper bound will be applied using the source values
  • add_slacks::Bool = false : Add slacks variables to relax the upper bound constraint.
source

Variables:

If slack variables are enabled:

Parameters:

The parameter UpperBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as an upper bound to the affected variable.

Objective:

The slack variable is added to the objective function using its large default cost $+ p^\text{ff,ubsl} \cdot 10^6$

Expressions:

No changes on expressions.

Constraints:

Set the VariableType from the affected_values to be lower than the source parameter store in UpperBoundValueParameter.

\[\begin{align*} +) where {T}

Constructs a parameterized upper bound constraint to implement feedforward from other models.

Arguments:

source

Variables:

If slack variables are enabled:

Parameters:

The parameter UpperBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as an upper bound to the affected variable.

Objective:

The slack variable is added to the objective function using its large default cost $+ p^\text{ff,ubsl} \cdot 10^6$

Expressions:

No changes on expressions.

Constraints:

Set the VariableType from the affected_values to be lower than the source parameter store in UpperBoundValueParameter.

\[\begin{align*} & \text{AffectedVariable}_t - p_t^\text{ff,ubsl} \le \text{SourceVariableParameter}_t, \quad \forall t \in \{1,\dots, T\} \end{align*}\]

LowerBoundFeedforward

PowerSimulations.LowerBoundFeedforwardType
LowerBoundFeedforward(
     component_type::Type{<:PSY.Component},
@@ -28,6 +28,6 @@
     affected_values::Vector{DataType},
     add_slacks::Bool = false,
     meta = CONTAINER_KEY_EMPTY_META
-) where {T}

Constructs a parameterized lower bound constraint to implement feedforward from other models.

Arguments:

  • component_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied
  • source::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward
  • affected_values::Vector{DataType} : Specify the variable on which the lower bound will be applied using the source values
  • add_slacks::Bool = false : Add slacks variables to relax the lower bound constraint.
source

Variables:

If slack variables are enabled:

Parameters:

The parameter LowerBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as a lower bound to the affected variable.

Objective:

The slack variable is added to the objective function using its large default cost $+ p^\text{ff,lbsl} \cdot 10^6$

Expressions:

No changes on expressions.

Constraints:

Set the VariableType from the affected_values to be greater than the source parameter store in LowerBoundValueParameter.

\[\begin{align*} +) where {T}

Constructs a parameterized lower bound constraint to implement feedforward from other models.

Arguments:

source

Variables:

If slack variables are enabled:

Parameters:

The parameter LowerBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as a lower bound to the affected variable.

Objective:

The slack variable is added to the objective function using its large default cost $+ p^\text{ff,lbsl} \cdot 10^6$

Expressions:

No changes on expressions.

Constraints:

Set the VariableType from the affected_values to be greater than the source parameter store in LowerBoundValueParameter.

\[\begin{align*} & \text{AffectedVariable}_t + p_t^\text{ff,lbsl} \ge \text{SourceVariableParameter}_t, \quad \forall t \in \{1,\dots, T\} -\end{align*}\]

+\end{align*}\]

diff --git a/dev/formulation_library/General/index.html b/dev/formulation_library/General/index.html index ef6e38a97..caafea7cd 100644 --- a/dev/formulation_library/General/index.html +++ b/dev/formulation_library/General/index.html @@ -1,5 +1,5 @@ -General · PowerSimulations.jl

Formulations

Modeling formulations are created by dispatching on abstract subtypes of PowerSimulations.AbstractDeviceFormulation

FixedOutput

Variables:

No variables are created for DeviceModel(<:DeviceType, FixedOutput)

Static Parameters:

  • ThermalGen:

    • $P^\text{th,max}$ = PowerSystems.get_max_active_power(device)
    • $Q^\text{th,max}$ = PowerSystems.get_max_reactive_power(device)
  • Storage:

    • $P^\text{st,max}$ = PowerSystems.get_max_active_power(device)
    • $Q^\text{st,max}$ = PowerSystems.get_max_reactive_power(device)

Time Series Parameters:

Device TypeParameterDefault Time Series Name
RenewableGenActivePowerTimeSeriesParametermax_active_power
RenewableGenReactivePowerTimeSeriesParametermax_active_power
HydroGenActivePowerTimeSeriesParametermax_active_power
HydroGenReactivePowerTimeSeriesParametermax_active_power
ElectricLoadActivePowerTimeSeriesParametermax_active_power
ElectricLoadReactivePowerTimeSeriesParametermax_active_power

Objective:

No objective terms are created for DeviceModel(<:DeviceType, FixedOutput)

Expressions:

Adds the active and reactive parameters listed for specific device types above to the respective active and reactive power balance expressions created by the selected Network Formulations.

Constraints:

No constraints are created for DeviceModel(<:DeviceType, FixedOutput)

FunctionData Options

PowerSimulations can represent variable costs using a variety of different methods depending on the data available in each device. The following describes the objective function terms that are populated for each variable cost option.

LinearFunctionData

variable_cost = LinearFunctionData(c): creates a fixed marginal cost term in the objective function

\[\begin{aligned} +General · PowerSimulations.jl

Formulations

Modeling formulations are created by dispatching on abstract subtypes of PowerSimulations.AbstractDeviceFormulation

FixedOutput

Variables:

No variables are created for DeviceModel(<:DeviceType, FixedOutput)

Static Parameters:

  • ThermalGen:

    • $P^\text{th,max}$ = PowerSystems.get_max_active_power(device)
    • $Q^\text{th,max}$ = PowerSystems.get_max_reactive_power(device)
  • Storage:

    • $P^\text{st,max}$ = PowerSystems.get_max_active_power(device)
    • $Q^\text{st,max}$ = PowerSystems.get_max_reactive_power(device)

Time Series Parameters:

Device TypeParameterDefault Time Series Name
RenewableGenReactivePowerTimeSeriesParametermax_active_power
RenewableGenActivePowerTimeSeriesParametermax_active_power
HydroGenReactivePowerTimeSeriesParametermax_active_power
HydroGenActivePowerTimeSeriesParametermax_active_power
ElectricLoadReactivePowerTimeSeriesParametermax_active_power
ElectricLoadActivePowerTimeSeriesParametermax_active_power

Objective:

No objective terms are created for DeviceModel(<:DeviceType, FixedOutput)

Expressions:

Adds the active and reactive parameters listed for specific device types above to the respective active and reactive power balance expressions created by the selected Network Formulations.

Constraints:

No constraints are created for DeviceModel(<:DeviceType, FixedOutput)

FunctionData Options

PowerSimulations can represent variable costs using a variety of different methods depending on the data available in each device. The following describes the objective function terms that are populated for each variable cost option.

LinearFunctionData

variable_cost = LinearFunctionData(c): creates a fixed marginal cost term in the objective function

\[\begin{aligned} & \text{min} \sum_{t} c * G_t \end{aligned}\]

QuadraticFunctionData and PolynomialFunctionData

variable_cost::QuadraticFunctionData and variable_cost::PolynomialFunctionData: create a polynomial cost term in the objective function

\[\begin{aligned} & \text{min} \sum_{t} \sum_{n} C_n * G_t^n @@ -7,4 +7,4 @@ & \text{min} \sum_{t} f(G_t) \end{aligned}\]

where

  • For variable_cost::PiecewiseLinearData, $f(x)$ is the piecewise linear function obtained by connecting the (x, y) points get_points(variable_cost) in order.

  • For variable_cost = PiecewiseLinearSlopeData([x0, x1, x2, ...], y0, [s0, s1, s2, ...]), $f(x)$ is the piecewise linear function obtained by starting at (x0, y0), drawing a segment at slope s0 to x=x1, drawing a segment at slope s1 to x=x2, etc.

StorageCost

Adds an objective function cost term according to:

\[\begin{aligned} & \text{min} \sum_{t} \quad [E^{surplus}_t * C^{penalty} - E^{shortage}_t * C^{value}] -\end{aligned}\]

Impact of different cost configurations:

The following table describes all possible configurations of the StorageCost with the target constraint in hydro or storage device models. Cases 1(a) & 2(a) will not impact the model's operations, and the target constraint will be rendered useless. In most cases that have no energy target and a non-zero value for $C^{value}$, if this cost is too high ($C^{value} >> 0$) or too low ($C^{value} <<0$) can result in either the model holding on to stored energy till the end of the model not storing any energy in the device. This is caused by the fact that when the energy target is zero, we have $E_t = - E^{shortage}_t$, and $- E^{shortage}_t * C^{value}$ in the objective function is replaced by $E_t * C^{value}$, thus resulting in $C^{value}$ to be seen as the cost of stored energy.

CaseEnergy TargetEnergy Shortage CostEnergy Value / Energy Surplus costEffect
Case 1(a)$\hat{E}=0$$C^{penalty}=0$$C^{value}=0$no change
Case 1(b)$\hat{E}=0$$C^{penalty}=0$$C^{value}<0$penalty for storing energy
Case 1(c)$\hat{E}=0$$C^{penalty}>0$$C^{value}=0$no penalties or incentives applied
Case 1(d)$\hat{E}=0$$C^{penalty}=0$$C^{value}>0$incentive for storing energy
Case 1(e)$\hat{E}=0$$C^{penalty}>0$$C^{value}<0$penalty for storing energy
Case 1(f)$\hat{E}=0$$C^{penalty}>0$$C^{value}>0$incentive for storing energy
Case 2(a)$\hat{E}>0$$C^{penalty}=0$$C^{value}=0$no change
Case 2(b)$\hat{E}>0$$C^{penalty}=0$$C^{value}<0$penalty on energy storage in excess of target
Case 2(c)$\hat{E}>0$$C^{penalty}>0$$C^{value}=0$penalty on energy storage short of target
Case 2(d)$\hat{E}>0$$C^{penalty}=0$$C^{value}>0$incentive on excess energy
Case 2(e)$\hat{E}>0$$C^{penalty}>0$$C^{value}<0$penalty on both excess/shortage of energy
Case 2(f)$\hat{E}>0$$C^{penalty}>0$$C^{value}>0$penalty for shortage, incentive for excess energy
+\end{aligned}\]

Impact of different cost configurations:

The following table describes all possible configurations of the StorageCost with the target constraint in hydro or storage device models. Cases 1(a) & 2(a) will not impact the model's operations, and the target constraint will be rendered useless. In most cases that have no energy target and a non-zero value for $C^{value}$, if this cost is too high ($C^{value} >> 0$) or too low ($C^{value} <<0$) can result in either the model holding on to stored energy till the end of the model not storing any energy in the device. This is caused by the fact that when the energy target is zero, we have $E_t = - E^{shortage}_t$, and $- E^{shortage}_t * C^{value}$ in the objective function is replaced by $E_t * C^{value}$, thus resulting in $C^{value}$ to be seen as the cost of stored energy.

CaseEnergy TargetEnergy Shortage CostEnergy Value / Energy Surplus costEffect
Case 1(a)$\hat{E}=0$$C^{penalty}=0$$C^{value}=0$no change
Case 1(b)$\hat{E}=0$$C^{penalty}=0$$C^{value}<0$penalty for storing energy
Case 1(c)$\hat{E}=0$$C^{penalty}>0$$C^{value}=0$no penalties or incentives applied
Case 1(d)$\hat{E}=0$$C^{penalty}=0$$C^{value}>0$incentive for storing energy
Case 1(e)$\hat{E}=0$$C^{penalty}>0$$C^{value}<0$penalty for storing energy
Case 1(f)$\hat{E}=0$$C^{penalty}>0$$C^{value}>0$incentive for storing energy
Case 2(a)$\hat{E}>0$$C^{penalty}=0$$C^{value}=0$no change
Case 2(b)$\hat{E}>0$$C^{penalty}=0$$C^{value}<0$penalty on energy storage in excess of target
Case 2(c)$\hat{E}>0$$C^{penalty}>0$$C^{value}=0$penalty on energy storage short of target
Case 2(d)$\hat{E}>0$$C^{penalty}=0$$C^{value}>0$incentive on excess energy
Case 2(e)$\hat{E}>0$$C^{penalty}>0$$C^{value}<0$penalty on both excess/shortage of energy
Case 2(f)$\hat{E}>0$$C^{penalty}>0$$C^{value}>0$penalty for shortage, incentive for excess energy
diff --git a/dev/formulation_library/Introduction/index.html b/dev/formulation_library/Introduction/index.html index a95ef3868..6d3f79157 100644 --- a/dev/formulation_library/Introduction/index.html +++ b/dev/formulation_library/Introduction/index.html @@ -12,4 +12,4 @@ & \hspace{0.9cm} p_t^\text{th} + p_t^\text{re} = P_t^\text{load}, \quad \forall t \in {1,\dots, 48} \\ & \hspace{0.9cm} 0 \le p_t^\text{th} \le P^\text{th,max} \\ & \hspace{0.9cm} 0 \le p_t^\text{re} \le \text{ActivePowerTimeSeriesParameter}_t -\end{align*}\]

Note that the StaticPowerLoad does not impose any cost to the objective function or constraint but adds its power demand to the supply-balance demand of the CopperPlatePowerModel used. Since we are using the ThermalDispatchNoMin formulation for the thermal generation, the lower bound for the power is 0, instead of $P^\text{th,min}$. In addition, we are assuming a linear cost $C^\text{th}$. Finally, the RenewableFullDispatch formulation allows the dispatch of the renewable unit between 0 and its maximum injection time series $p_t^\text{re,param}$.

Nomenclature

In the formulations described in the other pages, the nomenclature is as follows:

+\end{align*}\]

Note that the StaticPowerLoad does not impose any cost to the objective function or constraint but adds its power demand to the supply-balance demand of the CopperPlatePowerModel used. Since we are using the ThermalDispatchNoMin formulation for the thermal generation, the lower bound for the power is 0, instead of $P^\text{th,min}$. In addition, we are assuming a linear cost $C^\text{th}$. Finally, the RenewableFullDispatch formulation allows the dispatch of the renewable unit between 0 and its maximum injection time series $p_t^\text{re,param}$.

Nomenclature

In the formulations described in the other pages, the nomenclature is as follows:

diff --git a/dev/formulation_library/Load/index.html b/dev/formulation_library/Load/index.html index c9a38fabc..73b84c527 100644 --- a/dev/formulation_library/Load/index.html +++ b/dev/formulation_library/Load/index.html @@ -1,8 +1,8 @@ -Load · PowerSimulations.jl

PowerSystems.ElectricLoad Formulations

Electric load formulations define the optimization models that describe load units (demand) mathematical model in different operational settings, such as economic dispatch and unit commitment.

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Table of contents

  1. StaticPowerLoad
  2. PowerLoadInterruption
  3. PowerLoadDispatch
  4. Valid configurations

StaticPowerLoad

Variables:

No variables are created

Time Series Parameters:

Uses the max_active_power timeseries parameter to determine the demand value at each time-step

ParameterDefault Time Series Name
ActivePowerTimeSeriesParametermax_active_power
ReactivePowerTimeSeriesParametermax_active_power

Expressions:

Subtracts the parameters listed above from the respective active and reactive power balance expressions created by the selected Network Formulations.

Constraints:

No constraints are created

PowerLoadInterruption

Variables:

Static Parameters:

  • $P^\text{ld,max}$ = PowerSystems.get_max_active_power(device)
  • $Q^\text{ld,max}$ = PowerSystems.get_max_reactive_power(device)

Time Series Parameters:

ParameterDefault Time Series Name
ActivePowerTimeSeriesParametermax_active_power
ReactivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $p^\text{ld}$.

Expressions:

  • Subtract$p^\text{ld}$ and $q^\text{ld}$ terms and to the respective active and reactive power balance expressions created by the selected Network Formulations

Constraints:

\[\begin{aligned} +Load · PowerSimulations.jl

PowerSystems.ElectricLoad Formulations

Electric load formulations define the optimization models that describe load units (demand) mathematical model in different operational settings, such as economic dispatch and unit commitment.

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Table of contents

  1. StaticPowerLoad
  2. PowerLoadInterruption
  3. PowerLoadDispatch
  4. Valid configurations

StaticPowerLoad

Variables:

No variables are created

Time Series Parameters:

Uses the max_active_power timeseries parameter to determine the demand value at each time-step

ParameterDefault Time Series Name
ReactivePowerTimeSeriesParametermax_active_power
ActivePowerTimeSeriesParametermax_active_power

Expressions:

Subtracts the parameters listed above from the respective active and reactive power balance expressions created by the selected Network Formulations.

Constraints:

No constraints are created

PowerLoadInterruption

Variables:

Static Parameters:

  • $P^\text{ld,max}$ = PowerSystems.get_max_active_power(device)
  • $Q^\text{ld,max}$ = PowerSystems.get_max_reactive_power(device)

Time Series Parameters:

ParameterDefault Time Series Name
ReactivePowerTimeSeriesParametermax_active_power
ActivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $p^\text{ld}$.

Expressions:

  • Subtract$p^\text{ld}$ and $q^\text{ld}$ terms and to the respective active and reactive power balance expressions created by the selected Network Formulations

Constraints:

\[\begin{aligned} & p_t^\text{ld} \le u_t^\text{ld} \cdot \text{ActivePowerTimeSeriesParameter}_t, \quad \forall t \in \{1,\dots, T\} \\ & q_t^\text{re} = \text{pf} \cdot p_t^\text{re}, \quad \forall t \in \{1,\dots, T\} -\end{aligned}\]

on which $\text{pf} = \sin(\arctan(Q^\text{ld,max}/P^\text{ld,max}))$.

PowerLoadDispatch

Variables:

  • ActivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_active_power(device)
    • Symbol: $p^\text{ld}$
  • ReactivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_reactive_power(device)
    • Symbol: $q^\text{ld}$

Static Parameters:

  • $P^\text{ld,max}$ = PowerSystems.get_max_active_power(device)
  • $Q^\text{ld,max}$ = PowerSystems.get_max_reactive_power(device)

Time Series Parameters:

ParameterDefault Time Series Name
ActivePowerTimeSeriesParametermax_active_power
ReactivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $p^\text{ld}$.

Expressions:

  • Subtract$p^\text{ld}$ and $q^\text{ld}$ terms and to the respective active and reactive power balance expressions created by the selected Network Formulations

Constraints:

\[\begin{aligned} +\end{aligned}\]

on which $\text{pf} = \sin(\arctan(Q^\text{ld,max}/P^\text{ld,max}))$.

PowerLoadDispatch

Variables:

  • ActivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_active_power(device)
    • Symbol: $p^\text{ld}$
  • ReactivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_reactive_power(device)
    • Symbol: $q^\text{ld}$

Static Parameters:

  • $P^\text{ld,max}$ = PowerSystems.get_max_active_power(device)
  • $Q^\text{ld,max}$ = PowerSystems.get_max_reactive_power(device)

Time Series Parameters:

ParameterDefault Time Series Name
ReactivePowerTimeSeriesParametermax_active_power
ActivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $p^\text{ld}$.

Expressions:

  • Subtract$p^\text{ld}$ and $q^\text{ld}$ terms and to the respective active and reactive power balance expressions created by the selected Network Formulations

Constraints:

\[\begin{aligned} & p_t^\text{ld} \le \text{ActivePowerTimeSeriesParameter}_t, \quad \forall t \in \{1,\dots, T\}\\ & q_t^\text{ld} = \text{pf} \cdot p_t^\text{ld}, \quad \forall t \in \{1,\dots, T\}\\ -\end{aligned}\]

on which $\text{pf} = \sin(\arctan(Q^\text{ld,max}/P^\text{ld,max}))$.

Valid configurations

Valid DeviceModels for subtypes of ElectricLoad include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(InterruptiblePowerLoad, PowerLoadDispatch)InterruptiblePowerLoadPowerLoadDispatch
DeviceModel(ExponentialLoad, PowerLoadDispatch)ExponentialLoadPowerLoadDispatch
DeviceModel(PowerLoad, PowerLoadDispatch)PowerLoadPowerLoadDispatch
DeviceModel(StandardLoad, PowerLoadDispatch)StandardLoadPowerLoadDispatch
DeviceModel(InterruptiblePowerLoad, PowerLoadInterruption)InterruptiblePowerLoadPowerLoadInterruption
DeviceModel(ExponentialLoad, PowerLoadInterruption)ExponentialLoadPowerLoadInterruption
DeviceModel(PowerLoad, PowerLoadInterruption)PowerLoadPowerLoadInterruption
DeviceModel(StandardLoad, PowerLoadInterruption)StandardLoadPowerLoadInterruption
DeviceModel(FixedAdmittance, StaticPowerLoad)FixedAdmittanceStaticPowerLoad
DeviceModel(InterruptiblePowerLoad, StaticPowerLoad)InterruptiblePowerLoadStaticPowerLoad
DeviceModel(ExponentialLoad, StaticPowerLoad)ExponentialLoadStaticPowerLoad
DeviceModel(PowerLoad, StaticPowerLoad)PowerLoadStaticPowerLoad
DeviceModel(StandardLoad, StaticPowerLoad)StandardLoadStaticPowerLoad
DeviceModel(SwitchedAdmittance, StaticPowerLoad)SwitchedAdmittanceStaticPowerLoad
+\end{aligned}\]

on which $\text{pf} = \sin(\arctan(Q^\text{ld,max}/P^\text{ld,max}))$.

Valid configurations

Valid DeviceModels for subtypes of ElectricLoad include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(InterruptiblePowerLoad, PowerLoadDispatch)InterruptiblePowerLoadPowerLoadDispatch
DeviceModel(ExponentialLoad, PowerLoadDispatch)ExponentialLoadPowerLoadDispatch
DeviceModel(PowerLoad, PowerLoadDispatch)PowerLoadPowerLoadDispatch
DeviceModel(StandardLoad, PowerLoadDispatch)StandardLoadPowerLoadDispatch
DeviceModel(InterruptiblePowerLoad, PowerLoadInterruption)InterruptiblePowerLoadPowerLoadInterruption
DeviceModel(ExponentialLoad, PowerLoadInterruption)ExponentialLoadPowerLoadInterruption
DeviceModel(PowerLoad, PowerLoadInterruption)PowerLoadPowerLoadInterruption
DeviceModel(StandardLoad, PowerLoadInterruption)StandardLoadPowerLoadInterruption
DeviceModel(FixedAdmittance, StaticPowerLoad)FixedAdmittanceStaticPowerLoad
DeviceModel(InterruptiblePowerLoad, StaticPowerLoad)InterruptiblePowerLoadStaticPowerLoad
DeviceModel(ExponentialLoad, StaticPowerLoad)ExponentialLoadStaticPowerLoad
DeviceModel(PowerLoad, StaticPowerLoad)PowerLoadStaticPowerLoad
DeviceModel(StandardLoad, StaticPowerLoad)StandardLoadStaticPowerLoad
DeviceModel(SwitchedAdmittance, StaticPowerLoad)SwitchedAdmittanceStaticPowerLoad
diff --git a/dev/formulation_library/Network/index.html b/dev/formulation_library/Network/index.html index 4af2a11ac..057472116 100644 --- a/dev/formulation_library/Network/index.html +++ b/dev/formulation_library/Network/index.html @@ -1,10 +1,10 @@ -Network · PowerSimulations.jl

Network Formulations

Network formulations are used to describe how the network and buses are handled when constructing constraints. The most common constraint decided by the network formulation is the supply-demand balance constraint.

PowerSimulations.NetworkModelType

Establishes the model for the network specified by type.

Arguments

-::Type{T}: PowerModels AbstractPowerModel

Accepted Key Words

  • use_slacks::Bool: Adds slacks to the network modeling
  • PTDF::PTDF: PTDF Array calculated using PowerNetworkMatrices
  • duals::Vector{DataType}: Constraint types to calculate the duals
  • reduce_radial_branches::Bool: Skips modeling radial branches in the system to reduce problem size

Example

ptdfarray = PTDF(system) nw = NetworkModel(PTDFPowerModel, ptdf = ptdfarray),

source

Available Network Models are:

FormulationDescription
CopperPlatePowerModelCopper plate connection between all components, i.e. infinite transmission capacity
AreaBalancePowerModelNetwork model approximation to represent inter-area flow with each area represented as a single node
PTDFPowerModelUses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches
AreaPTDFPowerModelUses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches and balances power by Area instead of system-wide

PowerModels.jl available formulations:

  • Exact non-convex models: ACPPowerModel, ACRPowerModel, ACTPowerModel.
  • Linear approximations: DCPPowerModel, NFAPowerModel.
  • Quadratic approximations: DCPLLPowerModel, LPACCPowerModel
  • Quadratic relaxations: SOCWRPowerModel, SOCWRConicPowerModel, SOCBFPowerModel, SOCBFConicPowerModel, QCRMPowerModel, QCLSPowerModel.
  • SDP relaxations: SDPWRMPowerModel, SparseSDPWRMPowerModel.

All of these formulations are described in the PowerModels.jl documentation and will not be described here.

CopperPlatePowerModel

Variables:

If Slack variables are enabled:

  • SystemBalanceSlackUp:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,up}$
  • SystemBalanceSlackDown:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,dn}$

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ (p^\text{sl,up} + p^\text{sl,dn}) \cdot 10^6$

Expressions:

Adds $p^\text{sl,up}$ and $p^\text{sl,dn}$ terms to the respective active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation.

Constraints:

Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system

\[\begin{align} +Network · PowerSimulations.jl

Network Formulations

Network formulations are used to describe how the network and buses are handled when constructing constraints. The most common constraint decided by the network formulation is the supply-demand balance constraint.

PowerSimulations.NetworkModelType

Establishes the model for the network specified by type.

Arguments

-::Type{T}: PowerModels AbstractPowerModel

Accepted Key Words

  • use_slacks::Bool: Adds slacks to the network modeling
  • PTDF::PTDF: PTDF Array calculated using PowerNetworkMatrices
  • duals::Vector{DataType}: Constraint types to calculate the duals
  • reduce_radial_branches::Bool: Skips modeling radial branches in the system to reduce problem size

Example

ptdfarray = PTDF(system) nw = NetworkModel(PTDFPowerModel, ptdf = ptdfarray),

source

Available Network Models are:

FormulationDescription
CopperPlatePowerModelCopper plate connection between all components, i.e. infinite transmission capacity
AreaBalancePowerModelNetwork model approximation to represent inter-area flow with each area represented as a single node
PTDFPowerModelUses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches
AreaPTDFPowerModelUses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches and balances power by Area instead of system-wide

PowerModels.jl available formulations:

  • Exact non-convex models: ACPPowerModel, ACRPowerModel, ACTPowerModel.
  • Linear approximations: DCPPowerModel, NFAPowerModel.
  • Quadratic approximations: DCPLLPowerModel, LPACCPowerModel
  • Quadratic relaxations: SOCWRPowerModel, SOCWRConicPowerModel, SOCBFPowerModel, SOCBFConicPowerModel, QCRMPowerModel, QCLSPowerModel.
  • SDP relaxations: SDPWRMPowerModel, SparseSDPWRMPowerModel.

All of these formulations are described in the PowerModels.jl documentation and will not be described here.

CopperPlatePowerModel

Variables:

If Slack variables are enabled:

  • SystemBalanceSlackUp:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,up}$
  • SystemBalanceSlackDown:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,dn}$

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ (p^\text{sl,up} + p^\text{sl,dn}) \cdot 10^6$

Expressions:

Adds $p^\text{sl,up}$ and $p^\text{sl,dn}$ terms to the respective active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation.

Constraints:

Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system

\[\begin{align} & \sum_{c \in \text{components}} p_t^c = 0, \quad \forall t \in \{1, \dots, T\} -\end{align}\]

AreaBalancePowerModel

Variables: If Slack variables are enabled:

  • SystemBalanceSlackUp by area:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,up}$
  • SystemBalanceSlackDown by area:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,dn}$

Objective:

Adds $p^\text{sl,up}$ and $p^\text{sl,dn}$ terms to the respective active power balance expressions ActivePowerBalance per area.

Expressions:

Creates ActivePowerBalance expressions for each area that then are used to balance active power for all buses within a single area.

Constraints:

Adds the CopperPlateBalanceConstraint to balance the active power of all components available in an area.

\[\begin{align} +\end{align}\]

AreaBalancePowerModel

Variables: If Slack variables are enabled:

  • SystemBalanceSlackUp by area:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,up}$
  • SystemBalanceSlackDown by area:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,dn}$

Objective:

Adds $p^\text{sl,up}$ and $p^\text{sl,dn}$ terms to the respective active power balance expressions ActivePowerBalance per area.

Expressions:

Creates ActivePowerBalance expressions for each area that then are used to balance active power for all buses within a single area.

Constraints:

Adds the CopperPlateBalanceConstraint to balance the active power of all components available in an area.

\[\begin{align} & \sum_{c \in \text{components}_a} p_t^c = 0, \quad \forall a\in \{1,\dots, A\}, t \in \{1, \dots, T\} -\end{align}\]

PTDFPowerModel

Variables:

If Slack variables are enabled:

  • SystemBalanceSlackUp:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,up}$
  • SystemBalanceSlackDown:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,dn}$

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ (p^\text{sl,up} + p^\text{sl,dn}) \cdot 10^6$

Expressions:

Adds $p^\text{sl,up}$ and $p^\text{sl,dn}$ terms to the respective system-wide active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation. In addition, it creates ActivePowerBalance expressions for each bus to be used in the calculation of branch flows.

Constraints:

Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system

\[\begin{align} +\end{align}\]

PTDFPowerModel

Variables:

If Slack variables are enabled:

  • SystemBalanceSlackUp:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,up}$
  • SystemBalanceSlackDown:

    • Bounds: [0.0, ]
    • Default initial value: 0.0
    • Default proportional cost: 1e6
    • Symbol: $p^\text{sl,dn}$

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ (p^\text{sl,up} + p^\text{sl,dn}) \cdot 10^6$

Expressions:

Adds $p^\text{sl,up}$ and $p^\text{sl,dn}$ terms to the respective system-wide active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation. In addition, it creates ActivePowerBalance expressions for each bus to be used in the calculation of branch flows.

Constraints:

Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system

\[\begin{align} & \sum_{c \in \text{components}} p_t^c = 0, \quad \forall t \in \{1, \dots, T\} -\end{align}\]

In addition creates NodalBalanceActiveConstraint for HVDC buses balance, if DC components are connected to an HVDC network.

AreaPTDFPowerModel

Variables

Slack variables are not supported.

Objective Function

No changes to the objective function.

Expressions

Creates the area-wide and nodal-wide active power balance expressions ActivePowerBalance to balance power based on each area independently. The flows across areas are computed based on the PTDF factors of lines connecting areas.

Constraints:

Adds the ActivePowerBalance constraint to balance the active power of all components available for each area.

\[\begin{align} +\end{align}\]

In addition creates NodalBalanceActiveConstraint for HVDC buses balance, if DC components are connected to an HVDC network.

AreaPTDFPowerModel

Variables

Slack variables are not supported.

Objective Function

No changes to the objective function.

Expressions

Creates the area-wide and nodal-wide active power balance expressions ActivePowerBalance to balance power based on each area independently. The flows across areas are computed based on the PTDF factors of lines connecting areas.

Constraints:

Adds the ActivePowerBalance constraint to balance the active power of all components available for each area.

\[\begin{align} & \sum_{c \in \text{components}_a} p_t^c = 0, \quad \forall a\in \{1,\dots, A\}, t \in \{1, \dots, T\} -\end{align}\]

This includes the flows of lines based on the PTDF factors.

+\end{align}\]

This includes the flows of lines based on the PTDF factors.

diff --git a/dev/formulation_library/Piecewise/index.html b/dev/formulation_library/Piecewise/index.html index 018a0970f..76c95a01a 100644 --- a/dev/formulation_library/Piecewise/index.html +++ b/dev/formulation_library/Piecewise/index.html @@ -27,4 +27,4 @@ & \sum_{k \in \mathcal{K}} \delta_{k,t} = \text{on}_{t} & \forall t \in \mathcal{T}\\ & 0 \leq \Delta p_{t} \leq \left( P^{\text{max}} - P^{\text{min}} \right)\text{on}_{t} & \forall t \in \mathcal{T}\\ &\left \{\delta_{i,t} \dots \delta_{k,t} \right \} \in \text{SOS}_{2} & \forall t \in \mathcal{T} -\end{align*}\]

on which $\delta_{k,t} \in [0,1]$ is the interpolation variable, $\Delta p$ is the active power of the generator above the minimum power and $u \in \{0,1\}$ is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.

+\end{align*}\]

on which $\delta_{k,t} \in [0,1]$ is the interpolation variable, $\Delta p$ is the active power of the generator above the minimum power and $u \in \{0,1\}$ is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.

diff --git a/dev/formulation_library/README/index.html b/dev/formulation_library/README/index.html index 5f43799e9..bf3e019da 100644 --- a/dev/formulation_library/README/index.html +++ b/dev/formulation_library/README/index.html @@ -1,2 +1,2 @@ -Formulation documentation guide · PowerSimulations.jl

Formulation documentation guide

Formulation documentation should roughly follow the template established by RenewableGen.md

Auto generated items

  • Valid DeviceModel table: just change the device category in the filter function
  • Time Series Parameters: just change the device category and formulation in the get_default_time_series_names method call

Linked items

  • Formulations in the Valid DeviceModel table must have a docstring in src/core/formulations.jl
  • The Formulation in the @docs block must have a docstring in src/core/formulations.jl
  • The Variables must have docstrings in src/core/variables.jl
  • The Time Series Parameters must have docstrings in src/core/parameters.jl
+Formulation documentation guide · PowerSimulations.jl

Formulation documentation guide

Formulation documentation should roughly follow the template established by RenewableGen.md

Auto generated items

  • Valid DeviceModel table: just change the device category in the filter function
  • Time Series Parameters: just change the device category and formulation in the get_default_time_series_names method call

Linked items

  • Formulations in the Valid DeviceModel table must have a docstring in src/core/formulations.jl
  • The Formulation in the @docs block must have a docstring in src/core/formulations.jl
  • The Variables must have docstrings in src/core/variables.jl
  • The Time Series Parameters must have docstrings in src/core/parameters.jl
diff --git a/dev/formulation_library/RenewableGen/index.html b/dev/formulation_library/RenewableGen/index.html index bf11e50bf..5b2e120eb 100644 --- a/dev/formulation_library/RenewableGen/index.html +++ b/dev/formulation_library/RenewableGen/index.html @@ -1,8 +1,8 @@ -Renewable Generation · PowerSimulations.jl

PowerSystems.RenewableGen Formulations

Renewable generation formulations define the optimization models that describe renewable units mathematical model in different operational settings, such as economic dispatch and unit commitment.

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Note

Reserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.

Table of contents

  1. RenewableFullDispatch
  2. RenewableConstantPowerFactor
  3. Valid configurations

RenewableFullDispatch

Variables:

Static Parameters:

  • $P^\text{re,min}$ = PowerSystems.get_active_power_limits(device).min
  • $Q^\text{re,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{re,max}$ = PowerSystems.get_reactive_power_limits(device).max

Time Series Parameters:

Uses the max_active_power timeseries parameter to limit the available active power at each time-step.

ParameterDefault Time Series Name
ActivePowerTimeSeriesParametermax_active_power
ReactivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $- p^\text{re}$ to incentivize generation from RenewableGen devices.

Expressions:

Adds $p^\text{re}$ and $q^\text{re}$ terms to the respective active and reactive power balance expressions created by the selected Network Formulations.

Constraints:

\[\begin{aligned} +Renewable Generation · PowerSimulations.jl

PowerSystems.RenewableGen Formulations

Renewable generation formulations define the optimization models that describe renewable units mathematical model in different operational settings, such as economic dispatch and unit commitment.

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Note

Reserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.

Table of contents

  1. RenewableFullDispatch
  2. RenewableConstantPowerFactor
  3. Valid configurations

RenewableFullDispatch

Variables:

Static Parameters:

  • $P^\text{re,min}$ = PowerSystems.get_active_power_limits(device).min
  • $Q^\text{re,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{re,max}$ = PowerSystems.get_reactive_power_limits(device).max

Time Series Parameters:

Uses the max_active_power timeseries parameter to limit the available active power at each time-step.

ParameterDefault Time Series Name
ReactivePowerTimeSeriesParametermax_active_power
ActivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $- p^\text{re}$ to incentivize generation from RenewableGen devices.

Expressions:

Adds $p^\text{re}$ and $q^\text{re}$ terms to the respective active and reactive power balance expressions created by the selected Network Formulations.

Constraints:

\[\begin{aligned} & P^\text{re,min} \le p_t^\text{re} \le \text{ActivePowerTimeSeriesParameter}_t, \quad \forall t \in \{1,\dots, T\} \\ & Q^\text{re,min} \le q_t^\text{re} \le Q^\text{re,max}, \quad \forall t \in \{1,\dots, T\} -\end{aligned}\]

RenewableConstantPowerFactor

Variables:

  • ActivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_active_power(device)
    • Symbol: $p^\text{re}$
  • ReactivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_reactive_power(device)
    • Symbol: $q^\text{re}$

Static Parameters:

  • $P^\text{re,min}$ = PowerSystems.get_active_power_limits(device).min
  • $Q^\text{re,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{re,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $\text{pf}$ = PowerSystems.get_power_factor(device)

Time Series Parameters:

ParameterDefault Time Series Name
ActivePowerTimeSeriesParametermax_active_power
ReactivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $- p_t^\text{re}$ to incentivize generation from RenewableGen devices.

Expressions:

Adds $p^\text{re}$ and $q^\text{re}$ terms to the respective active and reactive power balance expressions created by the selected Network Formulations

Constraints:

\[\begin{aligned} +\end{aligned}\]

RenewableConstantPowerFactor

Variables:

  • ActivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_active_power(device)
    • Symbol: $p^\text{re}$
  • ReactivePowerVariable:

    • Bounds: [0.0, ]
    • Default initial value: PowerSystems.get_reactive_power(device)
    • Symbol: $q^\text{re}$

Static Parameters:

  • $P^\text{re,min}$ = PowerSystems.get_active_power_limits(device).min
  • $Q^\text{re,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{re,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $\text{pf}$ = PowerSystems.get_power_factor(device)

Time Series Parameters:

ParameterDefault Time Series Name
ReactivePowerTimeSeriesParametermax_active_power
ActivePowerTimeSeriesParametermax_active_power

Objective:

Creates an objective function term based on the FunctionData Options where the quantity term is defined as $- p_t^\text{re}$ to incentivize generation from RenewableGen devices.

Expressions:

Adds $p^\text{re}$ and $q^\text{re}$ terms to the respective active and reactive power balance expressions created by the selected Network Formulations

Constraints:

\[\begin{aligned} & P^\text{re,min} \le p_t^\text{re} \le \text{ActivePowerTimeSeriesParameter}_t, \quad \forall t \in \{1,\dots, T\} \\ & q_t^\text{re} = \text{pf} \cdot p_t^\text{re}, \quad \forall t \in \{1,\dots, T\} -\end{aligned}\]

Valid configurations

Valid DeviceModels for subtypes of RenewableGen include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(RenewableDispatch, FixedOutput)RenewableDispatchFixedOutput
DeviceModel(RenewableNonDispatch, FixedOutput)RenewableNonDispatchFixedOutput
DeviceModel(RenewableDispatch, RenewableConstantPowerFactor)RenewableDispatchRenewableConstantPowerFactor
DeviceModel(RenewableNonDispatch, RenewableConstantPowerFactor)RenewableNonDispatchRenewableConstantPowerFactor
DeviceModel(RenewableDispatch, RenewableFullDispatch)RenewableDispatchRenewableFullDispatch
DeviceModel(RenewableNonDispatch, RenewableFullDispatch)RenewableNonDispatchRenewableFullDispatch
+\end{aligned}\]

Valid configurations

Valid DeviceModels for subtypes of RenewableGen include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(RenewableDispatch, FixedOutput)RenewableDispatchFixedOutput
DeviceModel(RenewableNonDispatch, FixedOutput)RenewableNonDispatchFixedOutput
DeviceModel(RenewableDispatch, RenewableConstantPowerFactor)RenewableDispatchRenewableConstantPowerFactor
DeviceModel(RenewableNonDispatch, RenewableConstantPowerFactor)RenewableNonDispatchRenewableConstantPowerFactor
DeviceModel(RenewableDispatch, RenewableFullDispatch)RenewableDispatchRenewableFullDispatch
DeviceModel(RenewableNonDispatch, RenewableFullDispatch)RenewableNonDispatchRenewableFullDispatch
diff --git a/dev/formulation_library/Service/index.html b/dev/formulation_library/Service/index.html index ca0678c98..143b6d01d 100644 --- a/dev/formulation_library/Service/index.html +++ b/dev/formulation_library/Service/index.html @@ -1,11 +1,11 @@ -Services · PowerSimulations.jl

PowerSystems.Service Formulations

Services (or ancillary services) are models used to ensure that there is necessary support to the power grid from generators to consumers, in order to ensure reliable operation of the system.

The most common application for ancillary services are reserves, i.e., generation (or load) that is not currently being used, but can be quickly made available in case of unexpected changes of grid conditions, for example a sudden loss of load or generation.

A key challenge of adding services to a system, from a mathematical perspective, is specifying which units contribute to the specified requirement of a service, that implies the creation of new variables (such as reserve variables) and modification of constraints.

In this documentation, we first specify the available Services in the grid, and what requirements impose in the system, and later we discuss the implication on device formulations for specific units.

Table of contents

  1. RangeReserve
  2. StepwiseCostReserve
  3. GroupReserve
  4. RampReserve
  5. NonSpinningReserve
  6. ConstantMaxInterfaceFlow
  7. VariableMaxInterfaceFlow
  8. Changes on Expressions

RangeReserve

For each service $s$ of the model type RangeReserve the following variables are created:

Variables:

  • ActivePowerReserveVariable:

    • Bounds: [0.0, ]
    • Default proportional cost: $1.0 / \text{SystemBasePower}$
    • Symbol: $r_{d}$ for $d$ in contributing devices to the service $s$ If slacks are enabled:
  • ReserveRequirementSlack:

    • Bounds: [0.0, ]
    • Default proportional cost: 1e5
    • Symbol: $r^\text{sl}$

Depending on the PowerSystems.jl type associated to the RangeReserve formulation model, the parameters are:

Static Parameters

  • $\text{PF}$ = PowerSystems.get_max_participation_factor(service)

For a ConstantReserve PowerSystems type:

  • $\text{Req}$ = PowerSystems.get_requirement(service)

Time Series Parameters

For a VariableReserve PowerSystems type:

ParameterDefault Time Series Name
RequirementTimeSeriesParameterrequirement

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ r^\text{sl} \cdot 10^5$. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A RangeReserve implements two fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RangeReserve requirement. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{Req},\quad \forall t\in \{1,\dots, T\} \quad \text{(for a ConstantReserve)} \\ +Services · PowerSimulations.jl

PowerSystems.Service Formulations

Services (or ancillary services) are models used to ensure that there is necessary support to the power grid from generators to consumers, in order to ensure reliable operation of the system.

The most common application for ancillary services are reserves, i.e., generation (or load) that is not currently being used, but can be quickly made available in case of unexpected changes of grid conditions, for example a sudden loss of load or generation.

A key challenge of adding services to a system, from a mathematical perspective, is specifying which units contribute to the specified requirement of a service, that implies the creation of new variables (such as reserve variables) and modification of constraints.

In this documentation, we first specify the available Services in the grid, and what requirements impose in the system, and later we discuss the implication on device formulations for specific units.

Table of contents

  1. RangeReserve
  2. StepwiseCostReserve
  3. GroupReserve
  4. RampReserve
  5. NonSpinningReserve
  6. ConstantMaxInterfaceFlow
  7. VariableMaxInterfaceFlow
  8. Changes on Expressions

RangeReserve

For each service $s$ of the model type RangeReserve the following variables are created:

Variables:

  • ActivePowerReserveVariable:

    • Bounds: [0.0, ]
    • Default proportional cost: $1.0 / \text{SystemBasePower}$
    • Symbol: $r_{d}$ for $d$ in contributing devices to the service $s$ If slacks are enabled:
  • ReserveRequirementSlack:

    • Bounds: [0.0, ]
    • Default proportional cost: 1e5
    • Symbol: $r^\text{sl}$

Depending on the PowerSystems.jl type associated to the RangeReserve formulation model, the parameters are:

Static Parameters

  • $\text{PF}$ = PowerSystems.get_max_participation_factor(service)

For a ConstantReserve PowerSystems type:

  • $\text{Req}$ = PowerSystems.get_requirement(service)

Time Series Parameters

For a VariableReserve PowerSystems type:

ParameterDefault Time Series Name
RequirementTimeSeriesParameterrequirement

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ r^\text{sl} \cdot 10^5$. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A RangeReserve implements two fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RangeReserve requirement. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{Req},\quad \forall t\in \{1,\dots, T\} \quad \text{(for a ConstantReserve)} \\ \sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{RequirementTimeSeriesParameter}_{t},\quad \forall t\in \{1,\dots, T\} \quad \text{(for a VariableReserve)}\]

In addition, there is a restriction on how much each contributing device $d$ can contribute to the requirement, based on the max participation factor allowed.

\[r_{d,t} \le \text{Req} \cdot \text{PF} ,\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\} \quad \text{(for a ConstantReserve)} \\ -r_{d,t} \le \text{RequirementTimeSeriesParameter}_{t} \cdot \text{PF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for a VariableReserve)}\]

StepwiseCostReserve

Service must be used with ReserveDemandCurve PowerSystems.jl type. This service model is used to model ORDC (Operating Reserve Demand Curve) in ERCOT.

For each service $s$ of the model type ReserveDemandCurve the following variables are created:

Variables:

Time Series Parameters

For a ReserveDemandCurve PowerSystems type:

| Parameter | Default Time Series Name |

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

The ServiceRequirementVariable is added as a piecewise linear cost based on the decreasing offers listed in the variable_cost time series. These decreasing cost represent the scarcity prices of not having sufficient reserves. For example, if the variable $\text{req} = 0$, then a really high cost is paid for not having enough reserves, and if $\text{req}$ is larger, then a lower cost (or even zero) is paid.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A StepwiseCostReserve implements a single constraint, such that the sum of all reserves of contributing devices must be larger than the ServiceRequirementVariable variable. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} \ge \text{req}_t,\quad \forall t\in \{1,\dots, T\} \]

GroupReserve

Service must be used with ConstantReserveGroup PowerSystems.jl type. This service model is used to model an aggregation of services.

For each service $s$ of the model type GroupReserve the following variables are created:

Variables:

No variables are created, but the services associated with the GroupReserve must have created variables.

Static Parameters

  • $\text{Req}$ = PowerSystems.get_requirement(service)

Relevant Methods:

  • $\mathcal{S}_s$ = PowerSystems.get_contributing_services(system, service): Set (vector) of all contributing services to the group service $s$ in the system.
  • $\mathcal{D}_{s_i}$ = PowerSystems.get_contributing_devices(system, service_aux): Set (vector) of all contributing devices to the service $s_i$ in the system.

Objective:

Does not modify the objective function, besides the changes to the objective function due to the other services associated to the group service.

Expressions:

No changes, besides the changes to the expressions due to the other services associated to the group service.

Constraints:

A GroupReserve implements that the sum of all reserves of contributing devices, of all contributing services, must be larger than the GroupReserve requirement. Thus, for a GroupReserve service $s$:

\[\sum_{d\in\mathcal{D}_{s_i}} \sum_{i \in \mathcal{S}_s} r_{d,t} \ge \text{Req},\quad \forall t\in \{1,\dots, T\} \]

RampReserve

For each service $s$ of the model type RampReserve the following variables are created:

Variables:

  • ActivePowerReserveVariable:

    • Bounds: [0.0, ]
    • Default proportional cost: $1.0 / \text{SystemBasePower}$
    • Symbol: $r_{d}$ for $d$ in contributing devices to the service $s$ If slacks are enabled:
  • ReserveRequirementSlack:

    • Bounds: [0.0, ]
    • Default proportional cost: 1e5
    • Symbol: $r^\text{sl}$

RampReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:

Static Parameters

  • $\text{TF}$ = PowerSystems.get_time_frame(service)
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up for thermal contributing devices
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down for thermal contributing devices

Time Series Parameters

For a VariableReserve PowerSystems type:

ParameterDefault Time Series Name
RequirementTimeSeriesParameterrequirement

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ r^\text{sl} \cdot 10^5$. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A RampReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RampReserve requirement. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{RequirementTimeSeriesParameter}_{t},\quad \forall t\in \{1,\dots, T\}\]

Finally, there is a restriction based on the ramp limits of the contributing devices:

\[r_{d,t} \le R^\text{th,up} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveUp)} \\ -r_{d,t} \le R^\text{th,dn} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveDown)}\]

NonSpinningReserve

For each service $s$ of the model type NonSpinningReserve, the following variables are created:

Variables:

  • ActivePowerReserveVariable:

    • Bounds: [0.0, ]
    • Default proportional cost: $1.0 / \text{SystemBasePower}$
    • Symbol: $r_{d}$ for $d$ in contributing devices to the service $s$ If slacks are enabled:
  • ReserveRequirementSlack:

    • Bounds: [0.0, ]
    • Default proportional cost: 1e5
    • Symbol: $r^\text{sl}$

NonSpinningReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:

Static Parameters

  • $\text{PF}$ = PowerSystems.get_max_participation_factor(service)
  • $\text{TF}$ = PowerSystems.get_time_frame(service)
  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min for thermal contributing devices
  • $T^\text{st,up}$ = PowerSystems.get_time_limits(d).up for thermal contributing devices
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).down for thermal contributing devices

Other parameters:

  • $\Delta T$: Resolution of the problem in minutes.

Time Series Parameters

For a VariableReserve PowerSystems type:

| Parameter | Default Time Series Name |

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ r^\text{sl} \cdot 10^5$. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A NonSpinningReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the NonSpinningReserve requirement. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{RequirementTimeSeriesParameter}_{t},\quad \forall t\in \{1,\dots, T\}\]

In addition, there is a restriction on how much each contributing device $d$ can contribute to the requirement, based on the max participation factor allowed.

\[r_{d,t} \le \text{RequirementTimeSeriesParameter}_{t} \cdot \text{PF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\},\]

Finally, there is a restriction based on the reserve response time for the non-spinning reserve if the unit is off. To do so, compute $R^\text{limit}_d$ as the reserve response limit as:

\[R^\text{limit}_d = \begin{cases} +r_{d,t} \le \text{RequirementTimeSeriesParameter}_{t} \cdot \text{PF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for a VariableReserve)}\]

StepwiseCostReserve

Service must be used with ReserveDemandCurve PowerSystems.jl type. This service model is used to model ORDC (Operating Reserve Demand Curve) in ERCOT.

For each service $s$ of the model type ReserveDemandCurve the following variables are created:

Variables:

Time Series Parameters

For a ReserveDemandCurve PowerSystems type:

| Parameter | Default Time Series Name |

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

The ServiceRequirementVariable is added as a piecewise linear cost based on the decreasing offers listed in the variable_cost time series. These decreasing cost represent the scarcity prices of not having sufficient reserves. For example, if the variable $\text{req} = 0$, then a really high cost is paid for not having enough reserves, and if $\text{req}$ is larger, then a lower cost (or even zero) is paid.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A StepwiseCostReserve implements a single constraint, such that the sum of all reserves of contributing devices must be larger than the ServiceRequirementVariable variable. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} \ge \text{req}_t,\quad \forall t\in \{1,\dots, T\} \]

GroupReserve

Service must be used with ConstantReserveGroup PowerSystems.jl type. This service model is used to model an aggregation of services.

For each service $s$ of the model type GroupReserve the following variables are created:

Variables:

No variables are created, but the services associated with the GroupReserve must have created variables.

Static Parameters

  • $\text{Req}$ = PowerSystems.get_requirement(service)

Relevant Methods:

  • $\mathcal{S}_s$ = PowerSystems.get_contributing_services(system, service): Set (vector) of all contributing services to the group service $s$ in the system.
  • $\mathcal{D}_{s_i}$ = PowerSystems.get_contributing_devices(system, service_aux): Set (vector) of all contributing devices to the service $s_i$ in the system.

Objective:

Does not modify the objective function, besides the changes to the objective function due to the other services associated to the group service.

Expressions:

No changes, besides the changes to the expressions due to the other services associated to the group service.

Constraints:

A GroupReserve implements that the sum of all reserves of contributing devices, of all contributing services, must be larger than the GroupReserve requirement. Thus, for a GroupReserve service $s$:

\[\sum_{d\in\mathcal{D}_{s_i}} \sum_{i \in \mathcal{S}_s} r_{d,t} \ge \text{Req},\quad \forall t\in \{1,\dots, T\} \]

RampReserve

For each service $s$ of the model type RampReserve the following variables are created:

Variables:

  • ActivePowerReserveVariable:

    • Bounds: [0.0, ]
    • Default proportional cost: $1.0 / \text{SystemBasePower}$
    • Symbol: $r_{d}$ for $d$ in contributing devices to the service $s$ If slacks are enabled:
  • ReserveRequirementSlack:

    • Bounds: [0.0, ]
    • Default proportional cost: 1e5
    • Symbol: $r^\text{sl}$

RampReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:

Static Parameters

  • $\text{TF}$ = PowerSystems.get_time_frame(service)
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up for thermal contributing devices
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down for thermal contributing devices

Time Series Parameters

For a VariableReserve PowerSystems type:

ParameterDefault Time Series Name
RequirementTimeSeriesParameterrequirement

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ r^\text{sl} \cdot 10^5$. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A RampReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RampReserve requirement. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{RequirementTimeSeriesParameter}_{t},\quad \forall t\in \{1,\dots, T\}\]

Finally, there is a restriction based on the ramp limits of the contributing devices:

\[r_{d,t} \le R^\text{th,up} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveUp)} \\ +r_{d,t} \le R^\text{th,dn} \cdot \text{TF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\}, \quad \text{(for ReserveDown)}\]

NonSpinningReserve

For each service $s$ of the model type NonSpinningReserve, the following variables are created:

Variables:

  • ActivePowerReserveVariable:

    • Bounds: [0.0, ]
    • Default proportional cost: $1.0 / \text{SystemBasePower}$
    • Symbol: $r_{d}$ for $d$ in contributing devices to the service $s$ If slacks are enabled:
  • ReserveRequirementSlack:

    • Bounds: [0.0, ]
    • Default proportional cost: 1e5
    • Symbol: $r^\text{sl}$

NonSpinningReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:

Static Parameters

  • $\text{PF}$ = PowerSystems.get_max_participation_factor(service)
  • $\text{TF}$ = PowerSystems.get_time_frame(service)
  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min for thermal contributing devices
  • $T^\text{st,up}$ = PowerSystems.get_time_limits(d).up for thermal contributing devices
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).down for thermal contributing devices

Other parameters:

  • $\Delta T$: Resolution of the problem in minutes.

Time Series Parameters

For a VariableReserve PowerSystems type:

| Parameter | Default Time Series Name |

Relevant Methods:

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service $s$ in the system.

Objective:

Add a large proportional cost to the objective function if slack variables are used $+ r^\text{sl} \cdot 10^5$. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.

Expressions:

Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.

For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable

Example: for a thermal unit $d$ contributing to two different ReserveUp $s_1, s_2$ services (e.g. Reg-Up and Spin):

\[\text{ActivePowerRangeExpressionUB}_{t} = p_t^\text{th} + r_{s_1,t} + r_{s_2, t} \le P^\text{th,max}\]

similarly if $s_3$ is a ReserveDown service (e.g. Reg-Down):

\[\text{ActivePowerRangeExpressionLB}_{t} = p_t^\text{th} - r_{s_3,t} \ge P^\text{th,min}\]

Constraints:

A NonSpinningReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the NonSpinningReserve requirement. Thus, for a service $s$:

\[\sum_{d\in\mathcal{D}_s} r_{d,t} + r_t^\text{sl} \ge \text{RequirementTimeSeriesParameter}_{t},\quad \forall t\in \{1,\dots, T\}\]

In addition, there is a restriction on how much each contributing device $d$ can contribute to the requirement, based on the max participation factor allowed.

\[r_{d,t} \le \text{RequirementTimeSeriesParameter}_{t} \cdot \text{PF}\quad \forall d\in \mathcal{D}_s, \forall t\in \{1,\dots, T\},\]

Finally, there is a restriction based on the reserve response time for the non-spinning reserve if the unit is off. To do so, compute $R^\text{limit}_d$ as the reserve response limit as:

\[R^\text{limit}_d = \begin{cases} 0 & \text{ if TF } \le T^\text{st,up}_d \\ P^\text{th,min}_d + (\text{TF}_s - T^\text{st,up}_d) \cdot R^\text{th,up}_d \Delta T \cdot R^\text{th,up}_d & \text{ if TF } > T^\text{st,up}_d -\end{cases}, \quad \forall d\in \mathcal{D}_s\]

Then, the constraint depends on the commitment variable $u_t^\text{th}$ as:

\[r_{d,t} \le (1 - u_{d,t}^\text{th}) \cdot R^\text{limit}_d, \quad \forall d \in \mathcal{D}_s, \forall t \in \{1,\dots, T\}\]

ConstantMaxInterfaceFlow

This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.

Variables

If slacks are used:

Static Parameters

  • $F^\text{max}$ = PowerSystems.get_active_power_flow_limits(service).max
  • $F^\text{min}$ = PowerSystems.get_active_power_flow_limits(service).min
  • $C^\text{flow}$ = PowerSystems.get_violation_penalty(service)
  • $\mathcal{M}_s$ = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction ($\text{Dir}_d = 1$ or $\text{Dir}_d = -1$) with respect to the interface.

Relevant Methods

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service $s$ in the system.

Objective:

Add the violation penalty proportional cost to the objective function if slack variables are used $+ (f^\text{sl,up} + f^\text{sl,dn}) \cdot C^\text{flow}$.

Expressions:

Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.

Constraints:

It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service $s$:

\[F^\text{min} \le f^\text{sl,up}_t - f^\text{sl,dn}_t + \sum_{d\in\mathcal{D}_s} \text{Dir}_d f_{d,t} \le F^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

VariableMaxInterfaceFlow

This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.

Variables

If slacks are used:

Static Parameters

  • $F^\text{max}$ = PowerSystems.get_active_power_flow_limits(service).max
  • $F^\text{min}$ = PowerSystems.get_active_power_flow_limits(service).min
  • $C^\text{flow}$ = PowerSystems.get_violation_penalty(service)
  • $\mathcal{M}_s$ = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction ($\text{Dir}_d = 1$ or $\text{Dir}_d = -1$) with respect to the interface.

Time Series Parameters

For a TransmissionInterface PowerSystems type:

ParameterDefault Time Series Name
PowerSimulations.MinInterfaceFlowLimitParametermin_active_power_flow_limit
PowerSimulations.MaxInterfaceFlowLimitParametermax_active_power_flow_limit

Relevant Methods

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service $s$ in the system.

Objective:

Add the violation penalty proportional cost to the objective function if slack variables are used $+ (f^\text{sl,up} + f^\text{sl,dn}) \cdot C^\text{flow}$.

Expressions:

Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.

Constraints:

It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service $s$:

\[F^\text{min} \cdot \text{MinInterfaceFlowLimitParameter}_t \le f^\text{sl,up}_t - f^\text{sl,dn}_t + \sum_{d\in\mathcal{D}_s} \text{Dir}_d f_{d,t} \le F^\text{max}\cdot \text{MaxInterfaceFlowLimitParameter}_t, \quad \forall t \in \{1,\dots,T\}\]

Changes on Expressions due to Service models

It is important to note that by adding a service to a Optimization Problem, variables for each contributing device must be created. For example, for every contributing generator $d \in \mathcal{D}$ that is participating in services $s_1,s_2,s_3$, it is required to create three set of ActivePowerReserveVariable variables:

\[r_{s_1,d,t},~ r_{s_2,d,t},~ r_{s_3,d,t},\quad \forall d \in \mathcal{D}, \forall t \in \{1,\dots, T\}\]

Changes on UpperBound (UB) and LowerBound (LB) limits

Each contributing generator $d$ has active power limits that the reserve variables affect. In simple terms, the limits are implemented using expressions ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB as:

\[\text{ActivePowerRangeExpressionUB}_t \le P^\text{max} \\ +\end{cases}, \quad \forall d\in \mathcal{D}_s\]

Then, the constraint depends on the commitment variable $u_t^\text{th}$ as:

\[r_{d,t} \le (1 - u_{d,t}^\text{th}) \cdot R^\text{limit}_d, \quad \forall d \in \mathcal{D}_s, \forall t \in \{1,\dots, T\}\]

ConstantMaxInterfaceFlow

This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.

Variables

If slacks are used:

Static Parameters

  • $F^\text{max}$ = PowerSystems.get_active_power_flow_limits(service).max
  • $F^\text{min}$ = PowerSystems.get_active_power_flow_limits(service).min
  • $C^\text{flow}$ = PowerSystems.get_violation_penalty(service)
  • $\mathcal{M}_s$ = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction ($\text{Dir}_d = 1$ or $\text{Dir}_d = -1$) with respect to the interface.

Relevant Methods

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service $s$ in the system.

Objective:

Add the violation penalty proportional cost to the objective function if slack variables are used $+ (f^\text{sl,up} + f^\text{sl,dn}) \cdot C^\text{flow}$.

Expressions:

Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.

Constraints:

It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service $s$:

\[F^\text{min} \le f^\text{sl,up}_t - f^\text{sl,dn}_t + \sum_{d\in\mathcal{D}_s} \text{Dir}_d f_{d,t} \le F^\text{max}, \quad \forall t \in \{1,\dots,T\}\]

VariableMaxInterfaceFlow

This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.

Variables

If slacks are used:

Static Parameters

  • $F^\text{max}$ = PowerSystems.get_active_power_flow_limits(service).max
  • $F^\text{min}$ = PowerSystems.get_active_power_flow_limits(service).min
  • $C^\text{flow}$ = PowerSystems.get_violation_penalty(service)
  • $\mathcal{M}_s$ = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction ($\text{Dir}_d = 1$ or $\text{Dir}_d = -1$) with respect to the interface.

Time Series Parameters

For a TransmissionInterface PowerSystems type:

ParameterDefault Time Series Name
PowerSimulations.MaxInterfaceFlowLimitParametermax_active_power_flow_limit
PowerSimulations.MinInterfaceFlowLimitParametermin_active_power_flow_limit

Relevant Methods

  • $\mathcal{D}_s$ = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service $s$ in the system.

Objective:

Add the violation penalty proportional cost to the objective function if slack variables are used $+ (f^\text{sl,up} + f^\text{sl,dn}) \cdot C^\text{flow}$.

Expressions:

Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.

Constraints:

It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service $s$:

\[F^\text{min} \cdot \text{MinInterfaceFlowLimitParameter}_t \le f^\text{sl,up}_t - f^\text{sl,dn}_t + \sum_{d\in\mathcal{D}_s} \text{Dir}_d f_{d,t} \le F^\text{max}\cdot \text{MaxInterfaceFlowLimitParameter}_t, \quad \forall t \in \{1,\dots,T\}\]

Changes on Expressions due to Service models

It is important to note that by adding a service to a Optimization Problem, variables for each contributing device must be created. For example, for every contributing generator $d \in \mathcal{D}$ that is participating in services $s_1,s_2,s_3$, it is required to create three set of ActivePowerReserveVariable variables:

\[r_{s_1,d,t},~ r_{s_2,d,t},~ r_{s_3,d,t},\quad \forall d \in \mathcal{D}, \forall t \in \{1,\dots, T\}\]

Changes on UpperBound (UB) and LowerBound (LB) limits

Each contributing generator $d$ has active power limits that the reserve variables affect. In simple terms, the limits are implemented using expressions ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB as:

\[\text{ActivePowerRangeExpressionUB}_t \le P^\text{max} \\ \text{ActivePowerRangeExpressionLB}_t \ge P^\text{min}\]

ReserveUp type variables contribute to the upper bound expression, while ReserveDown variables contribute to the lower bound expressions. So if $s_1,s_2$ are ReserveUp services, and $s_3$ is a ReserveDown service, then for a thermal generator $d$ using a ThermalStandardDispatch:

\[\begin{align*} & p_{d,t}^\text{th} + r_{s_1,d,t} + r_{s_2,d,t} \le P^\text{th,max},\quad \forall d\in \mathcal{D}^\text{th}, \forall t \in \{1,\dots,T\} \\ & p_{d,t}^\text{th} - r_{s_3,d,t} \ge P^\text{th,min},\quad \forall d\in \mathcal{D}^\text{th}, \forall t \in \{1,\dots,T\} @@ -15,4 +15,4 @@ \end{align*}\]

Changes in Ramp limits

For the case of Ramp Limits (of formulation that model these limits), the reserve variables only affect the current time, and not the previous time. Then, for the same example as before:

\[\begin{align*} & p_{d,t}^\text{th} + r_{s_1,d,t} + r_{s_2,d,t} - p_{d,t-1}^\text{th}\le R^\text{th,up},\quad \forall d\in \mathcal{D}^\text{th}, \forall t \in \{1,\dots,T\}\\ & p_{d,t}^\text{th} - r_{s_3,d,t} - p_{d,t-1}^\text{th} \ge -R^\text{th,dn},\quad \forall d\in \mathcal{D}^\text{th}, \forall t \in \{1,\dots,T\} -\end{align*}\]

+\end{align*}\]

diff --git a/dev/formulation_library/ThermalGen/index.html b/dev/formulation_library/ThermalGen/index.html index 93c01b99c..105b9b8b1 100644 --- a/dev/formulation_library/ThermalGen/index.html +++ b/dev/formulation_library/ThermalGen/index.html @@ -1,33 +1,33 @@ -Thermal Generation · PowerSimulations.jl

ThermalGen Formulations

Thermal generation formulations define the optimization models that describe thermal units mathematical model in different operational settings, such as economic dispatch and unit commitment.

Note

Thermal units can include multiple terms added to the objective function, such as no-load cost, turn-on/off cost, fixed cost and variable cost. In addition, variable costs can be linear, quadratic or piecewise-linear formulations. These methods are properly described in the cost function page.

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Note

Reserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.

Table of Contents

  1. ThermalBasicDispatch
  2. ThermalDispatchNoMin
  3. ThermalCompactDispatch
  4. ThermalStandardDispatch
  5. ThermalBasicUnitCommitment
  6. ThermalBasicCompactUnitCommitment
  7. ThermalStandardUnitCommitment
  8. ThermalMultiStartUnitCommitment
  9. Valid configurations

ThermalBasicDispatch

Variables:

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.

\[\begin{align*} +Thermal Generation · PowerSimulations.jl

ThermalGen Formulations

Thermal generation formulations define the optimization models that describe thermal units mathematical model in different operational settings, such as economic dispatch and unit commitment.

Note

Thermal units can include multiple terms added to the objective function, such as no-load cost, turn-on/off cost, fixed cost and variable cost. In addition, variable costs can be linear, quadratic or piecewise-linear formulations. These methods are properly described in the cost function page.

Note

The use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.

Note

Reserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.

Table of Contents

  1. ThermalBasicDispatch
  2. ThermalDispatchNoMin
  3. ThermalCompactDispatch
  4. ThermalStandardDispatch
  5. ThermalBasicUnitCommitment
  6. ThermalBasicCompactUnitCommitment
  7. ThermalStandardUnitCommitment
  8. ThermalMultiStartUnitCommitment
  9. Valid configurations

ThermalBasicDispatch

Variables:

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.

\[\begin{align*} & P^\text{th,min} \le p^\text{th}_t \le P^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & Q^\text{th,min} \le q^\text{th}_t \le Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} -\end{align*}\]

ThermalDispatchNoMin

Variables:

Static Parameters:

  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.

\[\begin{align} +\end{align*}\]

ThermalDispatchNoMin

Variables:

Static Parameters:

  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.

\[\begin{align} & 0 \le p^\text{th}_t \le P^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & Q^\text{th,min} \le q^\text{th}_t \le Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} -\end{align}\]

ThermalCompactDispatch

Variables:

Auxiliary Variables:

  • PowerOutput:
    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = \text{on}^\text{th}P^\text{min} + \Delta p^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down

Variable Value Parameters:

  • $\text{on}^\text{th}$: Used in feedforwards to define if the unit is on/off at each time-step from another problem. If no feedforward is used, the parameter takes a {0,1} value if the unit is available or not.

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $\text{on}^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also implements ramp constraints for the active power variable.

\[\begin{align*} +\end{align}\]

ThermalCompactDispatch

Variables:

Auxiliary Variables:

  • PowerOutput:
    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = \text{on}^\text{th}P^\text{min} + \Delta p^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down

Variable Value Parameters:

  • $\text{on}^\text{th}$: Used in feedforwards to define if the unit is on/off at each time-step from another problem. If no feedforward is used, the parameter takes a {0,1} value if the unit is available or not.

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $\text{on}^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also implements ramp constraints for the active power variable.

\[\begin{align*} & 0 \le \Delta p^\text{th}_t \le \text{on}^\text{th}_t\left(P^\text{th,max} - P^\text{th,min}\right), \quad \forall t\in \{1, \dots, T\} \\ & \text{on}^\text{th}_t Q^\text{th,min} \le q^\text{th}_t \le \text{on}^\text{th}_t Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & -R^\text{th,dn} \le \Delta p_1^\text{th} - \Delta p^\text{th, init} \le R^\text{th,up} \\ & -R^\text{th,dn} \le \Delta p_t^\text{th} - \Delta p_{t-1}^\text{th} \le R^\text{th,up}, \quad \forall t\in \{2, \dots, T\} -\end{align*}\]

ThermalStandardDispatch

Variables:

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.

\[\begin{align*} +\end{align*}\]

ThermalStandardDispatch

Variables:

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.

\[\begin{align*} & P^\text{th,min} \le p^\text{th}_t \le P^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & Q^\text{th,min} \le q^\text{th}_t \le Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & -R^\text{th,dn} \le p_1^\text{th} - p^\text{th, init} \le R^\text{th,up} \\ & -R^\text{th,dn} \le p_t^\text{th} - p_{t-1}^\text{th} \le R^\text{th,up}, \quad \forall t\in \{2, \dots, T\} -\end{align*}\]

ThermalBasicUnitCommitment

Variables:

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.

\[\begin{align*} +\end{align*}\]

ThermalBasicUnitCommitment

Variables:

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.

\[\begin{align*} & u_t^\text{th} P^\text{th,min} \le p^\text{th}_t \le u_t^\text{th} P^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & u_t^\text{th} Q^\text{th,min} \le q^\text{th}_t \le u_t^\text{th} Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & u_1^\text{th} = u^\text{th,init} + v_1^\text{th} - w_1^\text{th} \\ & u_t^\text{th} = u_{t-1}^\text{th} + v_t^\text{th} - w_t^\text{th}, \quad \forall t \in \{2,\dots,T\} \\ & v_t^\text{th} + w_t^\text{th} \le 1, \quad \forall t \in \{1,\dots,T\} -\end{align*}\]

ThermalBasicCompactUnitCommitment

Variables:

Auxiliary Variables:

  • PowerOutput:
    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = u^\text{th}P^\text{min} + \Delta p^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $u^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.

\[\begin{align*} +\end{align*}\]

ThermalBasicCompactUnitCommitment

Variables:

Auxiliary Variables:

  • PowerOutput:
    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = u^\text{th}P^\text{min} + \Delta p^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $u^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.

\[\begin{align*} & 0 \le \Delta p^\text{th}_t \le u^\text{th}_t\left(P^\text{th,max} - P^\text{th,min}\right), \quad \forall t\in \{1, \dots, T\} \\ & u_t^\text{th} Q^\text{th,min} \le q^\text{th}_t \le u_t^\text{th} Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & u_1^\text{th} = u^\text{th,init} + v_1^\text{th} - w_1^\text{th} \\ & u_t^\text{th} = u_{t-1}^\text{th} + v_t^\text{th} - w_t^\text{th}, \quad \forall t \in \{2,\dots,T\} \\ & v_t^\text{th} + w_t^\text{th} \le 1, \quad \forall t \in \{1,\dots,T\} -\end{align*}\]

ThermalCompactUnitCommitment

Variables:

Auxiliary Variables:

  • PowerOutput:

    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = u^\text{th}P^\text{min} + \Delta p^\text{th}$
  • TimeDurationOn:

    • Symbol: $V_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned on variable $u_t^\text{th}$
  • TimeDurationOff:

    • Symbol: $W_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned off variable $1 - u_t^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down
  • $D^\text{min,up}$ = PowerSystems.get_time_limits(device).up
  • $D^\text{min,dn}$ = PowerSystems.get_time_limits(device).down

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $u^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.

\[\begin{align*} +\end{align*}\]

ThermalCompactUnitCommitment

Variables:

Auxiliary Variables:

  • PowerOutput:

    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = u^\text{th}P^\text{min} + \Delta p^\text{th}$
  • TimeDurationOn:

    • Symbol: $V_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned on variable $u_t^\text{th}$
  • TimeDurationOff:

    • Symbol: $W_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned off variable $1 - u_t^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down
  • $D^\text{min,up}$ = PowerSystems.get_time_limits(device).up
  • $D^\text{min,dn}$ = PowerSystems.get_time_limits(device).down

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $u^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.

\[\begin{align*} & 0 \le \Delta p^\text{th}_t \le u^\text{th}_t\left(P^\text{th,max} - P^\text{th,min}\right), \quad \forall t\in \{1, \dots, T\} \\ & u_t^\text{th} Q^\text{th,min} \le q^\text{th}_t \le u_t^\text{th} Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & -R^\text{th,dn} \le \Delta p_1^\text{th} - \Delta p^\text{th, init} \le R^\text{th,up} \\ @@ -45,7 +45,7 @@ & 1 + \sum_{i=t-D^\text{min,dn} + 1}^t w_i^\text{th} \leq 1 - u_t^\text{th} \quad \text{(for } i \text{ in the set of time steps).} \\ & \text{Otherwise:} \\ & \sum_{i=t-D^\text{min,dn} + 1}^t w_i^\text{th} \leq 1 - u_t^\text{th} -\end{align*}\]

ThermalStandardUnitCommitment

Variables:

Auxiliary Variables:

  • TimeDurationOn:

    • Symbol: $V_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned on variable $u_t^\text{th}$
  • TimeDurationOff:

    • Symbol: $W_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned off variable $1 - u_t^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down
  • $D^\text{min,up}$ = PowerSystems.get_time_limits(device).up
  • $D^\text{min,dn}$ = PowerSystems.get_time_limits(device).down

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.

\[\begin{align*} +\end{align*}\]

ThermalStandardUnitCommitment

Variables:

Auxiliary Variables:

  • TimeDurationOn:

    • Symbol: $V_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned on variable $u_t^\text{th}$
  • TimeDurationOff:

    • Symbol: $W_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned off variable $1 - u_t^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down
  • $D^\text{min,up}$ = PowerSystems.get_time_limits(device).up
  • $D^\text{min,dn}$ = PowerSystems.get_time_limits(device).down

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.

\[\begin{align*} & u^\text{th}_t P^\text{th,min} \le p^\text{th}_t \le u^\text{th}_t P^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & u_t^\text{th} Q^\text{th,min} \le q^\text{th}_t \le u_t^\text{th} Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & -R^\text{th,dn} \le p_1^\text{th} - p^\text{th, init} \le R^\text{th,up} \\ @@ -63,7 +63,7 @@ & 1 + \sum_{i=t-D^\text{min,dn} + 1}^t w_i^\text{th} \leq 1 - u_t^\text{th} \quad \text{(for } i \text{ in the set of time steps).} \\ & \text{Otherwise:} \\ & \sum_{i=t-D^\text{min,dn} + 1}^t w_i^\text{th} \leq 1 - u_t^\text{th} -\end{align*}\]

ThermalMultiStartUnitCommitment

Variables:

Auxiliary Variables:

  • PowerOutput:

    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = u^\text{th}P^\text{min} + \Delta p^\text{th}$
  • TimeDurationOn:

    • Symbol: $V_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned on variable $u_t^\text{th}$
  • TimeDurationOff:

    • Symbol: $W_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned off variable $1 - u_t^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down
  • $D^\text{min,up}$ = PowerSystems.get_time_limits(device).up
  • $D^\text{min,dn}$ = PowerSystems.get_time_limits(device).down
  • $D^\text{cold}$ = PowerSystems.get_start_time_limits(device).cold
  • $D^\text{warm}$ = PowerSystems.get_start_time_limits(device).warm
  • $D^\text{hot}$ = PowerSystems.get_start_time_limits(device).hot
  • $P^\text{th,startup}$ = PowerSystems.get_power_trajectory(device).startup
  • $P^\text{th, shdown}$ = PowerSystems.get_power_trajectory(device).shutdown

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $u^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.

\[\begin{align*} +\end{align*}\]

ThermalMultiStartUnitCommitment

Variables:

Auxiliary Variables:

  • PowerOutput:

    • Symbol: $P^\text{th}$
    • Definition: $P^\text{th} = u^\text{th}P^\text{min} + \Delta p^\text{th}$
  • TimeDurationOn:

    • Symbol: $V_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned on variable $u_t^\text{th}$
  • TimeDurationOff:

    • Symbol: $W_t^\text{th}$
    • Definition: Computed post optimization by adding consecutive turned off variable $1 - u_t^\text{th}$

Static Parameters:

  • $P^\text{th,min}$ = PowerSystems.get_active_power_limits(device).min
  • $P^\text{th,max}$ = PowerSystems.get_active_power_limits(device).max
  • $Q^\text{th,min}$ = PowerSystems.get_reactive_power_limits(device).min
  • $Q^\text{th,max}$ = PowerSystems.get_reactive_power_limits(device).max
  • $R^\text{th,up}$ = PowerSystems.get_ramp_limits(device).up
  • $R^\text{th,dn}$ = PowerSystems.get_ramp_limits(device).down
  • $D^\text{min,up}$ = PowerSystems.get_time_limits(device).up
  • $D^\text{min,dn}$ = PowerSystems.get_time_limits(device).down
  • $D^\text{cold}$ = PowerSystems.get_start_time_limits(device).cold
  • $D^\text{warm}$ = PowerSystems.get_start_time_limits(device).warm
  • $D^\text{hot}$ = PowerSystems.get_start_time_limits(device).hot
  • $P^\text{th,startup}$ = PowerSystems.get_power_trajectory(device).startup
  • $P^\text{th, shdown}$ = PowerSystems.get_power_trajectory(device).shutdown

Objective:

Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.

Expressions:

Adds $u^\text{th}P^\text{th,min} + \Delta p^\text{th}$ to the ActivePowerBalance expression and $q^\text{th}$ to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.

Constraints:

For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.

\[\begin{align*} & 0 \le \Delta p^\text{th}_t \le u^\text{th}_t\left(P^\text{th,max} - P^\text{th,min}\right), \quad \forall t\in \{1, \dots, T\} \\ & u_t^\text{th} Q^\text{th,min} \le q^\text{th}_t \le u_t^\text{th} Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\ & -R^\text{th,dn} \le \Delta p_1^\text{th} - \Delta p^\text{th, init} \le R^\text{th,up} \\ @@ -90,4 +90,4 @@ & D^\text{hot} z_t^\text{th} \le \sum_{i=1}^t (1 - u_i^\text{th}) + D^\text{init,hot}, \quad \forall t \in \{1, \dots, T\} \\ & (D^\text{cold} - 1) y_t^\text{th} + (1 - y_t^\text{th}) M^\text{big} \ge \sum_{i=1}^t (1 - u_i^\text{th}) + D^\text{init,warm}, \quad \forall t \in \{1, \dots, T\} \\ & D^\text{warm} y_t^\text{th} \le \sum_{i=1}^t (1 - u_i^\text{th}) + D^\text{init,warm}, \quad \forall t \in \{1, \dots, T\} \\ -\end{align*}\]

Valid configurations

Valid DeviceModels for subtypes of ThermalGen include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(ThermalMultiStart, FixedOutput)ThermalMultiStartFixedOutput
DeviceModel(ThermalStandard, FixedOutput)ThermalStandardFixedOutput
DeviceModel(ThermalMultiStart, ThermalBasicDispatch)ThermalMultiStartThermalBasicDispatch
DeviceModel(ThermalStandard, ThermalBasicDispatch)ThermalStandardThermalBasicDispatch
DeviceModel(ThermalMultiStart, ThermalCompactDispatch)ThermalMultiStartThermalCompactDispatch
DeviceModel(ThermalStandard, ThermalCompactDispatch)ThermalStandardThermalCompactDispatch
DeviceModel(ThermalMultiStart, ThermalDispatchNoMin)ThermalMultiStartThermalDispatchNoMin
DeviceModel(ThermalStandard, ThermalDispatchNoMin)ThermalStandardThermalDispatchNoMin
DeviceModel(ThermalMultiStart, ThermalStandardDispatch)ThermalMultiStartThermalStandardDispatch
DeviceModel(ThermalStandard, ThermalStandardDispatch)ThermalStandardThermalStandardDispatch
DeviceModel(ThermalMultiStart, ThermalBasicCompactUnitCommitment)ThermalMultiStartThermalBasicCompactUnitCommitment
DeviceModel(ThermalStandard, ThermalBasicCompactUnitCommitment)ThermalStandardThermalBasicCompactUnitCommitment
DeviceModel(ThermalMultiStart, ThermalCompactUnitCommitment)ThermalMultiStartThermalCompactUnitCommitment
DeviceModel(ThermalStandard, ThermalCompactUnitCommitment)ThermalStandardThermalCompactUnitCommitment
DeviceModel(ThermalMultiStart, ThermalMultiStartUnitCommitment)ThermalMultiStartThermalMultiStartUnitCommitment
DeviceModel(ThermalMultiStart, ThermalBasicUnitCommitment)ThermalMultiStartThermalBasicUnitCommitment
DeviceModel(ThermalStandard, ThermalBasicUnitCommitment)ThermalStandardThermalBasicUnitCommitment
DeviceModel(ThermalMultiStart, ThermalStandardUnitCommitment)ThermalMultiStartThermalStandardUnitCommitment
DeviceModel(ThermalStandard, ThermalStandardUnitCommitment)ThermalStandardThermalStandardUnitCommitment
+\end{align*}\]

Valid configurations

Valid DeviceModels for subtypes of ThermalGen include the following:

Valid DeviceModelDevice TypeFormulation
DeviceModel(ThermalMultiStart, FixedOutput)ThermalMultiStartFixedOutput
DeviceModel(ThermalStandard, FixedOutput)ThermalStandardFixedOutput
DeviceModel(ThermalMultiStart, ThermalBasicDispatch)ThermalMultiStartThermalBasicDispatch
DeviceModel(ThermalStandard, ThermalBasicDispatch)ThermalStandardThermalBasicDispatch
DeviceModel(ThermalMultiStart, ThermalCompactDispatch)ThermalMultiStartThermalCompactDispatch
DeviceModel(ThermalStandard, ThermalCompactDispatch)ThermalStandardThermalCompactDispatch
DeviceModel(ThermalMultiStart, ThermalDispatchNoMin)ThermalMultiStartThermalDispatchNoMin
DeviceModel(ThermalStandard, ThermalDispatchNoMin)ThermalStandardThermalDispatchNoMin
DeviceModel(ThermalMultiStart, ThermalStandardDispatch)ThermalMultiStartThermalStandardDispatch
DeviceModel(ThermalStandard, ThermalStandardDispatch)ThermalStandardThermalStandardDispatch
DeviceModel(ThermalMultiStart, ThermalBasicCompactUnitCommitment)ThermalMultiStartThermalBasicCompactUnitCommitment
DeviceModel(ThermalStandard, ThermalBasicCompactUnitCommitment)ThermalStandardThermalBasicCompactUnitCommitment
DeviceModel(ThermalMultiStart, ThermalCompactUnitCommitment)ThermalMultiStartThermalCompactUnitCommitment
DeviceModel(ThermalStandard, ThermalCompactUnitCommitment)ThermalStandardThermalCompactUnitCommitment
DeviceModel(ThermalMultiStart, ThermalMultiStartUnitCommitment)ThermalMultiStartThermalMultiStartUnitCommitment
DeviceModel(ThermalMultiStart, ThermalBasicUnitCommitment)ThermalMultiStartThermalBasicUnitCommitment
DeviceModel(ThermalStandard, ThermalBasicUnitCommitment)ThermalStandardThermalBasicUnitCommitment
DeviceModel(ThermalMultiStart, ThermalStandardUnitCommitment)ThermalMultiStartThermalStandardUnitCommitment
DeviceModel(ThermalStandard, ThermalStandardUnitCommitment)ThermalStandardThermalStandardUnitCommitment
diff --git a/dev/index.html b/dev/index.html index 4e78189b9..ee44d94b9 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Welcome Page · PowerSimulations.jl

PowerSimulations.jl

Overview

PowerSimulations.jl is a power system operations simulation tool developed as a flexible and open source software for quasi-static power systems simulations including Production Cost Models. PowerSimulations.jl tackles the issues of developing a simulation model in a modular way providing tools for the formulation of decision models and emulation models that can be solved independently or in an interconnected fashion.

PowerSimulations.jl supports the workflows to develop simulations by separating the development of operations models and simulation models.

  • Operation Models: Optimization model used to find the solution of an operation problem.
  • Simulations Models: Defined the requirements to find solutions to a sequence of operation problems in a way that resembles the procedures followed by operators.

The most common Simulation Model is the solution of a Unit Commitment and Economic Dispatch sequence of problems. This model is used in commercial Production Cost Modeling tools, but it has a limited scope of analysis.

How the documentation is structured

PowerSimulations.jl documentation and code are organized according to the needs of different users depending on their skillset and requirements. In broad terms there are three categories:

  • Modeler: Users that want to solve an operations problem or run a simulation using the existing models in PowerSimulations.jl. For instance, answer questions about the change in operation costs in future fuel mixes. Check the formulations library page to choose a modeling strategy that fits your needs.

  • Model Developer: Users that want to develop custom models and workflows for the simulation of a power system operation. For instance, study the impacts of an stochastic optimization problem over a deterministic.

  • Code Base Developers: Users that want to add new core functionalities or fix bugs in the core capabilities of PowerSimulations.jl.

PowerSimulations.jl is an active project under development, and we welcome your feedback, suggestions, and bug reports.

Note: PowerSimulations.jl uses the data model implemented in PowerSystems.jl to construct optimization models. In most cases, you need to add PowerSystems.jl to your scripts.

Installation

The latest stable release of PowerSimulations can be installed using the Julia package manager with

] add PowerSimulations

For the current development version, "checkout" this package with

] add PowerSimulations#main

An appropriate optimization solver is required for running PowerSimulations models. Refer to JuMP.jl solver's page to select the most appropriate for the application of interest.

PowerSystems has been developed as part of the Scalable Integrated Infrastructure Planning (SIIP) initiative at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL).

+Welcome Page · PowerSimulations.jl

PowerSimulations.jl

Overview

PowerSimulations.jl is a power system operations simulation tool developed as a flexible and open source software for quasi-static power systems simulations including Production Cost Models. PowerSimulations.jl tackles the issues of developing a simulation model in a modular way providing tools for the formulation of decision models and emulation models that can be solved independently or in an interconnected fashion.

PowerSimulations.jl supports the workflows to develop simulations by separating the development of operations models and simulation models.

  • Operation Models: Optimization model used to find the solution of an operation problem.
  • Simulations Models: Defined the requirements to find solutions to a sequence of operation problems in a way that resembles the procedures followed by operators.

The most common Simulation Model is the solution of a Unit Commitment and Economic Dispatch sequence of problems. This model is used in commercial Production Cost Modeling tools, but it has a limited scope of analysis.

How the documentation is structured

PowerSimulations.jl documentation and code are organized according to the needs of different users depending on their skillset and requirements. In broad terms there are three categories:

  • Modeler: Users that want to solve an operations problem or run a simulation using the existing models in PowerSimulations.jl. For instance, answer questions about the change in operation costs in future fuel mixes. Check the formulations library page to choose a modeling strategy that fits your needs.

  • Model Developer: Users that want to develop custom models and workflows for the simulation of a power system operation. For instance, study the impacts of an stochastic optimization problem over a deterministic.

  • Code Base Developers: Users that want to add new core functionalities or fix bugs in the core capabilities of PowerSimulations.jl.

PowerSimulations.jl is an active project under development, and we welcome your feedback, suggestions, and bug reports.

Note: PowerSimulations.jl uses the data model implemented in PowerSystems.jl to construct optimization models. In most cases, you need to add PowerSystems.jl to your scripts.

Installation

The latest stable release of PowerSimulations can be installed using the Julia package manager with

] add PowerSimulations

For the current development version, "checkout" this package with

] add PowerSimulations#main

An appropriate optimization solver is required for running PowerSimulations models. Refer to JuMP.jl solver's page to select the most appropriate for the application of interest.

PowerSystems has been developed as part of the Scalable Integrated Infrastructure Planning (SIIP) initiative at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL).

diff --git a/dev/model_developer_guide/structure_of_operation_problem/index.html b/dev/model_developer_guide/structure_of_operation_problem/index.html index 31616aec9..0975e3a86 100644 --- a/dev/model_developer_guide/structure_of_operation_problem/index.html +++ b/dev/model_developer_guide/structure_of_operation_problem/index.html @@ -23,4 +23,4 @@ end return -end +end diff --git a/dev/model_developer_guide/troubleshooting/index.html b/dev/model_developer_guide/troubleshooting/index.html index 99c0c119a..d69722f43 100644 --- a/dev/model_developer_guide/troubleshooting/index.html +++ b/dev/model_developer_guide/troubleshooting/index.html @@ -1,2 +1,2 @@ -Troubleshooting · PowerSimulations.jl
+Troubleshooting · PowerSimulations.jl
diff --git a/dev/modeler_guide/debugging_infeasible_models/index.html b/dev/modeler_guide/debugging_infeasible_models/index.html index 845064b8b..185295a35 100644 --- a/dev/modeler_guide/debugging_infeasible_models/index.html +++ b/dev/modeler_guide/debugging_infeasible_models/index.html @@ -124,4 +124,4 @@ │ │ ("317_Hybrid", 26) │ │ └───────────────────────────────────────┘ - Error: Serializing Infeasible Problem at /var/folders/1v/t69qyl0n5059n6c1nn7sp8zm7g8s6z/T/jl_jNSREb/compact_sim/problems/ED/infeasible_ED_2020-10-06T15:00:00.json

Note that the IIS clearly identify that the issue is happening at time step 26, and constraints are related with the CopperPlateBalanceConstraint__System, with multiple upper bound constraints, for the hybrid system, renewable units and thermal units. This highlights that there may not be enough generation in the system. Indeed, by enabling system slacks, the problem become feasible.

Finally, the infeasible model is exported in a json file that can be loaded directly in JuMP to be explored. More information about this is available here.

+ Error: Serializing Infeasible Problem at /var/folders/1v/t69qyl0n5059n6c1nn7sp8zm7g8s6z/T/jl_jNSREb/compact_sim/problems/ED/infeasible_ED_2020-10-06T15:00:00.json

Note that the IIS clearly identify that the issue is happening at time step 26, and constraints are related with the CopperPlateBalanceConstraint__System, with multiple upper bound constraints, for the hybrid system, renewable units and thermal units. This highlights that there may not be enough generation in the system. Indeed, by enabling system slacks, the problem become feasible.

Finally, the infeasible model is exported in a json file that can be loaded directly in JuMP to be explored. More information about this is available here.

diff --git a/dev/modeler_guide/definitions/index.html b/dev/modeler_guide/definitions/index.html index a3c0bb14d..23fa3d117 100644 --- a/dev/modeler_guide/definitions/index.html +++ b/dev/modeler_guide/definitions/index.html @@ -12,4 +12,4 @@ "regularization" => false, ), ), -)

Changing the attributes between true or false can enable/disable multiple aspects of the formulation.

C

D

E

F

H

I

R

S

T

+)

Changing the attributes between true or false can enable/disable multiple aspects of the formulation.

C

D

E

F

H

I

R

S

T

diff --git a/dev/modeler_guide/logging/index.html b/dev/modeler_guide/logging/index.html index 83d977803..13820f6bf 100644 --- a/dev/modeler_guide/logging/index.html +++ b/dev/modeler_guide/logging/index.html @@ -8,4 +8,4 @@ )

Configuring the simulation logger

You can configure the logging level used by the simulation logger when you call build!(simulation). Here is an example that increases logging verbosity:

import Logging
 using PowerSimulations
 simulation = Simulation(...)
-build!(simulation; console_level = Logging.Info, file_level = Logging.Debug)

The log file will be located at <your-output-path>/<simulation-name>/<run-output-dir>/logs/simulation.log.

Solver logs

You can configure logging for the solver you use. Refer to the solver documentation. PowerSimulations does not redirect or intercept prints to stdout or stderr from other libraries.

Recorder events

PowerSimulations uses the InfrastructureSystems.Recorder to store simulation events in a log file. Refer to this link for more information.

+build!(simulation; console_level = Logging.Info, file_level = Logging.Debug)

The log file will be located at <your-output-path>/<simulation-name>/<run-output-dir>/logs/simulation.log.

Solver logs

You can configure logging for the solver you use. Refer to the solver documentation. PowerSimulations does not redirect or intercept prints to stdout or stderr from other libraries.

Recorder events

PowerSimulations uses the InfrastructureSystems.Recorder to store simulation events in a log file. Refer to this link for more information.

diff --git a/dev/modeler_guide/modeling_faq/index.html b/dev/modeler_guide/modeling_faq/index.html index 5d8c23571..614d31482 100644 --- a/dev/modeler_guide/modeling_faq/index.html +++ b/dev/modeler_guide/modeling_faq/index.html @@ -1,2 +1,2 @@ -Modeling FAQ · PowerSimulations.jl

Modeling FAQ

How do I reduce the amount of print on my REPL?

The print to the REPL is controlled with the logging. Check the Logging documentation page to see how to reduce the print out

How do I print the optimizer logs to see the solution process?

When specifying the DecisionModel or EmulationModel pass the keyword print_optimizer_log = true

+Modeling FAQ · PowerSimulations.jl

Modeling FAQ

How do I reduce the amount of print on my REPL?

The print to the REPL is controlled with the logging. Check the Logging documentation page to see how to reduce the print out

How do I print the optimizer logs to see the solution process?

When specifying the DecisionModel or EmulationModel pass the keyword print_optimizer_log = true

diff --git a/dev/modeler_guide/parallel_simulations/index.html b/dev/modeler_guide/parallel_simulations/index.html index c4a2720e2..5086f8157 100644 --- a/dev/modeler_guide/parallel_simulations/index.html +++ b/dev/modeler_guide/parallel_simulations/index.html @@ -102,4 +102,4 @@ project_path=".", # This optionally specifies the Julia project environment to load. ) Created Jade configuration in config.json. Run 'jade submit-jobs [options] config.json' to execute them.

Exit Julia.

  1. View the configuration for accuracy.
$ jade config show config.json
  1. Start an interactive session on a debug node. Do not submit the jobs on a login node! The submission step will run a full build of the simulation and that may consume too many CPU and memory resources for the login node.
$ salloc -t 01:00:00 -N1 --account=<your-account> --partition=debug
  1. Follow the instructions at https://nrel.github.io/jade/tutorial.html to submit the jobs. The example below will configure Jade to run each partition on its own compute node. Depending on the compute and memory constraints of your simulation, you may be able to pack more jobs on each node.Adjust the walltime as necessary.
$ jade config hpc -c hpc_config.toml -t slurm  --walltime=04:00:00 -a <your-account>
-$ jade submit-jobs config.json --per-node-batch-size=1 -o output

If you are unsure about how much memory and CPU resources your simulation consumes, add these options:

$ jade submit-jobs config.json --per-node-batch-size=1 -o output --resource-monitor-type periodic --resource-monitor-interval 3

Jade will create HTML plots of the resource utilization in output/stats. You may be able to customize --per-node-batch-size and --num-processes to finish the simulations more quickly.

  1. Jade will run a final command to join the simulation partitions into one unified file. You can load the results as you normally would.
julia> results = SimulationResults("<output-dir>/job-outputs/<simulation-name>")

Note the log files and results for each partition are located in <output-dir>/job-outputs/<simulation-name>/simulation_partitions

+$ jade submit-jobs config.json --per-node-batch-size=1 -o output

If you are unsure about how much memory and CPU resources your simulation consumes, add these options:

$ jade submit-jobs config.json --per-node-batch-size=1 -o output --resource-monitor-type periodic --resource-monitor-interval 3

Jade will create HTML plots of the resource utilization in output/stats. You may be able to customize --per-node-batch-size and --num-processes to finish the simulations more quickly.

  1. Jade will run a final command to join the simulation partitions into one unified file. You can load the results as you normally would.
julia> results = SimulationResults("<output-dir>/job-outputs/<simulation-name>")

Note the log files and results for each partition are located in <output-dir>/job-outputs/<simulation-name>/simulation_partitions

diff --git a/dev/modeler_guide/problem_templates/index.html b/dev/modeler_guide/problem_templates/index.html index 7349f1241..b33264ad9 100644 --- a/dev/modeler_guide/problem_templates/index.html +++ b/dev/modeler_guide/problem_templates/index.html @@ -8,7 +8,7 @@ # Accepted Key Words - `network::Type{<:PM.AbstractPowerModel}` : override default network model settings - `devices::Vector{DeviceModel}` : override default `DeviceModel` settings -- `services::Vector{ServiceModel}` : override default `ServiceModel` settingssource
template_economic_dispatch()
+- `services::Vector{ServiceModel}` : override default `ServiceModel` settingssource
template_economic_dispatch()
@@ -131,7 +131,7 @@ # Accepted Key Words - `network::Type{<:PM.AbstractPowerModel}` : override default network model settings - `devices::Vector{DeviceModel}` : override default `DeviceModel` settings -- `services::Vector{ServiceModel}` : override default `ServiceModel` settingssource
template_unit_commitment()
Network Model
+- `services::Vector{ServiceModel}` : override default `ServiceModel` settingssource
template_unit_commitment()
@@ -249,4 +249,4 @@
Network Model
- + diff --git a/dev/modeler_guide/psi_structure/index.html b/dev/modeler_guide/psi_structure/index.html index f36260da5..69788f27d 100644 --- a/dev/modeler_guide/psi_structure/index.html +++ b/dev/modeler_guide/psi_structure/index.html @@ -1,2 +1,2 @@ -PowerSimulations.jl Modeling Structure · PowerSimulations.jl

PowerSimulations.jl Modeling Structure

PowerSimulations enables the simulation of a sequence of power systems optimization problems and provides user control over each aspect of the simulation configuration. Specifically:

What is the difference between a Model and a Problem?

A "Problem" is an abstract mathematical description of how to represent power system behavior, whereas a "Model" is a concrete representation of a "Problem" applied to a dataset. I.e. once a Problem is populated with data describing all the loads, generators, lines, etc., it becomes a Model.

+PowerSimulations.jl Modeling Structure · PowerSimulations.jl

PowerSimulations.jl Modeling Structure

PowerSimulations enables the simulation of a sequence of power systems optimization problems and provides user control over each aspect of the simulation configuration. Specifically:

What is the difference between a Model and a Problem?

A "Problem" is an abstract mathematical description of how to represent power system behavior, whereas a "Model" is a concrete representation of a "Problem" applied to a dataset. I.e. once a Problem is populated with data describing all the loads, generators, lines, etc., it becomes a Model.

diff --git a/dev/modeler_guide/read_results/index.html b/dev/modeler_guide/read_results/index.html index 0eb4b514a..ed6e70b9a 100644 --- a/dev/modeler_guide/read_results/index.html +++ b/dev/modeler_guide/read_results/index.html @@ -126,4 +126,4 @@ 190 │ 2020-10-09T21:00:00 -7.65965e-12 293.333 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 0.0 191 │ 2020-10-09T22:00:00 0.0 0.0 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 7.156 192 │ 2020-10-09T23:00:00 0.0 0.0 60.6667 0.0 117.81 0.0 0.0 0.0 76.0 0.0 - 44 columns and 180 rows omitted

In this case, the 8 simulation steps of 24 hours (192 hours), in a single DataFrame, to enable easy exploration of the realized results for the user.

+ 44 columns and 180 rows omitted

In this case, the 8 simulation steps of 24 hours (192 hours), in a single DataFrame, to enable easy exploration of the realized results for the user.

diff --git a/dev/modeler_guide/running_a_simulation/index.html b/dev/modeler_guide/running_a_simulation/index.html index c270f74e5..2d14b3a82 100644 --- a/dev/modeler_guide/running_a_simulation/index.html +++ b/dev/modeler_guide/running_a_simulation/index.html @@ -72,4 +72,4 @@ build!(sim) # Execute the simulation using the Optimizer specified in each DecisionModel -execute!(sim; enable_progress_bar = true)

Check the PCM tutorial for a more detailed tutorial on executing a simulation in a production cost modeling (PCM) environment.

+execute!(sim; enable_progress_bar = true)

Check the PCM tutorial for a more detailed tutorial on executing a simulation in a production cost modeling (PCM) environment.

diff --git a/dev/modeler_guide/simulation_recorder/index.html b/dev/modeler_guide/simulation_recorder/index.html index bf4e9d5c3..ade7654aa 100644 --- a/dev/modeler_guide/simulation_recorder/index.html +++ b/dev/modeler_guide/simulation_recorder/index.html @@ -40,4 +40,4 @@ │ ProblemExecutionEvent │ 2024-01-01T20:00:00 │ 1 │ 2 │ start │ │ ProblemExecutionEvent │ 2024-01-01T21:00:00 │ 1 │ 2 │ start │ │ ProblemExecutionEvent │ 2024-01-01T22:00:00 │ 1 │ 2 │ start │ -└──────────────────────┴─────────────────────┴──────┴───────┴────────┘ +└──────────────────────┴─────────────────────┴──────┴───────┴────────┘ diff --git a/dev/modeler_guide/tips_and_tricks/index.html b/dev/modeler_guide/tips_and_tricks/index.html index 1e4ea2aab..b4786b200 100644 --- a/dev/modeler_guide/tips_and_tricks/index.html +++ b/dev/modeler_guide/tips_and_tricks/index.html @@ -1,2 +1,2 @@ -Tips and tricks · PowerSimulations.jl
+Tips and tricks · PowerSimulations.jl
diff --git a/dev/objects.inv b/dev/objects.inv index 3b7655b6de4d0e7c5f2640c5a4f6b8b1a604c12d..7c60bf1a6ad2db4e73365c862fb52d38813e5424 100644 GIT binary patch delta 12 TcmbPHF{5IF52MLO-_zCrBbEg= delta 12 TcmbPHF{5IF52Nu$-_zCrBasC) diff --git a/dev/quick_start_guide/index.html b/dev/quick_start_guide/index.html index 75f1e58c1..4491b9649 100644 --- a/dev/quick_start_guide/index.html +++ b/dev/quick_start_guide/index.html @@ -1,2 +1,2 @@ -Quick Start Guide · PowerSimulations.jl

Quick Start Guide

Tip

If you need to develop a dataset for a simulation check the PowerSystems.jl Tutorials on how to parse data and attach time series

  • Tutorial: If you are eager to run your first simulation visit the Solve a Day Ahead Market Scheduling Problem using PowerSimulations.jl tutorial
+Quick Start Guide · PowerSimulations.jl

Quick Start Guide

Tip

If you need to develop a dataset for a simulation check the PowerSystems.jl Tutorials on how to parse data and attach time series

  • Tutorial: If you are eager to run your first simulation visit the Solve a Day Ahead Market Scheduling Problem using PowerSimulations.jl tutorial
diff --git a/dev/search_index.js b/dev/search_index.js index be2dc66e1..3c9c10c31 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"formulation_library/Network/#network_formulations","page":"Network","title":"Network Formulations","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Network formulations are used to describe how the network and buses are handled when constructing constraints. The most common constraint decided by the network formulation is the supply-demand balance constraint.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"NetworkModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.NetworkModel","page":"Network","title":"PowerSimulations.NetworkModel","text":"Establishes the model for the network specified by type.\n\nArguments\n\n-::Type{T}: PowerModels AbstractPowerModel\n\nAccepted Key Words\n\nuse_slacks::Bool: Adds slacks to the network modeling\nPTDF::PTDF: PTDF Array calculated using PowerNetworkMatrices\nduals::Vector{DataType}: Constraint types to calculate the duals\nreduce_radial_branches::Bool: Skips modeling radial branches in the system to reduce problem size\n\nExample\n\nptdfarray = PTDF(system) nw = NetworkModel(PTDFPowerModel, ptdf = ptdfarray),\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Available Network Models are:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Formulation Description\nCopperPlatePowerModel Copper plate connection between all components, i.e. infinite transmission capacity\nAreaBalancePowerModel Network model approximation to represent inter-area flow with each area represented as a single node\nPTDFPowerModel Uses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches\nAreaPTDFPowerModel Uses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches and balances power by Area instead of system-wide","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"PowerModels.jl available formulations:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Exact non-convex models: ACPPowerModel, ACRPowerModel, ACTPowerModel.\nLinear approximations: DCPPowerModel, NFAPowerModel.\nQuadratic approximations: DCPLLPowerModel, LPACCPowerModel\nQuadratic relaxations: SOCWRPowerModel, SOCWRConicPowerModel, SOCBFPowerModel, SOCBFConicPowerModel, QCRMPowerModel, QCLSPowerModel.\nSDP relaxations: SDPWRMPowerModel, SparseSDPWRMPowerModel.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"All of these formulations are described in the PowerModels.jl documentation and will not be described here.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"","category":"page"},{"location":"formulation_library/Network/#CopperPlatePowerModel","page":"Network","title":"CopperPlatePowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"CopperPlatePowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.CopperPlatePowerModel","page":"Network","title":"PowerSimulations.CopperPlatePowerModel","text":"Infinite capacity approximation of network flow to represent entire system with a single node.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"If Slack variables are enabled:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"SystemBalanceSlackUp:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textslup\nSystemBalanceSlackDown:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textsldn","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Add a large proportional cost to the objective function if slack variables are used + (p^textslup + p^textsldn) cdot 10^6","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds p^textslup and p^textsldn terms to the respective active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents p_t^c = 0 quad forall t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"","category":"page"},{"location":"formulation_library/Network/#AreaBalancePowerModel","page":"Network","title":"AreaBalancePowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"AreaBalancePowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.AreaBalancePowerModel","page":"Network","title":"PowerSimulations.AreaBalancePowerModel","text":"Approximation to represent inter-area flow with each area represented as a single node.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables: If Slack variables are enabled:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"SystemBalanceSlackUp by area:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textslup\nSystemBalanceSlackDown by area:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textsldn","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds p^textslup and p^textsldn terms to the respective active power balance expressions ActivePowerBalance per area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Creates ActivePowerBalance expressions for each area that then are used to balance active power for all buses within a single area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the CopperPlateBalanceConstraint to balance the active power of all components available in an area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents_a p_t^c = 0 quad forall ain 1dots A t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"","category":"page"},{"location":"formulation_library/Network/#PTDFPowerModel","page":"Network","title":"PTDFPowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"PTDFPowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.PTDFPowerModel","page":"Network","title":"PowerSimulations.PTDFPowerModel","text":"Linear active power approximation using the power transfer distribution factor PTDF matrix.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"If Slack variables are enabled:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"SystemBalanceSlackUp:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textslup\nSystemBalanceSlackDown:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textsldn","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Add a large proportional cost to the objective function if slack variables are used + (p^textslup + p^textsldn) cdot 10^6","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds p^textslup and p^textsldn terms to the respective system-wide active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation. In addition, it creates ActivePowerBalance expressions for each bus to be used in the calculation of branch flows.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents p_t^c = 0 quad forall t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"In addition creates NodalBalanceActiveConstraint for HVDC buses balance, if DC components are connected to an HVDC network.","category":"page"},{"location":"formulation_library/Network/#AreaPTDFPowerModel","page":"Network","title":"AreaPTDFPowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"AreaPTDFPowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.AreaPTDFPowerModel","page":"Network","title":"PowerSimulations.AreaPTDFPowerModel","text":"Linear active power approximation using the power transfer distribution factor PTDF matrix. Balancing areas independently.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Slack variables are not supported.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective Function","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"No changes to the objective function.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Creates the area-wide and nodal-wide active power balance expressions ActivePowerBalance to balance power based on each area independently. The flows across areas are computed based on the PTDF factors of lines connecting areas.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the ActivePowerBalance constraint to balance the active power of all components available for each area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents_a p_t^c = 0 quad forall ain 1dots A t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"This includes the flows of lines based on the PTDF factors.","category":"page"},{"location":"modeler_guide/simulation_recorder/#Simulation-Recorder","page":"Simulation Recorder","title":"Simulation Recorder","text":"","category":"section"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"PowerSimulations.jl provides the ability to record structured data as events during a simulation. These events can be post-processed to help debug problems.","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"By default only SimulationStepEvent and ProblemExecutionEvent are recorded. Here is an example.","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"Suppose a simulation is run in the directory ./output.","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"Assume that setup commands have been run:","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"using PowerSimulations\nconst PSI = PowerSimulations","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"Note that for all functions below you can optionally specify a function to filter events. The function must accept the event type and return true or false.","category":"page"},{"location":"modeler_guide/simulation_recorder/#Show-all-events-of-type-PSI.SimulationStepEvent","page":"Simulation Recorder","title":"Show all events of type PSI.SimulationStepEvent","text":"","category":"section"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"julia> show_simulation_events(PSI.SimulationStepEvent, \"./output/aggregation/1\")\n┌─────────────────────┬─────────────────────┬──────┬────────┐\n│ name │ simulation_time │ step │ status │\n├─────────────────────┼─────────────────────┼──────┼────────┤\n│ SimulationStepEvent │ 2024-01-01T00:00:00 │ 1 │ start │\n│ SimulationStepEvent │ 2024-01-01T23:00:00 │ 1 │ done │\n│ SimulationStepEvent │ 2024-01-01T23:00:00 │ 2 │ start │\n│ SimulationStepEvent │ 2024-01-02T23:00:00 │ 2 │ done │\n└─────────────────────┴─────────────────────┴──────┴────────┘","category":"page"},{"location":"modeler_guide/simulation_recorder/#Show-events-of-type-PSI.ProblemExecutionEvent-for-a-specific-step-and-stage.","page":"Simulation Recorder","title":"Show events of type PSI.ProblemExecutionEvent for a specific step and stage.","text":"","category":"section"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"show_simulation_events(\n PSI.ProblemExecutionEvent,\n \"./output/aggregation/1\",\n x -> x.step == 1 && x.stage == 2 && x.status == \"start\"\n)\n┌──────────────────────┬─────────────────────┬──────┬───────┬────────┐\n│ name │ simulation_time │ step │ stage │ status │\n├──────────────────────┼─────────────────────┼──────┼───────┼────────┤\n│ ProblemExecutionEvent │ 2024-01-01T00:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T00:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T01:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T02:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T03:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T04:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T05:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T06:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T07:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T08:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T09:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T10:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T11:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T12:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T13:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T14:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T15:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T16:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T17:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T18:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T19:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T20:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T21:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T22:00:00 │ 1 │ 2 │ start │\n└──────────────────────┴─────────────────────┴──────┴───────┴────────┘","category":"page"},{"location":"modeler_guide/parallel_simulations/#Parallel-Simulations","page":"Parallel Simulations","title":"Parallel Simulations","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This section contains instructions to:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Run a Simulation in Parallel on a local computer\nRun a Simulation in Parallel on an HPC","category":"page"},{"location":"modeler_guide/parallel_simulations/#Run-a-Simulation-in-Parallel-on-a-local-computer","page":"Parallel Simulations","title":"Run a Simulation in Parallel on a local computer","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This page describes how to split a simulation into partitions, run each partition in parallel, and then join the results.","category":"page"},{"location":"modeler_guide/parallel_simulations/#Setup","page":"Parallel Simulations","title":"Setup","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a Julia script to build and run simulations. It must meet the requirements below. A full example is in the PowerSimulations repository in test/run_partitioned_simulation.jl.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Call using PowerSimulations.\nImplement a build function that matches the signature below. It must construct a Simulation, call build!, and then return the Simulation instance. It must throw an exception if the build fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function build_simulation(\n output_dir::AbstractString,\n simulation_name::AbstractString,\n partitions::SimulationPartitions,\n index::Union{Nothing, Integer}=nothing,\n)","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Here is example code to construct the Simulation with these parameters:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":" sim = Simulation(\n name=simulation_name,\n steps=partitions.num_steps,\n models=models,\n sequence=sequence,\n simulation_folder=output_dir,\n )\n status = build!(sim; partitions=partitions, index=index, serialize=isnothing(index))\n if status != PSI.SimulationBuildStatus.BUILT\n error(\"Failed to build simulation: status=$status\")\n end","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Implement an execute function that matches the signature below. It must throw an exception if the execute fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function execute_simulation(sim, args...; kwargs...)\n status = execute!(sim)\n if status != PSI.RunStatus.SUCCESSFULLY_FINALIZED\n error(\"Simulation failed to execute: status=$status\")\n end\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/#Execution","page":"Parallel Simulations","title":"Execution","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"After loading your script, call the function run_parallel_simulation as shown below.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This example splits a year-long simulation into weekly partitions for a total of 53 individual jobs and then runs them four at a time.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> include(\"my_simulation.jl\")\njulia> run_parallel_simulation(\n build_simulation,\n execute_simulation,\n script=\"my_simulation.jl\",\n output_dir=\"my_simulation_output\",\n name=\"my_simulation\",\n num_steps=365,\n period=7,\n num_overlap_steps=1,\n num_parallel_processes=4,\n exeflags=\"--project=\",\n )","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"The final results will be in ./my_simulation_otuput/my_simulation","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Note the log files and results for each partition are located in ./my_simulation_otuput/my_simulation/simulation_partitions","category":"page"},{"location":"modeler_guide/parallel_simulations/#Run-a-Simulation-in-Parallel-on-an-HPC","page":"Parallel Simulations","title":"Run a Simulation in Parallel on an HPC","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This page describes how to split a simulation into partitions, run each partition in parallel on HPC compute nodes, and then join the results.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"These steps can be used on a local computer or any HPC supported by the submission software. Some steps may be specific to NREL's HPC Eagle cluster.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Note: Some instructions are preliminary and will change if functionality is moved to a new Julia package.","category":"page"},{"location":"modeler_guide/parallel_simulations/#Setup-2","page":"Parallel Simulations","title":"Setup","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a conda environment and install the Python package NREL-jade: https://nrel.github.io/jade/installation.html. The rest of this page assumes that the environment is called jade.\nActivate the environment with conda activate jade.\nLocate the path to that conda environment. It will likely be ~/.conda-envs/jade or ~/.conda/envs/jade.\nLoad the Julia environment that you use to run simulations. Add the packages Conda and PyCall.\nSetup Conda to use the existing jade environment by running these commands:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> run(`conda create -n conda_jl python conda`)\njulia> ENV[\"CONDA_JL_HOME\"] = joinpath(ENV[\"HOME\"], \".conda-envs\", \"jade\") # change this to your path\npkg> build Conda","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Copy the code below into a Julia file called configure_parallel_simulation.jl. This is an interface to Jade through PyCall. It will be used to create a Jade configuration. (It may eventually be moved to a separate package.)","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function configure_parallel_simulation(\n script::AbstractString,\n num_steps::Integer,\n num_period_steps::Integer;\n num_overlap_steps::Integer=0,\n project_path=nothing,\n simulation_name=\"simulation\",\n config_file=\"config.json\",\n force=false,\n)\n partitions = SimulationPartitions(num_steps, num_period_steps, num_overlap_steps)\n jgc = pyimport(\"jade.extensions.generic_command\")\n julia_cmd = isnothing(project_path) ? \"julia\" : \"julia --project=$project_path\"\n setup_command = \"$julia_cmd $script setup --simulation-name=$simulation_name \" *\n \"--num-steps=$num_steps --num-period-steps=$num_period_steps \" *\n \"--num-overlap-steps=$num_overlap_steps\"\n teardown_command = \"$julia_cmd $script join --simulation-name=$simulation_name\"\n config = jgc.GenericCommandConfiguration(\n setup_command=setup_command,\n teardown_command=teardown_command,\n )\n\n for i in 1:get_num_partitions(partitions)\n cmd = \"$julia_cmd $script execute --simulation-name=$simulation_name --index=$i\"\n job = jgc.GenericCommandParameters(command=cmd, name=\"execute-$i\")\n config.add_job(job)\n end\n\n config.dump(config_file, indent=2)\n println(\"Created Jade configuration in $config_file. \" *\n \"Run 'jade submit-jobs [options] $config_file' to execute them.\")\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a Julia script to build and run simulations. It must meet the requirements below. A full example is in the PowerSimulations repository in test/run_partitioned_simulation.jl.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Call using PowerSimulations.\nImplement a build function that matches the signature below. It must construct a Simulation, call build!, and then return the Simulation instance. It must throw an exception if the build fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function build_simulation(\n output_dir::AbstractString,\n simulation_name::AbstractString,\n partitions::SimulationPartitions,\n index::Union{Nothing, Integer}=nothing,\n)","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Here is example code to construct the Simulation with these parameters:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":" sim = Simulation(\n name=simulation_name,\n steps=partitions.num_steps,\n models=models,\n sequence=sequence,\n simulation_folder=output_dir,\n )\n status = build!(sim; partitions=partitions, index=index, serialize=isnothing(index))\n if status != PSI.SimulationBuildStatus.BUILT\n error(\"Failed to build simulation: status=$status\")\n end","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Implement an execute function that matches the signature below. It must throw an exception if the execute fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function execute_simulation(sim, args...; kwargs...)\n status = execute!(sim)\n if status != PSI.RunStatus.SUCCESSFULLY_FINALIZED\n error(\"Simulation failed to execute: status=$status\")\n end\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Make the script runnable as a CLI command by including the following code at the bottom of the file.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function main()\n process_simulation_partition_cli_args(build_simulation, execute_simulation, ARGS...)\nend\n\nif abspath(PROGRAM_FILE) == @__FILE__\n main()\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/#Execution-2","page":"Parallel Simulations","title":"Execution","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a Jade configuration that defines the partitioned simulation jobs. Load your Julia environment.\nThis example splits a year-long simulation into weekly partitions for a total of 53 individual jobs.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> include(\"configure_parallel_simulation.jl\")\njulia> num_steps = 365\njulia> period = 7\njulia> num_overlap_steps = 1\njulia> configure_parallel_simulation(\n \"my_simulation.jl\", # this is your build/execute script\n num_steps,\n period,\n num_overlap_steps=1,\n project_path=\".\", # This optionally specifies the Julia project environment to load.\n)\nCreated Jade configuration in config.json. Run 'jade submit-jobs [options] config.json' to execute them.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Exit Julia.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"View the configuration for accuracy.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ jade config show config.json","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Start an interactive session on a debug node. Do not submit the jobs on a login node! The submission step will run a full build of the simulation and that may consume too many CPU and memory resources for the login node.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ salloc -t 01:00:00 -N1 --account= --partition=debug","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Follow the instructions at https://nrel.github.io/jade/tutorial.html to submit the jobs. The example below will configure Jade to run each partition on its own compute node. Depending on the compute and memory constraints of your simulation, you may be able to pack more jobs on each node.\nAdjust the walltime as necessary.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ jade config hpc -c hpc_config.toml -t slurm --walltime=04:00:00 -a \n$ jade submit-jobs config.json --per-node-batch-size=1 -o output","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"If you are unsure about how much memory and CPU resources your simulation consumes, add these options:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ jade submit-jobs config.json --per-node-batch-size=1 -o output --resource-monitor-type periodic --resource-monitor-interval 3","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Jade will create HTML plots of the resource utilization in output/stats. You may be able to customize --per-node-batch-size and --num-processes to finish the simulations more quickly.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Jade will run a final command to join the simulation partitions into one unified file. You can load the results as you normally would.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> results = SimulationResults(\"/job-outputs/\")","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Note the log files and results for each partition are located in /job-outputs//simulation_partitions","category":"page"},{"location":"quick_start_guide/#Quick-Start-Guide","page":"Quick Start Guide","title":"Quick Start Guide","text":"","category":"section"},{"location":"quick_start_guide/","page":"Quick Start Guide","title":"Quick Start Guide","text":"Julia: If this is your first time using Julia visit our Introduction to Julia and the official Getting started with Julia.\nPackage Installation: If you want to install packages check the Package Manager instructions, or you can refer to the PowerSimulations installation instructions.\nPowerSystems: PowerSystems.jl manages the data and is a fundamental dependency of PowerSimulations.jl. Check the PowerSystems.jl Basics Tutorial and PowerSystems.jl documentation to understand how the inputs to the models are organized.\nDataset Library: If you don't have a data set to start using PowerSimulations.jl check the test systems provided in PowerSystemCaseBuilder.jl","category":"page"},{"location":"quick_start_guide/","page":"Quick Start Guide","title":"Quick Start Guide","text":"tip: Tip\nIf you need to develop a dataset for a simulation check the PowerSystems.jl Tutorials on how to parse data and attach time series","category":"page"},{"location":"quick_start_guide/","page":"Quick Start Guide","title":"Quick Start Guide","text":"Tutorial: If you are eager to run your first simulation visit the Solve a Day Ahead Market Scheduling Problem using PowerSimulations.jl tutorial","category":"page"},{"location":"code_base_developer_guide/troubleshooting/#Troubleshooting-code-development","page":"Troubleshooting","title":"Troubleshooting code development","text":"","category":"section"},{"location":"formulation_library/Piecewise/#pwl_cost","page":"Piecewise Linear Cost","title":"Piecewise linear cost functions","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"The choice for piecewise-linear (PWL) cost representation in PowerSimulations.jl is equivalent to the so-called λ-model from the paper The Impacts of Convex Piecewise Linear Cost Formulations on AC Optimal Power Flow. The SOS constraints in each model are only implemented if the data for PWL is not convex.","category":"page"},{"location":"formulation_library/Piecewise/#Special-Ordered-Set-(SOS)-Constraints","page":"Piecewise Linear Cost","title":"Special Ordered Set (SOS) Constraints","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"A special ordered set (SOS) is an ordered set of variables used as an additional way to specify integrality conditions in an optimization model.","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"Special Ordered Sets of type 1 (SOS1) are a set of variables, at most one of which can take a non-zero value, all others being at 0. They most frequently applications is in a a set of variables that are actually binary variables: in other words, we have to choose at most one from a set of possibilities.\nSpecial Ordered Sets of type 2 (SOS2) are an ordered set of non-negative variables, of which at most two can be non-zero, and if two are non-zero these must be consecutive in their ordering. Special Ordered Sets of type 2 are typically used to model non-linear functions of a variable in a linear model, such as non-convex quadratic functions using PWL functions.","category":"page"},{"location":"formulation_library/Piecewise/#Standard-representation-of-PWL-costs","page":"Piecewise Linear Cost","title":"Standard representation of PWL costs","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"Piecewise-linear costs are defined by a sequence of points representing the line segments for each generator: (P_k^textmax C_k) on which we assume C_k is the cost of generating P_k^textmax power, and k in 1dots K are the number of segments each generator cost function has.","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"note: Note\nPowerSystems has more options to specify cost functions for each thermal unit. Independent of which form of the cost data is provided, PowerSimulations.jl will internally transform the data to use the λ-model formulation. See TODO: ADD PSY COST DOCS for more information.","category":"page"},{"location":"formulation_library/Piecewise/#Commitment-formulation","page":"Piecewise Linear Cost","title":"Commitment formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"With this the standard representation of PWL costs for a thermal unit commitment is given by:","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = u_t forall t in mathcalT\n P^textmin u_t leq p_t leq P^textmax u_t forall t in mathcalT\n left delta_1t dots delta_Kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, p is the active power of the generator and u in 01 is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"formulation_library/Piecewise/#Dispatch-formulation","page":"Piecewise Linear Cost","title":"Dispatch formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = texton_t forall t in mathcalT\n P^textmin texton_t leq p_t leq P^textmax texton_t forall t in mathcalT\n left delta_it dots delta_kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, p is the active power of the generator and texton in 01 is the parameter that decides if the generator is available or not. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"formulation_library/Piecewise/#Compact-representation-of-PWL-costs","page":"Piecewise Linear Cost","title":"Compact representation of PWL costs","text":"","category":"section"},{"location":"formulation_library/Piecewise/#Commitment-Formulation","page":"Piecewise Linear Cost","title":"Commitment Formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = P^textmin u_t + Delta p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = u_t forall t in mathcalT\n 0 leq Delta p_t leq left( P^textmax - P^textmin right)u_t forall t in mathcalT\n left delta_it dots delta_kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, Delta p is the active power of the generator above the minimum power and u in 01 is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"formulation_library/Piecewise/#Dispatch-formulation-2","page":"Piecewise Linear Cost","title":"Dispatch formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = P^textmin texton_t + Delta p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = texton_t forall t in mathcalT\n 0 leq Delta p_t leq left( P^textmax - P^textmin right)texton_t forall t in mathcalT\n left delta_it dots delta_kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, Delta p is the active power of the generator above the minimum power and u in 01 is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"tutorials/decision_problem/#op_problem_tutorial","page":"Single-step Problem","title":"Operations problems with PowerSimulations.jl","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Originally Contributed by: Clayton Barrows","category":"page"},{"location":"tutorials/decision_problem/#Introduction","page":"Single-step Problem","title":"Introduction","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"PowerSimulations.jl supports the construction and solution of optimal power system scheduling problems (Operations Problems). Operations problems form the fundamental building blocks for sequential simulations. This example shows how to specify and customize a the mathematics that will be applied to the data with an ProblemTemplate, build and execute an DecisionModel, and access the results.","category":"page"},{"location":"tutorials/decision_problem/#Load-Packages","page":"Single-step Problem","title":"Load Packages","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"using PowerSystems\nusing PowerSimulations\nusing HydroPowerSimulations\nusing PowerSystemCaseBuilder\nusing HiGHS # solver\nusing Dates","category":"page"},{"location":"tutorials/decision_problem/#Data","page":"Single-step Problem","title":"Data","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"note: Note\nPowerSystemCaseBuilder.jl is a helper library that makes it easier to reproduce examples in the documentation and tutorials. Normally you would pass your local files to create the system data instead of calling the function build_system. For more details visit PowerSystemCaseBuilder Documentation","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"sys = build_system(PSISystems, \"modified_RTS_GMLC_DA_sys\")","category":"page"},{"location":"tutorials/decision_problem/#Define-a-problem-specification-with-an-ProblemTemplate","page":"Single-step Problem","title":"Define a problem specification with an ProblemTemplate","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"You can create an empty template with:","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"template_uc = ProblemTemplate()","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Now, you can add a DeviceModel for each device type to create an assignment between PowerSystems device types and the subtypes of AbstractDeviceFormulation. PowerSimulations has a variety of different AbstractDeviceFormulation subtypes that can be applied to different PowerSystems device types, each dispatching to different methods for populating optimization problem objectives, variables, and constraints. Documentation on the formulation options for various devices can be found in the formulation library docs","category":"page"},{"location":"tutorials/decision_problem/#Branch-Formulations","page":"Single-step Problem","title":"Branch Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Here is an example of relatively standard branch formulations. Other formulations allow for selective enforcement of transmission limits and greater control on transformer settings.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_device_model!(template_uc, Line, StaticBranch)\nset_device_model!(template_uc, Transformer2W, StaticBranch)\nset_device_model!(template_uc, TapTransformer, StaticBranch)","category":"page"},{"location":"tutorials/decision_problem/#Injection-Device-Formulations","page":"Single-step Problem","title":"Injection Device Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Here we define template entries for all devices that inject or withdraw power on the network. For each device type, we can define a distinct AbstractDeviceFormulation. In this case, we're defining a basic unit commitment model for thermal generators, curtailable renewable generators, and fixed dispatch (net-load reduction) formulations for HydroDispatch and RenewableNonDispatch devices.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_device_model!(template_uc, ThermalStandard, ThermalStandardUnitCommitment)\nset_device_model!(template_uc, RenewableDispatch, RenewableFullDispatch)\nset_device_model!(template_uc, PowerLoad, StaticPowerLoad)\nset_device_model!(template_uc, HydroDispatch, HydroDispatchRunOfRiver)\nset_device_model!(template_uc, RenewableNonDispatch, FixedOutput)","category":"page"},{"location":"tutorials/decision_problem/#Service-Formulations","page":"Single-step Problem","title":"Service Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"We have two VariableReserve types, parameterized by their direction. So, similar to creating DeviceModels, we can create ServiceModels. The primary difference being that DeviceModel objects define how constraints get created, while ServiceModel objects define how constraints get modified.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_service_model!(template_uc, VariableReserve{ReserveUp}, RangeReserve)\nset_service_model!(template_uc, VariableReserve{ReserveDown}, RangeReserve)","category":"page"},{"location":"tutorials/decision_problem/#Network-Formulations","page":"Single-step Problem","title":"Network Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Finally, we can define the transmission network specification that we'd like to model. For simplicity, we'll choose a copper plate formulation. But there are dozens of specifications available through an integration with PowerModels.jl. Note that many formulations will require appropriate data and may be computationally intractable","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_network_model!(template_uc, NetworkModel(CopperPlatePowerModel))","category":"page"},{"location":"tutorials/decision_problem/#DecisionModel","page":"Single-step Problem","title":"DecisionModel","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Now that we have a System and an ProblemTemplate, we can put the two together to create an DecisionModel that we solve.","category":"page"},{"location":"tutorials/decision_problem/#Optimizer","page":"Single-step Problem","title":"Optimizer","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"It's most convenient to define an optimizer instance upfront and pass it into the DecisionModel constructor. For this example, we can use the free HiGHS solver with a relatively relaxed MIP gap (ratioGap) setting to improve speed.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"solver = optimizer_with_attributes(HiGHS.Optimizer, \"mip_rel_gap\" => 0.5)","category":"page"},{"location":"tutorials/decision_problem/#Build-an-DecisionModel","page":"Single-step Problem","title":"Build an DecisionModel","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"The construction of an DecisionModel essentially applies an ProblemTemplate to System data to create a JuMP model.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"problem = DecisionModel(template_uc, sys; optimizer = solver, horizon = Hour(24))\nbuild!(problem; output_dir = mktempdir())","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"tip: Tip\nThe principal component of the DecisionModel is the JuMP model. But you can serialize to a file using the following command:serialize_optimization_model(problem, save_path)Keep in mind that if the setting \"storevariablenames\" is set to False then the file won't show the model's names.","category":"page"},{"location":"tutorials/decision_problem/#Solve-an-DecisionModel","page":"Single-step Problem","title":"Solve an DecisionModel","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"solve!(problem)","category":"page"},{"location":"tutorials/decision_problem/#Results-Inspection","page":"Single-step Problem","title":"Results Inspection","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"PowerSimulations collects the DecisionModel results into a OptimizationProblemResults struct:","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"res = OptimizationProblemResults(problem)","category":"page"},{"location":"tutorials/decision_problem/#Optimizer-Stats","page":"Single-step Problem","title":"Optimizer Stats","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"The optimizer summary is included","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"get_optimizer_stats(res)","category":"page"},{"location":"tutorials/decision_problem/#Objective-Function-Value","page":"Single-step Problem","title":"Objective Function Value","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"get_objective_value(res)","category":"page"},{"location":"tutorials/decision_problem/#Variable,-Parameter,-Auxillary-Variable,-Dual,-and-Expression-Values","page":"Single-step Problem","title":"Variable, Parameter, Auxillary Variable, Dual, and Expression Values","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"The solution value data frames for variables, parameters, auxillary variables, duals and expressions can be accessed using the read_ methods:","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"read_variables(res)","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Or, you can read a single parameter values for parameters that exist in the results.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"list_parameter_names(res)\nread_parameter(res, \"ActivePowerTimeSeriesParameter__RenewableDispatch\")","category":"page"},{"location":"tutorials/decision_problem/#Plotting","page":"Single-step Problem","title":"Plotting","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Take a look at the plotting capabilities in PowerGraphics.jl","category":"page"},{"location":"modeler_guide/tips_and_tricks/#Tips-and-tricks","page":"Tips and tricks","title":"Tips and tricks","text":"","category":"section"},{"location":"formulation_library/ThermalGen/#ThermalGen-Formulations","page":"Thermal Generation","title":"ThermalGen Formulations","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Thermal generation formulations define the optimization models that describe thermal units mathematical model in different operational settings, such as economic dispatch and unit commitment.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"note: Note\nThermal units can include multiple terms added to the objective function, such as no-load cost, turn-on/off cost, fixed cost and variable cost. In addition, variable costs can be linear, quadratic or piecewise-linear formulations. These methods are properly described in the cost function page.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"note: Note\nReserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.","category":"page"},{"location":"formulation_library/ThermalGen/#Table-of-Contents","page":"Thermal Generation","title":"Table of Contents","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicDispatch\nThermalDispatchNoMin\nThermalCompactDispatch\nThermalStandardDispatch\nThermalBasicUnitCommitment\nThermalBasicCompactUnitCommitment\nThermalStandardUnitCommitment\nThermalMultiStartUnitCommitment\nValid configurations","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalBasicDispatch","page":"Thermal Generation","title":"ThermalBasicDispatch","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicDispatch","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalBasicDispatch","page":"Thermal Generation","title":"PowerSimulations.ThermalBasicDispatch","text":"Formulation type to enable basic dispatch without any intertemporal (ramp) constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n P^textthmin le p^textth_t le P^textthmax quad forall tin 1 dots T \n Q^textthmin le q^textth_t le Q^textthmax quad forall tin 1 dots T \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalDispatchNoMin","page":"Thermal Generation","title":"ThermalDispatchNoMin","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalDispatchNoMin","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalDispatchNoMin","page":"Thermal Generation","title":"PowerSimulations.ThermalDispatchNoMin","text":"Formulation type to enable basic dispatch without any intertemporal constraints and relaxed minimum generation. May not work with non-convex PWL cost definitions\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign\n 0 le p^textth_t le P^textthmax quad forall tin 1 dots T \n Q^textthmin le q^textth_t le Q^textthmax quad forall tin 1 dots T \nendalign","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalCompactDispatch","page":"Thermal Generation","title":"ThermalCompactDispatch","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalCompactDispatch","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalCompactDispatch","page":"Thermal Generation","title":"PowerSimulations.ThermalCompactDispatch","text":"Formulation type to enable thermal compact dispatch\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = texton^textthP^textmin + Delta p^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variable Value Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"texton^textth: Used in feedforwards to define if the unit is on/off at each time-step from another problem. If no feedforward is used, the parameter takes a {0,1} value if the unit is available or not.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds texton^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also implements ramp constraints for the active power variable.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le texton^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n texton^textth_t Q^textthmin le q^textth_t le texton^textth_t Q^textthmax quad forall tin 1 dots T \n -R^textthdn le Delta p_1^textth - Delta p^textth init le R^textthup \n -R^textthdn le Delta p_t^textth - Delta p_t-1^textth le R^textthup quad forall tin 2 dots T\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalStandardDispatch","page":"Thermal Generation","title":"ThermalStandardDispatch","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalStandardDispatch","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalStandardDispatch","page":"Thermal Generation","title":"PowerSimulations.ThermalStandardDispatch","text":"Formulation type to enable standard dispatch with a range and enforce intertemporal ramp constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n P^textthmin le p^textth_t le P^textthmax quad forall tin 1 dots T \n Q^textthmin le q^textth_t le Q^textthmax quad forall tin 1 dots T \n -R^textthdn le p_1^textth - p^textth init le R^textthup \n -R^textthdn le p_t^textth - p_t-1^textth le R^textthup quad forall tin 2 dots T\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalBasicUnitCommitment","page":"Thermal Generation","title":"ThermalBasicUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalBasicUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalBasicUnitCommitment","text":"Formulation type to enable basic unit commitment representation without any intertemporal (ramp, min on/off time) constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n u_t^textth P^textthmin le p^textth_t le u_t^textth P^textthmax quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalBasicCompactUnitCommitment","page":"Thermal Generation","title":"ThermalBasicCompactUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicCompactUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalBasicCompactUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalBasicCompactUnitCommitment","text":"Formulation type to enable thermal compact commitment without intertemporal (ramp, min on/off time) constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = u^textthP^textmin + Delta p^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds u^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le u^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalCompactUnitCommitment","page":"Thermal Generation","title":"ThermalCompactUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalCompactUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalCompactUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalCompactUnitCommitment","text":"Formulation type to enable thermal compact commitment\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = u^textthP^textmin + Delta p^textth\nTimeDurationOn:\nSymbol: V_t^textth\nDefinition: Computed post optimization by adding consecutive turned on variable u_t^textth\nTimeDurationOff:\nSymbol: W_t^textth\nDefinition: Computed post optimization by adding consecutive turned off variable 1 - u_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down\nD^textminup = PowerSystems.get_time_limits(device).up\nD^textmindn = PowerSystems.get_time_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds u^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le u^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n -R^textthdn le Delta p_1^textth - Delta p^textth init le R^textthup \n -R^textthdn le Delta p_t^textth - Delta p_t-1^textth le R^textthup quad forall tin 2 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"In addition, this formulation adds duration constraints, i.e. minimum-up time and minimum-down time constraints. The duration constraints are added over the start times looking backwards.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"The duration times D^textminup and D^textmindn are processed to be used in multiple of the time-steps, given the resolution of the specific problem. In addition, parameters D^textinitup and D^textinitdn are used to identify how long the unit was on or off, respectively, before the simulation started.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum up-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textminup - D^textinitup text and D^textinitup 0 \n 1 + sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum down-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textmindn - D^textinitdn text and D^textinitup 0 \n 1 + sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalStandardUnitCommitment","page":"Thermal Generation","title":"ThermalStandardUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalStandardUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalStandardUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalStandardUnitCommitment","text":"Formulation type to enable standard unit commitment with intertemporal constraints and simplified startup profiles\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"TimeDurationOn:\nSymbol: V_t^textth\nDefinition: Computed post optimization by adding consecutive turned on variable u_t^textth\nTimeDurationOff:\nSymbol: W_t^textth\nDefinition: Computed post optimization by adding consecutive turned off variable 1 - u_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down\nD^textminup = PowerSystems.get_time_limits(device).up\nD^textmindn = PowerSystems.get_time_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n u^textth_t P^textthmin le p^textth_t le u^textth_t P^textthmax quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n -R^textthdn le p_1^textth - p^textth init le R^textthup \n -R^textthdn le p_t^textth - p_t-1^textth le R^textthup quad forall tin 2 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"In addition, this formulation adds duration constraints, i.e. minimum-up time and minimum-down time constraints. The duration constraints are added over the start times looking backwards.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"The duration times D^textminup and D^textmindn are processed to be used in multiple of the time-steps, given the resolution of the specific problem. In addition, parameters D^textinitup and D^textinitdn are used to identify how long the unit was on or off, respectively, before the simulation started.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum up-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textminup - D^textinitup text and D^textinitup 0 \n 1 + sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum down-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textmindn - D^textinitdn text and D^textinitup 0 \n 1 + sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalMultiStartUnitCommitment","page":"Thermal Generation","title":"ThermalMultiStartUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalMultiStartUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalMultiStartUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalMultiStartUnitCommitment","text":"Formulation type to enable pg-lib commitment formulation with startup/shutdown profiles\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth\nColdStartVariable:\nBounds: 01\nSymbol: x_t^textth\nWarmStartVariable:\nBounds: 01\nSymbol: y_t^textth\nHotStartVariable:\nBounds: 01\nSymbol: z_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = u^textthP^textmin + Delta p^textth\nTimeDurationOn:\nSymbol: V_t^textth\nDefinition: Computed post optimization by adding consecutive turned on variable u_t^textth\nTimeDurationOff:\nSymbol: W_t^textth\nDefinition: Computed post optimization by adding consecutive turned off variable 1 - u_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down\nD^textminup = PowerSystems.get_time_limits(device).up\nD^textmindn = PowerSystems.get_time_limits(device).down\nD^textcold = PowerSystems.get_start_time_limits(device).cold\nD^textwarm = PowerSystems.get_start_time_limits(device).warm\nD^texthot = PowerSystems.get_start_time_limits(device).hot\nP^textthstartup = PowerSystems.get_power_trajectory(device).startup\nP^textth shdown = PowerSystems.get_power_trajectory(device).shutdown","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds u^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le u^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n -R^textthdn le Delta p_1^textth - Delta p^textth init le R^textthup \n -R^textthdn le Delta p_t^textth - Delta p_t-1^textth le R^textthup quad forall tin 2 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT \n maxP^textthmax - P^textthshdown 0 cdot w_1^textth le u^textthinit (P^textthmax - P^textthmin) - P^textthinit\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"In addition, this formulation adds duration constraints, i.e. minimum-up time and minimum-down time constraints. The duration constraints are added over the start times looking backwards.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"The duration times D^textminup and D^textmindn are processed to be used in multiple of the time-steps, given the resolution of the specific problem. In addition, parameters D^textinitup and D^textinitdn are used to identify how long the unit was on or off, respectively, before the simulation started.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum up-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textminup - D^textinitup text and D^textinitup 0 \n 1 + sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum down-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textmindn - D^textinitdn text and D^textinitup 0 \n 1 + sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Finally, multi temperature start/stop constraints are implemented using the following constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n v_t^textth = x_t^textth + y_t^textth + z_t^textth quad forall t in 1 dots T \n z_t^textth le sum_i in D^texthot D^textwarm)w_t-i^textth quad forall t in D^textwarm dots T \n y_t^textth le sum_i in D^textwarm D^textcold)w_t-i^textth quad forall t in D^textcold dots T \n (D^textwarm - 1) z_t^textth + (1 - z_t^textth) M^textbig ge sum_i=1^t (1 - u_i^textth) + D^textinithot quad forall t in 1 dots T \n D^texthot z_t^textth le sum_i=1^t (1 - u_i^textth) + D^textinithot quad forall t in 1 dots T \n (D^textcold - 1) y_t^textth + (1 - y_t^textth) M^textbig ge sum_i=1^t (1 - u_i^textth) + D^textinitwarm quad forall t in 1 dots T \n D^textwarm y_t^textth le sum_i=1^t (1 - u_i^textth) + D^textinitwarm quad forall t in 1 dots T \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#Valid-configurations","page":"Thermal Generation","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Valid DeviceModels for subtypes of ThermalGen include the following:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> x[\"device_type\"] <: ThermalGen, combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/DCModels/#DC-Models-formulations","page":"DC Models formulations","title":"DC Models formulations","text":"","category":"section"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"note: Note\nMulti-terminal DC models are still in early stages of development and future versions will add a more comprehensive list of formulations","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"","category":"page"},{"location":"formulation_library/DCModels/#LossLessLine","page":"DC Models formulations","title":"LossLessLine","text":"","category":"section"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"LossLessLine models are used with PSY.DCBranch models.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"LossLessLine","category":"page"},{"location":"formulation_library/DCModels/#PowerSimulations.LossLessLine","page":"DC Models formulations","title":"PowerSimulations.LossLessLine","text":"LossLess Line Abstract Model\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Variables:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"FlowActivePowerVariable:\nBounds: (R^textminR^textmax)\nSymbol: f","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Static Parameters","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"R^textfrommin = PowerSystems.get_active_power_limits_from(branch).min\nR^textfrommax = PowerSystems.get_active_power_limits_from(branch).max\nR^texttomin = PowerSystems.get_active_power_limits_to(branch).min\nR^texttomax = PowerSystems.get_active_power_limits_to(branch).max","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Then, the minimum and maximum are computed as R^\\text{min} = \\min(R^\\text{from,min}, R^\\text{to,min}) and R^\\text{max} = \\min(R^\\text{from,max}, R^\\text{to,max})","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Objective:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Expressions:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"The variable FlowActivePowerVariable f is added to the nodal balance expression ActivePowerBalance for DC Buses, by adding the flow f in the receiving DC bus and subtracting it from the sending DC bus.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Constraints:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No constraints are added to the function.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"","category":"page"},{"location":"formulation_library/DCModels/#LossLessConverter","page":"DC Models formulations","title":"LossLessConverter","text":"","category":"section"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Converters are used to interface the AC Buses with DC Buses.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"LossLessConverter","category":"page"},{"location":"formulation_library/DCModels/#PowerSimulations.LossLessConverter","page":"DC Models formulations","title":"PowerSimulations.LossLessConverter","text":"LossLess InterconnectingConverter Model\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Variables:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"ActivePowerVariable:\nBounds: (P^textminP^textmax)\nSymbol: p","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Static Parameters:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"P^textmin = PowerSystems.get_active_power_limits(device).min\nP^textmax = PowerSystems.get_active_power_limits(device).max","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Objective:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Expressions:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"The variable ActivePowerVariable p is added positive to the AC balance expression ActivePowerBalance for AC Buses, and added negative to ActivePowerBalance for DC Buses, balancing both sides.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Constraints:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No constraints are added to the function.","category":"page"},{"location":"tutorials/adding_new_problem_model/#Adding-an-Operations-Problem-Model","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"This tutorial will show how to create a custom decision problem model. These cases are the ones where the user want to solve a fully specified problem. Some examples of custom decision models include:","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Solving a custom Security Constrained Unit Commitment Problem\nSolving a market agent utility maximization Problem. See examples of this functionality in HybridSystemsSimulations.jl","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"The tutorial follows the usual steps for operational model building. First, build the decision model in isolation and second, integrate it into a simulation. In most cases there will be more than one way of achieving the same objective when it comes to implementing the model. This guide shows a general set of steps and requirements but it is by no means an exhaustive and detailed guide on developing custom decision models.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"warning: Warning\nAll the code in this tutorial is considered \"pseudo-code\". Copy-paste will likely not work out of the box. You need to develop the internals of the functions correctly for the examples below to work.","category":"page"},{"location":"tutorials/adding_new_problem_model/#General-Rules","page":"Adding an Operations Problem Model","title":"General Rules","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"As a general rule you need to understand Julia's terminology such as multiple dispatch, parametric structs and method overloading, among others. Developing custom models for an operational simulation is a highly technical task and requires skilled development. This tutorial also requires good understanding of PowerSystems.jl data structures and features which are covered in the tutorials section of PowerSystems.jl documentation. Finally, developing a custom model decision model that will employ an optimization model under the hood requires understanding JuMP.jl.\nNeed to employ anonymous constraints and variables in JuMP and register the constraints, variables and other optimization objects into PowerSimulations.jl's optimization container. Otherwise the features to use your problem in the simulation like the coordination with other problems and post processing won't work. More on this in the section How to develop your build_model! function below.\nImplement the required methods for your custom decision models. In some cases it will be possible to re-use some of the other methods that exist in PowerSimulations to make life easier for variable addition and constraint creation but this is not required.","category":"page"},{"location":"tutorials/adding_new_problem_model/#Decision-Problem","page":"Adding an Operations Problem Model","title":"Decision Problem","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/#Step-1:-Define-a-Custom-Decision-Problem","page":"Adding an Operations Problem Model","title":"Step 1: Define a Custom Decision Problem","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Define a decision problem struct as a subtype of PowerSimulations.DecisionProblem. This requirement will enable a lot of the underlying functionality that relies on multiple dispatch. DecisionProblems are used to parameterize the behavior of DecisionModel objects which are just containers for the parameters, references and the optimization problem.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"It is possible to define a Custom Decision Problem that gives the user full control over the build, solve and execution process since it imposes less requirements on the developer. However, with less requirements there are also less checks and validations performed inside of PowerSimulations which might lead to unexpected errors","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"struct MyCustomDecisionProblem <: PSI.DecisionProblem end","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Alternatively, it is possible to define a Custom Decision Problem subtyping from DefaultDecisionProblem which imposes more requirements and structure onto the developer but employs more checks and validations in the process. Be aware that this route will decrease the flexibility of what can be done inside the custom model.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"struct MyCustomDecisionProblem <: PSI.DefaultDecisionProblem end","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Once the problem type is defined, initialize the decision model container with your custom decision problem passing the solver and some of the settings you need for the solution of the problem. For custom problems some of the settings need manual implementation by the developer. Settings availability is also dependent on wether you choose to subtype from PSI.DecisionProblem or PSI.DefaultDecisionProblem","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"my_model = DecisionModel{MyCustomDecisionProblem}(\n sys;\n name = \"MyModel\",\n optimizer = optimizer_with_attributes(HiGHS.Optimizer),\n optimizer_solve_log_print = true,\n)","category":"page"},{"location":"tutorials/adding_new_problem_model/#Mandatory-Method-Implementations","page":"Adding an Operations Problem Model","title":"Mandatory Method Implementations","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"build_model!: This method build the JuMP optimization model.","category":"page"},{"location":"tutorials/adding_new_problem_model/#Optional-Method-Overloads","page":"Adding an Operations Problem Model","title":"Optional Method Overloads","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"These methods can be defined optionally for your problem. By default for problems subtyped from DecisionProblem these checks are not executed. If the problems are subtyped from DefaultDecisionProblem these checks are always conducted with PowerSimulations defaults and require compliance with those defaults to pass. In any case, these can be overloaded when necessary depending on the problem requirements.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"validate_template\nvalidate_time_series!\nreset!\nsolve_impl!","category":"page"},{"location":"tutorials/adding_new_problem_model/#How-to-develop-your-build_model!-function","page":"Adding an Operations Problem Model","title":"How to develop your build_model! function","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/#Registering-a-variable-in-the-model","page":"Adding an Operations Problem Model","title":"Registering a variable in the model","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"To register a variable in the model, the developer must first allocate the container into the optimization container and then populate it. For example, it require start the build function as follows:","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"info: Info\nWe recommend calling import PowerSimulations and defining the constant CONST PSI = PowerSimulations to make it easier to read the code and determine which package is responsible for defining the functions.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"function PSI.build_model!(model::PSI.DecisionModel{MyCustomDecisionProblem})\n container = PSI.get_optimization_container(model)\n time_steps = 1:24\n PSI.set_time_steps!(container, time_steps)\n system = PSI.get_system(model)\n\n thermal_gens = PSY.get_components(PSY.ThermalStandard, system)\n thermal_gens_names = PSY.get_name.(thermal_gens)\n\n # Create the container for the variable\n variable = PSI.add_variable_container!(\n container,\n PSI.ActivePowerVariable(), # <- This variable is defined in PowerSimulations but the user can define their own\n PSY.ThermalGeneration, # <- Device type for the variable. Can be from PSY or custom defined\n thermal_gens_names, # <- First container dimension\n time_steps, # <- Second container dimension\n )\n\n # Iterate over the devices and time to store the JuMP variables into the container.\n for t in time_steps, d in thermal_gens_names\n name = PSY.get_name(d)\n variable[name, t] = JuMP.@variable(get_jump_model(container))\n # It is possible to use PSY getter functions to retrieve data from the generators\n JuMP.set_upper_bound(variable[name, t], UB_DATA) # <- Optional\n JuMP.set_lower_bound(variable[name, t], LB_DATA) # <- Optional\n end\n\n # Add More Variables.....\n\n return\nend","category":"page"},{"location":"tutorials/adding_new_problem_model/#Registering-a-constraint-in-the-model","page":"Adding an Operations Problem Model","title":"Registering a constraint in the model","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"A similar pattern is used to add constraints to the model, in this example the field meta is used to avoid creating unnecessary duplicate constraint types. For instance to reflect upperbound and lowerbound or upwards and downwards constraints. Meta can take any string value except for the _ character.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"function PSI.build_model!(model::PSI.DecisionModel{MyCustomDecisionProblem})\n container = PSI.get_optimization_container(model)\n time_steps = 1:24\n PSI.set_time_steps!(container, time_steps)\n system = PSI.get_system(model)\n\n # VARIABLE ADDITION CODE\n\n # Constraint additions\n con_ub = PSI.add_constraints_container!(\n container,\n PSI.RangeLimitConstraint(), # <- Constraint Type defined by PSI or your own\n PSY.ThermalGeneration, # <- Device type for variable. Can be PSY or custom\n thermal_gens_names, # <- First container dimension\n time_steps; # <- Second container dimension\n meta = \"ub\", # <- meta allows to reuse a constraint definition for similar constraints. It only requires to be a string\n )\n\n con_lb = PSI.add_constraints_container!(\n container,\n PSI.RangeLimitConstraint(),\n PSY.ThermalGeneration,\n thermal_gens_names, # <- First container dimension\n time_steps; # <- Second container dimension\n meta = \"lb\", # <- meta allows to reuse a constraint definition for similar constraints. It only requires to be a string\n )\n\n # Retrieve a relevant variable from the container if not defined in\n variable = PSI.get_variable(container, PSI.ActivePowerVariable(), PSY.ThermalGeneration)\n for device in devices, t in time_steps\n ci_name = PSY.get_name(device)\n limits = get_min_max_limits(device) # depends on constraint type and formulation type\n con_ub[ci_name, t] =\n JuMP.@constraint(get_jump_model(container), variable[ci_name, t] >= limits.min)\n con_lb[ci_name, t] =\n JuMP.@constraint(get_jump_model(container), variable[ci_name, t] >= limits.min)\n end\n\n return\nend","category":"page"},{"location":"formulation_library/Branch/#PowerSystems.Branch-Formulations","page":"Branch","title":"PowerSystems.Branch Formulations","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/Branch/#Table-of-contents","page":"Branch","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranch\nStaticBranchBounds\nStaticBranchUnbounded\nHVDCTwoTerminalUnbounded\nHVDCTwoTerminalLossless\nHVDCTwoTerminalDispatch\nPhaseAngleControl\nValid configurations","category":"page"},{"location":"formulation_library/Branch/#StaticBranch","page":"Branch","title":"StaticBranch","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranch","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.StaticBranch","page":"Branch","title":"PowerSimulations.StaticBranch","text":"Branch type to add unbounded flow variables and use flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: (-inftyinfty)\nSymbol: f If Slack variables are enabled:\nFlowActivePowerSlackUpperBound:\nBounds: [0.0, ]\nDefault proportional cost: 2e5\nSymbol: f^textslup\nFlowActivePowerSlackLowerBound:\nBounds: [0.0, ]\nDefault proportional cost: 2e5\nSymbol: f^textsllo","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textmax = PowerSystems.get_rating(branch)","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Add a large proportional cost to the objective function if rate constraint slack variables are used + (f^textslup + f^textsllo) cdot 2 cdot 10^5","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No expressions are used.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\n f_t - f_t^textslup le R^textmaxquad forall t in 1dots T \n f_t + f_t^textsllo ge -R^textmaxquad forall t in 1dots T \nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#StaticBranchBounds","page":"Branch","title":"StaticBranchBounds","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranchBounds","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.StaticBranchBounds","page":"Branch","title":"PowerSimulations.StaticBranchBounds","text":"Branch type to add bounded flow variables and use flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: left-R^textmaxR^textmaxright\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textmax = PowerSystems.get_rating(branch)","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No expressions are used.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#StaticBranchUnbounded","page":"Branch","title":"StaticBranchUnbounded","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranchUnbounded","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.StaticBranchUnbounded","page":"Branch","title":"PowerSimulations.StaticBranchUnbounded","text":"Branch type to avoid flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: (-inftyinfty)\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No expressions are used.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#HVDCTwoTerminalUnbounded","page":"Branch","title":"HVDCTwoTerminalUnbounded","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"HVDCTwoTerminalUnbounded","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.HVDCTwoTerminalUnbounded","page":"Branch","title":"PowerSimulations.HVDCTwoTerminalUnbounded","text":"Branch type to avoid flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"This model assumes that it can transfer power from two AC buses without losses and no limits.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: left(-inftyinftyright)\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"The variable FlowActivePowerVariable f is added to the nodal balance expression ActivePowerBalance, by adding the flow f in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No constraints are added.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#HVDCTwoTerminalLossless","page":"Branch","title":"HVDCTwoTerminalLossless","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"HVDCTwoTerminalLossless","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.HVDCTwoTerminalLossless","page":"Branch","title":"PowerSimulations.HVDCTwoTerminalLossless","text":"Branch type to represent lossless power flow on DC lines\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"This model assumes that it can transfer power from two AC buses without losses.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: left(-inftyinftyright)\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textfrommin = PowerSystems.get_active_power_limits_from(branch).min\nR^textfrommax = PowerSystems.get_active_power_limits_from(branch).max\nR^texttomin = PowerSystems.get_active_power_limits_to(branch).min\nR^texttomax = PowerSystems.get_active_power_limits_to(branch).max","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"The variable FlowActivePowerVariable f is added to the nodal balance expression ActivePowerBalance, by adding the flow f in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textmin le f_t le R^textmaxquad forall t in 1dots T \nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"where:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textmin = begincases\n\t\t\tminleft(R^textfrommin R^texttominright) textif R^textfrommin ge 0 text and R^texttomin ge 0 \n maxleft(R^textfrommin R^texttominright) textif R^textfrommin le 0 text and R^texttomin le 0 \n R^textfrommin textif R^textfrommin le 0 text and R^texttomin ge 0 \n R^texttomin textif R^textfrommin ge 0 text and R^texttomin le 0\n\t\t endcases\nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"and","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textmax = begincases\n\t\t\tminleft(R^textfrommax R^texttomaxright) textif R^textfrommax ge 0 text and R^texttomax ge 0 \n maxleft(R^textfrommax R^texttomaxright) textif R^textfrommax le 0 text and R^texttomax le 0 \n R^textfrommax textif R^textfrommax le 0 text and R^texttomax ge 0 \n R^texttomax textif R^textfrommax ge 0 text and R^texttomax le 0\n\t\t endcases\nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#HVDCTwoTerminalDispatch","page":"Branch","title":"HVDCTwoTerminalDispatch","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"HVDCTwoTerminalDispatch","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.HVDCTwoTerminalDispatch","page":"Branch","title":"PowerSimulations.HVDCTwoTerminalDispatch","text":"Branch type to represent lossy power flow on DC lines\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerToFromVariable:\nSymbol: f^textto-from\nFlowActivePowerFromToVariable:\nSymbol: f^textfrom-to\nHVDCLosses:\nSymbol: ell\nHVDCFlowDirectionVariable\nBounds: 01\nSymbol: u^textdir","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textfrommin = PowerSystems.get_active_power_limits_from(branch).min\nR^textfrommax = PowerSystems.get_active_power_limits_from(branch).max\nR^texttomin = PowerSystems.get_active_power_limits_to(branch).min\nR^texttomax = PowerSystems.get_active_power_limits_to(branch).max\nL_0 = PowerSystems.get_loss(branch).l0\nL_1 = PowerSystems.get_loss(branch).l1","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Each FlowActivePowerToFromVariable f^textto-from and FlowActivePowerFromToVariable f^textfrom-to is added to the nodal balance expression ActivePowerBalance, by adding the respective flow in the receiving bus and subtracting it from the sending bus. That is, f^textto-from adds the flow to the from bus, and subtracts the flow from the to bus, while f^textfrom-to adds the flow to the to bus, and subtracts the flow from the from bus This is used then to compute the AC flows using the PTDF equation.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"In addition, the HVDCLosses are subtracted to the from bus in the ActivePowerBalance expression.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textfrommin le f_t^textfrom-to le R^textfrommax forall t in 1dots T \n R^texttomin le f_t^textto-from le R^texttomaxquad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to le L_1 cdot f_t^textto-from - L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge L_1 cdot f_t^textfrom-to + L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge - M^textbig (1 - u^textdir_t)quad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to ge - M^textbig u^textdir_tquad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to le ell_tquad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from le ell_tquad forall t in 1dots T \nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#PhaseAngleControl","page":"Branch","title":"PhaseAngleControl","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"PhaseAngleControl","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.PhaseAngleControl","page":"Branch","title":"PowerSimulations.PhaseAngleControl","text":"Branch formulation for PhaseShiftingTransformer flow control\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: (-inftyinfty)\nSymbol: f\nPhaseShifterAngle:\nSymbol: theta^textshift","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textmax = PowerSystems.get_rating(branch)\nTheta^textmin = PowerSystems.get_phase_angle_limits(branch).min\nTheta^textmax = PowerSystems.get_phase_angle_limits(branch).max\nX = PowerSystems.get_x(branch) (series reactance)","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No changes to objective function","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Adds to the ActivePowerBalance expression the term -theta^textshift X to the from bus and +theta^textshift X to the to bus, that the PhaseShiftingTransformer is connected.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it + fractheta^textshift_tX quad forall t in 1dots T\n -R^textmax le f_t le R^textmaxquad forall t in 1dots T \nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#Valid-configurations","page":"Branch","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Valid DeviceModels for subtypes of Branch include the following:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> (x[\"device_type\"] <: Branch) && (x[\"device_type\"] != TModelHVDCLine), combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"modeler_guide/problem_templates/#op_problem_template","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"","category":"section"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"Templates are used to specify the modeling properties of the devices and network that are going to he used to specify a problem. A ProblemTemplate is just a collection of DeviceModels that allows the user to specify the formulations of each set of devices (by device type) independently so that the modeler can adjust the level of detail according to the question of interest and the available data. For more information about valid DeviceModels and their mathematical representations, check out the Formulation Library.","category":"page"},{"location":"modeler_guide/problem_templates/#Building-a-ProblemTemplate","page":"Operations ProblemTemplates","title":"Building a ProblemTemplate","text":"","category":"section"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"You can build a ProblemTemplate by adding a NetworkModel, DeviceModels, and ServiceModels.","category":"page"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"template = ProblemTemplate()\nset_network_model!(template, NetworkModel(CopperPlatePowerModel))\nset_device_model!(template, PowerLoad, StaticPowerLoad)\nset_device_model!(template, ThermalStandard, ThermalBasicUnitCommitment)\nset_service_model!(template, VariableReserve{ReserveUp}, RangeReserve)","category":"page"},{"location":"modeler_guide/problem_templates/#Default-Templates","page":"Operations ProblemTemplates","title":"Default Templates","text":"","category":"section"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"PowerSimulations.jl provides default templates for common operation problems. You can retrieve a default template and modify it according to your requirements. Currently supported default templates are:","category":"page"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"template_economic_dispatch","category":"page"},{"location":"modeler_guide/problem_templates/#PowerSimulations.template_economic_dispatch-modeler_guide-problem_templates","page":"Operations ProblemTemplates","title":"PowerSimulations.template_economic_dispatch","text":"template_economic_dispatch(; kwargs...) -> ProblemTemplate\n\n\ntemplate_economic_dispatch(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for an Economic Dispatch problem.\n\nExample\n\ntemplate = templateeconomicdispatch()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"function"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"using PowerSimulations #hide\ntemplate_economic_dispatch()","category":"page"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"template_unit_commitment","category":"page"},{"location":"modeler_guide/problem_templates/#PowerSimulations.template_unit_commitment-modeler_guide-problem_templates","page":"Operations ProblemTemplates","title":"PowerSimulations.template_unit_commitment","text":"template_unit_commitment(; kwargs...) -> ProblemTemplate\n\n\ntemplate_unit_commitment(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for a Unit Commitment problem.\n\nExample\n\ntemplate = templateunitcommitment()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"function"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"using PowerSimulations #hide\ntemplate_unit_commitment()","category":"page"},{"location":"code_base_developer_guide/developer/#Guidelines-for-Developers","page":"Developer Guide","title":"Guidelines for Developers","text":"","category":"section"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"In order to contribute to PowerSystems.jl repository please read the following sections of InfrastructureSystems.jl documentation in detail:","category":"page"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"Style Guide\nContributing Guidelines","category":"page"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"Pull requests are always welcome to fix bugs or add additional modeling capabilities.","category":"page"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"All the code contributions need to include tests with a minimum coverage of 70%","category":"page"},{"location":"modeler_guide/modeling_faq/#Modeling-FAQ","page":"Modeling FAQ","title":"Modeling FAQ","text":"","category":"section"},{"location":"modeler_guide/modeling_faq/","page":"Modeling FAQ","title":"Modeling FAQ","text":"question: How do I reduce the amount of print on my REPL?\nThe print to the REPL is controlled with the logging. Check the Logging documentation page to see how to reduce the print out","category":"page"},{"location":"modeler_guide/modeling_faq/","page":"Modeling FAQ","title":"Modeling FAQ","text":"question: How do I print the optimizer logs to see the solution process?\nWhen specifying the DecisionModel or EmulationModel pass the keyword print_optimizer_log = true","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"CurrentModule = PowerSimulations\nDocTestSetup = quote\n using PowerSimulations\nend","category":"page"},{"location":"api/PowerSimulations/#API-Reference","page":"API Reference","title":"API Reference","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Pages = [\"PowerSimulations.md\"]\nDepth = 3","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/#Device-Models","page":"API Reference","title":"Device Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"List of structures and methods for Device models","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"DeviceModel","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.DeviceModel","page":"API Reference","title":"PowerSimulations.DeviceModel","text":"DeviceModel(\n ::Type{D},\n ::Type{B},\n feedforwards::Vector{<:AbstractAffectFeedforward}\n use_slacks::Bool,\n duals::Vector{DataType},\n services::Vector{ServiceModel}\n attributes::Dict{String, Any}\n)\n\nEstablishes the model for a particular device specified by type. Uses the keyword argument feedforward to enable passing values between operation model at simulation time\n\nArguments\n\n::Type{D} where D<:PSY.Device: Power System Device Type\n::Type{B} where B<:AbstractDeviceFormulation: Abstract Device Formulation\nfeedforward::Array{<:AbstractAffectFeedforward} = Vector{AbstractAffectFeedforward}() : use to pass parameters between models\nuse_slacks::Bool = false : Add slacks to the device model. Implementation is model dependent and not all models feature slacks\nduals::Vector{DataType} = Vector{DataType}(): use to pass constraint type to calculate the duals. The DataType needs to be a valid ConstraintType\ntime_series_names::Dict{Type{<:TimeSeriesParameter}, String} = get_default_time_series_names(D, B) : use to specify time series names associated to the device`\nattributes::Dict{String, Any} = get_default_attributes(D, B) : use to specify attributes to the device\n\nExample\n\nthermal_gens = DeviceModel(ThermalStandard, ThermalBasicUnitCommitment)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Formulations","page":"API Reference","title":"Formulations","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Refer to the Formulations Page for each Abstract Device Formulation.","category":"page"},{"location":"api/PowerSimulations/#Problem-Templates","page":"API Reference","title":"Problem Templates","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"problem_template.jl\",\n \"operation_problem_templates.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ProblemTemplate","page":"API Reference","title":"PowerSimulations.ProblemTemplate","text":"ProblemTemplate(::Type{T}) where {T<:PM.AbstractPowerFormulation}\n\nCreates a model reference of the PowerSimulations Optimization Problem.\n\nArguments\n\nmodel::Type{T<:PM.AbstractPowerFormulation}:\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.set_device_model!-Tuple{ProblemTemplate, DeviceModel}","page":"API Reference","title":"PowerSimulations.set_device_model!","text":"set_device_model!(\n template::ProblemTemplate,\n model::DeviceModel\n)\n\n\nSets the device model in a template using a DeviceModel instance\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_device_model!-Tuple{ProblemTemplate, Type{<:Device}, Type{<:PowerSimulations.AbstractDeviceFormulation}}","page":"API Reference","title":"PowerSimulations.set_device_model!","text":"set_device_model!(\n template::ProblemTemplate,\n component_type::Type{<:Device},\n formulation::Type{<:PowerSimulations.AbstractDeviceFormulation}\n)\n\n\nSets the device model in a template using the component type and formulation. Builds a default DeviceModel\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_network_model!-Tuple{ProblemTemplate, NetworkModel}","page":"API Reference","title":"PowerSimulations.set_network_model!","text":"set_network_model!(\n template::ProblemTemplate,\n model::NetworkModel\n)\n\n\nSets the network model in a template.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_service_model!-Tuple{ProblemTemplate, String, Type{<:Service}, Type{<:PowerSimulations.AbstractServiceFormulation}}","page":"API Reference","title":"PowerSimulations.set_service_model!","text":"set_service_model!(\n template::ProblemTemplate,\n service_name::String,\n service_type::Type{<:Service},\n formulation::Type{<:PowerSimulations.AbstractServiceFormulation}\n)\n\n\nSets the service model in a template using a name and the service type and formulation. Builds a default ServiceModel with useservicename set to true.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_service_model!-Tuple{ProblemTemplate, Type{<:Service}, Type{<:PowerSimulations.AbstractServiceFormulation}}","page":"API Reference","title":"PowerSimulations.set_service_model!","text":"set_service_model!(\n template::ProblemTemplate,\n service_type::Type{<:Service},\n formulation::Type{<:PowerSimulations.AbstractServiceFormulation}\n)\n\n\nSets the service model in a template using a ServiceModel instance.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.template_economic_dispatch-Tuple{}","page":"API Reference","title":"PowerSimulations.template_economic_dispatch","text":"template_economic_dispatch(; kwargs...) -> ProblemTemplate\n\n\ntemplate_economic_dispatch(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for an Economic Dispatch problem.\n\nExample\n\ntemplate = templateeconomicdispatch()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.template_unit_commitment-Tuple{}","page":"API Reference","title":"PowerSimulations.template_unit_commitment","text":"template_unit_commitment(; kwargs...) -> ProblemTemplate\n\n\ntemplate_unit_commitment(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for a Unit Commitment problem.\n\nExample\n\ntemplate = templateunitcommitment()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Decision-Models","page":"API Reference","title":"Decision Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"decision_model.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Tuple{AbstractString, MathOptInterface.OptimizerWithAttributes}","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"DecisionModel(\n directory::AbstractString,\n optimizer::MathOptInterface.OptimizerWithAttributes;\n jump_model,\n system\n) -> Any\n\n\nConstruct an DecisionProblem from a serialized file.\n\nArguments\n\ndirectory::AbstractString: Directory containing a serialized model\njump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.\noptimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\nsystem::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Union{Tuple{M}, Tuple{PowerSimulations.AbstractProblemTemplate, System, PowerSimulations.Settings}, Tuple{PowerSimulations.AbstractProblemTemplate, System, PowerSimulations.Settings, Union{Nothing, JuMP.Model}}} where M<:PowerSimulations.DecisionProblem","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"DecisionModel{M}(\n template::AbstractProblemTemplate,\n sys::PSY.System,\n jump_model::Union{Nothing, JuMP.Model}=nothing;\n kwargs...) where {M<:DecisionProblem}\n\nBuild the optimization problem of type M with the specific system and template.\n\nArguments\n\n::Type{M} where M<:DecisionProblem: The abstract operation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care\nname = nothing: name of model, string or symbol; defaults to the type of template converted to a symbol.\noptimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing : The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\nhorizon::Dates.Period = UNSET_HORIZON: Manually specify the length of the forecast Horizon\nresolution::Dates.Period = UNSET_RESOLUTION: Manually specify the model's resolution\nwarm_start::Bool = true: True will use the current operation point in the system to initialize variable values. False initializes all variables to zero. Default is true\nsystem_to_file::Bool = true:: True to create a copy of the system used in the model.\ninitialize_model::Bool = true: Option to decide to initialize the model or not.\ninitialization_file::String = \"\": This allows to pass pre-existing initialization values to avoid the solution of an optimization problem to find feasible initial conditions.\ndeserialize_initial_conditions::Bool = false: Option to deserialize conditions\nexport_pwl_vars::Bool = false: True to export all the pwl intermediate variables. It can slow down significantly the build and solve time.\nallow_fails::Bool = false: True to allow the simulation to continue even if the optimization step fails. Use with care.\noptimizer_solve_log_print::Bool = false: Uses JuMP.unset_silent() to print the optimizer's log. By default all solvers are set to MOI.Silent()\ndetailed_optimizer_stats::Bool = false: True to save detailed optimizer stats log.\ncalculate_conflict::Bool = false: True to use solver to calculate conflicts for infeasible problems. Only specific solvers are able to calculate conflicts.\ndirect_mode_optimizer::Bool = false: True to use the solver in direct mode. Creates a JuMP.direct_model.\nstore_variable_names::Bool = false: to store variable names in optimization model. Decreases the build times.\nrebuild_model::Bool = false: It will force the rebuild of the underlying JuMP model with each call to update the model. It increases solution times, use only if the model can't be updated in memory.\ninitial_time::Dates.DateTime = UNSET_INI_TIME: Initial Time for the model solve.\ntime_series_cache_size::Int = IS.TIME_SERIES_CACHE_SIZE_BYTES: Size in bytes to cache for each time array. Default is 1 MiB. Set to 0 to disable.\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nOpModel = DecisionModel(MockOperationProblem, template, system)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Union{Tuple{M}, Tuple{Type{M}, PowerSimulations.AbstractProblemTemplate, System}, Tuple{Type{M}, PowerSimulations.AbstractProblemTemplate, System, Union{Nothing, JuMP.Model}}} where M<:PowerSimulations.DecisionProblem","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"DecisionModel(\n ::Type{M<:PowerSimulations.DecisionProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System;\n ...\n) -> DecisionModel\nDecisionModel(\n ::Type{M<:PowerSimulations.DecisionProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System,\n jump_model::Union{Nothing, JuMP.Model};\n kwargs...\n) -> DecisionModel\n\n\nBuild the optimization problem of type M with the specific system and template\n\nArguments\n\n::Type{M} where M<:DecisionProblem: The abstract operation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model} = nothing: Enables passing a custom JuMP model. Use with care.\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nproblem = DecisionModel(MyOpProblemType, template, system, optimizer)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Union{Tuple{System}, Tuple{M}, Tuple{System, Union{Nothing, JuMP.Model}}} where M<:PowerSimulations.DecisionProblem","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"Builds an empty decision model. This constructor is used for the implementation of custom decision models that do not require a template.\n\nArguments\n\n::Type{M} where M<:DecisionProblem: The abstract operation model type\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model} = nothing: Enables passing a custom JuMP model. Use with care.\n\nExample\n\nproblem = DecisionModel(system, optimizer)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.GenericOpProblem","page":"API Reference","title":"PowerSimulations.GenericOpProblem","text":"Generic PowerSimulations Operation Problem Type for unspecified models\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.build!-Tuple{DecisionModel}","page":"API Reference","title":"PowerSimulations.build!","text":"build!(\n model::DecisionModel;\n output_dir,\n recorders,\n console_level,\n file_level,\n disable_timer_outputs\n)\n\n\nBuild the Decision Model based on the specified DecisionProblem.\n\nArguments\n\nmodel::DecisionModel{<:DecisionProblem}: DecisionModel object\noutput_dir::String: Output directory for results\nrecorders::Vector{Symbol} = []: recorder names to register\nconsole_level = Logging.Error:\nfile_level = Logging.Info:\ndisable_timer_outputs = false : Enable/Disable timing outputs\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.solve!-Tuple{DecisionModel}","page":"API Reference","title":"PowerSimulations.solve!","text":"solve!(\n model::DecisionModel;\n export_problem_results,\n console_level,\n file_level,\n disable_timer_outputs,\n export_optimization_problem,\n kwargs...\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault solve method for models that conform to the requirements of DecisionModel{<: DecisionProblem}.\n\nThis will call build! on the model if it is not already built. It will forward all keyword arguments to that function.\n\nArguments\n\nmodel::OperationModel = model: operation model\nexport_problem_results::Bool = false: If true, export OptimizationProblemResults DataFrames to CSV files. Reduces solution times during simulation.\nconsole_level = Logging.Error:\nfile_level = Logging.Info:\ndisable_timer_outputs = false : Enable/Disable timing outputs\nexport_optimization_problem::Bool = true: If true, serialize the model to a file to allow re-execution later.\n\nExamples\n\nresults = solve!(OpModel)\nresults = solve!(OpModel, export_problem_results = true)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.solve!-Tuple{Int64, DecisionModel, Dates.DateTime, PowerSimulations.SimulationStore}","page":"API Reference","title":"PowerSimulations.solve!","text":"solve!(\n step::Int64,\n model::DecisionModel,\n start_time::Dates.DateTime,\n store::PowerSimulations.SimulationStore;\n exports\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault solve method for a DecisionModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}\n\nArguments\n\nstep::Int: Simulation Step\nmodel::OperationModel: operation model\nstart_time::Dates.DateTime: Initial Time of the simulation step in Simulation time.\nstore::SimulationStore: Simulation output store\n\nAccepted Key Words\n\nexports: realtime export of output. Use wisely, it can have negative impacts in the simulation times\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Emulation-Models","page":"API Reference","title":"Emulation Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"EmulationModel\nEmulationModel(::Type{M} where {M <: EmulationProblem}, ::ProblemTemplate, ::PSY.System, ::Union{Nothing, JuMP.Model})\nEmulationModel(::AbstractString, ::MOI.OptimizerWithAttributes)\nbuild!(::EmulationModel)\nrun!(::EmulationModel)\nsolve!(::Int, ::EmulationModel{<:EmulationProblem}, ::Dates.DateTime, ::SimulationStore)","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.EmulationModel","page":"API Reference","title":"PowerSimulations.EmulationModel","text":"EmulationModel{M}(\n template::AbstractProblemTemplate,\n sys::PSY.System,\n jump_model::Union{Nothing, JuMP.Model}=nothing;\n kwargs...) where {M<:EmulationProblem}\n\nBuild the optimization problem of type M with the specific system and template.\n\nArguments\n\n::Type{M} where M<:EmulationProblem: The abstract Emulation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care\nname = nothing: name of model, string or symbol; defaults to the type of template converted to a symbol.\noptimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing : The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\nwarm_start::Bool = true: True will use the current operation point in the system to initialize variable values. False initializes all variables to zero. Default is true\nsystem_to_file::Bool = true:: True to create a copy of the system used in the model.\ninitialize_model::Bool = true: Option to decide to initialize the model or not.\ninitialization_file::String = \"\": This allows to pass pre-existing initialization values to avoid the solution of an optimization problem to find feasible initial conditions.\ndeserialize_initial_conditions::Bool = false: Option to deserialize conditions\nexport_pwl_vars::Bool = false: True to export all the pwl intermediate variables. It can slow down significantly the build and solve time.\nallow_fails::Bool = false: True to allow the simulation to continue even if the optimization step fails. Use with care.\ncalculate_conflict::Bool = false: True to use solver to calculate conflicts for infeasible problems. Only specific solvers are able to calculate conflicts.\noptimizer_solve_log_print::Bool = false: Uses JuMP.unset_silent() to print the optimizer's log. By default all solvers are set to MOI.Silent()\ndetailed_optimizer_stats::Bool = false: True to save detailed optimizer stats log.\ndirect_mode_optimizer::Bool = false: True to use the solver in direct mode. Creates a JuMP.direct_model.\nstore_variable_names::Bool = false: True to store variable names in optimization model.\nrebuild_model::Bool = false: It will force the rebuild of the underlying JuMP model with each call to update the model. It increases solution times, use only if the model can't be updated in memory.\ninitial_time::Dates.DateTime = UNSET_INI_TIME: Initial Time for the model solve.\ntime_series_cache_size::Int = IS.TIME_SERIES_CACHE_SIZE_BYTES: Size in bytes to cache for each time array. Default is 1 MiB. Set to 0 to disable.\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nOpModel = EmulationModel(MockEmulationProblem, template, system)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.EmulationModel-Tuple{Type{M} where M<:PowerSimulations.EmulationProblem, ProblemTemplate, System, Union{Nothing, JuMP.Model}}","page":"API Reference","title":"PowerSimulations.EmulationModel","text":"EmulationModel(\n ::Type{M<:PowerSimulations.EmulationProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System;\n ...\n) -> EmulationModel\nEmulationModel(\n ::Type{M<:PowerSimulations.EmulationProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System,\n jump_model::Union{Nothing, JuMP.Model};\n kwargs...\n) -> EmulationModel\n\n\nBuild the optimization problem of type M with the specific system and template\n\nArguments\n\n::Type{M} where M<:EmulationProblem: The abstract Emulation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nproblem = EmulationModel(MyEmProblemType, template, system, optimizer)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.EmulationModel-Tuple{AbstractString, MathOptInterface.OptimizerWithAttributes}","page":"API Reference","title":"PowerSimulations.EmulationModel","text":"EmulationModel(\n directory::AbstractString,\n optimizer::MathOptInterface.OptimizerWithAttributes;\n jump_model,\n system,\n kwargs...\n) -> Any\n\n\nConstruct an EmulationProblem from a serialized file.\n\nArguments\n\ndirectory::AbstractString: Directory containing a serialized model.\noptimizer::MOI.OptimizerWithAttributes: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\njump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.\nsystem::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.build!-Tuple{EmulationModel}","page":"API Reference","title":"PowerSimulations.build!","text":"build!(\n model::EmulationModel;\n executions,\n output_dir,\n recorders,\n console_level,\n file_level,\n disable_timer_outputs\n)\n\n\nImplementation of build for any EmulationProblem\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.run!-Tuple{EmulationModel}","page":"API Reference","title":"PowerSimulations.run!","text":"run!(\n model::EmulationModel;\n export_problem_results,\n console_level,\n file_level,\n disable_timer_outputs,\n export_optimization_model,\n kwargs...\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault run method for problems that conform to the requirements of EmulationModel{<: EmulationProblem}\n\nThis will call build! on the model if it is not already built. It will forward all keyword arguments to that function.\n\nArguments\n\nmodel::EmulationModel = model: Emulation model\noptimizer::MOI.OptimizerWithAttributes: The optimizer that is used to solve the model\nexecutions::Int: Number of executions for the emulator run\nexport_problem_results::Bool: If true, export OptimizationProblemResults DataFrames to CSV files.\noutput_dir::String: Required if the model is not already built, otherwise ignored\nenable_progress_bar::Bool: Enables/Disable progress bar printing\nexport_optimization_model::Bool: If true, serialize the model to a file to allow re-execution later.\n\nExamples\n\nstatus = run!(model; optimizer = GLPK.Optimizer, executions = 10)\nstatus = run!(model; output_dir = ./model_output, optimizer = GLPK.Optimizer, executions = 10)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.solve!-Tuple{Int64, EmulationModel, Dates.DateTime, PowerSimulations.SimulationStore}","page":"API Reference","title":"PowerSimulations.solve!","text":"solve!(\n step::Int64,\n model::EmulationModel,\n start_time::Dates.DateTime,\n store::PowerSimulations.SimulationStore;\n exports\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault solve method for an EmulationModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}\n\nArguments\n\nstep::Int: Simulation Step\nmodel::OperationModel: operation model\nstart_time::Dates.DateTime: Initial Time of the simulation step in Simulation time.\nstore::SimulationStore: Simulation output store\nexports = nothing: realtime export of output. Use wisely, it can have negative impacts in the simulation times\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Service-Models","page":"API Reference","title":"Service Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"List of structures and methods for Service models","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ServiceModel","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ServiceModel","page":"API Reference","title":"PowerSimulations.ServiceModel","text":"Establishes the model for a particular services specified by type. Uses the keyword argument use_service_name to assign the model to a service with the same name as the name in the template. Uses the keyword argument feedforward to enable passing values between operation model at simulation time\n\nArguments\n\n-::Type{D}: Power System Service Type -::Type{B}: Abstract Service Formulation\n\nAccepted Key Words\n\nfeedforward::Array{<:AbstractAffectFeedforward} : use to pass parameters between models\nuse_service_name::Bool : use the name as the name for the service\n\nExample\n\nreserves = ServiceModel(PSY.VariableReserve{PSY.ReserveUp}, RangeReserve)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Simulation-Models","page":"API Reference","title":"Simulation Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Refer to the Simulations Page to explanations on how to setup a Simulation, with Sequencing and Feedforwards.","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"InitialCondition\nSimulationModels\nSimulationSequence\nSimulation\nSimulation(::AbstractString, ::Dict)\nbuild!(::Simulation)\nexecute!(::Simulation)","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.InitialCondition","page":"API Reference","title":"PowerSimulations.InitialCondition","text":"Container for the initial condition data\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationModels","page":"API Reference","title":"PowerSimulations.SimulationModels","text":"SimulationModels(\n decision_models::Vector{<:DecisionModel},\n emulation_models::Union{Nothing, EmulationModel}\n)\n\nStores the OperationProblem definitions to be used in the simulation. When creating the SimulationModels, the order in which the models are created determines the order on which the simulation is executed.\n\nArguments\n\ndecision_models::Vector{<:DecisionModel}: Vector of decision models.\nemulation_models::Union{Nothing, EmulationModel}: Optional argument to include\n\nan EmulationModel in the Simulation\n\nExample\n\ntemplate_uc = template_unit_commitment()\ntemplate_ed = template_economic_dispatch()\nmy_decision_model_uc = DecisionModel(template_1, sys_uc, optimizer, name = \"UC\")\nmy_decision_model_ed = DecisionModel(template_ed, sys_ed, optimizer, name = \"ED\")\nmodels = SimulationModels(\n decision_models = [\n my_decision_model_uc,\n my_decision_model_ed\n ]\n)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationSequence","page":"API Reference","title":"PowerSimulations.SimulationSequence","text":"SimulationSequence(\n models::SimulationModels,\n feedforward::Dict{String, Vector{<:AbstractAffectFeedforward}}\n ini_cond_chronology::InitialConditionChronology\n)\n\nConstruct the simulation sequence between decision and emulation models.\n\nArguments\n\nmodels::SimulationModels: Vector of decisions and emulation models.\nfeedforward = Dict{String, Vector{<:AbstractAffectFeedforward}}(): Optional dictionary to specify how information and variables are exchanged between decision and emulation models.\nini_cond_chronology::InitialConditionChronology = InterProblemChronology(): Define information sharing model between stages with InterProblemChronology\n\nExample\n\ntemplate_uc = template_unit_commitment()\ntemplate_ed = template_economic_dispatch()\nmy_decision_model_uc = DecisionModel(template_1, sys_uc, optimizer, name = \"UC\")\nmy_decision_model_ed = DecisionModel(template_ed, sys_ed, optimizer, name = \"ED\")\nmodels = SimulationModels(\n decision_models = [\n my_decision_model_uc,\n my_decision_model_ed\n ]\n)\n# The following sequence set the commitment variables (`OnVariable`) for `ThermalStandard` units from UC to ED.\nsequence = SimulationSequence(;\n models = models,\n feedforwards = Dict(\n \"ED\" => [\n SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n ),\n ],\n ),\n)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.Simulation","page":"API Reference","title":"PowerSimulations.Simulation","text":"Simulation(\n sequence::SimulationSequence,\n name::String,\n steps::Int\n models::SimulationModels,\n simulation_folder::String,\n initial_time::Union{Nothing, Dates.DateTime}\n)\n\nConstruct the Simulation structure to run the sequence of decision and emulation models specified.\n\nArguments\n\nsequence::SimulationSequence: Simulation sequence that specify how the decision and emulation models will be executed.\nname::String: Name of the Simulation\nsteps::Int: Number of steps on which the sequence of models will be executed\nmodels::SimulationModels: List of Decision and Emulation Models\nsimulation_folder::String: Folder on which results will be stored\ninitial_time::Union{Nothing, Dates.DateTime} = nothing: Initial time of which the simulation starts. If nothing it will default to the first timestamp of time series of the system.\n\nExample\n\ntemplate_uc = template_unit_commitment()\ntemplate_ed = template_economic_dispatch()\nmy_decision_model_uc = DecisionModel(template_1, sys_uc, optimizer, name = \"UC\")\nmy_decision_model_ed = DecisionModel(template_ed, sys_ed, optimizer, name = \"ED\")\nmodels = SimulationModels(\n decision_models = [\n my_decision_model_uc,\n my_decision_model_ed\n ]\n)\n# The following sequence set the commitment variables (`OnVariable`) for `ThermalStandard` units from UC to ED.\nsequence = SimulationSequence(;\n models = models,\n feedforwards = Dict(\n \"ED\" => [\n SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n ),\n ],\n ),\n)\n\nsim = Simulation(\n sequence = sequence,\n name = \"Sim\",\n steps = 5,\n models = models,\n simulation_folder = mktempdir(cleanup=true),\n)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.Simulation-Tuple{AbstractString, Dict}","page":"API Reference","title":"PowerSimulations.Simulation","text":"Simulation(directory::AbstractString, model_info::Dict)\n\n\nConstructs Simulation from a serialized directory. Callers should pass any kwargs here that they passed to the original Simulation.\n\nArguments\n\ndirectory::AbstractString: the directory returned from the call to serialize\nmodel_info::Dict: Two-level dictionary containing model parameters that cannot be serialized. The outer dict should be keyed by the problem name. The inner dict must contain 'optimizer' and may contain 'jump_model'. These should be the same values used for the original simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.build!-Tuple{Simulation}","page":"API Reference","title":"PowerSimulations.build!","text":"build!(\n sim::Simulation;\n recorders,\n console_level,\n file_level,\n serialize,\n partitions,\n index\n) -> InfrastructureSystems.Simulation.SimulationBuildStatusModule.SimulationBuildStatus\n\n\nBuild the Simulation, problems and the related folder structure.\n\nArguments\n\nsim::Simulation: simulation object\nrecorders::Vector{Symbol} = []: recorder names to register\nserialize::Bool = true: serializes the simulation objects in the simulation\nconsole_level = Logging.Error:\nfile_level = Logging.Info:\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.execute!-Tuple{Simulation}","page":"API Reference","title":"PowerSimulations.execute!","text":"execute!(\n sim::Simulation;\n kwargs...\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nSolves the simulation model for sequential Simulations.\n\nArguments\n\nsim::Simulation=sim: simulation object created by Simulation()\n\nThe optional keyword argument exports controls exporting of results to CSV files as the simulation runs.\n\nExample\n\nsim = Simulation(\"Test\", 7, problems, \"/Users/folder\")\nexecute!(sim::Simulation; kwargs...)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"simulation_partitions.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationPartitions","page":"API Reference","title":"PowerSimulations.SimulationPartitions","text":"Defines how a simulation can be partition into partitions and run in parallel.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.get_num_partitions-Tuple{SimulationPartitions}","page":"API Reference","title":"PowerSimulations.get_num_partitions","text":"get_num_partitions(x::SimulationPartitions) -> Int64\n\n\nReturn the number of partitions in the simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.run_parallel_simulation-Tuple{Any, Any}","page":"API Reference","title":"PowerSimulations.run_parallel_simulation","text":"run_parallel_simulation(\n build_function,\n execute_function;\n script,\n output_dir,\n name,\n num_steps,\n period,\n num_overlap_steps,\n num_parallel_processes,\n exeflags,\n force\n)\n\n\nRun a partitioned simulation in parallel on a local computer.\n\nArguments\n\nbuild_function: Function reference that returns a built Simulation.\nexecute_function: Function reference that executes a Simulation.\nscript::AbstractString: Path to script that includes build_function and execute_function.\noutput_dir::AbstractString: Path for simulation outputs\nname::AbstractString: Simulation name\nnum_steps::Integer: Total number of steps in the simulation\nperiod::Integer: Number of steps in each simulation partition\nnum_overlap_steps::Integer: Number of steps that each partition overlaps with the previous partition\nnum_parallel_processes: Number of partitions to run in parallel. If nothing, use the number of cores.\nexeflags: Path to Julia project. Forwarded to Distributed.addprocs.\nforce: Overwrite the output directory if it already exists.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/#Chronology-Models","page":"API Reference","title":"Chronology Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"initial_condition_chronologies.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.InterProblemChronology","page":"API Reference","title":"PowerSimulations.InterProblemChronology","text":"InterProblemChronology()\n\nType struct to select an information sharing model between stages that uses results from the most recent stage executed to calculate the initial conditions. This model takes into account solutions from stages defined with finer temporal resolutions\n\nSee also: IntraProblemChronology\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.IntraProblemChronology","page":"API Reference","title":"PowerSimulations.IntraProblemChronology","text":"IntraProblemChronology()\n\nType struct to select an information sharing model between stages that uses results from the same recent stage to calculate the initial conditions. This model ignores solutions from stages defined with finer temporal resolutions.\n\nSee also: InterProblemChronology\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Variables","page":"API Reference","title":"Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"For a list of variables for each device refer to its Formulations page.","category":"page"},{"location":"api/PowerSimulations/#Common-Variables","page":"API Reference","title":"Common Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerVariable\nReactivePowerVariable\nPieceWiseLinearCostVariable","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerVariable","page":"API Reference","title":"PowerSimulations.ActivePowerVariable","text":"Struct to dispatch the creation of Active Power Variables\n\nDocs abbreviation: p\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReactivePowerVariable","page":"API Reference","title":"PowerSimulations.ReactivePowerVariable","text":"Struct to dispatch the creation of Reactive Power Variables\n\nDocs abbreviation: q\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PieceWiseLinearCostVariable","page":"API Reference","title":"PowerSimulations.PieceWiseLinearCostVariable","text":"Struct to dispatch the creation of piecewise linear cost variables for objective function\n\nDocs abbreviation: delta\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Thermal-Unit-Variables","page":"API Reference","title":"Thermal Unit Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"OnVariable\nStartVariable\nStopVariable\nTimeDurationOn\nTimeDurationOff\nHotStartVariable\nWarmStartVariable\nColdStartVariable\nPowerAboveMinimumVariable\nPowerOutput","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.OnVariable","page":"API Reference","title":"PowerSimulations.OnVariable","text":"Struct to dispatch the creation of a binary commitment status variable\n\nDocs abbreviation: u\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StartVariable","page":"API Reference","title":"PowerSimulations.StartVariable","text":"Struct to dispatch the creation of Binary Start Variables\n\nDocs abbreviation: v\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StopVariable","page":"API Reference","title":"PowerSimulations.StopVariable","text":"Struct to dispatch the creation of Binary Stop Variables\n\nDocs abbreviation: w\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.TimeDurationOn","page":"API Reference","title":"PowerSimulations.TimeDurationOn","text":"Auxiliary Variable for Thermal Generation Models to keep track of time elapsed on\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.TimeDurationOff","page":"API Reference","title":"PowerSimulations.TimeDurationOff","text":"Auxiliary Variable for Thermal Generation Models to keep track of time elapsed off\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HotStartVariable","page":"API Reference","title":"PowerSimulations.HotStartVariable","text":"Struct to dispatch the creation of Hot Start Variable for Thermal units with temperature considerations\n\nDocs abbreviation: z^textth\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.WarmStartVariable","page":"API Reference","title":"PowerSimulations.WarmStartVariable","text":"Struct to dispatch the creation of Warm Start Variable for Thermal units with temperature considerations\n\nDocs abbreviation: y^textth\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ColdStartVariable","page":"API Reference","title":"PowerSimulations.ColdStartVariable","text":"Struct to dispatch the creation of Cold Start Variable for Thermal units with temperature considerations\n\nDocs abbreviation: x^textth\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PowerAboveMinimumVariable","page":"API Reference","title":"PowerSimulations.PowerAboveMinimumVariable","text":"Struct to dispatch the creation of Active Power Variables above minimum power for Thermal Compact formulations\n\nDocs abbreviation: Delta p\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PowerOutput","page":"API Reference","title":"PowerSimulations.PowerOutput","text":"Auxiliary Variable for Thermal Generation Models that solve for power above min\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Storage-Unit-Variables","page":"API Reference","title":"Storage Unit Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ReservationVariable\nEnergyVariable\nActivePowerOutVariable\nActivePowerInVariable","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ReservationVariable","page":"API Reference","title":"PowerSimulations.ReservationVariable","text":"Struct to dispatch the creation of binary storage charge reservation variable\n\nDocs abbreviation: u^textst\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.EnergyVariable","page":"API Reference","title":"PowerSimulations.EnergyVariable","text":"Struct to dispatch the creation of a variable for energy storage level (state of charge)\n\nDocs abbreviation: e\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerOutVariable","page":"API Reference","title":"PowerSimulations.ActivePowerOutVariable","text":"Struct to dispatch the creation of Active Power Output Variables for 2-directional devices. For instance storage or pump-hydro\n\nDocs abbreviation: p^textout\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerInVariable","page":"API Reference","title":"PowerSimulations.ActivePowerInVariable","text":"Struct to dispatch the creation of Active Power Input Variables for 2-directional devices. For instance storage or pump-hydro\n\nDocs abbreviation: p^textin\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Branches-and-Network-Variables","page":"API Reference","title":"Branches and Network Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"FlowActivePowerVariable\nFlowActivePowerSlackUpperBound\nFlowActivePowerSlackLowerBound\nFlowActivePowerFromToVariable\nFlowActivePowerToFromVariable\nFlowReactivePowerFromToVariable\nFlowReactivePowerToFromVariable\nPhaseShifterAngle\nHVDCLosses\nHVDCFlowDirectionVariable\nVoltageMagnitude\nVoltageAngle","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerVariable","page":"API Reference","title":"PowerSimulations.FlowActivePowerVariable","text":"Struct to dispatch the creation of bidirectional Active Power Flow Variables\n\nDocs abbreviation: f\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerSlackUpperBound","page":"API Reference","title":"PowerSimulations.FlowActivePowerSlackUpperBound","text":"Struct to dispatch the creation of active power flow upper bound slack variables. Used when there is not enough flow through the branch in the forward direction.\n\nDocs abbreviation: f^textslup\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerSlackLowerBound","page":"API Reference","title":"PowerSimulations.FlowActivePowerSlackLowerBound","text":"Struct to dispatch the creation of active power flow lower bound slack variables. Used when there is not enough flow through the branch in the reverse direction.\n\nDocs abbreviation: f^textsllo\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerFromToVariable","page":"API Reference","title":"PowerSimulations.FlowActivePowerFromToVariable","text":"Struct to dispatch the creation of unidirectional Active Power Flow Variables\n\nDocs abbreviation: f^textfrom-to\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerToFromVariable","page":"API Reference","title":"PowerSimulations.FlowActivePowerToFromVariable","text":"Struct to dispatch the creation of unidirectional Active Power Flow Variables\n\nDocs abbreviation: f^textto-from\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowReactivePowerFromToVariable","page":"API Reference","title":"PowerSimulations.FlowReactivePowerFromToVariable","text":"Struct to dispatch the creation of unidirectional Reactive Power Flow Variables\n\nDocs abbreviation: f^textqfrom-to\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowReactivePowerToFromVariable","page":"API Reference","title":"PowerSimulations.FlowReactivePowerToFromVariable","text":"Struct to dispatch the creation of unidirectional Reactive Power Flow Variables\n\nDocs abbreviation: f^textqto-from\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PhaseShifterAngle","page":"API Reference","title":"PowerSimulations.PhaseShifterAngle","text":"Struct to dispatch the creation of Phase Shifters Variables\n\nDocs abbreviation: theta^textshift\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HVDCLosses","page":"API Reference","title":"PowerSimulations.HVDCLosses","text":"Struct to dispatch the creation of HVDC Losses Auxiliary Variables\n\nDocs abbreviation: ell\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HVDCFlowDirectionVariable","page":"API Reference","title":"PowerSimulations.HVDCFlowDirectionVariable","text":"Struct to dispatch the creation of HVDC Flow Direction Auxiliary Variables\n\nDocs abbreviation: u^textdir\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.VoltageMagnitude","page":"API Reference","title":"PowerSimulations.VoltageMagnitude","text":"Struct to dispatch the creation of Voltage Magnitude Variables for AC formulations\n\nDocs abbreviation: v\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.VoltageAngle","page":"API Reference","title":"PowerSimulations.VoltageAngle","text":"Struct to dispatch the creation of Voltage Angle Variables for AC/DC formulations\n\nDocs abbreviation: theta\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Services-Variables","page":"API Reference","title":"Services Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerReserveVariable\nServiceRequirementVariable\nSystemBalanceSlackUp\nSystemBalanceSlackDown\nReserveRequirementSlack\nInterfaceFlowSlackUp\nInterfaceFlowSlackDown","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerReserveVariable","page":"API Reference","title":"PowerSimulations.ActivePowerReserveVariable","text":"Struct to dispatch the creation of Active Power Reserve Variables\n\nDocs abbreviation: r\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ServiceRequirementVariable","page":"API Reference","title":"PowerSimulations.ServiceRequirementVariable","text":"Struct to dispatch the creation of Service Requirement Variables\n\nDocs abbreviation: textreq\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SystemBalanceSlackUp","page":"API Reference","title":"PowerSimulations.SystemBalanceSlackUp","text":"Struct to dispatch the creation of System-wide slack up variables. Used when there is not enough generation.\n\nDocs abbreviation: p^textslup\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SystemBalanceSlackDown","page":"API Reference","title":"PowerSimulations.SystemBalanceSlackDown","text":"Struct to dispatch the creation of System-wide slack down variables. Used when there is not enough load curtailment.\n\nDocs abbreviation: p^textsldn\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReserveRequirementSlack","page":"API Reference","title":"PowerSimulations.ReserveRequirementSlack","text":"Struct to dispatch the creation of Reserve requirement slack variables. Used when there is not reserves in the system to satisfy the requirement.\n\nDocs abbreviation: r^textsl\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.InterfaceFlowSlackUp","page":"API Reference","title":"PowerSimulations.InterfaceFlowSlackUp","text":"Struct to dispatch the creation of Interface Flow Slack Up variables\n\nDocs abbreviation: f^textslup\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.InterfaceFlowSlackDown","page":"API Reference","title":"PowerSimulations.InterfaceFlowSlackDown","text":"Struct to dispatch the creation of Interface Flow Slack Down variables\n\nDocs abbreviation: f^textsldn\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Feedforward-Variables","page":"API Reference","title":"Feedforward Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"UpperBoundFeedForwardSlack\nLowerBoundFeedForwardSlack","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.UpperBoundFeedForwardSlack","page":"API Reference","title":"PowerSimulations.UpperBoundFeedForwardSlack","text":"Struct to dispatch the creation of Slack variables for UpperBoundFeedforward\n\nDocs abbreviation: p^textffubsl\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.LowerBoundFeedForwardSlack","page":"API Reference","title":"PowerSimulations.LowerBoundFeedForwardSlack","text":"Struct to dispatch the creation of Slack variables for LowerBoundFeedforward\n\nDocs abbreviation: p^textfflbsl\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Constraints","page":"API Reference","title":"Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/#Common-Constraints","page":"API Reference","title":"Common Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"PieceWiseLinearCostConstraint\n","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.PieceWiseLinearCostConstraint","page":"API Reference","title":"PowerSimulations.PieceWiseLinearCostConstraint","text":"Struct to create the PieceWiseLinearCostConstraint associated with a specified variable.\n\nSee Piecewise linear cost functions for more information.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Network-Constraints","page":"API Reference","title":"Network Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"CopperPlateBalanceConstraint\nNodalBalanceActiveConstraint\nNodalBalanceReactiveConstraint\nAreaParticipationAssignmentConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.CopperPlateBalanceConstraint","page":"API Reference","title":"PowerSimulations.CopperPlateBalanceConstraint","text":"Struct to create the constraint to balance power in the copperplate model. For more information check Network Formulations.\n\nThe specified constraint is generally formulated as:\n\nsum_c in textcomponents p_t^c = 0 quad forall t in 1 dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.NodalBalanceActiveConstraint","page":"API Reference","title":"PowerSimulations.NodalBalanceActiveConstraint","text":"Struct to create the constraint to balance active power in nodal formulation. For more information check Network Formulations.\n\nThe specified constraint depends on the network model chosen.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.NodalBalanceReactiveConstraint","page":"API Reference","title":"PowerSimulations.NodalBalanceReactiveConstraint","text":"Struct to create the constraint to balance reactive power in nodal formulation. For more information check Network Formulations.\n\nThe specified constraint depends on the network model chosen.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.AreaParticipationAssignmentConstraint","page":"API Reference","title":"PowerSimulations.AreaParticipationAssignmentConstraint","text":"Struct to create the constraint to balance power across specified areas. For more information check Network Formulations.\n\nThe specified constraint is generally formulated as:\n\nsum_c in textcomponents_a p_t^c = 0 quad forall ain 1dots A t in 1 dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Power-Variable-Limit-Constraints","page":"API Reference","title":"Power Variable Limit Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerVariableLimitsConstraint\nReactivePowerVariableLimitsConstraint\nActivePowerVariableTimeSeriesLimitsConstraint\nInputActivePowerVariableLimitsConstraint\nOutputActivePowerVariableLimitsConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.ActivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit active power expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nP^textmin le p_t le P^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReactivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.ReactivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit reactive power expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nQ^textmin le q_t le Q^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerVariableTimeSeriesLimitsConstraint","page":"API Reference","title":"PowerSimulations.ActivePowerVariableTimeSeriesLimitsConstraint","text":"Struct to create the constraint to limit active power expressions by a time series parameter. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound expressions, but in its most basic formulation is of the form:\n\np_t le textActivePowerTimeSeriesParameter_t quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.InputActivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.InputActivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit active power input expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nP^textmin le p_t^textin le P^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.OutputActivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.OutputActivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit active power output expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nP^textmin le p_t^textout le P^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Services-Constraints","page":"API Reference","title":"Services Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"RequirementConstraint\nParticipationFractionConstraint\nReservePowerConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.RequirementConstraint","page":"API Reference","title":"PowerSimulations.RequirementConstraint","text":"Struct to create the constraint for satisfying active power reserve requirements. For more information check Service Formulations.\n\nThe constraint is as follows:\n\nsum_dinmathcalD_s r_dt + r_t^textsl ge textReqquad forall tin 1dots T quad text(for a ConstantReserve) \nsum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T quad text(for a VariableReserve)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ParticipationFractionConstraint","page":"API Reference","title":"PowerSimulations.ParticipationFractionConstraint","text":"Struct to create the constraint to participation assignments limits in the active power reserves. For more information check Service Formulations.\n\nThe constraint is as follows:\n\nr_dt le textReq cdot textPF quad forall din mathcalD_s forall tin 1dots T quad text(for a ConstantReserve) \nr_dt le textRequirementTimeSeriesParameter_t cdot textPFquad forall din mathcalD_s forall tin 1dots T quad text(for a VariableReserve)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReservePowerConstraint","page":"API Reference","title":"PowerSimulations.ReservePowerConstraint","text":"Struct to create the constraint for ensuring that NonSpinning Reserve can be delivered from turn-off thermal units.\n\nFor more information check Service Formulations for NonSpinningReserve.\n\nThe constraint is as follows:\n\nr_dt le (1 - u_dt^textth) cdot R^textlimit_d quad forall d in mathcalD_s forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Thermal-Unit-Constraints","page":"API Reference","title":"Thermal Unit Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActiveRangeICConstraint\nCommitmentConstraint\nDurationConstraint\nRampConstraint\nStartupInitialConditionConstraint\nStartupTimeLimitTemperatureConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActiveRangeICConstraint","page":"API Reference","title":"PowerSimulations.ActiveRangeICConstraint","text":"Struct to create the constraint for starting up ThermalMultiStart units. For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.\n\nThe specified constraint is formulated as:\n\nmaxP^textthmax - P^textthshdown 0 cdot w_1^textth le u^textthinit (P^textthmax - P^textthmin) - P^textthinit\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.CommitmentConstraint","page":"API Reference","title":"PowerSimulations.CommitmentConstraint","text":"Struct to create the commitment constraint between the on, start, and stop variables. For more information check ThermalGen Formulations.\n\nThe specified constraints are formulated as:\n\nu_1^textth = u^textthinit + v_1^textth - w_1^textth \nu_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \nv_t^textth + w_t^textth le 1 quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.DurationConstraint","page":"API Reference","title":"PowerSimulations.DurationConstraint","text":"Struct to create the duration constraint for commitment formulations, i.e. min-up and min-down.\n\nFor more information check ThermalGen Formulations.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.RampConstraint","page":"API Reference","title":"PowerSimulations.RampConstraint","text":"Struct to create the RampConstraint associated with a specified thermal device or reserve service.\n\nFor thermal units, see more information in Thermal Formulations. The constraint is as follows:\n\n-R^textthdn le p_t^textth - p_t-1^textth le R^textthup quad forall tin 1 dots T\n\nFor Ramp Reserve, see more information in Service Formulations. The constraint is as follows:\n\nr_dt le R^textthup cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveUp) \nr_dt le R^textthdn cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveDown)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StartupInitialConditionConstraint","page":"API Reference","title":"PowerSimulations.StartupInitialConditionConstraint","text":"Struct to create the start-up initial condition constraints for ThermalMultiStart.\n\nFor more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StartupTimeLimitTemperatureConstraint","page":"API Reference","title":"PowerSimulations.StartupTimeLimitTemperatureConstraint","text":"Struct to create the start-up time limit constraints for ThermalMultiStart.\n\nFor more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Renewable-Unit-Constraints","page":"API Reference","title":"Renewable Unit Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"EqualityConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.EqualityConstraint","page":"API Reference","title":"PowerSimulations.EqualityConstraint","text":"Struct to create the constraint that sets the reactive power to the power factor in the RenewableConstantPowerFactor formulation for renewable units.\n\nFor more information check RenewableGen Formulations.\n\nThe specified constraint is formulated as:\n\nq_t^textre = textpf cdot p_t^textre quad forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Branches-Constraints","page":"API Reference","title":"Branches Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"FlowLimitConstraint\nFlowRateConstraint\nFlowRateConstraintFromTo\nFlowRateConstraintToFrom\nHVDCPowerBalance\nNetworkFlowConstraint\nRateLimitConstraint\nPhaseAngleControlLimit","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.FlowLimitConstraint","page":"API Reference","title":"PowerSimulations.FlowLimitConstraint","text":"Struct to create the constraint that set the flow limits through a PhaseShiftingTransformer.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\n-R^textmax le f_t le R^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowRateConstraint","page":"API Reference","title":"PowerSimulations.FlowRateConstraint","text":"Struct to create the constraint that set the flow limits through an HVDC two-terminal branch.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nR^textmin le f_t le R^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowRateConstraintFromTo","page":"API Reference","title":"PowerSimulations.FlowRateConstraintFromTo","text":"Struct to create the constraint that set the flow from-to limits through an HVDC two-terminal branch.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nR^textfrommin le f_t^textfrom-to le R^textfrommax forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowRateConstraintToFrom","page":"API Reference","title":"PowerSimulations.FlowRateConstraintToFrom","text":"Struct to create the constraint that set the flow to-from limits through an HVDC two-terminal branch.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nR^texttomin le f_t^textto-from le R^texttomaxquad forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HVDCPowerBalance","page":"API Reference","title":"PowerSimulations.HVDCPowerBalance","text":"Struct to create the constraints that set the power balance across a lossy HVDC two-terminal line.\n\nFor more information check Branch Formulations.\n\nThe specified constraints are formulated as:\n\nbeginalign*\n f_t^textto-from - f_t^textfrom-to le L_1 cdot f_t^textto-from - L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge L_1 cdot f_t^textfrom-to + L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge - M^textbig (1 - u^textdir_t)quad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to ge - M^textbig u^textdir_tquad forall t in 1dots T \nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.NetworkFlowConstraint","page":"API Reference","title":"PowerSimulations.NetworkFlowConstraint","text":"Struct to create the constraint the AC branch flows depending on the network model. For more information check Branch Formulations.\n\nThe specified constraint depends on the network model chosen. The most common application is the StaticBranch in a PTDF Network Model:\n\nf_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.RateLimitConstraint","page":"API Reference","title":"PowerSimulations.RateLimitConstraint","text":"Struct to create the constraint that set the AC flow limits through branches.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n f_t - f_t^textslup le R^textmaxquad forall t in 1dots T \n f_t + f_t^textsllo ge -R^textmaxquad forall t in 1dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PhaseAngleControlLimit","page":"API Reference","title":"PowerSimulations.PhaseAngleControlLimit","text":"Struct to create the constraint that set the angle limits through a PhaseShiftingTransformer.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nTheta^textmin le theta^textshift_t le Theta^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Feedforward-Constraints","page":"API Reference","title":"Feedforward Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"FeedforwardSemiContinuousConstraint\nFeedforwardUpperBoundConstraint\nFeedforwardLowerBoundConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.FeedforwardSemiContinuousConstraint","page":"API Reference","title":"PowerSimulations.FeedforwardSemiContinuousConstraint","text":"Struct to create the constraint for semicontinuous feedforward limits.\n\nFor more information check Feedforward Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n textActivePowerRangeExpressionUB_t = p_t^textth - texton_t^textthP^textthmax le 0 quad forall tin 1 dots T \n textActivePowerRangeExpressionLB_t = p_t^textth - texton_t^textthP^textthmin ge 0 quad forall tin 1 dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FeedforwardUpperBoundConstraint","page":"API Reference","title":"PowerSimulations.FeedforwardUpperBoundConstraint","text":"Struct to create the constraint for upper bound feedforward limits.\n\nFor more information check Feedforward Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n textAffectedVariable_t - p_t^textffubsl le textSourceVariableParameter_t quad forall t in 1dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FeedforwardLowerBoundConstraint","page":"API Reference","title":"PowerSimulations.FeedforwardLowerBoundConstraint","text":"Struct to create the constraint for lower bound feedforward limits.\n\nFor more information check Feedforward Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n textAffectedVariable_t + p_t^textfflbsl ge textSourceVariableParameter_t quad forall t in 1dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Parameters","page":"API Reference","title":"Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/#Time-Series-Parameters","page":"API Reference","title":"Time Series Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerTimeSeriesParameter\nReactivePowerTimeSeriesParameter\nRequirementTimeSeriesParameter","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerTimeSeriesParameter","page":"API Reference","title":"PowerSimulations.ActivePowerTimeSeriesParameter","text":"Parameter to define active power time series\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReactivePowerTimeSeriesParameter","page":"API Reference","title":"PowerSimulations.ReactivePowerTimeSeriesParameter","text":"Parameter to define reactive power time series\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.RequirementTimeSeriesParameter","page":"API Reference","title":"PowerSimulations.RequirementTimeSeriesParameter","text":"Parameter to define requirement time series\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Variable-Value-Parameters","page":"API Reference","title":"Variable Value Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"UpperBoundValueParameter\nLowerBoundValueParameter\nOnStatusParameter\nFixValueParameter","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.UpperBoundValueParameter","page":"API Reference","title":"PowerSimulations.UpperBoundValueParameter","text":"Parameter to define variable upper bound\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.LowerBoundValueParameter","page":"API Reference","title":"PowerSimulations.LowerBoundValueParameter","text":"Parameter to define variable lower bound\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.OnStatusParameter","page":"API Reference","title":"PowerSimulations.OnStatusParameter","text":"Parameter to define unit commitment status\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FixValueParameter","page":"API Reference","title":"PowerSimulations.FixValueParameter","text":"Parameter to FixValueParameter\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Objective-Function-Parameters","page":"API Reference","title":"Objective Function Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"CostFunctionParameter","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.CostFunctionParameter","page":"API Reference","title":"PowerSimulations.CostFunctionParameter","text":"Parameter to define cost function coefficient\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Results","page":"API Reference","title":"Results","text":"","category":"section"},{"location":"api/PowerSimulations/#Acessing-Optimization-Model","page":"API Reference","title":"Acessing Optimization Model","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"optimization_container.jl\",\n \"optimization_debugging.jl\"\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.serialize_optimization_model-Tuple{PowerSimulations.OptimizationContainer, String}","page":"API Reference","title":"PowerSimulations.serialize_optimization_model","text":"serialize_optimization_model(\n container::PowerSimulations.OptimizationContainer,\n save_path::String\n)\n\n\nExports the OpModel JuMP object in MathOptFormat\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.get_all_constraint_index-Tuple{PowerSimulations.OperationModel}","page":"API Reference","title":"PowerSimulations.get_all_constraint_index","text":"get_all_constraint_index(\n model::PowerSimulations.OperationModel\n) -> Vector{Tuple{InfrastructureSystems.Optimization.ConstraintKey, Int64, Int64}}\n\n\nEach Tuple corresponds to (conname, internalindex, moi_index)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.get_all_variable_index-Tuple{PowerSimulations.OperationModel}","page":"API Reference","title":"PowerSimulations.get_all_variable_index","text":"get_all_variable_index(\n model::PowerSimulations.OperationModel\n) -> Vector{Tuple{Symbol, Int64, Int64}}\n\n\nEach Tuple corresponds to (conname, internalindex, moi_index)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#Accessing-Problem-Results","page":"API Reference","title":"Accessing Problem Results","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"operation/problem_results.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.OptimizationProblemResults-Tuple{DecisionModel}","page":"API Reference","title":"InfrastructureSystems.Optimization.OptimizationProblemResults","text":"OptimizationProblemResults(\n model::DecisionModel\n) -> OptimizationProblemResults\n\n\nConstruct OptimizationProblemResults from a solved DecisionModel.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.OptimizationProblemResults-Tuple{EmulationModel}","page":"API Reference","title":"InfrastructureSystems.Optimization.OptimizationProblemResults","text":"OptimizationProblemResults(\n model::EmulationModel\n) -> OptimizationProblemResults\n\n\nConstruct OptimizationProblemResults from a solved EmulationModel.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#Accessing-Simulation-Results","page":"API Reference","title":"Accessing Simulation Results","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"simulation_results.jl\",\n \"simulation_problem_results.jl\",\n \"simulation_partition_results.jl\",\n \"hdf_simulation_store.jl\"\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationResults","page":"API Reference","title":"PowerSimulations.SimulationResults","text":"SimulationResults(\n path::AbstractString,\n name::AbstractString;\n ...\n) -> SimulationResults\nSimulationResults(\n path::AbstractString,\n name::AbstractString,\n execution;\n ignore_status\n) -> SimulationResults\n\n\nConstruct SimulationResults from a simulation output directory.\n\nArguments\n\npath::AbstractString: Simulation output directory\nname::AbstractString: Simulation name\nexecution::AbstractString: Execution number. Default is the most recent.\nignore_status::Bool: If true, return results even if the simulation failed.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationResults-Tuple{Simulation}","page":"API Reference","title":"PowerSimulations.SimulationResults","text":"SimulationResults(\n sim::Simulation;\n ignore_status,\n kwargs...\n) -> SimulationResults\n\n\nConstruct SimulationResults from a simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.export_results-Tuple{SimulationResults, Any}","page":"API Reference","title":"InfrastructureSystems.Optimization.export_results","text":"export_results(results::SimulationResults, exports)\n\n\nExport results to files in the results directory.\n\nArguments\n\nresults::SimulationResults: simulation results\nexports: SimulationResultsExport or anything that can be passed to its constructor. (such as Dict or path to JSON file)\n\nAn example JSON file demonstrating possible options is below. Note that start_time, end_time, path, and format are optional.\n\n{\n \"decision_models\": [\n {\n \"name\": \"ED\",\n \"variables\": [\n \"P__ThermalStandard\",\n ],\n \"parameters\": [\n \"all\"\n ]\n },\n {\n \"name\": \"UC\",\n \"variables\": [\n \"On__ThermalStandard\"\n ],\n \"parameters\": [\n \"all\"\n ],\n \"duals\": [\n \"all\"\n ]\n }\n ],\n \"start_time\": \"2020-01-01T04:00:00\",\n \"end_time\": null,\n \"path\": null,\n \"format\": \"csv\"\n}\n\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_aux_variable-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_aux_variable","text":"read_aux_variable(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_aux_variable_names or args that can be splatted into a AuxVarKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_dual-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_dual","text":"read_dual(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested dual. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_dual_names or args that can be splatted into a ConstraintKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\nstore::SimulationStore: a store that has been opened for reading\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_expression-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_expression","text":"read_expression(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_expression_names or args that can be splatted into a ExpressionKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_parameter-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_parameter","text":"read_parameter(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested parameter. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_parameter_names or args that can be splatted into a ParameterKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_variable-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_variable","text":"read_variable(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested variable. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_variable_names or args that can be splatted into a VariableKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\nstore::SimulationStore: a store that has been opened for reading\n\nExamples\n\nread_variable(results, ActivePowerVariable, ThermalStandard)\nread_variable(results, \"ActivePowerVariable__ThermalStandard\")\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.list_decision_problems-Tuple{SimulationResults}","page":"API Reference","title":"PowerSimulations.list_decision_problems","text":"list_decision_problems(\n results::SimulationResults\n) -> Vector{String}\n\n\nReturn the problem names in the simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.load_results!-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Int64}","page":"API Reference","title":"PowerSimulations.load_results!","text":"load_results!(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n count::Int64;\n initial_time,\n variables,\n duals,\n parameters,\n aux_variables,\n expressions,\n store\n)\n\n\nLoad the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections, when reading the same data very many times, etc. Multiple calls augment the cache according to these rules, where \"variable\" means \"variable, expression, etc.\":\n\nRequests for an already cached variable at a lesser count than already cached do not decrease the count of the cached variable\nRequests for an already cached variable at a greater count than already cached do increase the count of the cached variable\nRequests for new variables are fulfilled without evicting existing variables\n\nNote that count is global across all variables, so increasing the count re-reads already cached variables. For each variable, each element must be the name encoded as a string, like \"ActivePowerVariable__ThermalStandard\" or a Tuple with its constituent types, like (ActivePowerVariable, ThermalStandard). To clear the cache, use Base.empty!.\n\nArguments\n\ncount::Int: Number of windows to load.\ninitial_time::Dates.DateTime : Initial time of first window to load. Defaults to first.\naux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.\nduals::Vector{Union{String, Tuple}}: Optional list of duals to load.\nexpressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.\nparameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.\nvariables::Vector{Union{String, Tuple}}: Optional list of variables to load.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.load_results!-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.EmulationModelSimulationResults}}","page":"API Reference","title":"PowerSimulations.load_results!","text":"load_results!(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.EmulationModelSimulationResults};\n aux_variables,\n duals,\n expressions,\n parameters,\n variables\n)\n\n\nLoad the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections.\n\nFor each variable/parameter/dual, etc., each element must be the name encoded as a string, like \"ActivePowerVariable__ThermalStandard\"or a Tuple with its constituent types, like(ActivePowerVariable, ThermalStandard)`.\n\nArguments\n\naux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.\nduals::Vector{Union{String, Tuple}}: Optional list of duals to load.\nexpressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.\nparameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.\nvariables::Vector{Union{String, Tuple}}: Optional list of variables to load.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.get_timestamps-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.get_timestamps","text":"get_timestamps(\n result::PowerSimulations.SimulationProblemResults\n) -> StepRange{Dates.DateTime, Dates.Millisecond}\n\n\nReturn a reference to a StepRange of available timestamps.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_aux_variable_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_aux_variable_names","text":"list_aux_variable_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of auxillary variable names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_dual_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_dual_names","text":"list_dual_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of dual names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_expression_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_expression_names","text":"list_expression_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of expression names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_parameter_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_parameter_names","text":"list_parameter_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of parmater names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_variable_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_variable_names","text":"list_variable_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of variable names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_optimizer_stats-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_optimizer_stats","text":"read_optimizer_stats(\n res::PowerSimulations.SimulationProblemResults;\n store\n) -> Any\n\n\nReturn the optimizer stats for the problem as a DataFrame.\n\nAccepted keywords\n\nstore::SimulationStore: a store that has been opened for reading\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.get_system!-Tuple{Union{OptimizationProblemResults, PowerSimulations.SimulationProblemResults}}","page":"API Reference","title":"PowerSimulations.get_system!","text":"get_system!(\n results::Union{OptimizationProblemResults, PowerSimulations.SimulationProblemResults};\n kwargs...\n) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsType}\n\n\nReturn the system used for the problem. If the system hasn't already been deserialized or set with set_system! then deserialize and store it.\n\nIf the simulation was configured to serialize all systems to file then the returned system will include all data. If that was not configured then the returned system will include all data except time series data.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_aux_variable-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_aux_variable","text":"read_realized_aux_variable(\n res::PowerSimulations.SimulationProblemResults,\n aux_variable::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested auxiliary variable for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_aux_variables-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_aux_variables","text":"read_realized_aux_variables(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested auxiliary variables for each time step for a problem.\n\nRefer to read_realized_aux_variables for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_dual-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_dual","text":"read_realized_dual(\n res::PowerSimulations.SimulationProblemResults,\n dual::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested dual for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_duals-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_duals","text":"read_realized_duals(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested duals for each time step for a problem.\n\nRefer to read_realized_duals for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_expression-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_expression","text":"read_realized_expression(\n res::PowerSimulations.SimulationProblemResults,\n expression::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested expression for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_expressions-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_expressions","text":"read_realized_expressions(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested expressions for each time step for a problem.\n\nRefer to read_realized_expressions for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_parameter-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_parameter","text":"read_realized_parameter(\n res::PowerSimulations.SimulationProblemResults,\n parameter::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested parameter for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_parameters-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_parameters","text":"read_realized_parameters(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested parameters for each time step for a problem.\n\nRefer to read_realized_parameters for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_variable-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_variable","text":"read_realized_variable(\n res::PowerSimulations.SimulationProblemResults,\n variable::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested variable for each time step for a problem.\n\nDecision problem results are returned in a Dict{DateTime, DataFrame}.\n\nEmulation problem results are returned in a DataFrame.\n\nLimit the data sizes returned by specifying initial_time and count for decision problems or start_time and len for emulation problems.\n\nSee also load_results! to preload data into memory.\n\nArguments\n\nvariable::Union{String, Tuple}: Variable name as a string or a Tuple with variable type and device type.\ninitial_time::Dates.DateTime: Initial time of the requested results. Decision problems only.\ncount::Int: Number of results. Decision problems only.\nstart_time::Dates.DateTime: Start time of the requested results. Emulation problems only.\nlen::Int: Number of rows in each DataFrame. Emulation problems only.\n\nExamples\n\njulia > read_realized_variable(results, \"ActivePowerVariable__ThermalStandard\")\njulia > read_realized_variable(results, (ActivePowerVariable, ThermalStandard))\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_variables-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_variables","text":"read_realized_variables(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested variables for each time step for a problem.\n\nDecision problem results are returned in a Dict{String, Dict{DateTime, DataFrame}}.\n\nEmulation problem results are returned in a Dict{String, DataFrame}.\n\nLimit the data sizes returned by specifying initial_time and count for decision problems or start_time and len for emulation problems.\n\nIf the Julia process is started with multiple threads, the code will read the variables in parallel.\n\nSee also load_results! to preload data into memory.\n\nArguments\n\nvariables::Vector{Union{String, Tuple}}: Variable name as a string or a Tuple with variable type and device type. If not provided then return all variables.\ninitial_time::Dates.DateTime: Initial time of the requested results. Decision problems only.\ncount::Int: Number of results. Decision problems only.\nstart_time::Dates.DateTime: Start time of the requested results. Emulation problems only.\nlen::Int: Number of rows in each DataFrame. Emulation problems only.\n\nExamples\n\njulia > variables_as_strings =\n [\"ActivePowerVariable__ThermalStandard\", \"ActivePowerVariable__RenewableDispatch\"]\njulia > variables_as_types =\n [(ActivePowerVariable, ThermalStandard), (ActivePowerVariable, RenewableDispatch)]\njulia > read_realized_variables(results, variables_as_strings)\njulia > read_realized_variables(results, variables_as_types)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_system!-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.set_system!","text":"set_system!(\n results::PowerSimulations.SimulationProblemResults,\n system::AbstractString\n)\n\n\nSet the system in the results instance.\n\nThrows InvalidValue if the system UUID is incorrect.\n\nArguments\n\nresults::SimulationProblemResults: Results object\nsystem::AbstractString: Path to the system json file\n\nExamples\n\njulia > set_system!(res, \"my_path/system_data.json\")\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationPartitionResults","page":"API Reference","title":"PowerSimulations.SimulationPartitionResults","text":"Handles merging of simulation partitions\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_optimizer_stats-Tuple{PowerSimulations.HdfSimulationStore, Any}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_optimizer_stats","text":"read_optimizer_stats(\n store::PowerSimulations.HdfSimulationStore,\n model_name\n) -> Any\n\n\nReturn the optimizer stats for a problem as a DataFrame.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_optimizer_stats-Tuple{PowerSimulations.HdfSimulationStore, Int64, Symbol, Int64}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_optimizer_stats","text":"read_optimizer_stats(\n store::PowerSimulations.HdfSimulationStore,\n simulation_step::Int64,\n model_name::Symbol,\n execution_index::Int64\n) -> Any\n\n\nRead the optimizer stats for a problem execution.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#Simulation-Recorder","page":"API Reference","title":"Simulation Recorder","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"utils/recorder_events.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.list_simulation_events-Union{Tuple{T}, Tuple{Type{T}, AbstractString}, Tuple{Type{T}, AbstractString, Union{Nothing, Function}}} where T<:InfrastructureSystems.AbstractRecorderEvent","page":"API Reference","title":"PowerSimulations.list_simulation_events","text":"list_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString;\n ...\n) -> Vector{T} where T<:PowerSimulations.AbstractSimulationStatusEvent\nlist_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString,\n filter_func::Union{Nothing, Function};\n step,\n model_name\n) -> Vector{T} where T<:PowerSimulations.AbstractSimulationStatusEvent\n\n\nlist_simulation_events(\n ::Type{T},\n output_dir::AbstractString,\n filter_func::Union{Nothing, Function} = nothing;\n step = nothing,\n model = nothing,\n) where {T <: IS.AbstractRecorderEvent}\n\nList simulation events of type T in a simulation output directory.\n\nArguments\n\noutput_dir::AbstractString: Simulation output directory\nfilter_func::Union{Nothing, Function} = nothing: Refer to show_simulation_events.\nstep::Int = nothing: Filter events by step. Required if model is passed.\nmodel::Int = nothing: Filter events by model.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.show_recorder_events-Union{Tuple{T}, Tuple{Type{T}, AbstractString}, Tuple{Type{T}, AbstractString, Union{Nothing, Function}}} where T<:InfrastructureSystems.AbstractRecorderEvent","page":"API Reference","title":"PowerSimulations.show_recorder_events","text":"show_recorder_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n filename::AbstractString;\n ...\n)\nshow_recorder_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n filename::AbstractString,\n filter_func::Union{Nothing, Function};\n wall_time,\n kwargs...\n)\n\n\nshow_recorder_events(\n ::Type{T},\n filename::AbstractString,\n filter_func::Union{Nothing, Function} = nothing;\n wall_time = false,\n kwargs...,\n) where {T <: IS.AbstractRecorderEvent}\n\nShow the events of type T in a recorder file.\n\nArguments\n\n::Type{T}: Recorder event type\nfilename::AbstractString: recorder filename\nfilter_func::Union{Nothing, Function} = nothing: Optional function that accepts an event of type T and returns a Bool. Apply this function to each event and only return events where the result is true.\nwall_time = false: If true, show the wall_time timestamp.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.show_simulation_events-Union{Tuple{T}, Tuple{Type{T}, AbstractString}, Tuple{Type{T}, AbstractString, Union{Nothing, Function}}} where T<:InfrastructureSystems.AbstractRecorderEvent","page":"API Reference","title":"PowerSimulations.show_simulation_events","text":"show_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString;\n ...\n)\nshow_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString,\n filter_func::Union{Nothing, Function};\n step,\n model,\n wall_time,\n kwargs...\n)\n\n\nshow_simulation_events(\n ::Type{T},\n output_dir::AbstractString,\n filter_func::Union{Nothing,Function} = nothing;\n step = nothing,\n model = nothing,\n wall_time = false,\n kwargs...,\n) where { T <: IS.AbstractRecorderEvent}\n\nShow all simulation events of type T in a simulation output directory.\n\nArguments\n\n::Type{T}: Recorder event type\noutput_dir::AbstractString: Simulation output directory\nfilter_func::Union{Nothing, Function} = nothing: Refer to show_recorder_events.\nstep::Int = nothing: Filter events by step. Required if model is passed.\nmodel::Int = nothing: Filter events by model.\nwall_time = false: If true, show the wall_time timestamp.\n\n\n\n\n\n","category":"method"},{"location":"modeler_guide/read_results/#read_results","page":"Read results","title":"Read results","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Once a DecisionModel is solved via solve!(model) or a Simulation is executed (and solved) via execute!(simulation), the results are stored and can be accessed directly in the REPL for result exploration and plotting.","category":"page"},{"location":"modeler_guide/read_results/#Read-results-of-a-Decision-Problem","page":"Read results","title":"Read results of a Decision Problem","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Once a DecisionModel is solved, results are accessed using OptimizationProblemResults(model) as follows:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# The DecisionModel is already constructed\nbuild!(model; output_dir = mktempdir())\nsolve!(model)\n\nresults = OptimizationProblemResults(model)","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"The output will showcase the available expressions, parameters and variables to read. For example it will look like:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Start: 2020-01-01T00:00:00\nEnd: 2020-01-03T23:00:00\nResolution: 60 minutes\n\nPowerSimulations Problem Auxiliary variables Results\n┌──────────────────────────────────────────┐\n│ CumulativeCyclingCharge__HybridSystem │\n│ CumulativeCyclingDischarge__HybridSystem │\n└──────────────────────────────────────────┘\n\nPowerSimulations Problem Expressions Results\n┌─────────────────────────────────────────────┐\n│ ProductionCostExpression__RenewableDispatch │\n│ ProductionCostExpression__ThermalStandard │\n└─────────────────────────────────────────────┘\n\nPowerSimulations Problem Duals Results\n┌──────────────────────────────────────┐\n│ CopperPlateBalanceConstraint__System │\n└──────────────────────────────────────┘\n\nPowerSimulations Problem Parameters Results\n┌────────────────────────────────────────────────────────────────────────┐\n│ ActivePowerTimeSeriesParameter__RenewableNonDispatch │\n│ RenewablePowerTimeSeries__HybridSystem │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3 │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up │\n│ ActivePowerTimeSeriesParameter__PowerLoad │\n│ ActivePowerTimeSeriesParameter__RenewableDispatch │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down │\n│ ActivePowerTimeSeriesParameter__HydroDispatch │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R1 │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2 │\n└────────────────────────────────────────────────────────────────────────┘\n\nPowerSimulations Problem Variables Results\n┌────────────────────────────────────────────────────────────────────┐\n│ ActivePowerOutVariable__HybridSystem │\n│ ReservationVariable__HybridSystem │\n│ RenewablePower__HybridSystem │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R1 │\n│ SystemBalanceSlackUp__System │\n│ BatteryEnergyShortageVariable__HybridSystem │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Reg_Up │\n│ StopVariable__ThermalStandard │\n│ BatteryStatus__HybridSystem │\n│ BatteryDischarge__HybridSystem │\n│ ActivePowerInVariable__HybridSystem │\n│ DischargeRegularizationVariable__HybridSystem │\n│ BatteryCharge__HybridSystem │\n│ ActivePowerVariable__RenewableDispatch │\n│ ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down │\n│ EnergyVariable__HybridSystem │\n│ OnVariable__HybridSystem │\n│ BatteryEnergySurplusVariable__HybridSystem │\n│ SystemBalanceSlackDown__System │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R2 │\n│ ThermalPower__HybridSystem │\n│ ActivePowerVariable__ThermalStandard │\n│ StartVariable__ThermalStandard │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3 │\n│ OnVariable__ThermalStandard │\n│ ChargeRegularizationVariable__HybridSystem │\n└────────────────────────────────────────────────────────────────────┘","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Then the following code can be used to read results:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# Read active power of Thermal Standard\nthermal_active_power = read_variable(results, \"ActivePowerVariable__ThermalStandard\")\n\n# Read max active power parameter of RenewableDispatch\nrenewable_param =\n read_parameter(results, \"ActivePowerTimeSeriesParameter__RenewableDispatch\")\n\n# Read cost expressions of ThermalStandard units\ncost_thermal = read_expression(results, \"ProductionCostExpression__ThermalStandard\")\n\n# Read dual variables\ndual_balance_constraint = read_dual(results, \"CopperPlateBalanceConstraint__System\")\n\n# Read auxiliary variables\naux_var_result = read_aux_variable(results, \"CumulativeCyclingCharge__HybridSystem\")","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Results will be in the form of DataFrames that can be easily explored.","category":"page"},{"location":"modeler_guide/read_results/#Read-results-of-a-Simulation","page":"Read results","title":"Read results of a Simulation","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# The Simulation is already constructed\nbuild!(sim)\nexecute!(sim; enable_progress_bar = true)\n\nresults_sim = SimulationResults(sim)","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"As an example, the SimulationResults printing will look like:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Decision Problem Results\n┌──────────────┬─────────────────────┬──────────────┬─────────────────────────┐\n│ Problem Name │ Initial Time │ Resolution │ Last Solution Timestamp │\n├──────────────┼─────────────────────┼──────────────┼─────────────────────────┤\n│ ED │ 2020-10-02T00:00:00 │ 60 minutes │ 2020-10-09T23:00:00 │\n│ UC │ 2020-10-02T00:00:00 │ 1440 minutes │ 2020-10-09T00:00:00 │\n└──────────────┴─────────────────────┴──────────────┴─────────────────────────┘\n\nEmulator Results\n┌─────────────────┬───────────┐\n│ Name │ Emulator │\n│ Resolution │ 5 minutes │\n│ Number of steps │ 2304 │\n└─────────────────┴───────────┘","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"With this, it is possible to obtain results of each DecisionModel and EmulationModel as follows:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# Use the Problem Name for Decision Problems\nresults_uc = get_decision_problem_results(results_sim, \"UC\")\nresults_ed = get_decision_problem_results(results_sim, \"ED\")\nresults_emulator = get_emulation_problem_results(results_sim)","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Once we have each decision (or emulation) problem results, we can explore directly using the approach for Decision Models, mentioned in the previous section.","category":"page"},{"location":"modeler_guide/read_results/#Reading-solutions-for-all-simulation-steps","page":"Read results","title":"Reading solutions for all simulation steps","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"In this case, using read_variable (or read expression, parameter or dual), will return a dictionary of all steps (of that Decision Problem). For example, the following code:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"thermal_active_power = read_variable(results_uc, \"ActivePowerVariable__ThermalStandard\")","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"will return:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"DataStructures.SortedDict{Any, Any, Base.Order.ForwardOrdering} with 8 entries:\n DateTime(\"2020-10-02T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-03T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-04T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-05T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-06T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-07T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-08T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-09T00:00:00\") => 72×54 DataFrame…","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"That is, a sorted dictionary for each simulation step, using as a key the initial timestamp for that specific simulation step.","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Note that in this case, each DataFrame, has a dimension of 72 times 54, since the horizon is 72 hours (number of rows), but the interval is only 24 hours. Indeed, note the initial timestamp of each simulation step is the beginning of each day, i.e. 24 hours. Finally, there 54 columns, since this example system has 53 ThermalStandard units (plus 1 column for the timestamps). The user is free to explore the solution of any simulation step as needed.","category":"page"},{"location":"modeler_guide/read_results/#Reading-the-\"realized\"-solution-(i.e.-the-interval)","page":"Read results","title":"Reading the \"realized\" solution (i.e. the interval)","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Using read_realized_variable (or read realized expression, parameter or dual), will return the DataFrame of the realized solution of any specific variable. That is, it will concatenate the corresponding simulation step with the specified interval of that step, to construct a single DataFrame with the \"realized solution\" of the entire simulation.","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"For example, the code:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"th_realized_power =\n read_realized_variable(results_uc, \"ActivePowerVariable__ThermalStandard\")","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"will return:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"92×54 DataFrame\n Row │ DateTime 322_CT_6 321_CC_1 202_STEAM_3 223_CT_4 123_STEAM_2 213_CT_1 223_CT_6 313_CC_1 101_STEAM_3 123_C ⋯\n │ DateTime Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float ⋯\n─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n 1 │ 2020-10-02T00:00:00 0.0 293.333 0.0 0.0 0.0 0.0 0.0 231.667 76.0 0.0 ⋯\n 2 │ 2020-10-02T01:00:00 0.0 267.552 0.0 0.0 0.0 0.0 0.0 231.667 76.0 0.0\n 3 │ 2020-10-02T02:00:00 0.0 234.255 0.0 0.0 -4.97544e-11 0.0 0.0 231.667 76.0 0.0\n 4 │ 2020-10-02T03:00:00 0.0 249.099 0.0 0.0 -4.97544e-11 0.0 0.0 231.667 76.0 0.0\n 5 │ 2020-10-02T04:00:00 0.0 293.333 0.0 0.0 -4.97544e-11 0.0 0.0 231.667 76.0 0.0 ⋯\n 6 │ 2020-10-02T05:00:00 0.0 293.333 1.27578e-11 0.0 -4.97544e-11 0.0 0.0 293.333 76.0 0.0\n ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱\n 187 │ 2020-10-09T18:00:00 0.0 293.333 76.0 0.0 155.0 0.0 0.0 318.843 76.0 0.0\n 188 │ 2020-10-09T19:00:00 0.0 293.333 76.0 0.0 124.0 0.0 0.0 293.333 76.0 0.0\n 189 │ 2020-10-09T20:00:00 0.0 293.333 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 0.0 ⋯\n 190 │ 2020-10-09T21:00:00 -7.65965e-12 293.333 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 0.0\n 191 │ 2020-10-09T22:00:00 0.0 0.0 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 7.156\n 192 │ 2020-10-09T23:00:00 0.0 0.0 60.6667 0.0 117.81 0.0 0.0 0.0 76.0 0.0\n 44 columns and 180 rows omitted","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"In this case, the 8 simulation steps of 24 hours (192 hours), in a single DataFrame, to enable easy exploration of the realized results for the user.","category":"page"},{"location":"tutorials/basics_of_developing_models/#Basics-of-Developing-Operation-Models","page":"Basics of Developing Operation Models","title":"Basics of Developing Operation Models","text":"","category":"section"},{"location":"tutorials/basics_of_developing_models/","page":"Basics of Developing Operation Models","title":"Basics of Developing Operation Models","text":"Check the page PowerSimulations Structure for more background on PowerSimulations.jl","category":"page"},{"location":"code_base_developer_guide/internal/","page":"Internals","title":"Internals","text":"CollapsedDocStrings = true","category":"page"},{"location":"code_base_developer_guide/internal/#Internal-API","page":"Internals","title":"Internal API","text":"","category":"section"},{"location":"code_base_developer_guide/internal/","page":"Internals","title":"Internals","text":"Modules = [PowerSimulations]\nPublic = false","category":"page"},{"location":"code_base_developer_guide/internal/#PowerSimulations.IGNORABLE_FILES","page":"Internals","title":"PowerSimulations.IGNORABLE_FILES","text":"If the name of an extraneous file that appears in simulation results matches one of these regexes, it is safe to ignore\n\n\n\n\n\n","category":"constant"},{"location":"code_base_developer_guide/internal/#PowerSimulations.AbstractDeviceFormulation","page":"Internals","title":"PowerSimulations.AbstractDeviceFormulation","text":"Abstract type for Device Formulations (a.k.a Models)\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyCustomDeviceFormulation <: PSI.AbstractDeviceFormulation\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.AbstractServiceFormulation","page":"Internals","title":"PowerSimulations.AbstractServiceFormulation","text":"Abstract type for Service Formulations (a.k.a Models)\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyServiceFormulation <: PSI.AbstractServiceFormulation\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.AbstractSimulationStatusEvent","page":"Internals","title":"PowerSimulations.AbstractSimulationStatusEvent","text":"All events subtyped from this need to be recorded under :simulation_status.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.CacheFlushRules","page":"Internals","title":"PowerSimulations.CacheFlushRules","text":"Informs the flusher on what data to keep in cache.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DecisionModelStore","page":"Internals","title":"PowerSimulations.DecisionModelStore","text":"Stores results data for one DecisionModel\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DecisionProblem","page":"Internals","title":"PowerSimulations.DecisionProblem","text":"Abstract type for Decision Problems\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyCustomProblem <: PSI.DecisionProblem\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DefaultDecisionProblem","page":"Internals","title":"PowerSimulations.DefaultDecisionProblem","text":"Abstract type for models than employ PowerSimulations methods. For custom decision problems use DecisionProblem as the super type.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DefaultEmulationProblem","page":"Internals","title":"PowerSimulations.DefaultEmulationProblem","text":"Abstract type for models than employ PowerSimulations methods. For custom emulation problems use EmulationProblem as the super type.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.EmulationModelStore","page":"Internals","title":"PowerSimulations.EmulationModelStore","text":"Stores results data for one EmulationModel\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.EmulationProblem","page":"Internals","title":"PowerSimulations.EmulationProblem","text":"Abstract type for Emulation Problems\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyCustomEmulator <: PSI.EmulationProblem\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.FromToFlowLimitParameter","page":"Internals","title":"PowerSimulations.FromToFlowLimitParameter","text":"Parameter to define Flow From_To limit time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.GenericEmulationProblem","page":"Internals","title":"PowerSimulations.GenericEmulationProblem","text":"Default PowerSimulations Emulation Problem Type for unspecified problems\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCActivePowerReceivedFromVariable","page":"Internals","title":"PowerSimulations.HVDCActivePowerReceivedFromVariable","text":"Struct to dispatch the creation of HVDC Received Flow at From Bus Variables for PWL formulations\n\nDocs abbreviation: x\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCActivePowerReceivedToVariable","page":"Internals","title":"PowerSimulations.HVDCActivePowerReceivedToVariable","text":"Struct to dispatch the creation of HVDC Received Flow at To Bus Variables for PWL formulations\n\nDocs abbreviation: y\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCPiecewiseBinaryLossVariable","page":"Internals","title":"PowerSimulations.HVDCPiecewiseBinaryLossVariable","text":"Struct to dispatch the creation of HVDC Piecewise Binary Loss Variables\n\nDocs abbreviation: z\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCPiecewiseLossVariable","page":"Internals","title":"PowerSimulations.HVDCPiecewiseLossVariable","text":"Struct to dispatch the creation of HVDC Piecewise Loss Variables\n\nDocs abbreviation: h or w\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCTwoTerminalPiecewiseLoss","page":"Internals","title":"PowerSimulations.HVDCTwoTerminalPiecewiseLoss","text":"Branch type to represent piecewise lossy power flow on two terminal DC lines\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HdfSimulationStore","page":"Internals","title":"PowerSimulations.HdfSimulationStore","text":"Stores simulation data in an HDF file.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.InMemorySimulationStore","page":"Internals","title":"PowerSimulations.InMemorySimulationStore","text":"Stores simulation data in memory\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.InitialConditionChronology","page":"Internals","title":"PowerSimulations.InitialConditionChronology","text":"Supertype for initial condition chronologies \n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.InitialConditionsData","page":"Internals","title":"PowerSimulations.InitialConditionsData","text":"Stores data to populate initial conditions before the build call\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.MaxInterfaceFlowLimitParameter","page":"Internals","title":"PowerSimulations.MaxInterfaceFlowLimitParameter","text":"Parameter to define Max Flow limit for interface time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.MinInterfaceFlowLimitParameter","page":"Internals","title":"PowerSimulations.MinInterfaceFlowLimitParameter","text":"Parameter to define Min Flow limit for interface time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.OperationModel","page":"Internals","title":"PowerSimulations.OperationModel","text":"Abstract type for Decision Model and Emulation Model. OperationModel structs are parameterized with DecisionProblem or Emulation Problem structs\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.OptimizationOutputCache","page":"Internals","title":"PowerSimulations.OptimizationOutputCache","text":"Cache for a single parameter/variable/dual. Stores arrays chronologically by simulation timestamp.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.OptimizationOutputCaches","page":"Internals","title":"PowerSimulations.OptimizationOutputCaches","text":"Cache for all model results\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.PieceWiseLinearBlockOffer","page":"Internals","title":"PowerSimulations.PieceWiseLinearBlockOffer","text":"Struct to dispatch the creation of piecewise linear block offer variables for objective function\n\nDocs abbreviation: delta\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.PieceWiseLinearBlockOfferConstraint","page":"Internals","title":"PowerSimulations.PieceWiseLinearBlockOfferConstraint","text":"Struct to create the PieceWiseLinearBlockOfferConstraint associated with a specified variable.\n\nSee Piecewise linear cost functions for more information.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.PieceWiseLinearUpperBoundConstraint","page":"Internals","title":"PowerSimulations.PieceWiseLinearUpperBoundConstraint","text":"Struct to create the PieceWiseLinearUpperBoundConstraint associated with a specified variable.\n\nSee Piecewise linear cost functions for more information.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.SimulationProblemResults","page":"Internals","title":"PowerSimulations.SimulationProblemResults","text":"Holds the results of a simulation problem for plotting or exporting.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.SimulationStore","page":"Internals","title":"PowerSimulations.SimulationStore","text":"Provides storage of simulation data\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.ToFromFlowLimitParameter","page":"Internals","title":"PowerSimulations.ToFromFlowLimitParameter","text":"Parameter to define Flow To_From limit time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{PowerSimulations.EmulationModelStore}","page":"Internals","title":"Base.empty!","text":"empty!(store::PowerSimulations.EmulationModelStore)\n\n\nBase.empty!(store::EmulationModelStore)\n\nEmpty the EmulationModelStore\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{PowerSimulations.OptimizationOutputCaches}","page":"Internals","title":"Base.empty!","text":"empty!(cache::PowerSimulations.OptimizationOutputCaches)\n\n\nBase.empty!(cache::OptimizationOutputCaches)\n\nEmpty the OptimizationOutputCaches\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{PowerSimulations.OptimizationOutputCache}","page":"Internals","title":"Base.empty!","text":"empty!(cache::PowerSimulations.OptimizationOutputCache)\n\n\nBase.empty!(cache::OptimizationOutputCache)\n\nEmpty the OptimizationOutputCache\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{SimulationResults}","page":"Internals","title":"Base.empty!","text":"empty!(res::SimulationResults)\n\n\nBase.empty!(res::SimulationResults)\n\nEmpty the SimulationResults\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#InfrastructureSystems.Optimization.read_results_with_keys-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vector{<:InfrastructureSystems.Optimization.OptimizationContainerKey}}","page":"Internals","title":"InfrastructureSystems.Optimization.read_results_with_keys","text":"read_results_with_keys(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n result_keys::Vector{<:InfrastructureSystems.Optimization.OptimizationContainerKey};\n start_time,\n len,\n cols\n) -> Dict{InfrastructureSystems.Optimization.OptimizationContainerKey, DataFrames.DataFrame}\n\n\nHigh-level function to read a DataFrame of results.\n\nArguments\n\nres: the results to read.\nresult_keys::Vector{<:OptimizationContainerKey}: the keys to read. Output will be a Dict{OptimizationContainerKey, DataFrame} with these as the keys\nstart_time::Union{Nothing, Dates.DateTime} = nothing: the time at which the resulting time series should begin; nothing indicates the first time in the results\nlen::Union{Int, Nothing} = nothing: the number of steps in the resulting time series; nothing indicates up to the end of the results\ncols::Union{Colon, Vector{String}} = (:): which columns to fetch; defaults to :, i.e., all the columns\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, Int64}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::InfrastructureSystems.Optimization.VariableType,\n break_points::Vector{Float64},\n period::Int64\n)\n\n\nImplement the constraints for PWL Block Offer variables. That is:\n\nsum_kinmathcalK delta_kt = p_t \nsum_kinmathcalK delta_kt = P_k+1t^max - P_kt^max\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::InfrastructureSystems.Optimization.VariableType,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the constraints for PWL variables. That is:\n\nsum_kinmathcalK P_k^max delta_kt = p_t \nsum_kinmathcalK delta_kt = on_t\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:Component, U<:PowerAboveMinimumVariable}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::PowerAboveMinimumVariable,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the constraints for PWL variables for Compact form. That is:\n\nsum_kinmathcalK P_k^max delta_kt = p_t + P_min * u_t \nsum_kinmathcalK delta_kt = on_t\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:ReserveDemandCurve, U<:ServiceRequirementVariable}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::ReserveDemandCurve,\n _::ServiceRequirementVariable,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the constraints for PWL Block Offer variables for ORDC. That is:\n\nsum_kinmathcalK delta_kt = p_t \nsum_kinmathcalK delta_kt = P_k+1t^max - P_kt^max\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_sos_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType}","page":"Internals","title":"PowerSimulations._add_pwl_sos_constraint!","text":"_add_pwl_sos_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::InfrastructureSystems.Optimization.VariableType,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the SOS for PWL variables. That is:\n\ndelta_it delta_kt in textSOS_2\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_term!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, MarketBidCost, CostCurve{PiecewiseIncrementalCurve}, U, V}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType, V<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_pwl_term!","text":"_add_pwl_term!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n cost_function::MarketBidCost,\n _::CostCurve{PiecewiseIncrementalCurve},\n _::InfrastructureSystems.Optimization.VariableType,\n _::PowerSimulations.AbstractDeviceFormulation\n) -> Vector{JuMP.AffExpr}\n\n\nAdd PWL cost terms for data coming from the MarketBidCost with a fixed incremental offer curve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_term!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}}, U, V}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType, V<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_pwl_term!","text":"_add_pwl_term!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},\n _::InfrastructureSystems.Optimization.VariableType,\n _::PowerSimulations.AbstractDeviceFormulation\n) -> Vector{JuMP.AffExpr}\n\n\nAdd PWL cost terms for data coming from a PiecewisePointCurve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_term!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}}, U, V}} where {T<:ThermalGen, U<:InfrastructureSystems.Optimization.VariableType, V<:ThermalDispatchNoMin}","page":"Internals","title":"PowerSimulations._add_pwl_term!","text":"_add_pwl_term!(\n container::PowerSimulations.OptimizationContainer,\n component::ThermalGen,\n cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},\n _::InfrastructureSystems.Optimization.VariableType,\n _::ThermalDispatchNoMin\n) -> Vector{JuMP.AffExpr}\n\n\nAdd PWL cost terms for data coming from a PiecewisePointCurve for ThermalDispatchNoMin formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, CostCurve{LinearCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::CostCurve{LinearCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.CostCurve{PSY.LinearCurve} : container for cost to be associated with variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, CostCurve{QuadraticCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::CostCurve{QuadraticCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nEquation\n\ngen_cost = dt*sign*(sum(variable.^2)*cost_data[1] + sum(variable)*cost_data[2])\n\nLaTeX\n\ncost = dttimes sign (sum_iin I c_1 v_i^2 + sum_iin I c_2 v_i )\n\nfor quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.CostCurve{PSY.QuadraticCurve} : container for quadratic factors\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, FuelCurve{LinearCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::FuelCurve{LinearCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.FuelCurve{PSY.LinearCurve} : container for cost to be associated with variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, FuelCurve{QuadraticCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::FuelCurve{QuadraticCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nEquation\n\ngen_cost = dt*(sum(variable.^2)*cost_data[1]*fuel_cost + sum(variable)*cost_data[2]*fuel_cost)\n\nLaTeX\n\ncost = dttimes (sum_iin I c_f c_1 v_i^2 + sum_iin I c_f c_2 v_i )\n\nfor quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.FuelCurve{PSY.QuadraticCurve} : container for quadratic factors\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, MarketBidCost, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::MarketBidCost,\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear market bid function using a sum of variables and expression for market participants. Decremental offers are not accepted for most components, except Storage systems and loads.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::MarketBidCost : container for market bid cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear cost function using a sum of variables and expression with sign and time step included.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::PSY.CostCurve{PSY.PiecewisePointCurve}: container for piecewise linear cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{V}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, V, U}} where {T<:InfrastructureSystems.Optimization.VariableType, V<:Union{CostCurve{PiecewiseAverageCurve}, CostCurve{PiecewiseIncrementalCurve}}, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::Union{CostCurve{PiecewiseAverageCurve}, CostCurve{PiecewiseIncrementalCurve}},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear cost function using a sum of variables and expression with sign and time step included.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::PSY.Union{PSY.CostCurve{PSY.PiecewiseIncrementalCurve}, PSY.CostCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{V}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, V, U}} where {T<:InfrastructureSystems.Optimization.VariableType, V<:Union{FuelCurve{PiecewiseAverageCurve}, FuelCurve{PiecewiseIncrementalCurve}}, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::Union{FuelCurve{PiecewiseAverageCurve}, FuelCurve{PiecewiseIncrementalCurve}},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear fuel cost function using a sum of variables and expression with sign and time step included.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::PSY.Union{PSY.FuelCurve{PSY.PiecewiseIncrementalCurve}, PSY.FuelCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._allocate_execution_order-Tuple{Vector{Int64}}","page":"Internals","title":"PowerSimulations._allocate_execution_order","text":"_allocate_execution_order(\n interval_run_counts::Vector{Int64}\n) -> Vector{Int64}\n\n\nFunction calculates the total number of problem executions in the simulation and allocates the appropiate vector\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._calculate_interval_inner_counts-Tuple{OrderedDict{Symbol, Dates.Millisecond}}","page":"Internals","title":"PowerSimulations._calculate_interval_inner_counts","text":"_calculate_interval_inner_counts(\n intervals::OrderedDict{Symbol, Dates.Millisecond}\n) -> Vector{Int64}\n\n\ncalculateintervalinnercounts(intervals::OrderedDict{String,<:Dates.TimePeriod})\n\nCalculates how many times a problem is executed for every interval of the previous problem\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._create_time_series_multiplier_index-Union{Tuple{T}, Tuple{Any, Type{T}}} where T<:InfrastructureSystems.Optimization.TimeSeriesParameter","page":"Internals","title":"PowerSimulations._create_time_series_multiplier_index","text":"_create_time_series_multiplier_index(\n model,\n _::Type{T<:InfrastructureSystems.Optimization.TimeSeriesParameter}\n) -> Union{Nothing, Int64}\n\n\nFunction to create a unique index of time series names for each device model. For example, if two parameters each reference the same time series name, this function will return a different value for each parameter entry\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._get_data_for_tdc-Union{Tuple{U}, Tuple{T}, Tuple{Vector{T}, Vector{U}, Dates.TimePeriod}} where {T<:InitialCondition, U<:InitialCondition}","page":"Internals","title":"PowerSimulations._get_data_for_tdc","text":"_get_data_for_tdc(\n initial_conditions_on::Array{T<:InitialCondition, 1},\n initial_conditions_off::Array{U<:InitialCondition, 1},\n resolution::Dates.TimePeriod\n) -> Tuple{Matrix{InitialCondition}, Vector{@NamedTuple{up::Float64, down::Float64}}}\n\n\nIf the fraction of hours that a generator has a duration constraint is less than the fraction of hours that a single time_step represents then it is not binding.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._get_initial_condition_type-Tuple{Type{RampConstraint}, Type{<:ThermalGen}, Type{<:PowerSimulations.AbstractThermalFormulation}}","page":"Internals","title":"PowerSimulations._get_initial_condition_type","text":"_get_initial_condition_type(\n _::Type{RampConstraint},\n _::Type{<:ThermalGen},\n _::Type{<:PowerSimulations.AbstractThermalFormulation}\n) -> Type{PowerSimulations.DeviceAboveMinPower}\n\n\nThis function gets the data for the generators for ramping constraints of thermal generators\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._get_pwl_cost_expression-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Int64, PiecewiseStepData, Float64}} where T<:ReserveDemandCurve","page":"Internals","title":"PowerSimulations._get_pwl_cost_expression","text":"_get_pwl_cost_expression(\n container::PowerSimulations.OptimizationContainer,\n component::ReserveDemandCurve,\n time_period::Int64,\n cost_data::PiecewiseStepData,\n multiplier::Float64\n) -> JuMP.AffExpr\n\n\nGet cost expression for StepwiseCostReserve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._summary_to_dict!-Tuple{OptimizerStats, JuMP.Model}","page":"Internals","title":"PowerSimulations._summary_to_dict!","text":"_summary_to_dict!(\n optimizer_stats::OptimizerStats,\n jump_model::JuMP.Model\n)\n\n\nRun this function only when getting detailed solver stats\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{B}, Tuple{PowerSimulations.OptimizationContainer, Type{NetworkFlowConstraint}, InfrastructureSystems.FlattenIteratorWrapper{B}, DeviceModel{B, <:PowerSimulations.AbstractBranchFormulation}, NetworkModel{<:PowerSimulations.AbstractPTDFModel}}} where B<:ACBranch","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{NetworkFlowConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},\n model::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nAdd network flow constraints for ACBranch and NetworkModel with <: AbstractPTDFModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{SR}, Tuple{PowerSimulations.OptimizationContainer, Type{RequirementConstraint}, SR, Vector{<:Service}, ServiceModel{SR, GroupReserve}}} where SR<:ConstantReserveGroup","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{RequirementConstraint},\n service::ConstantReserveGroup,\n contributing_services::Vector{<:Service},\n model::ServiceModel{SR<:ConstantReserveGroup, GroupReserve}\n)\n\n\nThis function creates the requirement constraint that will be attained by the appropriate services\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{B}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraintFromTo}, InfrastructureSystems.FlattenIteratorWrapper{B}, DeviceModel{B, <:PowerSimulations.AbstractBranchFormulation}, NetworkModel{T}}} where {B<:ACBranch, T<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n cons_type::Type{RateLimitConstraintFromTo},\n devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},\n device_model::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{T<:PowerModels.AbstractPowerModel}\n)\n\n\nAdd rate limit from to constraints for ACBranch with AbstractPowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{B}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraintToFrom}, InfrastructureSystems.FlattenIteratorWrapper{B}, DeviceModel{B, <:PowerSimulations.AbstractBranchFormulation}, NetworkModel{T}}} where {B<:ACBranch, T<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n cons_type::Type{RateLimitConstraintToFrom},\n devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},\n _::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{T<:PowerModels.AbstractPowerModel}\n)\n\n\nAdd rate limit to from constraints for ACBranch with AbstractPowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{FlowLimitConstraint}, InfrastructureSystems.FlattenIteratorWrapper{AreaInterchange}, DeviceModel{AreaInterchange, StaticBranch}, NetworkModel{T}}} where T<:PowerModels.AbstractActivePowerModel","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{FlowLimitConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{AreaInterchange},\n model::DeviceModel{AreaInterchange, StaticBranch},\n _::NetworkModel{T<:PowerModels.AbstractActivePowerModel}\n)\n\n\nAdd flow constraints for area interchanges\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{NetworkFlowConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, PhaseAngleControl}, NetworkModel{<:PowerSimulations.AbstractPTDFModel}}} where T<:PhaseShiftingTransformer","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{NetworkFlowConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},\n model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},\n network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nAdd network flow constraints for PhaseShiftingTransformer and NetworkModel with <: AbstractPTDFModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{NetworkFlowConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, PhaseAngleControl}, NetworkModel{DCPPowerModel}}} where T<:PhaseShiftingTransformer","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{NetworkFlowConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},\n model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},\n _::NetworkModel{DCPPowerModel}\n)\n\n\nAdd network flow constraints for PhaseShiftingTransformer and NetworkModel with PM.DCPPowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{StartTypeConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, ThermalMultiStartUnitCommitment}, NetworkModel}} where T<:ThermalMultiStart","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{StartTypeConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},\n model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},\n _::NetworkModel\n)\n\n\nConstructs contraints that restricts devices to one type of start at a time\n\nEquations\n\nsum(var_starts[name, s, t] for s in starts) = var_start[name, t]\n\nLaTeX\n\nsum^S_g_s=1 δ^s(t) eq x^start(t)\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{StartupInitialConditionConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, ThermalMultiStartUnitCommitment}, NetworkModel}} where T<:ThermalMultiStart","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{StartupInitialConditionConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},\n model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},\n _::NetworkModel\n)\n\n\nConstructs contraints that restricts devices to one type of start at a time\n\nEquations\n\nub: (time_limits[st+1]-1)*δ^{s}(t) + (1 - δ^{s}(t)) * M_VALUE >= sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime lb: (time_limits[st]-1)*δ^{s}(t) =< sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime\n\nLaTeX\n\nTS^s+1_g δ^s(t) + (1-δ^s(t)) M_VALUE geq sum^t_i=1 x^status(i) + DT_g^0 forall t in 1 ldots TS^s+1_g\n\nTS^s_g δ^s(t) leq sum^t_i=1 x^status(i) + DT_g^0 forall t in 1 ldots TS^s+1_g\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{StartupTimeLimitTemperatureConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, ThermalMultiStartUnitCommitment}, NetworkModel}} where T<:ThermalMultiStart","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{StartupTimeLimitTemperatureConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},\n model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},\n _::NetworkModel\n)\n\n\nConstructs contraints for different types of starts based on generator down-time\n\nEquations\n\nfor t in time_limits[s+1]:T\n\nvar_starts[name, s, t] <= sum( var_stop[name, t-i] for i in time_limits[s]:(time_limits[s+1]-1)\n\nLaTeX\n\nδ^s(t) leq sum_i=TS^s_g^TS^s+1_g x^stop(t-i)\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{PhaseAngleControlLimit}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, PhaseAngleControl}, NetworkModel{U}}} where {T<:PhaseShiftingTransformer, U<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{PhaseAngleControlLimit},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},\n model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},\n _::NetworkModel{U<:PowerModels.AbstractActivePowerModel}\n)\n\n\nAdd phase angle limits for phase shifters\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{FlowLimitConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:Union{MonitoredLine, PhaseShiftingTransformer}, U<:PowerSimulations.AbstractBranchFormulation, V<:PowerModels.AbstractDCPModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{FlowLimitConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Union{MonitoredLine, PhaseShiftingTransformer}},\n model::DeviceModel{T<:Union{MonitoredLine, PhaseShiftingTransformer}, U<:PowerSimulations.AbstractBranchFormulation},\n _::NetworkModel{V<:PowerModels.AbstractDCPModel}\n)\n\n\nAdd branch flow constraints for monitored lines with DC Power Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{FlowLimitToFromConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:MonitoredLine, U<:StaticBranchUnbounded, V<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n _::PowerSimulations.OptimizationContainer,\n _::Type{FlowLimitToFromConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:MonitoredLine},\n model::DeviceModel{T<:MonitoredLine, U<:StaticBranchUnbounded},\n _::NetworkModel{V<:PowerModels.AbstractActivePowerModel}\n)\n\n\nDon't add branch flow constraints for monitored lines if formulation is StaticBranchUnbounded\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraintFromTo}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:MonitoredLine, U<:StaticBranchUnbounded, V<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n _::PowerSimulations.OptimizationContainer,\n _::Type{RateLimitConstraintFromTo},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:MonitoredLine},\n model::DeviceModel{T<:MonitoredLine, U<:StaticBranchUnbounded},\n _::NetworkModel{V<:PowerModels.AbstractActivePowerModel}\n)\n\n\nDon't add branch flow constraints for monitored lines if formulation is StaticBranchUnbounded\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:ACBranch, U<:PowerSimulations.AbstractBranchFormulation, V<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n cons_type::Type{RateLimitConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ACBranch},\n device_model::DeviceModel{T<:ACBranch, U<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{V<:PowerModels.AbstractActivePowerModel}\n)\n\n\nAdd branch rate limit constraints for ACBranch with AbstractActivePowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{PowerSimulations.OptimizationContainer, Type{RampConstraint}, InfrastructureSystems.FlattenIteratorWrapper{U}, DeviceModel{U, V}, NetworkModel{W}}} where {U<:ThermalGen, V<:PowerSimulations.AbstractThermalUnitCommitment, W<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{RampConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{U<:ThermalGen},\n model::DeviceModel{U<:ThermalGen, V<:PowerSimulations.AbstractThermalUnitCommitment},\n _::NetworkModel{W<:PowerModels.AbstractPowerModel}\n)\n\n\nThis function adds the ramping limits of generators when there are CommitmentVariables\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:ActivePowerVariableLimitsConstraint}, Type{<:InfrastructureSystems.Optimization.VariableType}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalMultiStart, W<:ThermalMultiStartUnitCommitment, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:ActivePowerVariableLimitsConstraint},\n U::Type{<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalMultiStart},\n _::DeviceModel{V<:ThermalMultiStart, W<:ThermalMultiStartUnitCommitment},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nThis function adds range constraint for the first time period. Constraint (10) from PGLIB formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:PowerSimulations.PowerVariableLimitsConstraint}, Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalGen, W<:PowerSimulations.AbstractThermalDispatchFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},\n U::Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalGen},\n model::DeviceModel{V<:ThermalGen, W<:PowerSimulations.AbstractThermalDispatchFormulation},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nSemicontinuous range constraints for thermal dispatch formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:PowerSimulations.PowerVariableLimitsConstraint}, Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalGen, W<:PowerSimulations.AbstractThermalUnitCommitment, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},\n U::Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalGen},\n model::DeviceModel{V<:ThermalGen, W<:PowerSimulations.AbstractThermalUnitCommitment},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nSemicontinuous range constraints for unit commitment formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:PowerSimulations.PowerVariableLimitsConstraint}, Type{<:Union{PowerAboveMinimumVariable, InfrastructureSystems.Optimization.ExpressionType}}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalGen, W<:ThermalCompactDispatch, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},\n U::Type{<:Union{PowerAboveMinimumVariable, InfrastructureSystems.Optimization.ExpressionType}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalGen},\n model::DeviceModel{V<:ThermalGen, W<:ThermalCompactDispatch},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nRange constraints for thermal compact dispatch\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:ReactivePowerVariableLimitsConstraint}, Type{<:ReactivePowerVariable}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ElectricLoad, W<:PowerSimulations.AbstractControllablePowerLoadFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:ReactivePowerVariableLimitsConstraint},\n U::Type{<:ReactivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ElectricLoad},\n _::DeviceModel{V<:ElectricLoad, W<:PowerSimulations.AbstractControllablePowerLoadFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nReactive Power Constraints on Controllable Loads Assume Constant power_factor\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:ReactivePowerVariableLimitsConstraint}, Type{<:ReactivePowerVariable}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:RenewableGen, W<:RenewableConstantPowerFactor, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{<:ReactivePowerVariableLimitsConstraint},\n _::Type{<:ReactivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:RenewableGen},\n _::DeviceModel{V<:RenewableGen, W<:RenewableConstantPowerFactor},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nReactive Power Constraints on Renewable Gen Constant power_factor\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_feedforward_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, DeviceModel, InfrastructureSystems.FlattenIteratorWrapper{T}, UpperBoundFeedforward}} where T<:Component","page":"Internals","title":"PowerSimulations.add_feedforward_constraints!","text":"add_feedforward_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::DeviceModel,\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Component},\n ff::UpperBoundFeedforward\n)\n\n\n ub_ff(container::OptimizationContainer,\n cons_name::Symbol,\n constraint_infos,\n param_reference,\n var_key::VariableKey)\n\nConstructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.\n\nvariable[var_name, t] <= param_reference[var_name]\n\nLaTeX\n\nx leq param^max\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\ncons_name::Symbol : name of the constraint\nparam_reference : Reference to the JuMP.VariableRef used to determine the upperbound\nvar_key::VariableKey : the name of the continuous variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_feedforward_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, DeviceModel, Union{InfrastructureSystems.FlattenIteratorWrapper{T}, Vector{T}}, FixValueFeedforward}} where T<:Component","page":"Internals","title":"PowerSimulations.add_feedforward_constraints!","text":"add_feedforward_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::DeviceModel,\n devices::Union{Array{T<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{T<:Component}},\n ff::FixValueFeedforward\n)\n\n\n add_feedforward_constraints(\n container::OptimizationContainer,\n ::DeviceModel,\n devices::IS.FlattenIteratorWrapper{T},\n ff::FixValueFeedforward,\n ) where {T <: PSY.Component}\n\nConstructs a equality constraint to a fix a variable in one model using the variable value from other model results.\n\nvariable[var_name, t] == param[var_name, t]\n\nLaTeX\n\nx == param\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nmodel::DeviceModel : the device model\ndevices::IS.FlattenIteratorWrapper{T} : list of devices\nff::FixValueFeedforward : a instance of the FixValue Feedforward\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_feedforward_constraints!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, DeviceModel{T, U}, InfrastructureSystems.FlattenIteratorWrapper{T}, LowerBoundFeedforward}} where {T<:Component, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_feedforward_constraints!","text":"add_feedforward_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::DeviceModel{T<:Component, U<:PowerSimulations.AbstractDeviceFormulation},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Component},\n ff::LowerBoundFeedforward\n)\n\n\n lb_ff(container::OptimizationContainer,\n cons_name::Symbol,\n constraint_infos,\n param_reference,\n var_key::VariableKey)\n\nConstructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.\n\nvariable[var_name, t] <= param_reference[var_name]\n\nLaTeX\n\nx leq param^max\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\ncons_name::Symbol : name of the constraint\nparam_reference : Reference to the JuMP.VariableRef used to determine the upperbound\nvar_key::VariableKey : the name of the continuous variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_linear_ramp_constraints!-Union{Tuple{W}, Tuple{V}, Tuple{S}, Tuple{PowerSimulations.OptimizationContainer, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{S}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{<:PowerModels.AbstractPowerModel}}} where {S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_linear_ramp_constraints!","text":"add_linear_ramp_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n U::Type{S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs allowed rate-of-change constraints from variables, initial condtions, and rate data.\n\nIf t = 1:\n\nvariable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up\n\ninitial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down\n\nIf t > 1:\n\nvariable[name, t] - variable[name, t-1] <= rate_data[1][ix].up\n\nvariable[name, t-1] - variable[name, t] <= rate_data[1][ix].down\n\nLaTeX\n\nr^down leq x_1 - x_init leq r^up text for t = 1\n\nr^down leq x_t - x_t-1 leq r^up forall t geq 2\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_range_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{X}}} where {T<:InfrastructureSystems.Optimization.ConstraintType, U<:InfrastructureSystems.Optimization.VariableType, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_range_constraints!","text":"add_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{X<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable.\n\nIf min and max within an epsilon width:\n\nvariable[name, t] == limits.max\n\nOtherwise:\n\nlimits.min <= variable[name, t] <= limits.max\n\nwhere limits in constraint_infos.\n\nLaTeX\n\nx = limits^max text for limits^max - limits^min varepsilon\n\nlimits^min leq x leq limits^max text otherwise \n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_reserve_range_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{X}}} where {T<:InputActivePowerVariableLimitsConstraint, U<:InfrastructureSystems.Optimization.VariableType, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_reserve_range_constraints!","text":"add_reserve_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InputActivePowerVariableLimitsConstraint},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{X<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and reservation decision variable.\n\nvarcts[name, t] <= limits.max * (1 - varbin[name, t])\n\nvarcts[name, t] >= limits.min * (1 - varbin[name, t])\n\nwhere limits in constraint_infos.\n\nLaTeX\n\n0 leq x^cts leq limits^max (1 - x^bin) text for limits^min = 0\n\nlimits^min (1 - x^bin) leq x^cts leq limits^max (1 - x^bin) text otherwise \n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_reserve_range_constraints!-Union{Tuple{Y}, Tuple{X}, Tuple{W}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{W}, DeviceModel{W, X}, Type{Y}}} where {T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}, U<:InfrastructureSystems.Optimization.ExpressionType, W<:Component, X<:PowerSimulations.AbstractDeviceFormulation, Y<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_reserve_range_constraints!","text":"add_reserve_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}},\n _::Type{U<:InfrastructureSystems.Optimization.ExpressionType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{W<:Component},\n model::DeviceModel{W<:Component, X<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{Y<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and reservation decision variable.\n\nvarcts[name, t] <= limits.max * varbin[name, t]\n\nvarcts[name, t] >= limits.min * varbin[name, t]\n\nwhere limits in constraint_infos.\n\nLaTeX\n\nlimits^min x^bin leq x^cts leq limits^max x^bin\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_reserve_range_constraints!-Union{Tuple{Y}, Tuple{X}, Tuple{W}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{W}, DeviceModel{W, X}, Type{Y}}} where {T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}, U<:InfrastructureSystems.Optimization.VariableType, W<:Component, X<:PowerSimulations.AbstractDeviceFormulation, Y<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_reserve_range_constraints!","text":"add_reserve_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{W<:Component},\n model::DeviceModel{W<:Component, X<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{Y<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and reservation decision variable.\n\nvarcts[name, t] <= limits.max * varbin[name, t]\n\nvarcts[name, t] >= limits.min * varbin[name, t]\n\nwhere limits in constraint_infos.\n\nLaTeX\n\nlimits^min x^bin leq x^cts leq limits^max x^bin\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_result!-Tuple{PowerSimulations.OptimizationOutputCache, Dates.DateTime, Array{Float64}, Bool}","page":"Internals","title":"PowerSimulations.add_result!","text":"add_result!(\n cache::PowerSimulations.OptimizationOutputCache,\n timestamp::Dates.DateTime,\n array::Array{Float64},\n system_cache_is_full::Bool\n) -> Int64\n\n\nAdd result to the cache.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_semicontinuous_ramp_constraints!-Union{Tuple{W}, Tuple{V}, Tuple{S}, Tuple{PowerSimulations.OptimizationContainer, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{S}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{<:PowerModels.AbstractPowerModel}}} where {S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_semicontinuous_ramp_constraints!","text":"add_semicontinuous_ramp_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n U::Type{S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n _::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs allowed rate-of-change constraints from variables, initial condtions, start/stop status, and rate data\n\nEquations\n\nIf t = 1:\n\nvariable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, 1]\n\ninitial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, 1]\n\nIf t > 1:\n\nvariable[name, t] - variable[name, t-1] <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, t]\n\nvariable[name, t-1] - variable[name, t] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, t]\n\nLaTeX\n\nr^down + r^min x^stop_1 leq x_1 - x_init leq r^up + r^max x^start_1 text for t = 1\n\nr^down + r^min x^stop_t leq x_t - x_t-1 leq r^up + r^max x^start_t forall t geq 2\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_semicontinuous_range_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{X}}} where {T<:InfrastructureSystems.Optimization.ConstraintType, U<:InfrastructureSystems.Optimization.VariableType, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_semicontinuous_range_constraints!","text":"add_semicontinuous_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{X<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and on/off decision variable.\n\nIf device min = 0:\n\nvarcts[name, t] <= limits.max*varbin[name, t])\n\nvarcts[name, t] >= 0.0\n\nOtherwise:\n\nvarcts[name, t] <= limits.max*varbin[name, t]\n\nvarcts[name, t] >= limits.min*varbin[name, t]\n\nwhere limits in constraint_infos.\n\nLaTeX\n\n0 leq x^cts leq limits^max x^bin text for limits^min = 0\n\nlimits^min x^bin leq x^cts leq limits^max x^bin text otherwise \n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{PhaseShiftingTransformer}, DeviceModel{PhaseShiftingTransformer, V}, NetworkModel{<:PowerSimulations.AbstractPTDFModel}}} where {T<:ActivePowerBalance, U<:PhaseShifterAngle, V<:PhaseAngleControl}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:PhaseShifterAngle},\n devices::InfrastructureSystems.FlattenIteratorWrapper{PhaseShiftingTransformer},\n _::DeviceModel{PhaseShiftingTransformer, V<:PhaseAngleControl},\n network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{CopperPlatePowerModel}}} where {T<:ActivePowerBalance, U<:FlowActivePowerVariable, V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{CopperPlatePowerModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{CopperPlatePowerModel}}} where {T<:ActivePowerBalance, U<:InfrastructureSystems.Optimization.VariableType, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{CopperPlatePowerModel}\n)\n\n\nDefault implementation to add variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{PTDFPowerModel}}} where {T<:ActivePowerBalance, U<:FlowActivePowerToFromVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerToFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{PTDFPowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{PTDFPowerModel}}} where {T<:ActivePowerBalance, U<:FlowActivePowerVariable, V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{PTDFPowerModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{PTDFPowerModel}}} where {T<:ActivePowerBalance, U<:InfrastructureSystems.Optimization.VariableType, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{PTDFPowerModel}\n)\n\n\nDefault implementation to add variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerFromToVariable, V<:Branch, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerFromToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Branch},\n _::DeviceModel{V<:Branch, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerFromToVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation, X<:CopperPlatePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerFromToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{X<:CopperPlatePowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerFromToVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerFromToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerToFromVariable, V<:ACBranch, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerToFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerToFromVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation, X<:CopperPlatePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerToFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{X<:CopperPlatePowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerVariable, V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation, X<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractActivePowerModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:HVDCLosses, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:HVDCTwoTerminalDispatch, X<:Union{CopperPlatePowerModel, PTDFPowerModel}}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:HVDCLosses},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:HVDCTwoTerminalDispatch},\n network_model::NetworkModel{X<:Union{CopperPlatePowerModel, PTDFPowerModel}}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:PowerSimulations.HVDCActivePowerReceivedFromVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:PowerSimulations.HVDCActivePowerReceivedFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nPWL implementation to add FromTo branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:PowerSimulations.HVDCActivePowerReceivedToVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:PowerSimulations.HVDCActivePowerReceivedToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nPWL implementation to add FromTo branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.TimeSeriesParameter, V<:Device, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Device},\n model::DeviceModel{V<:Device, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add parameters to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.TimeSeriesParameter, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation, X<:CopperPlatePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:CopperPlatePowerModel}\n)\n\n\nDefault implementation to add parameters to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.TimeSeriesParameter, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nDefault implementation to add parameters to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.VariableType, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n _::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add device variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{D}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, D, Any}} where {T<:ServiceRequirementVariable, D<:ReserveDemandCurve}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n variable_type::ServiceRequirementVariable,\n service::ReserveDemandCurve,\n formulation\n)\n\n\nAdd variables for ServiceRequirementVariable for StepWiseCostReserve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{U}, Tuple{D}, Tuple{PowerSimulations.OptimizationContainer, InfrastructureSystems.Optimization.AuxVariableType, U, Any}} where {D<:Component, U<:Union{InfrastructureSystems.FlattenIteratorWrapper{D}, Vector{D}}}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n var_type::InfrastructureSystems.Optimization.AuxVariableType,\n devices::Union{Array{D<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:Component}},\n formulation\n)\n\n\nDefault implementation of adding auxiliary variable to the model.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{U}, Tuple{T}, Tuple{D}, Tuple{PowerSimulations.OptimizationContainer, T, U, Any}} where {D<:Component, T<:InfrastructureSystems.Optimization.VariableType, U<:Union{InfrastructureSystems.FlattenIteratorWrapper{D}, Vector{D}}}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n variable_type::InfrastructureSystems.Optimization.VariableType,\n devices::Union{Array{D<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:Component}},\n formulation\n)\n\n\nAdds a variable to the optimization model and to the affine expressions contained in the optimization_container model according to the specified sign. Based on the inputs, the variable can be specified as binary.\n\nBounds\n\nlb_value_function <= varstart[name, t] <= ub_value_function\n\nIf binary = true:\n\nvarstart[name, t] in {0,1}\n\nLaTeX\n\nlb ge x^device_t le ub forall t\n\nx^device_t in 01 forall t iff textbinary = true\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\ndevices : Vector or Iterator with the devices\nvar_key::VariableKey : Base Name for the variable\nbinary::Bool : Select if the variable is binary\nexpressionname::Symbol : Expressionname name stored in container.expressions to add the variable\nsign::Float64 : sign of the addition of the variable to the expression_name. Default Value is 1.0\n\nAccepted Keyword Arguments\n\nubvalue : Provides the function over device to obtain the value for a upperbound\nlbvalue : Provides the function over device to obtain the value for a lowerbound. If the variable is meant to be positive define lb = x -> 0.0\ninitial_value : Provides the function over device to obtain the warm start value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{U}, Tuple{T}, Tuple{D}, Tuple{PowerSimulations.OptimizationContainer, T, U, PowerSimulations.AbstractThermalFormulation}} where {D<:ThermalGen, T<:Union{OnVariable, StartVariable, StopVariable}, U<:Union{InfrastructureSystems.FlattenIteratorWrapper{D}, Vector{D}}}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n variable_type::Union{OnVariable, StartVariable, StopVariable},\n devices::Union{Array{D<:ThermalGen, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:ThermalGen}},\n formulation::PowerSimulations.AbstractThermalFormulation\n)\n\n\nAdds a variable to the optimization model for the OnVariable of Thermal Units\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variables!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Union{InfrastructureSystems.FlattenIteratorWrapper{U}, Vector{U}}, Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}}} where {T<:InfrastructureSystems.Optimization.AuxVariableType, U<:Component}","page":"Internals","title":"PowerSimulations.add_variables!","text":"add_variables!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.AuxVariableType},\n devices::Union{Array{U<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{U<:Component}},\n formulation::Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}\n)\n\n\nAdd variables to the OptimizationContainer for any component.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variables!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Union{InfrastructureSystems.FlattenIteratorWrapper{U}, Vector{U}}, Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:Component}","page":"Internals","title":"PowerSimulations.add_variables!","text":"add_variables!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.VariableType},\n devices::Union{Array{U<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{U<:Component}},\n formulation::Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}\n)\n\n\nAdd variables to the OptimizationContainer for any component.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variables!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, U, Union{InfrastructureSystems.FlattenIteratorWrapper{V}, Vector{V}}, PowerSimulations.AbstractReservesFormulation}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:AbstractReserve, V<:Component}","page":"Internals","title":"PowerSimulations.add_variables!","text":"add_variables!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.VariableType},\n service::AbstractReserve,\n contributing_devices::Union{Array{V<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{V<:Component}},\n formulation::PowerSimulations.AbstractReservesFormulation\n)\n\n\nAdd variables to the OptimizationContainer for a service.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.build_model!-Tuple{DecisionModel{<:PowerSimulations.DefaultDecisionProblem}}","page":"Internals","title":"PowerSimulations.build_model!","text":"build_model!(\n model::DecisionModel{<:PowerSimulations.DefaultDecisionProblem}\n)\n\n\nDefault implementation of build method for Operational Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.build_model!-Tuple{EmulationModel}","page":"Internals","title":"PowerSimulations.build_model!","text":"build_model!(model::EmulationModel)\n\n\nDefault implementation of build method for Emulation Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.check_activeservice_variables-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{T}}} where T<:Service","page":"Internals","title":"PowerSimulations.check_activeservice_variables","text":"check_activeservice_variables(\n container::PowerSimulations.OptimizationContainer,\n contributing_services::Array{T<:Service, 1}\n)\n\n\nThis function checks if the variables for reserves were created\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.check_file_integrity-Tuple{String}","page":"Internals","title":"PowerSimulations.check_file_integrity","text":"check_file_integrity(path::String)\n\n\ncheck_file_integrity(path::String)\n\nChecks the hash value for each file made with the file is written with the new hash_value to verify the file hasn't been tampered with since written\n\nArguments\n\npath::String: this is the folder path that contains the results and the check.sha256 file\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{D}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, D}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where {T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment}","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the arguments model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{D}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, D}, NetworkModel}} where {T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment}","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, <:PowerSimulations.AbstractStandardUnitCommitment}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, <:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, <:PowerSimulations.AbstractStandardUnitCommitment}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, <:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_service!-Union{Tuple{SR}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, ServiceModel{SR, GroupReserve}, Dict{Symbol, DeviceModel}, Set{<:DataType}, NetworkModel}} where SR<:ConstantReserveGroup","page":"Internals","title":"PowerSimulations.construct_service!","text":"construct_service!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::ServiceModel{SR<:ConstantReserveGroup, GroupReserve},\n _::Dict{Symbol, DeviceModel},\n _::Set{<:DataType},\n _::NetworkModel\n)\n\n\nConstructs a service for ConstantReserveGroup.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.container_spec-Tuple{Type{Float64}, Vararg{Any}}","page":"Internals","title":"PowerSimulations.container_spec","text":"container_spec(\n _::Type{Float64},\n axs...\n) -> JuMP.Containers.DenseAxisArray\n\n\nReturns the correct container specification for the selected type of JuMP Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.container_spec-Union{Tuple{T}, Tuple{Type{T}, Vararg{Any}}} where T","page":"Internals","title":"PowerSimulations.container_spec","text":"container_spec(\n _::Type{T},\n axs...\n) -> JuMP.Containers.DenseAxisArray\n\n\nReturns the correct container specification for the selected type of JuMP Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_compact_retrospective!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_compact_retrospective!","text":"device_duration_compact_retrospective!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints adds over the start times looking backwards.\n\nLaTeX\n\nMinimum up-time constraint:\n\nsum_i=t-min(d_min^up T)+ 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nsum_i=t-min(d_min^down T) + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_look_ahead!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_look_ahead!","text":"device_duration_look_ahead!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type_up::InfrastructureSystems.Optimization.ConstraintType,\n cons_type_down::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints looks ahead in the time frame of the model.\n\nLaTeX\n\nMinimum up-time constraint:\n\nIf t leq d_min^up\n\nd_min^downx_t^stop - sum_i=t-d_min^up + 1^t x_i^on - x_init^up leq 0\n\nfor i in the set of time steps. Otherwise:\n\nd_min^downx_t^stop - sum_i=t-d_min^up + 1^t x_i^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nIf t leq d_min^down\n\nd_min^upx_t^start - sum_i=t-d_min^down + 1^t (1 - x_i^on) - x_init^down leq 0\n\nfor i in the set of time steps. Otherwise:\n\nd_min^upx_t^start - sum_i=t-d_min^down + 1^t (1 - x_i^on) leq 0\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_parameters!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_parameters!","text":"device_duration_parameters!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints considers parameters.\n\nLaTeX\n\nMinimum up-time constraint:\n\nIf t leq d_min^up\n\nd_min^downx_t^stop - sum_i=t-d_min^up + 1^t x_i^on - x_init^up leq 0\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^up + 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nIf t leq d_min^down\n\nd_min^upx_t^start - sum_i=t-d_min^down + 1^t (1 - x_i^on) - x_init^down leq 0\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^down + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitialdurationon::Vector{InitialCondition} : gives initial number of time steps variable is up\ninitialdurationoff::Vector{InitialCondition} : gives initial number of time steps variable is down\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_retrospective!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_retrospective!","text":"device_duration_retrospective!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints adds over the start times looking backwards.\n\nLaTeX\n\nMinimum up-time constraint:\n\nIf t leq d_min^up - d_init^up and d_init^up 0\n\n1 + sum_i=t-d_min^up + 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^up + 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nIf t leq d_min^down - d_init^down and d_init^down 0\n\n1 + sum_i=t-d_min^down + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^down + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.find_key_with_value-Tuple{Any, Any}","page":"Internals","title":"PowerSimulations.find_key_with_value","text":"find_key_with_value(d, value) -> Any\n\n\nReturn the key for the given value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.find_timestamp_index-Tuple{Union{StepRange{Dates.DateTime, Dates.Millisecond}, Vector{Dates.DateTime}}, Dates.DateTime}","page":"Internals","title":"PowerSimulations.find_timestamp_index","text":"find_timestamp_index(\n dates::Union{StepRange{Dates.DateTime, Dates.Millisecond}, Vector{Dates.DateTime}},\n date::Dates.DateTime\n) -> Int64\n\n\ncalculates the index in the time series corresponding to the data. Assumes that the dates vector is sorted.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.generate_formulation_combinations","page":"Internals","title":"PowerSimulations.generate_formulation_combinations","text":"generate_formulation_combinations(\n\n) -> Dict{String, Vector{Any}}\ngenerate_formulation_combinations(\n sys\n) -> Dict{String, Vector{Any}}\n\n\nGenerate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types.\n\nArguments\n\nsys::Union{Nothing, System}: If set, only include component types present in the system.\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_absolute_step_range-Tuple{SimulationPartitions, Int64}","page":"Internals","title":"PowerSimulations.get_absolute_step_range","text":"get_absolute_step_range(\n partitions::SimulationPartitions,\n index::Int64\n) -> UnitRange{Int64}\n\n\nReturn a UnitRange for the steps in the partition with the given index. Includes overlap.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_dirty_data_to_flush!-Tuple{PowerSimulations.OptimizationOutputCache}","page":"Internals","title":"PowerSimulations.get_dirty_data_to_flush!","text":"get_dirty_data_to_flush!(\n cache::PowerSimulations.OptimizationOutputCache\n) -> Tuple{Vector{Dates.DateTime}, Any}\n\n\nReturn all dirty data from the cache. Mark the timestamps as clean.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_enum_value-Tuple{Any, String}","page":"Internals","title":"PowerSimulations.get_enum_value","text":"get_enum_value(enum, value::String) -> Any\n\n\nGet the enum value for the string. Case insensitive.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_last_updated_timestamp-Tuple{PowerSimulations.DatasetContainer, InfrastructureSystems.Optimization.OptimizationContainerKey}","page":"Internals","title":"PowerSimulations.get_last_updated_timestamp","text":"get_last_updated_timestamp(\n container::PowerSimulations.DatasetContainer,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey\n) -> Dates.DateTime\n\n\nReturn the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_last_updated_timestamp-Tuple{PowerSimulations.HDF5Dataset}","page":"Internals","title":"PowerSimulations.get_last_updated_timestamp","text":"get_last_updated_timestamp(\n s::PowerSimulations.HDF5Dataset\n) -> Dates.DateTime\n\n\nReturn the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_last_updated_timestamp-Tuple{PowerSimulations.InMemoryDataset}","page":"Internals","title":"PowerSimulations.get_last_updated_timestamp","text":"get_last_updated_timestamp(\n s::PowerSimulations.InMemoryDataset\n) -> Dates.DateTime\n\n\nReturn the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{ACBranch, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::ACBranch,\n _::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> @NamedTuple{min::Float64, max::Float64}\n\n\nMin and max limits for Abstract Branch Formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractCompactUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractCompactUnitCommitment}\n) -> Any\n\n\nMin and Max active power limits for Compact Unit Commitment\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalDispatchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalDispatchFormulation}\n) -> Any\n\n\nMin and max active power limits of generators for thermal dispatch formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalUnitCommitment}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits of generators for thermal unit commitment formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalCompactDispatch}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalCompactDispatch}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits of generators for thermal dispatch compact formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalDispatchNoMin}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalDispatchNoMin}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits of generators for thermal dispatch no minimum formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalMultiStartUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalMultiStartUnitCommitment}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits for multi-start unit commitment formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ReactivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalDispatchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ReactivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalDispatchFormulation}\n) -> Any\n\n\nReactive power limits of generators for all dispatch formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ReactivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ReactivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalUnitCommitment}\n) -> Any\n\n\nReactive power limits of generators when there CommitmentVariables\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{MonitoredLine, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::MonitoredLine,\n _::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}\n\n\nMin and max limits for monitored line\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{MonitoredLine, Type{FlowLimitFromToConstraint}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::MonitoredLine,\n _::Type{FlowLimitFromToConstraint},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}\n\n\nMin and max limits for flow limit from-to constraint\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{MonitoredLine, Type{FlowLimitToFromConstraint}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::MonitoredLine,\n _::Type{FlowLimitToFromConstraint},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}\n\n\nMin and max limits for flow limit to-from constraint\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{PhaseShiftingTransformer, Type{PhaseAngleControlLimit}, Type{PhaseAngleControl}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n _::PhaseShiftingTransformer,\n _::Type{PhaseAngleControlLimit},\n _::Type{PhaseAngleControl}\n) -> @NamedTuple{min::Float64, max::Float64}\n\n\nMin and max limits for Abstract Branch Formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_piecewise_incrementalcurve_per_system_unit-Tuple{PiecewiseStepData, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_piecewise_incrementalcurve_per_system_unit","text":"get_piecewise_incrementalcurve_per_system_unit(\n cost_component::PiecewiseStepData,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> PiecewiseStepData\n\n\nObtain the normalized PiecewiseStep cost data in system base per unit depending on the specified power units.\n\nNote that the costs (y-axis) are in /MWh, /(sys pu h) or /(device pu h), so they also require transformation.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_piecewise_pointcurve_per_system_unit-Tuple{PiecewiseLinearData, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_piecewise_pointcurve_per_system_unit","text":"get_piecewise_pointcurve_per_system_unit(\n cost_component::PiecewiseLinearData,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> PiecewiseLinearData\n\n\nObtain the normalized PiecewiseLinear cost data in system base per unit depending on the specified power units.\n\nNote that the costs (y-axis) are always in /h so they do not require transformation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_proportional_cost_per_system_unit-Tuple{Float64, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_proportional_cost_per_system_unit","text":"get_proportional_cost_per_system_unit(\n cost_term::Float64,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> Float64\n\n\nObtain proportional (marginal or slope) cost data in system base per unit depending on the specified power units\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_quadratic_cost_per_system_unit-Tuple{Float64, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_quadratic_cost_per_system_unit","text":"get_quadratic_cost_per_system_unit(\n cost_term::Float64,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> Float64\n\n\nObtain quadratic cost data in system base per unit depending on the specified power units\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_startup_shutdown_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractCompactUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_startup_shutdown_limits","text":"get_startup_shutdown_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractCompactUnitCommitment}\n) -> NamedTuple{(:startup, :shutdown), <:Tuple{Any, Any}}\n\n\nStartup shutdown limits for Compact Unit Commitment\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_startup_shutdown_limits-Tuple{ThermalMultiStart, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalMultiStartUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_startup_shutdown_limits","text":"get_startup_shutdown_limits(\n device::ThermalMultiStart,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalMultiStartUnitCommitment}\n) -> NamedTuple{(:startup, :shutdown), <:Tuple{Any, Any}}\n\n\nStartup and shutdown active power limits for Compact Unit Commitment\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_update_timestamp-Tuple{PowerSimulations.AbstractDataset}","page":"Internals","title":"PowerSimulations.get_update_timestamp","text":"get_update_timestamp(\n s::PowerSimulations.AbstractDataset\n) -> Any\n\n\nReturn the timestamp from the data used in the last update\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_update_timestamp-Tuple{PowerSimulations.DatasetContainer, InfrastructureSystems.Optimization.OptimizationContainerKey}","page":"Internals","title":"PowerSimulations.get_update_timestamp","text":"get_update_timestamp(\n container::PowerSimulations.DatasetContainer,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey\n) -> Any\n\n\nReturn the timestamp from the data used in the last update\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_valid_step_length-Tuple{SimulationPartitions, Int64}","page":"Internals","title":"PowerSimulations.get_valid_step_length","text":"get_valid_step_length(\n partitions::SimulationPartitions,\n index::Int64\n) -> Int64\n\n\nReturn the length of valid data at the given index.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_valid_step_offset-Tuple{SimulationPartitions, Int64}","page":"Internals","title":"PowerSimulations.get_valid_step_offset","text":"get_valid_step_offset(\n partitions::SimulationPartitions,\n index::Int64\n) -> Int64\n\n\nReturn the step offset for valid data at the given index.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.has_dirty-Tuple{PowerSimulations.OptimizationOutputCaches}","page":"Internals","title":"PowerSimulations.has_dirty","text":"has_dirty(\n cache::PowerSimulations.OptimizationOutputCaches\n) -> Bool\n\n\nReturn true if the cache has data that has not been flushed to storage.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.is_cached-Tuple{PowerSimulations.OptimizationOutputCaches, Any, Any, Any}","page":"Internals","title":"PowerSimulations.is_cached","text":"is_cached(\n cache::PowerSimulations.OptimizationOutputCaches,\n model_name,\n key,\n index\n) -> Bool\n\n\nReturn true if the data for timestamp is stored in cache.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.join_simulation-Tuple{AbstractString}","page":"Internals","title":"PowerSimulations.join_simulation","text":"join_simulation(path::AbstractString)\n\n\nCombine all partition simulation files.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.list_decision_model_keys-Tuple{PowerSimulations.HdfSimulationStore, Symbol, Symbol}","page":"Internals","title":"PowerSimulations.list_decision_model_keys","text":"list_decision_model_keys(\n store::PowerSimulations.HdfSimulationStore,\n model::Symbol,\n container_type::Symbol\n) -> Vector\n\n\nReturn the fields stored for the problem and container_type (duals/parameters/variables).\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.list_decision_models-Tuple{PowerSimulations.HdfSimulationStore}","page":"Internals","title":"PowerSimulations.list_decision_models","text":"list_decision_models(\n store::PowerSimulations.HdfSimulationStore\n) -> Base.KeySet{Symbol, OrderedDict{Symbol, PowerSimulations.DatasetContainer{PowerSimulations.HDF5Dataset}}}\n\n\nReturn the problem names in order of execution.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.log_cache_hit_percentages-Tuple{PowerSimulations.OptimizationOutputCaches}","page":"Internals","title":"PowerSimulations.log_cache_hit_percentages","text":"log_cache_hit_percentages(\n cache::PowerSimulations.OptimizationOutputCaches\n)\n\n\nLog the cache hit percentages for all caches.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.onvar_cost-Tuple{ThermalGenerationCost, OnVariable, ThermalGen, PowerSimulations.AbstractThermalFormulation}","page":"Internals","title":"PowerSimulations.onvar_cost","text":"onvar_cost(\n cost::ThermalGenerationCost,\n S::OnVariable,\n d::ThermalGen,\n U::PowerSimulations.AbstractThermalFormulation\n) -> Any\n\n\nTheoretical Cost at power output zero. Mathematically is the intercept with the y-axis\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.open_store","page":"Internals","title":"PowerSimulations.open_store","text":"open_store(\n ::Type{PowerSimulations.HdfSimulationStore},\n directory::AbstractString;\n ...\n) -> PowerSimulations.HdfSimulationStore\nopen_store(\n ::Type{PowerSimulations.HdfSimulationStore},\n directory::AbstractString,\n mode;\n filename\n) -> PowerSimulations.HdfSimulationStore\n\n\nConstruct and open an HdfSimulationStore.\n\nWhen reading or writing results in a program you should use the method that accepts a function in order to guarantee that the file handle gets closed.\n\nArguments\n\ndirectory::AbstractString: Directory containing the store file\nmode::AbstractString: Mode to use to open the store file\nfilename::AbstractString: Base name of the store file\n\nExamples\n\n# Assumes a simulation has been executed in the './rts' directory with these parameters.\npath = \"./rts\"\nproblem = :ED\nvar_name = :P__ThermalStandard\ntimestamp = DateTime(\"2020-01-01T05:00:00\")\nstore = open_store(HdfSimulationStore, path)\ndf = PowerSimulations.read_result(DataFrame, store, model, :variables, var_name, timestamp)\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_dataframe-Tuple{AbstractString}","page":"Internals","title":"PowerSimulations.read_dataframe","text":"read_dataframe(\n filename::AbstractString\n) -> DataFrames.DataFrame\n\n\nReturn a DataFrame from a CSV file.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_json-Tuple{AbstractString}","page":"Internals","title":"PowerSimulations.read_json","text":"read_json(\n filename::AbstractString\n) -> Union{Nothing, Bool, Float64, Int64, String, JSON3.Array, JSON3.Object}\n\n\nReturn a decoded JSON file.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_result-Tuple{PowerSimulations.OptimizationOutputCaches, Any, Any, Any}","page":"Internals","title":"PowerSimulations.read_result","text":"read_result(\n cache::PowerSimulations.OptimizationOutputCaches,\n model_name,\n key,\n timestamp\n) -> Array\n\n\nRead the result from cache. Callers must first call is_cached to check if the timestamp is present.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_result-Tuple{Type{DataFrames.DataFrame}, PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Union{Int64, Dates.DateTime}}","page":"Internals","title":"PowerSimulations.read_result","text":"read_result(\n _::Type{DataFrames.DataFrame},\n store::PowerSimulations.HdfSimulationStore,\n model_name::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Union{Int64, Dates.DateTime}\n) -> DataFrames.DataFrame\n\n\nReturn DataFrame, DenseAxisArray, or Array for a model result at a timestamp.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.serialize_formulation_combinations","page":"Internals","title":"PowerSimulations.serialize_formulation_combinations","text":"serialize_formulation_combinations(\n\n) -> Dict{String, Vector{Any}}\nserialize_formulation_combinations(\n sys\n) -> Dict{String, Vector{Any}}\n\n\nGenerate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types encoded as strings.\n\nArguments\n\nsys::Union{Nothing, System}: If set, only include component types present in the system.\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.serialize_jump_optimization_model-Tuple{JuMP.Model, String}","page":"Internals","title":"PowerSimulations.serialize_jump_optimization_model","text":"serialize_jump_optimization_model(\n jump_model::JuMP.Model,\n save_path::String\n)\n\n\nExports the JuMP object in MathOptFormat\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.serialize_simulation-Tuple{Simulation}","page":"Internals","title":"PowerSimulations.serialize_simulation","text":"serialize_simulation(sim::Simulation; path, force) -> String\n\n\nserialize_simulation(sim::Simulation, path = \".\")\n\nSerialize the simulation to a directory in path.\n\nReturn the serialized simulation directory name that is created.\n\nArguments\n\nsim::Simulation: simulation to serialize\npath = \".\": path in which to create the serialzed directory\nforce = false: If true, delete the directory if it already exists. Otherwise, it will throw an exception.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.set_expression!-Union{Tuple{T}, Tuple{S}, Tuple{PowerSimulations.OptimizationContainer, Type{S}, JuMP.AbstractJuMPScalar, T, Int64}} where {S<:CostExpressions, T<:Component}","page":"Internals","title":"PowerSimulations.set_expression!","text":"set_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{S<:CostExpressions},\n cost_expression::JuMP.AbstractJuMPScalar,\n component::Component,\n time_period::Int64\n)\n\n\nReplaces an expression value in the expression container if the key exists\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.set_ic_quantity!-Union{Tuple{T}, Tuple{InitialCondition{T, Float64}, Float64}} where T<:InfrastructureSystems.Optimization.InitialConditionType","page":"Internals","title":"PowerSimulations.set_ic_quantity!","text":"set_ic_quantity!(\n ic::InitialCondition{T<:InfrastructureSystems.Optimization.InitialConditionType, Float64},\n var_value::Float64\n)\n\n\nDefault implementation of setinitialcondition_value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.set_ic_quantity!-Union{Tuple{T}, Tuple{InitialCondition{T, JuMP.VariableRef}, Float64}} where T<:InfrastructureSystems.Optimization.InitialConditionType","page":"Internals","title":"PowerSimulations.set_ic_quantity!","text":"set_ic_quantity!(\n ic::InitialCondition{T<:InfrastructureSystems.Optimization.InitialConditionType, JuMP.VariableRef},\n var_value::Float64\n)\n\n\nDefault implementation of setinitialcondition_value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.solve_impl!-Tuple{PowerSimulations.OptimizationContainer, System}","page":"Internals","title":"PowerSimulations.solve_impl!","text":"solve_impl!(\n container::PowerSimulations.OptimizationContainer,\n system::System\n) -> Any\n\n\nDefault solve method for OptimizationContainer\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.sparse_container_spec-Union{Tuple{T}, Tuple{Type{T}, Vararg{Any}}} where T<:JuMP.AbstractJuMPScalar","page":"Internals","title":"PowerSimulations.sparse_container_spec","text":"sparse_container_spec(\n _::Type{T<:JuMP.AbstractJuMPScalar},\n axs...\n) -> JuMP.Containers.SparseAxisArray\n\n\nReturns the correct container specification for the selected type of JuMP Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.to_dataframe-Union{Tuple{T}, Tuple{JuMP.Containers.DenseAxisArray{T, 2, Ax, L} where {Ax, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}}, InfrastructureSystems.Optimization.OptimizationContainerKey}} where T<:Number","page":"Internals","title":"PowerSimulations.to_dataframe","text":"to_dataframe(\n array::JuMP.Containers.DenseAxisArray{T<:Number, 2, Ax, L} where {Ax, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}},\n key::InfrastructureSystems.Optimization.OptimizationContainerKey\n) -> DataFrames.DataFrame\n\n\nCreates a DataFrame from a JuMP DenseAxisArray or SparseAxisArray.\n\nArguments\n\narray: JuMP DenseAxisArray or SparseAxisArray to convert\nkey::OptimizationContainerKey:\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_container_parameter_values!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, PowerSimulations.OperationModel, InfrastructureSystems.Optimization.ParameterKey{T, U}, PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}}} where {T<:InfrastructureSystems.Optimization.ParameterType, U<:Component}","page":"Internals","title":"PowerSimulations.update_container_parameter_values!","text":"update_container_parameter_values!(\n optimization_container::PowerSimulations.OptimizationContainer,\n model::PowerSimulations.OperationModel,\n key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},\n input::PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}\n)\n\n\nUpdate parameter function an OperationModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_model!-Tuple{PowerSimulations.OperationModel, Simulation}","page":"Internals","title":"PowerSimulations.update_model!","text":"update_model!(\n model::PowerSimulations.OperationModel,\n sim::Simulation\n)\n\n\nDefault problem update function for most problems with no customization\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_parameter_values!-Union{Tuple{U}, Tuple{T}, Tuple{EmulationModel, InfrastructureSystems.Optimization.ParameterKey{T, U}, PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}}} where {T<:InfrastructureSystems.Optimization.ParameterType, U<:Component}","page":"Internals","title":"PowerSimulations.update_parameter_values!","text":"update_parameter_values!(\n model::EmulationModel,\n key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},\n input::PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}\n)\n\n\nUpdate parameter function an OperationModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_parameter_values!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OperationModel, InfrastructureSystems.Optimization.ParameterKey{T, U}, PowerSimulations.SimulationState}} where {T<:InfrastructureSystems.Optimization.ParameterType, U<:Component}","page":"Internals","title":"PowerSimulations.update_parameter_values!","text":"update_parameter_values!(\n model::PowerSimulations.OperationModel,\n key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},\n simulation_state::PowerSimulations.SimulationState\n)\n\n\nUpdate parameter function an OperationModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.variable_reactive_net_injection-Tuple{PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.variable_reactive_net_injection","text":"variable_reactive_net_injection(\n pm::PowerModels.AbstractActivePowerModel;\n kwargs...\n)\n\n\nactive power only models ignore reactive power variables\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_formulation_combinations","page":"Internals","title":"PowerSimulations.write_formulation_combinations","text":"write_formulation_combinations(filename::AbstractString)\nwrite_formulation_combinations(\n filename::AbstractString,\n sys\n)\n\n\nGenerate valid combinations of devicetype/formulation and servicetype/formulation and write the result to a JSON file.\n\nArguments\n\nsys::Union{Nothing, System}: If set, only include component types present in the system.\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_result!-Tuple{PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Dates.DateTime, Dates.DateTime, JuMP.Containers.DenseAxisArray{Float64, 3, var\"#s547\", L} where {var\"#s547\"<:Tuple{Any, Any, Any}, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}}}","page":"Internals","title":"PowerSimulations.write_result!","text":"write_result!(\n store::PowerSimulations.HdfSimulationStore,\n model_name::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Dates.DateTime,\n _::Dates.DateTime,\n data::JuMP.Containers.DenseAxisArray{Float64, 3, var\"#s547\", L} where {var\"#s547\"<:Tuple{Any, Any, Any}, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}}\n)\n\n\nWrite a decision model result for a timestamp to the store.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_result!-Tuple{PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Int64, Dates.DateTime, JuMP.Containers.DenseAxisArray}","page":"Internals","title":"PowerSimulations.write_result!","text":"write_result!(\n store::PowerSimulations.HdfSimulationStore,\n _::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Int64,\n simulation_time::Dates.DateTime,\n data::JuMP.Containers.DenseAxisArray\n)\n\n\nWrite an emulation model result for an execution index value and the timestamp of the update\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_result!-Union{Tuple{N}, Tuple{PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Dates.DateTime, Dates.DateTime, JuMP.Containers.DenseAxisArray{Float64, N, var\"#s547\", L} where {var\"#s547\"<:NTuple{N, Any}, L<:NTuple{N, JuMP.Containers._AxisLookup}}}} where N","page":"Internals","title":"PowerSimulations.write_result!","text":"write_result!(\n store::PowerSimulations.HdfSimulationStore,\n model_name::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Dates.DateTime,\n _::Dates.DateTime,\n data::JuMP.Containers.DenseAxisArray{Float64, N, var\"#s547\", L} where {var\"#s547\"<:NTuple{N, Any}, L<:NTuple{N, JuMP.Containers._AxisLookup}}\n)\n\n\nWrite a decision model result for a timestamp to the store.\n\n\n\n\n\n","category":"method"},{"location":"formulation_library/Introduction/#formulation_intro","page":"Introduction","title":"Formulations Introduction","text":"","category":"section"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"PowerSimulations.jl enables modularity in its formulations by assigning a DeviceModel to each PowerSystems.jl component type existing in a defined system.","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"PowerSimulations.jl has a multiple AbstractDeviceFormulation subtypes that can be applied to different PowerSystems.jl device types, each dispatching to different methods for populating the optimization problem variables, objective function, expressions and constraints.","category":"page"},{"location":"formulation_library/Introduction/#Example-Formulation","page":"Introduction","title":"Example Formulation","text":"","category":"section"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"For example a typical optimization problem in a DecisionModel in PowerSimulations.jl with three DeviceModel has the abstract form of:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"beginalign*\n min_boldsymbolx textObjective_DeviceModelA + textObjective_DeviceModelB + textObjective_DeviceModelC \n textst \n hspace09cm textConstraints_NetworkModel \n hspace09cm textConstraints_DeviceModelA \n hspace09cm textConstraints_DeviceModelB \n hspace09cm textConstraints_DeviceModelC \nendalign*","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Suppose this is a system with the following characteristics:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Horizon: 48 hours\nInterval: 24 hours\nResolution: 1 hour\nThree Buses: 1, 2 and 3\nOne ThermalStandard (device A) unit at bus 1\nOne RenewableDispatch (device B) unit at bus 2\nOne PowerLoad (device C) at bus 3\nThree Line that connects all the buses","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Now, we assign the following DeviceModel to each PowerSystems.jl with:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Type Formulation\nNetwork CopperPlatePowerModel\nThermalStandard ThermalDispatchNoMin\nRenewableDispatch RenewableFullDispatch\nPowerLoad StaticPowerLoad","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Note that we did not assign any DeviceModel to Line since the CopperPlatePowerModel used for the network assumes that everything is lumped in the same node (like a copper plate with infinite capacity), and hence there are no flows between buses that branches can limit.","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Each DeviceModel formulation is described in specific in their respective page, but the overall optimization problem will end-up as:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"beginalign*\n min_boldsymbolp^textth boldsymbolp^textre sum_t=1^48 C^textth p_t^textth - C^textre p_t^textre \n textst \n hspace09cm p_t^textth + p_t^textre = P_t^textload quad forall t in 1dots 48 \n hspace09cm 0 le p_t^textth le P^textthmax \n hspace09cm 0 le p_t^textre le textActivePowerTimeSeriesParameter_t \nendalign*","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Note that the StaticPowerLoad does not impose any cost to the objective function or constraint but adds its power demand to the supply-balance demand of the CopperPlatePowerModel used. Since we are using the ThermalDispatchNoMin formulation for the thermal generation, the lower bound for the power is 0, instead of P^textthmin. In addition, we are assuming a linear cost C^textth. Finally, the RenewableFullDispatch formulation allows the dispatch of the renewable unit between 0 and its maximum injection time series p_t^textreparam.","category":"page"},{"location":"formulation_library/Introduction/#Nomenclature","page":"Introduction","title":"Nomenclature","text":"","category":"section"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"In the formulations described in the other pages, the nomenclature is as follows:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Lowercase letters are used for variables, e.g., p for power.\nUppercase letters are used for parameters, e.g., C for costs.\nSubscripts are used for indexing, e.g., (cdot)_t for indexing at time t.\nSuperscripts are used for descriptions, e.g., (cdot)^textth to describe a thermal (th) variable/parameter.\nBold letters are used for vectors, e.g., boldsymbolp = p_1dots24.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Debugging-infeasible-models","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Getting infeasible solutions to models is a common occurrence in operations simulations, there are multiple reasons why this can happen. PowerSimulations.jl has several tools to help debug this situation.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Adding-slacks-to-the-model","page":"Debugging infeasible models","title":"Adding slacks to the model","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"One of the most common infeasibility issues observed is due to not enough generation to supply demand, or conversely, excessive fixed (non-curtailable) generation in a low demand scenario.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"The recommended solution for any of these cases is adding slack variables to the network model, for example:","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"template_uc = ProblemTemplate(\n NetworkModel(\n CopperPlatePowerModel;\n use_slacks = true,\n ),\n)","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"will add slack variables to the ActivePowerBalance expression.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"In this case, if the problem is now feasible, the user can check the solution of the variables SystemBalanceSlackUp and SystemBalanceSlackDown, and if one value is greater than zero, it represents that not enough generation (for Slack Up) or not enough demand (for Slack Down) in the optimization problem.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Services-cases","page":"Debugging infeasible models","title":"Services cases","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"In many scenarios, certain units are also required to provide reserve requirements, e.g. thermal units mandated to provide up-regulation. In such scenarios, it is also possible to add slack variables, by specifying the service model (RangeReserve) for the specific service type (VariableReserve{ReserveUp}) as:","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"set_service_model!(\n template_uc,\n ServiceModel(\n VariableReserve{ReserveUp},\n RangeReserve;\n use_slacks = true,\n ),\n)","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Again, if the problem is now feasible, check the solution of ReserveRequirementSlack variable, and if it is larger than zero in a specific time-step, then it is evidence that there is not enough reserve available to satisfy the requirement.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Getting-the-infeasibility-conflict","page":"Debugging infeasible models","title":"Getting the infeasibility conflict","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Some solvers allows to identify which constraints and variables are producing the infeasibility, by finding the irreducible infeasible set (IIS), that is the subset of constraints and variable bounds that will become feasible if any single constraint or variable bound is removed.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"To enable this feature in PowerSimulations the keyword argument calculate_conflict must be set to true, when creating the DecisionModel. Note that not all solvers allow the computation of the IIS, but most commercial solvers have this capability. It is also recommended to enable the keyword argument store_variable_names=true to help understanding which variables are with infeasibility issues.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"The following code creates a decision model with the Xpress optimizer, and enabling the calculate_conflict=true keyword argument.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"DecisionModel(\n template_ed,\n sys_rts_rt;\n name = \"ED\",\n optimizer = optimizer_with_attributes(Xpress.Optimizer, \"MIPRELSTOP\" => 1e-2),\n optimizer_solve_log_print = true,\n calculate_conflict = true,\n store_variable_names = true,\n)","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Here is an example on how the IIS will be displayed as:","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Error: Constraints participating in conflict basis (IIS) \n│ \n│ ┌──────────────────────────────────────┐\n│ │ CopperPlateBalanceConstraint__System │\n│ ├──────────────────────────────────────┤\n│ │ (113, 26) │\n│ └──────────────────────────────────────┘\n│ ┌──────────────────────────────────┐\n│ │ EnergyAssetBalance__HybridSystem │\n│ ├──────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └──────────────────────────────────┘\n│ ┌─────────────────────────────────────────────┐\n│ │ PieceWiseLinearCostConstraint__HybridSystem │\n│ ├─────────────────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └─────────────────────────────────────────────┘\n│ ┌────────────────────────────────────────────────┐\n│ │ PieceWiseLinearCostConstraint__ThermalStandard │\n│ ├────────────────────────────────────────────────┤\n│ │ (\"202_STEAM_3\", 26) │\n│ │ (\"101_STEAM_3\", 26) │\n│ │ (\"118_CC_1\", 26) │\n│ │ (\"202_STEAM_4\", 26) │\n│ │ (\"315_CT_6\", 26) │\n│ │ (\"201_STEAM_3\", 26) │\n│ │ (\"102_STEAM_4\", 26) │\n│ └────────────────────────────────────────────────┘\n│ ┌──────────────────────────────────────────────────────────────────────┐\n│ │ ActivePowerVariableTimeSeriesLimitsConstraint__RenewableDispatch__ub │\n│ ├──────────────────────────────────────────────────────────────────────┤\n│ │ (\"122_WIND_1\", 26) │\n│ │ (\"324_PV_3\", 26) │\n│ │ (\"312_PV_1\", 26) │\n│ │ (\"102_PV_1\", 26) │\n│ │ (\"101_PV_1\", 26) │\n│ │ (\"324_PV_2\", 26) │\n│ │ (\"313_PV_2\", 26) │\n│ │ (\"104_PV_1\", 26) │\n│ │ (\"101_PV_2\", 26) │\n│ │ (\"309_WIND_1\", 26) │\n│ │ (\"310_PV_2\", 26) │\n│ │ (\"113_PV_1\", 26) │\n│ │ (\"314_PV_1\", 26) │\n│ │ (\"324_PV_1\", 26) │\n│ │ (\"103_PV_1\", 26) │\n│ │ (\"303_WIND_1\", 26) │\n│ │ (\"314_PV_2\", 26) │\n│ │ (\"102_PV_2\", 26) │\n│ │ (\"314_PV_3\", 26) │\n│ │ (\"320_PV_1\", 26) │\n│ │ (\"101_PV_3\", 26) │\n│ │ (\"319_PV_1\", 26) │\n│ │ (\"314_PV_4\", 26) │\n│ │ (\"310_PV_1\", 26) │\n│ │ (\"215_PV_1\", 26) │\n│ │ (\"313_PV_1\", 26) │\n│ │ (\"101_PV_4\", 26) │\n│ │ (\"119_PV_1\", 26) │\n│ └──────────────────────────────────────────────────────────────────────┘\n│ ┌─────────────────────────────────────────────────────────────────────────────┐\n│ │ FeedforwardSemiContinuousConstraint__ThermalStandard__ActivePowerVariable_ub │\n│ ├─────────────────────────────────────────────────────────────────────────────┤\n│ │ (\"322_CT_6\", 26) │\n│ │ (\"321_CC_1\", 26) │\n│ │ (\"223_CT_4\", 26) │\n│ │ (\"213_CT_1\", 26) │\n│ │ (\"223_CT_6\", 26) │\n│ │ (\"123_CT_1\", 26) │\n│ │ (\"113_CT_3\", 26) │\n│ │ (\"302_CT_3\", 26) │\n│ │ (\"215_CT_4\", 26) │\n│ │ (\"301_CT_4\", 26) │\n│ │ (\"113_CT_2\", 26) │\n│ │ (\"221_CC_1\", 26) │\n│ │ (\"223_CT_5\", 26) │\n│ │ (\"315_CT_7\", 26) │\n│ │ (\"215_CT_5\", 26) │\n│ │ (\"113_CT_1\", 26) │\n│ │ (\"307_CT_2\", 26) │\n│ │ (\"213_CT_2\", 26) │\n│ │ (\"113_CT_4\", 26) │\n│ │ (\"218_CC_1\", 26) │\n│ │ (\"213_CC_3\", 26) │\n│ │ (\"323_CC_2\", 26) │\n│ │ (\"322_CT_5\", 26) │\n│ │ (\"207_CT_2\", 26) │\n│ │ (\"123_CT_5\", 26) │\n│ │ (\"123_CT_4\", 26) │\n│ │ (\"207_CT_1\", 26) │\n│ │ (\"301_CT_3\", 26) │\n│ │ (\"302_CT_4\", 26) │\n│ │ (\"307_CT_1\", 26) │\n│ └─────────────────────────────────────────────────────────────────────────────┘\n│ ┌───────────────────────────────────────────────────────┐\n│ │ RenewableActivePowerLimitConstraint__HybridSystem__ub │\n│ ├───────────────────────────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └───────────────────────────────────────────────────────┘\n│ ┌───────────────────────────────────────┐\n│ │ ThermalOnVariableUb__HybridSystem__ub │\n│ ├───────────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └───────────────────────────────────────┘\n\n Error: Serializing Infeasible Problem at /var/folders/1v/t69qyl0n5059n6c1nn7sp8zm7g8s6z/T/jl_jNSREb/compact_sim/problems/ED/infeasible_ED_2020-10-06T15:00:00.json","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Note that the IIS clearly identify that the issue is happening at time step 26, and constraints are related with the CopperPlateBalanceConstraint__System, with multiple upper bound constraints, for the hybrid system, renewable units and thermal units. This highlights that there may not be enough generation in the system. Indeed, by enabling system slacks, the problem become feasible.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Finally, the infeasible model is exported in a json file that can be loaded directly in JuMP to be explored. More information about this is available here.","category":"page"},{"location":"modeler_guide/definitions/#Definitions","page":"Definitions","title":"Definitions","text":"","category":"section"},{"location":"modeler_guide/definitions/#A","page":"Definitions","title":"A","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Attributes: Certain device formulations can be customized by specifying attributes that will include/remove certain variables, expressions and/or constraints. For example, in StorageSystemsSimulations.jl, the device formulation of StorageDispatchWithReserves can be specified with the following dictionary of attributes:","category":"page"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"set_device_model!(\n template,\n DeviceModel(\n GenericBattery,\n StorageDispatchWithReserves;\n attributes = Dict{String, Any}(\n \"reservation\" => false,\n \"cycling_limits\" => false,\n \"energy_target\" => false,\n \"complete_coverage\" => false,\n \"regularization\" => false,\n ),\n ),\n)","category":"page"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Changing the attributes between true or false can enable/disable multiple aspects of the formulation.","category":"page"},{"location":"modeler_guide/definitions/#C","page":"Definitions","title":"C","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Chronologies: In PowerSimulations.jl, chronologies define where information is flowing. There are two types of chronologies. 1) inter-stage chronologies (InterProblemChronology) that define how information flows between stages. e.g. day-ahead solutions are used to inform economic dispatch problems; and 2) intra-stage chronologies (IntraProblemChronology) that define how information flows between multiple executions of a single stage. e.g. the dispatch setpoints of the first period of an economic dispatch problem are constrained by the ramping limits from setpoints in the final period of the previous problem.","category":"page"},{"location":"modeler_guide/definitions/#D","page":"Definitions","title":"D","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Decision Problem: A decision problem calculates the desired system operation based on forecasts of uncertain inputs and information about the state of the system. The output of a decision problem represents the policies used to drive the set-points of the system's devices, like generators or switches, and depends on the purpose of the problem. See the Decision Model Tutorial to learn more about solving individual problems.\nDevice Formulation: The model of a device that is incorporated into a large system optimization models. For instance, the storage device model used inside of a Unit Commitment (UC) problem. A device model needs to follow some requirements to be integrated into operation problems. For more information about valid DeviceModels and their mathematical representations, check out the Formulation Library.","category":"page"},{"location":"modeler_guide/definitions/#E","page":"Definitions","title":"E","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Emulation Problem: An emulation problem is used to mimic the system's behavior subject to an incoming decision and the realization of a forecasted inputs. The solution of the emulator produces outputs representative of the system performance when operating subject the policies resulting from the decision models.","category":"page"},{"location":"modeler_guide/definitions/#F","page":"Definitions","title":"F","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"FeedForward: The definition of exactly what information is passed using the defined chronologies is accomplished using FeedForwards. Specifically, a FeedForward is used to define what to do with information being passed with an inter-stage chronology in a Simulation. The most common FeedForward is the SemiContinuousFeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the (already solved) unit-commitment variables.","category":"page"},{"location":"modeler_guide/definitions/#H","page":"Definitions","title":"H","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Horizon: The number of steps in the look-ahead of a decision problem. For instance, a Day-Ahead problem usually has a 48 step horizon. Check the time Time Series Data Section in PowerSystems.jl","category":"page"},{"location":"modeler_guide/definitions/#I","page":"Definitions","title":"I","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Interval: The amount of time between updates to the decision problem. For instance, Day-Ahead problems usually have a 24-hour intervals and Real-Time problems have 5-minute intervals. Check the time Time Series Data Section in PowerSystems.jl","category":"page"},{"location":"modeler_guide/definitions/#R","page":"Definitions","title":"R","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Resolution: The amount of time between time steps in a simulation. For instance 1-hour or 5-minutes. In Julia these are defined using the syntax Hour(1) and Minute(5). Check the time Time Series Data Section in PowerSystems.jl\nResults vs Realized Results: In PowerSimulations.jl the term results is used to refer to the solution of all optimization problems in a Simulation. When using read_variable(results, Variable) in a DecisionModel of a simulation, the output is a dictionary with the values of such variable for every optimization problem solved, while read_realized_variable(results, Variable) will return the values of the specified interval and number of steps in the simulation. See the Read Results page for more details.","category":"page"},{"location":"modeler_guide/definitions/#S","page":"Definitions","title":"S","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Service Formulation: The model of a service that is incorporated into a large system optimization models. Services (or ancillary services) are models used to ensure that there is necessary support to the power grid from generators to consumers, in order to ensure reliable operation of the system. The most common application for ancillary services are reserves, i.e., generation (or load) that is not currently being used, but can be quickly made available in case of unexpected changes of grid conditions, for example a sudden loss of load or generation. A service model needs to follow some requirements to be integrated into operation problems. For more information about valid ServiceModels and their mathematical representations, check out the Formulation Library.\nSimulation: A simulation is a pre-determined sequence of decision problems in a way that solving it, resembles the solution procedures commonly used by operators. The most common simulation model is the solution of a Unit Commitment and Economic Dispatch sequence of problems.\nSolver: A solver is a software package that incorporates algorithms for finding solutions to one or more classes of optimization problem. For example, FICO Xpress is a commercial optimization solver for linear programming (LP), convex quadratic programming (QP) problems, convex quadratically constrained quadratic programming (QCQP), second-order cone programming (SOCP) and their mixed integer counterparts. A solver is required to be specified in order to solve any computer optimization problem.","category":"page"},{"location":"modeler_guide/definitions/#T","page":"Definitions","title":"T","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Template: A ProblemTemplate is just a collection of DeviceModels that allows the user to specify the formulations of each set of devices (by device type) independently so that the modeler can adjust the level of detail according to the question of interest and the available data. For more information about valid DeviceModels and their mathematical representations, check out the Formulation Library.","category":"page"},{"location":"modeler_guide/psi_structure/#psi_structure","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"","category":"section"},{"location":"modeler_guide/psi_structure/","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"PowerSimulations enables the simulation of a sequence of power systems optimization problems and provides user control over each aspect of the simulation configuration. Specifically:","category":"page"},{"location":"modeler_guide/psi_structure/","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"mathematical formulations can be selected for each component with DeviceModel and ServiceModel\na problem can be defined by creating model entries in a Operations ProblemTemplates\nmodels (DecisionModel or EmulationModel) can be built by applying a ProblemTemplate to a System and can be executed/solved in isolation or as part of a Simulation\nSimulations can be defined and executed by sequencing one or more models and defining how and when data flows between models.","category":"page"},{"location":"modeler_guide/psi_structure/","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"question: What is the difference between a Model and a Problem?\nA \"Problem\" is an abstract mathematical description of how to represent power system behavior, whereas a \"Model\" is a concrete representation of a \"Problem\" applied to a dataset. I.e. once a Problem is populated with data describing all the loads, generators, lines, etc., it becomes a Model.","category":"page"},{"location":"formulation_library/General/#formulation_library","page":"General","title":"Formulations","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Modeling formulations are created by dispatching on abstract subtypes of PowerSimulations.AbstractDeviceFormulation","category":"page"},{"location":"formulation_library/General/#FixedOutput","page":"General","title":"FixedOutput","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"FixedOutput","category":"page"},{"location":"formulation_library/General/#PowerSimulations.FixedOutput","page":"General","title":"PowerSimulations.FixedOutput","text":"Formulation type to augment the power balance constraint expression with a time series parameter\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Variables:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"No variables are created for DeviceModel(<:DeviceType, FixedOutput)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Static Parameters:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"ThermalGen:\nP^textthmax = PowerSystems.get_max_active_power(device)\nQ^textthmax = PowerSystems.get_max_reactive_power(device)\nStorage:\nP^textstmax = PowerSystems.get_max_active_power(device)\nQ^textstmax = PowerSystems.get_max_reactive_power(device)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"using PowerSimulations\nusing HydroPowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombo_tables = []\nfor t in [RenewableGen, ThermalGen, HydroGen, ElectricLoad]\n combos = PowerSimulations.get_default_time_series_names(t, FixedOutput)\n combo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n )\n insertcols!(combo_table, 1, \"Device Type\" => fill(string(t), length(combos)))\n push!(combo_tables, combo_table)\nend\nmdtable(vcat(combo_tables...); latex = false)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Objective:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"No objective terms are created for DeviceModel(<:DeviceType, FixedOutput)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Expressions:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Adds the active and reactive parameters listed for specific device types above to the respective active and reactive power balance expressions created by the selected Network Formulations.","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Constraints:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"No constraints are created for DeviceModel(<:DeviceType, FixedOutput)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"","category":"page"},{"location":"formulation_library/General/#FunctionData-Options","page":"General","title":"FunctionData Options","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"PowerSimulations can represent variable costs using a variety of different methods depending on the data available in each device. The following describes the objective function terms that are populated for each variable cost option.","category":"page"},{"location":"formulation_library/General/#LinearFunctionData","page":"General","title":"LinearFunctionData","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"variable_cost = LinearFunctionData(c): creates a fixed marginal cost term in the objective function","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t c * G_t\nendaligned","category":"page"},{"location":"formulation_library/General/#QuadraticFunctionData-and-PolynomialFunctionData","page":"General","title":"QuadraticFunctionData and PolynomialFunctionData","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"variable_cost::QuadraticFunctionData and variable_cost::PolynomialFunctionData: create a polynomial cost term in the objective function","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t sum_n C_n * G_t^n\nendaligned","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"where","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"For QuadraticFunctionData:\nC_0 = get_constant_term(variable_cost)\nC_1 = get_proportional_term(variable_cost)\nC_2 = get_quadratic_term(variable_cost)\nFor PolynomialFunctionData:\nC_n = get_coefficients(variable_cost)[n]","category":"page"},{"location":"formulation_library/General/#andPiecewiseLinearSlopeData","page":"General","title":"`andPiecewiseLinearSlopeData`","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"variable_cost::PiecewiseLinearData and variable_cost::PiecewiseLinearSlopeData: create a piecewise linear cost term in the objective function","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t f(G_t)\nendaligned","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"where","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"For variable_cost::PiecewiseLinearData, f(x) is the piecewise linear function obtained by connecting the (x, y) points get_points(variable_cost) in order.\nFor variable_cost = PiecewiseLinearSlopeData([x0, x1, x2, ...], y0, [s0, s1, s2, ...]), f(x) is the piecewise linear function obtained by starting at (x0, y0), drawing a segment at slope s0 to x=x1, drawing a segment at slope s1 to x=x2, etc.\n","category":"page"},{"location":"formulation_library/General/#StorageCost","page":"General","title":"StorageCost","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Adds an objective function cost term according to:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t quad E^surplus_t * C^penalty - E^shortage_t * C^value\nendaligned","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Impact of different cost configurations:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"The following table describes all possible configurations of the StorageCost with the target constraint in hydro or storage device models. Cases 1(a) & 2(a) will not impact the model's operations, and the target constraint will be rendered useless. In most cases that have no energy target and a non-zero value for C^value, if this cost is too high (C^value 0) or too low (C^value 0) can result in either the model holding on to stored energy till the end of the model not storing any energy in the device. This is caused by the fact that when the energy target is zero, we have E_t = - E^shortage_t, and - E^shortage_t * C^value in the objective function is replaced by E_t * C^value, thus resulting in C^value to be seen as the cost of stored energy.","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Case Energy Target Energy Shortage Cost Energy Value / Energy Surplus cost Effect\nCase 1(a) hatE=0 C^penalty=0 C^value=0 no change\nCase 1(b) hatE=0 C^penalty=0 C^value0 penalty for storing energy\nCase 1(c) hatE=0 C^penalty0 C^value=0 no penalties or incentives applied\nCase 1(d) hatE=0 C^penalty=0 C^value0 incentive for storing energy\nCase 1(e) hatE=0 C^penalty0 C^value0 penalty for storing energy\nCase 1(f) hatE=0 C^penalty0 C^value0 incentive for storing energy\nCase 2(a) hatE0 C^penalty=0 C^value=0 no change\nCase 2(b) hatE0 C^penalty=0 C^value0 penalty on energy storage in excess of target\nCase 2(c) hatE0 C^penalty0 C^value=0 penalty on energy storage short of target\nCase 2(d) hatE0 C^penalty=0 C^value0 incentive on excess energy\nCase 2(e) hatE0 C^penalty0 C^value0 penalty on both excess/shortage of energy\nCase 2(f) hatE0 C^penalty0 C^value0 penalty for shortage, incentive for excess energy","category":"page"},{"location":"modeler_guide/logging/#Logging","page":"Logging","title":"Logging","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"PowerSimulations.jl will output many log messages when building systems and running simulations. You may want to customize what gets logged to the console and, optionally, a file.","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"By default all log messages of level Logging.Info or higher will get displayed to the console. When you run a simulation a simulation-specific logger will take over and log its messages to a file in the logs directory in the simulation output directory. When finished it will relinquish control back to the global logger.","category":"page"},{"location":"modeler_guide/logging/#Configuring-the-global-logger","page":"Logging","title":"Configuring the global logger","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"To configure the global logger in a Jupyter Notebook or REPL you may configure your own logger with the Julia Logging standard library or use the convenience function provided by PowerSimulations. This example will log messages of level Logging.Error to console and Logging.Info and higher to the file power-simulations.log in the current directory.","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"import Logging\nusing PowerSimulations\nlogger = configure_logging(;\n console_level = Logging.Error,\n file_level = Logging.Info,\n filename = \"power-simulations.log\",\n)","category":"page"},{"location":"modeler_guide/logging/#Configuring-the-simulation-logger","page":"Logging","title":"Configuring the simulation logger","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"You can configure the logging level used by the simulation logger when you call build!(simulation). Here is an example that increases logging verbosity:","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"import Logging\nusing PowerSimulations\nsimulation = Simulation(...)\nbuild!(simulation; console_level = Logging.Info, file_level = Logging.Debug)","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"The log file will be located at ///logs/simulation.log.","category":"page"},{"location":"modeler_guide/logging/#Solver-logs","page":"Logging","title":"Solver logs","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"You can configure logging for the solver you use. Refer to the solver documentation. PowerSimulations does not redirect or intercept prints to stdout or stderr from other libraries.","category":"page"},{"location":"modeler_guide/logging/#Recorder-events","page":"Logging","title":"Recorder events","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"PowerSimulations uses the InfrastructureSystems.Recorder to store simulation events in a log file. Refer to this link for more information.","category":"page"},{"location":"formulation_library/RenewableGen/#PowerSystems.RenewableGen-Formulations","page":"Renewable Generation","title":"PowerSystems.RenewableGen Formulations","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Renewable generation formulations define the optimization models that describe renewable units mathematical model in different operational settings, such as economic dispatch and unit commitment.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"note: Note\nReserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.","category":"page"},{"location":"formulation_library/RenewableGen/#Table-of-contents","page":"Renewable Generation","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"RenewableFullDispatch\nRenewableConstantPowerFactor\nValid configurations","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"","category":"page"},{"location":"formulation_library/RenewableGen/#RenewableFullDispatch","page":"Renewable Generation","title":"RenewableFullDispatch","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"RenewableFullDispatch","category":"page"},{"location":"formulation_library/RenewableGen/#PowerSimulations.RenewableFullDispatch","page":"Renewable Generation","title":"PowerSimulations.RenewableFullDispatch","text":"Formulation type to add injection variables constrained by a maximum injection time series for RenewableGen\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Variables:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textre\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textre","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"P^textremin = PowerSystems.get_active_power_limits(device).min\nQ^textremin = PowerSystems.get_reactive_power_limits(device).min\nQ^textremax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Uses the max_active_power timeseries parameter to limit the available active power at each time-step.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(RenewableGen, RenewableFullDispatch)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Objective:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as - p^textre to incentivize generation from RenewableGen devices.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Adds p^textre and q^textre terms to the respective active and reactive power balance expressions created by the selected Network Formulations.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"beginaligned\n P^textremin le p_t^textre le textActivePowerTimeSeriesParameter_t quad forall t in 1dots T \n Q^textremin le q_t^textre le Q^textremax quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"","category":"page"},{"location":"formulation_library/RenewableGen/#RenewableConstantPowerFactor","page":"Renewable Generation","title":"RenewableConstantPowerFactor","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"RenewableConstantPowerFactor","category":"page"},{"location":"formulation_library/RenewableGen/#PowerSimulations.RenewableConstantPowerFactor","page":"Renewable Generation","title":"PowerSimulations.RenewableConstantPowerFactor","text":"Formulation type to add real and reactive injection variables with constant power factor with maximum real power injections constrained by a time series for RenewableGen\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Variables:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_active_power(device)\nSymbol: p^textre\nReactivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_reactive_power(device)\nSymbol: q^textre","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"P^textremin = PowerSystems.get_active_power_limits(device).min\nQ^textremin = PowerSystems.get_reactive_power_limits(device).min\nQ^textremax = PowerSystems.get_reactive_power_limits(device).max\ntextpf = PowerSystems.get_power_factor(device)","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(\n RenewableGen,\n RenewableConstantPowerFactor,\n)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Objective:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as - p_t^textre to incentivize generation from RenewableGen devices.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Adds p^textre and q^textre terms to the respective active and reactive power balance expressions created by the selected Network Formulations","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"beginaligned\n P^textremin le p_t^textre le textActivePowerTimeSeriesParameter_t quad forall t in 1dots T \n q_t^textre = textpf cdot p_t^textre quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"","category":"page"},{"location":"formulation_library/RenewableGen/#Valid-configurations","page":"Renewable Generation","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Valid DeviceModels for subtypes of RenewableGen include the following:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> x[\"device_type\"] <: RenewableGen, combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/#service_formulations","page":"Services","title":"PowerSystems.Service Formulations","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Services (or ancillary services) are models used to ensure that there is necessary support to the power grid from generators to consumers, in order to ensure reliable operation of the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"The most common application for ancillary services are reserves, i.e., generation (or load) that is not currently being used, but can be quickly made available in case of unexpected changes of grid conditions, for example a sudden loss of load or generation.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A key challenge of adding services to a system, from a mathematical perspective, is specifying which units contribute to the specified requirement of a service, that implies the creation of new variables (such as reserve variables) and modification of constraints.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"In this documentation, we first specify the available Services in the grid, and what requirements impose in the system, and later we discuss the implication on device formulations for specific units.","category":"page"},{"location":"formulation_library/Service/#Table-of-contents","page":"Services","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RangeReserve\nStepwiseCostReserve\nGroupReserve\nRampReserve\nNonSpinningReserve\nConstantMaxInterfaceFlow\nVariableMaxInterfaceFlow\nChanges on Expressions","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#RangeReserve","page":"Services","title":"RangeReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RangeReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.RangeReserve","page":"Services","title":"PowerSimulations.RangeReserve","text":"Struct for to add reserves to be larger than a specified requirement\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type RangeReserve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nDefault proportional cost: 10 textSystemBasePower\nSymbol: r_d for d in contributing devices to the service s If slacks are enabled:\nReserveRequirementSlack:\nBounds: [0.0, ]\nDefault proportional cost: 1e5\nSymbol: r^textsl","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Depending on the PowerSystems.jl type associated to the RangeReserve formulation model, the parameters are:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textPF = PowerSystems.get_max_participation_factor(service)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a ConstantReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textReq = PowerSystems.get_requirement(service)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a VariableReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(VariableReserve, RangeReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add a large proportional cost to the objective function if slack variables are used + r^textsl cdot 10^5. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A RangeReserve implements two fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RangeReserve requirement. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt + r_t^textsl ge textReqquad forall tin 1dots T quad text(for a ConstantReserve) \nsum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T quad text(for a VariableReserve)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"In addition, there is a restriction on how much each contributing device d can contribute to the requirement, based on the max participation factor allowed.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le textReq cdot textPF quad forall din mathcalD_s forall tin 1dots T quad text(for a ConstantReserve) \nr_dt le textRequirementTimeSeriesParameter_t cdot textPFquad forall din mathcalD_s forall tin 1dots T quad text(for a VariableReserve)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#StepwiseCostReserve","page":"Services","title":"StepwiseCostReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Service must be used with ReserveDemandCurve PowerSystems.jl type. This service model is used to model ORDC (Operating Reserve Demand Curve) in ERCOT.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"StepwiseCostReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.StepwiseCostReserve","page":"Services","title":"PowerSimulations.StepwiseCostReserve","text":"Struct for to add reserves to be larger than a variable requirement depending of costs\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type ReserveDemandCurve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nSymbol: r_d for d in contributing devices to the service s\nServiceRequirementVariable:\nBounds: [0.0, ]\nSymbol: textreq","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a ReserveDemandCurve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos =\n PowerSimulations.get_default_time_series_names(ReserveDemandCurve, StepwiseCostReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"The ServiceRequirementVariable is added as a piecewise linear cost based on the decreasing offers listed in the variable_cost time series. These decreasing cost represent the scarcity prices of not having sufficient reserves. For example, if the variable textreq = 0, then a really high cost is paid for not having enough reserves, and if textreq is larger, then a lower cost (or even zero) is paid.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A StepwiseCostReserve implements a single constraint, such that the sum of all reserves of contributing devices must be larger than the ServiceRequirementVariable variable. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt ge textreq_tquad forall tin 1dots T ","category":"page"},{"location":"formulation_library/Service/#GroupReserve","page":"Services","title":"GroupReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Service must be used with ConstantReserveGroup PowerSystems.jl type. This service model is used to model an aggregation of services.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"GroupReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.GroupReserve","page":"Services","title":"PowerSimulations.GroupReserve","text":"Struct to add reserves to be larger than a specified requirement for an aggregated collection of services\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type GroupReserve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"No variables are created, but the services associated with the GroupReserve must have created variables.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textReq = PowerSystems.get_requirement(service)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalS_s = PowerSystems.get_contributing_services(system, service): Set (vector) of all contributing services to the group service s in the system.\nmathcalD_s_i = PowerSystems.get_contributing_devices(system, service_aux): Set (vector) of all contributing devices to the service s_i in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Does not modify the objective function, besides the changes to the objective function due to the other services associated to the group service.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"No changes, besides the changes to the expressions due to the other services associated to the group service.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A GroupReserve implements that the sum of all reserves of contributing devices, of all contributing services, must be larger than the GroupReserve requirement. Thus, for a GroupReserve service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s_i sum_i in mathcalS_s r_dt ge textReqquad forall tin 1dots T ","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#RampReserve","page":"Services","title":"RampReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RampReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.RampReserve","page":"Services","title":"PowerSimulations.RampReserve","text":"Struct to add reserves to be larger than a specified requirement, with ramp constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type RampReserve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nDefault proportional cost: 10 textSystemBasePower\nSymbol: r_d for d in contributing devices to the service s If slacks are enabled:\nReserveRequirementSlack:\nBounds: [0.0, ]\nDefault proportional cost: 1e5\nSymbol: r^textsl","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RampReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textTF = PowerSystems.get_time_frame(service)\nR^textthup = PowerSystems.get_ramp_limits(device).up for thermal contributing devices\nR^textthdn = PowerSystems.get_ramp_limits(device).down for thermal contributing devices","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a VariableReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(VariableReserve, RampReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add a large proportional cost to the objective function if slack variables are used + r^textsl cdot 10^5. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A RampReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RampReserve requirement. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Finally, there is a restriction based on the ramp limits of the contributing devices:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le R^textthup cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveUp) \nr_dt le R^textthdn cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveDown)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#NonSpinningReserve","page":"Services","title":"NonSpinningReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"NonSpinningReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.NonSpinningReserve","page":"Services","title":"PowerSimulations.NonSpinningReserve","text":"Struct to add non spinning reserve requirements larger than specified requirement\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type NonSpinningReserve, the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nDefault proportional cost: 10 textSystemBasePower\nSymbol: r_d for d in contributing devices to the service s If slacks are enabled:\nReserveRequirementSlack:\nBounds: [0.0, ]\nDefault proportional cost: 1e5\nSymbol: r^textsl","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"NonSpinningReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textPF = PowerSystems.get_max_participation_factor(service)\ntextTF = PowerSystems.get_time_frame(service)\nP^textthmin = PowerSystems.get_active_power_limits(device).min for thermal contributing devices\nT^textstup = PowerSystems.get_time_limits(d).up for thermal contributing devices\nR^textthup = PowerSystems.get_ramp_limits(device).down for thermal contributing devices","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Other parameters:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Delta T: Resolution of the problem in minutes.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a VariableReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(VariableReserve, NonSpinningReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add a large proportional cost to the objective function if slack variables are used + r^textsl cdot 10^5. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A NonSpinningReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the NonSpinningReserve requirement. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"In addition, there is a restriction on how much each contributing device d can contribute to the requirement, based on the max participation factor allowed.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le textRequirementTimeSeriesParameter_t cdot textPFquad forall din mathcalD_s forall tin 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Finally, there is a restriction based on the reserve response time for the non-spinning reserve if the unit is off. To do so, compute R^textlimit_d as the reserve response limit as:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"R^textlimit_d = begincases\n0 text if TF le T^textstup_d \nP^textthmin_d + (textTF_s - T^textstup_d) cdot R^textthup_d Delta T cdot R^textthup_d text if TF T^textstup_d\nendcases quad forall din mathcalD_s","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Then, the constraint depends on the commitment variable u_t^textth as:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le (1 - u_dt^textth) cdot R^textlimit_d quad forall d in mathcalD_s forall t in 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#ConstantMaxInterfaceFlow","page":"Services","title":"ConstantMaxInterfaceFlow","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ConstantMaxInterfaceFlow","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.ConstantMaxInterfaceFlow","page":"Services","title":"PowerSimulations.ConstantMaxInterfaceFlow","text":"Struct to add a constant maximum transmission flow for specified interface\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"If slacks are used:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"InterfaceFlowSlackUp:\nBounds: [0.0, ]\nSymbol: f^textslup\nInterfaceFlowSlackDown:\nBounds: [0.0, ]\nSymbol: f^textsldn","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmax = PowerSystems.get_active_power_flow_limits(service).max\nF^textmin = PowerSystems.get_active_power_flow_limits(service).min\nC^textflow = PowerSystems.get_violation_penalty(service)\nmathcalM_s = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction (textDir_d = 1 or textDir_d = -1) with respect to the interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add the violation penalty proportional cost to the objective function if slack variables are used + (f^textslup + f^textsldn) cdot C^textflow.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmin le f^textslup_t - f^textsldn_t + sum_dinmathcalD_s textDir_d f_dt le F^textmax quad forall t in 1dotsT","category":"page"},{"location":"formulation_library/Service/#VariableMaxInterfaceFlow","page":"Services","title":"VariableMaxInterfaceFlow","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"VariableMaxInterfaceFlow","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.VariableMaxInterfaceFlow","page":"Services","title":"PowerSimulations.VariableMaxInterfaceFlow","text":"Struct to add a variable maximum transmission flow for specified interface\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"If slacks are used:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"InterfaceFlowSlackUp:\nBounds: [0.0, ]\nSymbol: f^textslup\nInterfaceFlowSlackDown:\nBounds: [0.0, ]\nSymbol: f^textsldn","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmax = PowerSystems.get_active_power_flow_limits(service).max\nF^textmin = PowerSystems.get_active_power_flow_limits(service).min\nC^textflow = PowerSystems.get_violation_penalty(service)\nmathcalM_s = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction (textDir_d = 1 or textDir_d = -1) with respect to the interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a TransmissionInterface PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(\n TransmissionInterface,\n VariableMaxInterfaceFlow,\n)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add the violation penalty proportional cost to the objective function if slack variables are used + (f^textslup + f^textsldn) cdot C^textflow.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmin cdot textMinInterfaceFlowLimitParameter_t le f^textslup_t - f^textsldn_t + sum_dinmathcalD_s textDir_d f_dt le F^textmaxcdot textMaxInterfaceFlowLimitParameter_t quad forall t in 1dotsT","category":"page"},{"location":"formulation_library/Service/#Changes-on-Expressions-due-to-Service-models","page":"Services","title":"Changes on Expressions due to Service models","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"It is important to note that by adding a service to a Optimization Problem, variables for each contributing device must be created. For example, for every contributing generator d in mathcalD that is participating in services s_1s_2s_3, it is required to create three set of ActivePowerReserveVariable variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_s_1dt r_s_2dt r_s_3dtquad forall d in mathcalD forall t in 1dots T","category":"page"},{"location":"formulation_library/Service/#Changes-on-UpperBound-(UB)-and-LowerBound-(LB)-limits","page":"Services","title":"Changes on UpperBound (UB) and LowerBound (LB) limits","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Each contributing generator d has active power limits that the reserve variables affect. In simple terms, the limits are implemented using expressions ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB as:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t le P^textmax \ntextActivePowerRangeExpressionLB_t ge P^textmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ReserveUp type variables contribute to the upper bound expression, while ReserveDown variables contribute to the lower bound expressions. So if s_1s_2 are ReserveUp services, and s_3 is a ReserveDown service, then for a thermal generator d using a ThermalStandardDispatch:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"beginalign*\n p_dt^textth + r_s_1dt + r_s_2dt le P^textthmaxquad forall din mathcalD^textth forall t in 1dotsT \n p_dt^textth - r_s_3dt ge P^textthminquad forall din mathcalD^textth forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"while for a renewable generator d using a RenewableFullDispatch:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"beginalign*\n p_dt^textre + r_s_1dt + r_s_2dt le textActivePowerTimeSeriesParameter_tquad forall din mathcalD^textre forall t in 1dotsT\n p_dt^textre - r_s_3dt ge 0quad forall din mathcalD^textre forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/Service/#Changes-in-Ramp-limits","page":"Services","title":"Changes in Ramp limits","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For the case of Ramp Limits (of formulation that model these limits), the reserve variables only affect the current time, and not the previous time. Then, for the same example as before:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"beginalign*\n p_dt^textth + r_s_1dt + r_s_2dt - p_dt-1^textthle R^textthupquad forall din mathcalD^textth forall t in 1dotsT\n p_dt^textth - r_s_3dt - p_dt-1^textth ge -R^textthdnquad forall din mathcalD^textth forall t in 1dotsT\nendalign*","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/#Structure-of-an-operations-problem-model","page":"Operation Problem Structure","title":"Structure of an operations problem model","text":"","category":"section"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"In most cases operation problem models are optimization models. Although in PowerSimulations.jl it is possible to define arbitrary problems that can reflect heuristic decision rules, this is not the common case. This page focuses on explaining the structure of operations problems that employ an optimization problem and solver.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"The first aspect to consider when thinking about developing a model compatible with PowerSimulations.jl is that although we support all of JuMP.jl objects, you need to employ anonymous constraints and variables in JuMP and register the constraints, variables and other optimization objects into PowerSimulations.jl's optimization container. Otherwise the features to use your problem in the simulation like the coordination with other problems and post processing won't work.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"info: Info\nThe requirements for the simulation of Power Systems operations are more strict than solving an optimization problem once with just JuMP.jl. The requirements imposed by PowerSimulations.jl to integrate your models in a simulation are designed to help with other complex operations that go beyond JuMP.jl scope.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"warning: Warning\nAll the code in this page is considered \"pseudo-code\". Copy-paste will likely not work out of the box. You need to develop the internals of the functions correctly for the examples below to work.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/#Registering-a-variable-in-the-model","page":"Operation Problem Structure","title":"Registering a variable in the model","text":"","category":"section"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"To register a variable in the model, the developer must first allocate the container into the optimization container and then populate it. For example, it require start the build function as follows:","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"info: Info\nWe recommend calling import PowerSimulations and defining the constant CONST PSI = PowerSimulations to make it easier to read the code and determine which package is responsible for defining the functions.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"function PSI.build_model!(model::PSI.DecisionModel{MyCustomModel})\n container = PSI.get_optimization_container(model)\n PSI.set_time_steps!(container, 1:24)\n\n # Create the container for the variable\n variable = PSI.add_variable_container!(\n container,\n PSI.ActivePowerVariable(), # <- This variable is defined in PowerSimulations but the user can define their own\n PSY.ThermalGeneration, # <- Device type for the variable. Can be from PSY or custom defined\n devices_names, # <- First container dimension\n time_steps, # <- Second container dimension\n )\n\n # Iterate over the devices and time to store the JuMP variables into the container.\n for t in time_steps, d in devices\n name = PSY.get_name(d)\n variable[name, t] = JuMP.@variable(get_jump_model(container))\n # It is possible to use PSY getter functions to retrieve data from the generators\n # Any other variable property can be specified inside this loop.\n JuMP.set_upper_bound(variable[name, t], UB_DATA) # <- Optional\n JuMP.set_lower_bound(variable[name, t], LB_DATA) # <- Optional\n end\n\n return\nend","category":"page"},{"location":"model_developer_guide/troubleshooting/#Troubleshooting-model-development","page":"Troubleshooting","title":"Troubleshooting model development","text":"","category":"section"},{"location":"formulation_library/README/#Formulation-documentation-guide","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"","category":"section"},{"location":"formulation_library/README/","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"Formulation documentation should roughly follow the template established by RenewableGen.md","category":"page"},{"location":"formulation_library/README/#Auto-generated-items","page":"Formulation documentation guide","title":"Auto generated items","text":"","category":"section"},{"location":"formulation_library/README/","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"Valid DeviceModel table: just change the device category in the filter function\nTime Series Parameters: just change the device category and formulation in the get_default_time_series_names method call","category":"page"},{"location":"formulation_library/README/#Linked-items","page":"Formulation documentation guide","title":"Linked items","text":"","category":"section"},{"location":"formulation_library/README/","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"Formulations in the Valid DeviceModel table must have a docstring in src/core/formulations.jl\nThe Formulation in the @docs block must have a docstring in src/core/formulations.jl\nThe Variables must have docstrings in src/core/variables.jl \nThe Time Series Parameters must have docstrings in src/core/parameters.jl","category":"page"},{"location":"tutorials/pcm_simulation/#pcm_tutorial","page":"Multi-stage Production Cost Simulation","title":"Sequential Simulations with PowerSimulations.jl","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Originally Contributed by: Clayton Barrows","category":"page"},{"location":"tutorials/pcm_simulation/#Introduction","page":"Multi-stage Production Cost Simulation","title":"Introduction","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"PowerSimulations.jl supports simulations that consist of sequential optimization problems where results from previous problems inform subsequent problems in a variety of ways. This example demonstrates some of these capabilities to represent electricity market clearing. This example is intended to be an extension of the OperationsProblem tutorial.","category":"page"},{"location":"tutorials/pcm_simulation/#Load-Packages","page":"Multi-stage Production Cost Simulation","title":"Load Packages","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"using PowerSystems\nusing PowerSimulations\nusing HydroPowerSimulations\nconst PSI = PowerSimulations\nusing PowerSystemCaseBuilder\nusing Dates\nusing HiGHS #solver","category":"page"},{"location":"tutorials/pcm_simulation/#Optimizer","page":"Multi-stage Production Cost Simulation","title":"Optimizer","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"It's most convenient to define an optimizer instance upfront and pass it into the DecisionModel constructor. For this example, we can use the free HiGHS solver with a relatively relaxed MIP gap (ratioGap) setting to improve speed.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"solver = optimizer_with_attributes(HiGHS.Optimizer, \"mip_rel_gap\" => 0.5)","category":"page"},{"location":"tutorials/pcm_simulation/#Hourly-day-ahead-system","page":"Multi-stage Production Cost Simulation","title":"Hourly day-ahead system","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"First, we'll create a System with hourly data to represent day-ahead forecasted wind, solar, and load profiles:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"sys_DA = build_system(PSISystems, \"modified_RTS_GMLC_DA_sys\"; skip_serialization = true)","category":"page"},{"location":"tutorials/pcm_simulation/#5-Minute-system","page":"Multi-stage Production Cost Simulation","title":"5-Minute system","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"The RTS data also includes 5-minute resolution time series data. So, we can create another System to represent 15 minute ahead forecasted data for a \"real-time\" market:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"sys_RT = build_system(PSISystems, \"modified_RTS_GMLC_RT_sys\"; skip_serialization = true)","category":"page"},{"location":"tutorials/pcm_simulation/#ProblemTemplates-define-stages","page":"Multi-stage Production Cost Simulation","title":"ProblemTemplates define stages","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Sequential simulations in PowerSimulations are created by defining OperationsProblems that represent stages, and how information flows between executions of a stage and between different stages.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Let's start by defining a two stage simulation that might look like a typical day-Ahead and real-time electricity market clearing process.","category":"page"},{"location":"tutorials/pcm_simulation/#Day-ahead-unit-commitment-stage","page":"Multi-stage Production Cost Simulation","title":"Day-ahead unit commitment stage","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"First, we can define a unit commitment template for the day ahead problem. We can use the included UC template, but in this example, we'll replace the ThermalBasicUnitCommitment with the slightly more complex ThermalStandardUnitCommitment for the thermal generators.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"template_uc = template_unit_commitment()\nset_device_model!(template_uc, ThermalStandard, ThermalStandardUnitCommitment)\nset_device_model!(template_uc, HydroDispatch, HydroDispatchRunOfRiver)","category":"page"},{"location":"tutorials/pcm_simulation/#Define-the-reference-model-for-the-real-time-economic-dispatch","page":"Multi-stage Production Cost Simulation","title":"Define the reference model for the real-time economic dispatch","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"In addition to the manual specification process demonstrated in the OperationsProblem example, PSI also provides pre-specified templates for some standard problems:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"template_ed = template_economic_dispatch(;\n network = NetworkModel(PTDFPowerModel; use_slacks = true),\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Define-the-SimulationModels","page":"Multi-stage Production Cost Simulation","title":"Define the SimulationModels","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"DecisionModels define the problems that are executed in the simulation. The actual problem will change as the stage gets updated to represent different time periods, but the formulations applied to the components is constant within a stage. In this case, we want to define two stages with the ProblemTemplates and the Systems that we've already created.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"models = SimulationModels(;\n decision_models = [\n DecisionModel(template_uc, sys_DA; optimizer = solver, name = \"UC\"),\n DecisionModel(template_ed, sys_RT; optimizer = solver, name = \"ED\"),\n ],\n)","category":"page"},{"location":"tutorials/pcm_simulation/#SimulationSequence","page":"Multi-stage Production Cost Simulation","title":"SimulationSequence","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Similar to an ProblemTemplate, the SimulationSequence provides a template of how to execute a sequential set of operations problems.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Let's review some of the SimulationSequence arguments.","category":"page"},{"location":"tutorials/pcm_simulation/#Chronologies","page":"Multi-stage Production Cost Simulation","title":"Chronologies","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"In PowerSimulations, chronologies define where information is flowing. There are two types of chronologies.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"inter-stage chronologies: Define how information flows between stages. e.g. day-ahead solutions are used to inform economic dispatch problems\nintra-stage chronologies: Define how information flows between multiple executions of a single stage. e.g. the dispatch setpoints of the first period of an economic dispatch problem are constrained by the ramping limits from setpoints in the final period of the previous problem.","category":"page"},{"location":"tutorials/pcm_simulation/#FeedForward","page":"Multi-stage Production Cost Simulation","title":"FeedForward","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"The definition of exactly what information is passed using the defined chronologies is accomplished with FeedForward. Specifically, FeedForward is used to define what to do with information being passed with an inter-stage chronology. Let's define a FeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the unit-commitment variables.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"feedforward = Dict(\n \"ED\" => [\n SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n ),\n ],\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Sequencing","page":"Multi-stage Production Cost Simulation","title":"Sequencing","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"The stage problem length, look-ahead, and other details surrounding the temporal Sequencing of stages are controlled using the structure of the time series data in the Systems. So, to define a typical day-ahead - real-time sequence:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Day ahead problems should represent 48 hours, advancing 24 hours after each execution (24-hour look-ahead)\nReal time problems should represent 1 hour (12 5-minute periods), advancing 15 min after each execution (15 min look-ahead)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"We can adjust the time series data to reflect this structure in each System:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"transform_single_time_series!(sys_DA, 48, Hour(1))\ntransform_single_time_series!(sys_RT, 12, Minute(15))","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Now we can put it all together to define a SimulationSequence","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"DA_RT_sequence = SimulationSequence(;\n models = models,\n ini_cond_chronology = InterProblemChronology(),\n feedforwards = feedforward,\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Simulation","page":"Multi-stage Production Cost Simulation","title":"Simulation","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Now, we can build and execute a simulation using the SimulationSequence and Stages that we've defined.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"path = mkdir(joinpath(\".\", \"rts-store\")) #hide\nsim = Simulation(;\n name = \"rts-test\",\n steps = 2,\n models = models,\n sequence = DA_RT_sequence,\n simulation_folder = joinpath(\".\", \"rts-store\"),\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Build-simulation","page":"Multi-stage Production Cost Simulation","title":"Build simulation","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"build!(sim)","category":"page"},{"location":"tutorials/pcm_simulation/#Execute-simulation","page":"Multi-stage Production Cost Simulation","title":"Execute simulation","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"the following command returns the status of the simulation (0: is proper execution) and stores the results in a set of HDF5 files on disk.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"execute!(sim; enable_progress_bar = false)","category":"page"},{"location":"tutorials/pcm_simulation/#Results","page":"Multi-stage Production Cost Simulation","title":"Results","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"To access the results, we need to load the simulation result metadata and then make requests to the specific data of interest. This allows you to efficiently access the results of interest without overloading resources.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"results = SimulationResults(sim);\nuc_results = get_decision_problem_results(results, \"UC\"); # UC stage result metadata\ned_results = get_decision_problem_results(results, \"ED\"); # ED stage result metadata","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"We can read all the result variables","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_variables(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"or all the parameters","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_parameters(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"We can just list the variable names contained in uc_results:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"list_variable_names(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"and a number of parameters (this pattern also works for aux_variables, expressions, and duals)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"list_parameter_names(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Now we can read the specific results of interest for a specific problem, time window (optional), and set of variables, duals, or parameters (optional)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Dict([\n v => read_variable(uc_results, v) for v in [\n \"ActivePowerVariable__RenewableDispatch\",\n \"ActivePowerVariable__HydroDispatch\",\n \"StopVariable__ThermalStandard\",\n ]\n])","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Or if we want the result of just one variable, parameter, or dual (must be defined in the problem definition), we can use:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_parameter(\n ed_results,\n \"ActivePowerTimeSeriesParameter__RenewableNonDispatch\";\n initial_time = DateTime(\"2020-01-01T06:00:00\"),\n count = 5,\n)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"info: Info\n","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"note that this returns the results of each execution step in a separate dataframe If you want the realized results (without lookahead periods), you can call read_realized_*:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_realized_variables(\n uc_results,\n [\"ActivePowerVariable__ThermalStandard\", \"ActivePowerVariable__RenewableDispatch\"],\n)\nrm(path; force = true, recursive = true) #hide","category":"page"},{"location":"tutorials/pcm_simulation/#Plotting","page":"Multi-stage Production Cost Simulation","title":"Plotting","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Take a look at the plotting capabilities in PowerGraphics.jl","category":"page"},{"location":"modeler_guide/running_a_simulation/#running_a_simulation","page":"Simulation","title":"Simulation","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"tip: Always try to solve the operations problem first before putting together the simulation\nIt is not uncommon that when trying to solve a complex simulation the resulting models are infeasible. This situation can be the result of many factors like the input data, the incorrect specification of the initial conditions for models with time dependencies or a poorly specified model. Therefore, it's highly recommended to run and analyze an Operations Problems that reflect the problems that will be included in a simulation prior to executing a simulation.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Check out the Operations Problem Tutorial","category":"page"},{"location":"modeler_guide/running_a_simulation/#Feedforward","page":"Simulation","title":"Feedforward","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The definition of exactly what information is passed using the defined chronologies is accomplished using FeedForwards.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Specifically, a FeedForward is used to define what to do with information being passed with an inter-stage chronology in a Simulation. The most common FeedForward is the SemiContinuousFeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the (already solved) unit-commitment variables.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The creation of a FeedForward requires at least to specify the component_type on which the FeedForward will be applied. The source variable specify which variable will be taken from the problem solved, for example the commitment variable of the thermal unit in the unit commitment problem. Finally, the affected_values specify which variables will be affected in the problem to be solved, for example the next economic dispatch problem.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The following code specify the creation of semi-continuous range constraints on the ActivePowerVariable based on the solution of the commitment variable OnVariable for all ThermalStandard units.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n)","category":"page"},{"location":"modeler_guide/running_a_simulation/#Chronologies","page":"Simulation","title":"Chronologies","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"In PowerSimulations, chronologies define where information is flowing. There are two types of chronologies.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"inter-stage chronologies: Define how information flows between stages. e.g. day-ahead solutions are used to inform economic dispatch problems\nintra-stage chronologies: Define how information flows between multiple executions of a single stage. e.g. the dispatch setpoints of the first period of an economic dispatch problem are constrained by the ramping limits from setpoints in the final period of the previous problem.","category":"page"},{"location":"modeler_guide/running_a_simulation/#Sequencing","page":"Simulation","title":"Sequencing","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"In a typical simulation pipeline, we want to connect daily (24-hours) day-ahead unit commitment problems, with multiple economic dispatch problems. Usually, our day-ahead unit commitment problem will have an hourly (1-hour) resolution, while the economic dispatch will have a 5-minute resolution.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Depending on your problem, it is common to use a 2-day look-ahead for unit commitment problems, so in this case, the Day-Ahead problem will have: resolution = Hour(1) with interval = Hour(24) and horizon = Hour(48). In the case of the economic dispatch problem, it is common to use a look-ahead of two hours. Thus, the Real-Time problem will have: resolution = Minute(5), with interval = Minute(5) (we only store the first operating point) and horizon = 24 (24 time steps of 5 minutes are 120 minutes, that is 2 hours).","category":"page"},{"location":"modeler_guide/running_a_simulation/#Simulation-Setup","page":"Simulation","title":"Simulation Setup","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The following code creates the entire simulation pipeline:","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"# We assume that the templates for UC and ED are ready\n# sys_da has the resolution of 1 hour:\n# with the 24 hours interval and horizon of 48 hours.\n# sys_rt has the resolution of 5 minutes:\n# with a 5-minute interval and horizon of 2 hours (24 time steps)\n\n# Create the UC Decision Model\ndecision_model_uc = DecisionModel(\n template_uc,\n sys_da;\n name = \"UC\",\n optimizer = optimizer_with_attributes(\n Xpress.Optimizer,\n \"MIPRELSTOP\" => 1e-1,\n ),\n)\n\n# Create the ED Decision Model\ndecision_model_ed = DecisionModel(\n template_ed,\n sys_rt;\n name = \"ED\",\n optimizer = optimizer_with_attributes(Xpress.Optimizer),\n)\n\n# Specify the SimulationModels using a Vector of decision_models: UC, ED\nsim_models = SimulationModels(;\n decision_models = [\n decision_model_uc,\n decision_model_ed,\n ],\n)\n\n# Create the FeedForwards:\nsemi_ff = SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n)\n\n# Specify the sequencing:\nsim_sequence = SimulationSequence(;\n # Specify the vector of decision models: sim_models\n models = sim_models,\n # Specify a Dict of feedforwards on which the FF applies\n # based on the DecisionModel name, in this case \"ED\"\n feedforwards = Dict(\n \"ED\" => [semi_ff],\n ),\n # Specify the chronology, in this case inter-stage\n ini_cond_chronology = InterProblemChronology(),\n)\n\n# Construct the simulation:\nsim = Simulation(;\n name = \"compact_sim\",\n steps = 10, # 10 days\n models = sim_models,\n sequence = sim_sequence,\n # Specify the start_time as a DateTime: e.g. DateTime(\"2020-10-01T00:00:00\")\n initial_time = start_time,\n # Specify a temporary folder to avoid storing logs if not needed\n simulation_folder = mktempdir(; cleanup = true),\n)\n\n# Build the decision models and simulation setup\nbuild!(sim)\n\n# Execute the simulation using the Optimizer specified in each DecisionModel\nexecute!(sim; enable_progress_bar = true)","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Check the PCM tutorial for a more detailed tutorial on executing a simulation in a production cost modeling (PCM) environment.","category":"page"},{"location":"tutorials/adding_new_device_formulation/#Adding-Device-Formulations","page":"Adding Device Formulations","title":"Adding Device Formulations","text":"","category":"section"},{"location":"formulation_library/Feedforward/#ff_formulations","page":"Feedforwards","title":"FeedForward Formulations","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"FeedForwards are the mechanism to define how information is shared between models. Specifically, a FeedForward defines what to do with information passed with an inter-stage chronology in a Simulation. The most common FeedForward is the SemiContinuousFeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the (already solved) unit-commitment variables.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The creation of a FeedForward requires at least specifying the component_type on which the FeedForward will be applied. The source variable specifies which variable will be taken from the problem solved, for example, the commitment variable of the thermal unit in the unit commitment problem. Finally, the affected_values specify which variables will be affected in the problem to be solved, for example, the next economic dispatch problem.","category":"page"},{"location":"formulation_library/Feedforward/#Table-of-contents","page":"Feedforwards","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"SemiContinuousFeedforward\nFixValueFeedforward\nUpperBoundFeedforward\nLowerBoundFeedforward","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#SemiContinuousFeedforward","page":"Feedforwards","title":"SemiContinuousFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"SemiContinuousFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.SemiContinuousFeedforward","page":"Feedforwards","title":"PowerSimulations.SemiContinuousFeedforward","text":"SemiContinuousFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nIt allows to enable/disable bounds to 0.0 for a specified variable. Commonly used to limit the ActivePowerVariable in an Economic Dispatch problem by the commitment decision taken in an another problem (typically a Unit Commitment problem).\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the semicontinuous limit will be applied using the source values\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No variables are created","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"texton^textth = OnStatusParameter obtained from the source variable, typically the commitment variable of the unit commitment problem u^textth.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes to the objective function.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Adds -texton^textthP^textthmax to the ActivePowerRangeExpressionUB expression and -texton^textthP^textthmin to the ActivePowerRangeExpressionLB expression.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Limits the ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB by zero as:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textActivePowerRangeExpressionUB_t = p_t^textth - texton_t^textthP^textthmax le 0 quad forall tin 1 dots T \n textActivePowerRangeExpressionLB_t = p_t^textth - texton_t^textthP^textthmin ge 0 quad forall tin 1 dots T \nendalign*","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Thus, if the commitment parameter is zero, the dispatch is limited to zero, forcing to turn off the generator without introducing binary variables in the economic dispatch problem.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#FixValueFeedforward","page":"Feedforwards","title":"FixValueFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"FixValueFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.FixValueFeedforward","page":"Feedforwards","title":"PowerSimulations.FixValueFeedforward","text":"FixValueFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nFixes a Variable or Parameter Value in the model from another problem. Is the only Feed Forward that can be used with a Parameter or a Variable as the affected value.\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the fix value will be applied using the source values\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No variables are created","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The parameter FixValueParameter is used to match the result obtained from the source variable (from the simulation state).","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes to the objective function.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes on expressions.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Set the VariableType from the affected_values to be equal to the source parameter store in FixValueParameter","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textAffectedVariable_t = textSourceVariableParameter_t quad forall t in 1dots T\nendalign*","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#UpperBoundFeedforward","page":"Feedforwards","title":"UpperBoundFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"UpperBoundFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.UpperBoundFeedforward","page":"Feedforwards","title":"PowerSimulations.UpperBoundFeedforward","text":"UpperBoundFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n add_slacks::Bool = false,\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nConstructs a parameterized upper bound constraint to implement feedforward from other models.\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the upper bound will be applied using the source values\nadd_slacks::Bool = false : Add slacks variables to relax the upper bound constraint.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"If slack variables are enabled:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"UpperBoundFeedForwardSlack\nBounds: [0.0, ]\nDefault proportional cost: 1e6\nSymbol: p^textffubsl","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The parameter UpperBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as an upper bound to the affected variable.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The slack variable is added to the objective function using its large default cost + p^textffubsl cdot 10^6","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes on expressions.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Set the VariableType from the affected_values to be lower than the source parameter store in UpperBoundValueParameter.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textAffectedVariable_t - p_t^textffubsl le textSourceVariableParameter_t quad forall t in 1dots T\nendalign*","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#LowerBoundFeedforward","page":"Feedforwards","title":"LowerBoundFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"LowerBoundFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.LowerBoundFeedforward","page":"Feedforwards","title":"PowerSimulations.LowerBoundFeedforward","text":"LowerBoundFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n add_slacks::Bool = false,\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nConstructs a parameterized lower bound constraint to implement feedforward from other models.\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the lower bound will be applied using the source values\nadd_slacks::Bool = false : Add slacks variables to relax the lower bound constraint.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"If slack variables are enabled:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"LowerBoundFeedForwardSlack\nBounds: [0.0, ]\nDefault proportional cost: 1e6\nSymbol: p^textfflbsl","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The parameter LowerBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as a lower bound to the affected variable.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The slack variable is added to the objective function using its large default cost + p^textfflbsl cdot 10^6","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes on expressions.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Set the VariableType from the affected_values to be greater than the source parameter store in LowerBoundValueParameter.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textAffectedVariable_t + p_t^textfflbsl ge textSourceVariableParameter_t quad forall t in 1dots T\nendalign*","category":"page"},{"location":"#PowerSimulations.jl","page":"Welcome Page","title":"PowerSimulations.jl","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"CurrentModule = PowerSimulations","category":"page"},{"location":"#Overview","page":"Welcome Page","title":"Overview","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl is a power system operations simulation tool developed as a flexible and open source software for quasi-static power systems simulations including Production Cost Models. PowerSimulations.jl tackles the issues of developing a simulation model in a modular way providing tools for the formulation of decision models and emulation models that can be solved independently or in an interconnected fashion.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl supports the workflows to develop simulations by separating the development of operations models and simulation models.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Operation Models: Optimization model used to find the solution of an operation problem.\nSimulations Models: Defined the requirements to find solutions to a sequence of operation problems in a way that resembles the procedures followed by operators.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"The most common Simulation Model is the solution of a Unit Commitment and Economic Dispatch sequence of problems. This model is used in commercial Production Cost Modeling tools, but it has a limited scope of analysis.","category":"page"},{"location":"#How-the-documentation-is-structured","page":"Welcome Page","title":"How the documentation is structured","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl documentation and code are organized according to the needs of different users depending on their skillset and requirements. In broad terms there are three categories:","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Modeler: Users that want to solve an operations problem or run a simulation using the existing models in PowerSimulations.jl. For instance, answer questions about the change in operation costs in future fuel mixes. Check the formulations library page to choose a modeling strategy that fits your needs.\nModel Developer: Users that want to develop custom models and workflows for the simulation of a power system operation. For instance, study the impacts of an stochastic optimization problem over a deterministic.\nCode Base Developers: Users that want to add new core functionalities or fix bugs in the core capabilities of PowerSimulations.jl.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl is an active project under development, and we welcome your feedback, suggestions, and bug reports.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Note: PowerSimulations.jl uses the data model implemented in PowerSystems.jl to construct optimization models. In most cases, you need to add PowerSystems.jl to your scripts.","category":"page"},{"location":"#Installation","page":"Welcome Page","title":"Installation","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"The latest stable release of PowerSimulations can be installed using the Julia package manager with","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"] add PowerSimulations","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"For the current development version, \"checkout\" this package with","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"] add PowerSimulations#main","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"An appropriate optimization solver is required for running PowerSimulations models. Refer to JuMP.jl solver's page to select the most appropriate for the application of interest.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSystems has been developed as part of the Scalable Integrated Infrastructure Planning (SIIP) initiative at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL).","category":"page"},{"location":"formulation_library/Load/#PowerSystems.ElectricLoad-Formulations","page":"Load","title":"PowerSystems.ElectricLoad Formulations","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Electric load formulations define the optimization models that describe load units (demand) mathematical model in different operational settings, such as economic dispatch and unit commitment.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/Load/#Table-of-contents","page":"Load","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"StaticPowerLoad\nPowerLoadInterruption\nPowerLoadDispatch\nValid configurations","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"","category":"page"},{"location":"formulation_library/Load/#StaticPowerLoad","page":"Load","title":"StaticPowerLoad","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"StaticPowerLoad","category":"page"},{"location":"formulation_library/Load/#PowerSimulations.StaticPowerLoad","page":"Load","title":"PowerSimulations.StaticPowerLoad","text":"Formulation type to add a time series parameter for non-dispatchable ElectricLoad withdrawals to power balance constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Variables:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"No variables are created","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Uses the max_active_power timeseries parameter to determine the demand value at each time-step","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(ElectricLoad, StaticPowerLoad)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Expressions:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Subtracts the parameters listed above from the respective active and reactive power balance expressions created by the selected Network Formulations.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Constraints:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"No constraints are created","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"","category":"page"},{"location":"formulation_library/Load/#PowerLoadInterruption","page":"Load","title":"PowerLoadInterruption","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"PowerLoadInterruption","category":"page"},{"location":"formulation_library/Load/#PowerSimulations.PowerLoadInterruption","page":"Load","title":"PowerSimulations.PowerLoadInterruption","text":"Formulation type to enable (binary) load interruptions\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Variables:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"ActivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: 0.0\nSymbol: p^textld\nReactivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: 0.0\nSymbol: q^textld\nOnVariable:\nBounds: 01\nDefault initial value: 1\nSymbol: u^textld","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Static Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"P^textldmax = PowerSystems.get_max_active_power(device)\nQ^textldmax = PowerSystems.get_max_reactive_power(device)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(ElectricLoad, PowerLoadInterruption)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Objective:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as p^textld.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Expressions:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Subtractp^textld and q^textld terms and to the respective active and reactive power balance expressions created by the selected Network Formulations","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Constraints:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"beginaligned\n p_t^textld le u_t^textld cdot textActivePowerTimeSeriesParameter_t quad forall t in 1dots T \n q_t^textre = textpf cdot p_t^textre quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"on which textpf = sin(arctan(Q^textldmaxP^textldmax)).","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"","category":"page"},{"location":"formulation_library/Load/#PowerLoadDispatch","page":"Load","title":"PowerLoadDispatch","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"PowerLoadDispatch","category":"page"},{"location":"formulation_library/Load/#PowerSimulations.PowerLoadDispatch","page":"Load","title":"PowerSimulations.PowerLoadDispatch","text":"Formulation type to enable (continuous) load interruption dispatch\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Variables:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"ActivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_active_power(device)\nSymbol: p^textld\nReactivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_reactive_power(device)\nSymbol: q^textld","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Static Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"P^textldmax = PowerSystems.get_max_active_power(device)\nQ^textldmax = PowerSystems.get_max_reactive_power(device)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(ElectricLoad, PowerLoadDispatch)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Objective:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as p^textld.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Expressions:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Subtractp^textld and q^textld terms and to the respective active and reactive power balance expressions created by the selected Network Formulations","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Constraints:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"beginaligned\n p_t^textld le textActivePowerTimeSeriesParameter_t quad forall t in 1dots T\n q_t^textld = textpf cdot p_t^textld quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"on which textpf = sin(arctan(Q^textldmaxP^textldmax)).","category":"page"},{"location":"formulation_library/Load/#Valid-configurations","page":"Load","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Valid DeviceModels for subtypes of ElectricLoad include the following:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> x[\"device_type\"] <: ElectricLoad, combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/#Extending-Source-Code-Functionalities","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"","category":"section"},{"location":"code_base_developer_guide/extending_powersimulations/#Enable-other-recorder-events","page":"Extending Source Code Functionalities","title":"Enable other recorder events","text":"","category":"section"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"Other types of recorder events can be enabled with a possible performance impact. To do this pass in the specific recorder names to be enabled when you call build.","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"sim = Simulation(...)\nrecorders = [:execution]\nbuild!(sim; recorders = recorders)\nexecute!(sim)","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"Now we can examine InitialConditionUpdateEvents for specific steps and stages.","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"show_simulation_events(\n PSI.InitialConditionUpdateEvent,\n \"./output/aggregation/1\",\n x -> x.initial_condition_type == \"DeviceStatus\";\n step = 2,\n stage = 1\n)\n┌─────────────────────────────┬─────────────────────┬────────────────────────┬─────────────────┬─────────────┬─────┬──────────────┐\n│ name │ simulation_time │ initial_condition_type │ device_type │ device_name │ val │ stage_number │\n├─────────────────────────────┼─────────────────────┼────────────────────────┼─────────────────┼─────────────┼─────┼──────────────┤\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Solitude │ 0.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Park City │ 1.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Alta │ 1.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Brighton │ 1.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Sundance │ 0.0 │ 1 │\n└─────────────────────────────┴─────────────────────┴────────────────────────┴─────────────────┴─────────────┴─────┴──────────────┘","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/#Show-the-wall-time-with-your-events","page":"Extending Source Code Functionalities","title":"Show the wall time with your events","text":"","category":"section"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"Sometimes you might want to see how the events line up with the wall time.","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"show_simulation_events(\n PSI.InitialConditionUpdateEvent,\n \"./output/aggregation/1\",\n x -> x.initial_condition_type == \"DeviceStatus\";\n step = 2,\n stage = 1,\n wall_time = true\n)\n┌─────────────────────────┬─────────────────────────────┬─────────────────────┬────────────────────────┬─────────────────┬─────────────┬─────┬──────────────┐\n│ timestamp │ name │ simulation_time │ initial_condition_type │ device_type │ device_name │ val │ stage_number │\n├─────────────────────────┼─────────────────────────────┼─────────────────────┼────────────────────────┼─────────────────┼─────────────┼─────┼──────────────┤\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Solitude │ 0.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Park City │ 1.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Alta │ 1.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Brighton │ 1.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Sundance │ 0.0 │ 1 │\n└─────────────────────────┴─────────────────────────────┴─────────────────────┴────────────────────────┴─────────────────┴─────────────┴─────┴──────────────┘","category":"page"}] +[{"location":"formulation_library/Network/#network_formulations","page":"Network","title":"Network Formulations","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Network formulations are used to describe how the network and buses are handled when constructing constraints. The most common constraint decided by the network formulation is the supply-demand balance constraint.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"NetworkModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.NetworkModel","page":"Network","title":"PowerSimulations.NetworkModel","text":"Establishes the model for the network specified by type.\n\nArguments\n\n-::Type{T}: PowerModels AbstractPowerModel\n\nAccepted Key Words\n\nuse_slacks::Bool: Adds slacks to the network modeling\nPTDF::PTDF: PTDF Array calculated using PowerNetworkMatrices\nduals::Vector{DataType}: Constraint types to calculate the duals\nreduce_radial_branches::Bool: Skips modeling radial branches in the system to reduce problem size\n\nExample\n\nptdfarray = PTDF(system) nw = NetworkModel(PTDFPowerModel, ptdf = ptdfarray),\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Available Network Models are:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Formulation Description\nCopperPlatePowerModel Copper plate connection between all components, i.e. infinite transmission capacity\nAreaBalancePowerModel Network model approximation to represent inter-area flow with each area represented as a single node\nPTDFPowerModel Uses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches\nAreaPTDFPowerModel Uses the PTDF factor matrix to compute the fraction of power transferred in the network across the branches and balances power by Area instead of system-wide","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"PowerModels.jl available formulations:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Exact non-convex models: ACPPowerModel, ACRPowerModel, ACTPowerModel.\nLinear approximations: DCPPowerModel, NFAPowerModel.\nQuadratic approximations: DCPLLPowerModel, LPACCPowerModel\nQuadratic relaxations: SOCWRPowerModel, SOCWRConicPowerModel, SOCBFPowerModel, SOCBFConicPowerModel, QCRMPowerModel, QCLSPowerModel.\nSDP relaxations: SDPWRMPowerModel, SparseSDPWRMPowerModel.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"All of these formulations are described in the PowerModels.jl documentation and will not be described here.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"","category":"page"},{"location":"formulation_library/Network/#CopperPlatePowerModel","page":"Network","title":"CopperPlatePowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"CopperPlatePowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.CopperPlatePowerModel","page":"Network","title":"PowerSimulations.CopperPlatePowerModel","text":"Infinite capacity approximation of network flow to represent entire system with a single node.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"If Slack variables are enabled:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"SystemBalanceSlackUp:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textslup\nSystemBalanceSlackDown:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textsldn","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Add a large proportional cost to the objective function if slack variables are used + (p^textslup + p^textsldn) cdot 10^6","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds p^textslup and p^textsldn terms to the respective active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents p_t^c = 0 quad forall t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"","category":"page"},{"location":"formulation_library/Network/#AreaBalancePowerModel","page":"Network","title":"AreaBalancePowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"AreaBalancePowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.AreaBalancePowerModel","page":"Network","title":"PowerSimulations.AreaBalancePowerModel","text":"Approximation to represent inter-area flow with each area represented as a single node.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables: If Slack variables are enabled:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"SystemBalanceSlackUp by area:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textslup\nSystemBalanceSlackDown by area:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textsldn","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds p^textslup and p^textsldn terms to the respective active power balance expressions ActivePowerBalance per area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Creates ActivePowerBalance expressions for each area that then are used to balance active power for all buses within a single area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the CopperPlateBalanceConstraint to balance the active power of all components available in an area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents_a p_t^c = 0 quad forall ain 1dots A t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"","category":"page"},{"location":"formulation_library/Network/#PTDFPowerModel","page":"Network","title":"PTDFPowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"PTDFPowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.PTDFPowerModel","page":"Network","title":"PowerSimulations.PTDFPowerModel","text":"Linear active power approximation using the power transfer distribution factor PTDF matrix.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"If Slack variables are enabled:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"SystemBalanceSlackUp:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textslup\nSystemBalanceSlackDown:\nBounds: [0.0, ]\nDefault initial value: 0.0\nDefault proportional cost: 1e6\nSymbol: p^textsldn","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Add a large proportional cost to the objective function if slack variables are used + (p^textslup + p^textsldn) cdot 10^6","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds p^textslup and p^textsldn terms to the respective system-wide active power balance expressions ActivePowerBalance created by this CopperPlatePowerModel network formulation. In addition, it creates ActivePowerBalance expressions for each bus to be used in the calculation of branch flows.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the CopperPlateBalanceConstraint to balance the active power of all components available in the system","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents p_t^c = 0 quad forall t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"In addition creates NodalBalanceActiveConstraint for HVDC buses balance, if DC components are connected to an HVDC network.","category":"page"},{"location":"formulation_library/Network/#AreaPTDFPowerModel","page":"Network","title":"AreaPTDFPowerModel","text":"","category":"section"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"AreaPTDFPowerModel","category":"page"},{"location":"formulation_library/Network/#PowerSimulations.AreaPTDFPowerModel","page":"Network","title":"PowerSimulations.AreaPTDFPowerModel","text":"Linear active power approximation using the power transfer distribution factor PTDF matrix. Balancing areas independently.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Variables","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Slack variables are not supported.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Objective Function","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"No changes to the objective function.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Expressions","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Creates the area-wide and nodal-wide active power balance expressions ActivePowerBalance to balance power based on each area independently. The flows across areas are computed based on the PTDF factors of lines connecting areas.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Constraints:","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"Adds the ActivePowerBalance constraint to balance the active power of all components available for each area.","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"beginalign\n sum_c in textcomponents_a p_t^c = 0 quad forall ain 1dots A t in 1 dots T\nendalign","category":"page"},{"location":"formulation_library/Network/","page":"Network","title":"Network","text":"This includes the flows of lines based on the PTDF factors.","category":"page"},{"location":"modeler_guide/simulation_recorder/#Simulation-Recorder","page":"Simulation Recorder","title":"Simulation Recorder","text":"","category":"section"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"PowerSimulations.jl provides the ability to record structured data as events during a simulation. These events can be post-processed to help debug problems.","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"By default only SimulationStepEvent and ProblemExecutionEvent are recorded. Here is an example.","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"Suppose a simulation is run in the directory ./output.","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"Assume that setup commands have been run:","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"using PowerSimulations\nconst PSI = PowerSimulations","category":"page"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"Note that for all functions below you can optionally specify a function to filter events. The function must accept the event type and return true or false.","category":"page"},{"location":"modeler_guide/simulation_recorder/#Show-all-events-of-type-PSI.SimulationStepEvent","page":"Simulation Recorder","title":"Show all events of type PSI.SimulationStepEvent","text":"","category":"section"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"julia> show_simulation_events(PSI.SimulationStepEvent, \"./output/aggregation/1\")\n┌─────────────────────┬─────────────────────┬──────┬────────┐\n│ name │ simulation_time │ step │ status │\n├─────────────────────┼─────────────────────┼──────┼────────┤\n│ SimulationStepEvent │ 2024-01-01T00:00:00 │ 1 │ start │\n│ SimulationStepEvent │ 2024-01-01T23:00:00 │ 1 │ done │\n│ SimulationStepEvent │ 2024-01-01T23:00:00 │ 2 │ start │\n│ SimulationStepEvent │ 2024-01-02T23:00:00 │ 2 │ done │\n└─────────────────────┴─────────────────────┴──────┴────────┘","category":"page"},{"location":"modeler_guide/simulation_recorder/#Show-events-of-type-PSI.ProblemExecutionEvent-for-a-specific-step-and-stage.","page":"Simulation Recorder","title":"Show events of type PSI.ProblemExecutionEvent for a specific step and stage.","text":"","category":"section"},{"location":"modeler_guide/simulation_recorder/","page":"Simulation Recorder","title":"Simulation Recorder","text":"show_simulation_events(\n PSI.ProblemExecutionEvent,\n \"./output/aggregation/1\",\n x -> x.step == 1 && x.stage == 2 && x.status == \"start\"\n)\n┌──────────────────────┬─────────────────────┬──────┬───────┬────────┐\n│ name │ simulation_time │ step │ stage │ status │\n├──────────────────────┼─────────────────────┼──────┼───────┼────────┤\n│ ProblemExecutionEvent │ 2024-01-01T00:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T00:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T01:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T02:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T03:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T04:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T05:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T06:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T07:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T08:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T09:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T10:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T11:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T12:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T13:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T14:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T15:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T16:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T17:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T18:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T19:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T20:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T21:00:00 │ 1 │ 2 │ start │\n│ ProblemExecutionEvent │ 2024-01-01T22:00:00 │ 1 │ 2 │ start │\n└──────────────────────┴─────────────────────┴──────┴───────┴────────┘","category":"page"},{"location":"modeler_guide/parallel_simulations/#Parallel-Simulations","page":"Parallel Simulations","title":"Parallel Simulations","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This section contains instructions to:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Run a Simulation in Parallel on a local computer\nRun a Simulation in Parallel on an HPC","category":"page"},{"location":"modeler_guide/parallel_simulations/#Run-a-Simulation-in-Parallel-on-a-local-computer","page":"Parallel Simulations","title":"Run a Simulation in Parallel on a local computer","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This page describes how to split a simulation into partitions, run each partition in parallel, and then join the results.","category":"page"},{"location":"modeler_guide/parallel_simulations/#Setup","page":"Parallel Simulations","title":"Setup","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a Julia script to build and run simulations. It must meet the requirements below. A full example is in the PowerSimulations repository in test/run_partitioned_simulation.jl.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Call using PowerSimulations.\nImplement a build function that matches the signature below. It must construct a Simulation, call build!, and then return the Simulation instance. It must throw an exception if the build fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function build_simulation(\n output_dir::AbstractString,\n simulation_name::AbstractString,\n partitions::SimulationPartitions,\n index::Union{Nothing, Integer}=nothing,\n)","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Here is example code to construct the Simulation with these parameters:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":" sim = Simulation(\n name=simulation_name,\n steps=partitions.num_steps,\n models=models,\n sequence=sequence,\n simulation_folder=output_dir,\n )\n status = build!(sim; partitions=partitions, index=index, serialize=isnothing(index))\n if status != PSI.SimulationBuildStatus.BUILT\n error(\"Failed to build simulation: status=$status\")\n end","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Implement an execute function that matches the signature below. It must throw an exception if the execute fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function execute_simulation(sim, args...; kwargs...)\n status = execute!(sim)\n if status != PSI.RunStatus.SUCCESSFULLY_FINALIZED\n error(\"Simulation failed to execute: status=$status\")\n end\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/#Execution","page":"Parallel Simulations","title":"Execution","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"After loading your script, call the function run_parallel_simulation as shown below.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This example splits a year-long simulation into weekly partitions for a total of 53 individual jobs and then runs them four at a time.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> include(\"my_simulation.jl\")\njulia> run_parallel_simulation(\n build_simulation,\n execute_simulation,\n script=\"my_simulation.jl\",\n output_dir=\"my_simulation_output\",\n name=\"my_simulation\",\n num_steps=365,\n period=7,\n num_overlap_steps=1,\n num_parallel_processes=4,\n exeflags=\"--project=\",\n )","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"The final results will be in ./my_simulation_otuput/my_simulation","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Note the log files and results for each partition are located in ./my_simulation_otuput/my_simulation/simulation_partitions","category":"page"},{"location":"modeler_guide/parallel_simulations/#Run-a-Simulation-in-Parallel-on-an-HPC","page":"Parallel Simulations","title":"Run a Simulation in Parallel on an HPC","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"This page describes how to split a simulation into partitions, run each partition in parallel on HPC compute nodes, and then join the results.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"These steps can be used on a local computer or any HPC supported by the submission software. Some steps may be specific to NREL's HPC Eagle cluster.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Note: Some instructions are preliminary and will change if functionality is moved to a new Julia package.","category":"page"},{"location":"modeler_guide/parallel_simulations/#Setup-2","page":"Parallel Simulations","title":"Setup","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a conda environment and install the Python package NREL-jade: https://nrel.github.io/jade/installation.html. The rest of this page assumes that the environment is called jade.\nActivate the environment with conda activate jade.\nLocate the path to that conda environment. It will likely be ~/.conda-envs/jade or ~/.conda/envs/jade.\nLoad the Julia environment that you use to run simulations. Add the packages Conda and PyCall.\nSetup Conda to use the existing jade environment by running these commands:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> run(`conda create -n conda_jl python conda`)\njulia> ENV[\"CONDA_JL_HOME\"] = joinpath(ENV[\"HOME\"], \".conda-envs\", \"jade\") # change this to your path\npkg> build Conda","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Copy the code below into a Julia file called configure_parallel_simulation.jl. This is an interface to Jade through PyCall. It will be used to create a Jade configuration. (It may eventually be moved to a separate package.)","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function configure_parallel_simulation(\n script::AbstractString,\n num_steps::Integer,\n num_period_steps::Integer;\n num_overlap_steps::Integer=0,\n project_path=nothing,\n simulation_name=\"simulation\",\n config_file=\"config.json\",\n force=false,\n)\n partitions = SimulationPartitions(num_steps, num_period_steps, num_overlap_steps)\n jgc = pyimport(\"jade.extensions.generic_command\")\n julia_cmd = isnothing(project_path) ? \"julia\" : \"julia --project=$project_path\"\n setup_command = \"$julia_cmd $script setup --simulation-name=$simulation_name \" *\n \"--num-steps=$num_steps --num-period-steps=$num_period_steps \" *\n \"--num-overlap-steps=$num_overlap_steps\"\n teardown_command = \"$julia_cmd $script join --simulation-name=$simulation_name\"\n config = jgc.GenericCommandConfiguration(\n setup_command=setup_command,\n teardown_command=teardown_command,\n )\n\n for i in 1:get_num_partitions(partitions)\n cmd = \"$julia_cmd $script execute --simulation-name=$simulation_name --index=$i\"\n job = jgc.GenericCommandParameters(command=cmd, name=\"execute-$i\")\n config.add_job(job)\n end\n\n config.dump(config_file, indent=2)\n println(\"Created Jade configuration in $config_file. \" *\n \"Run 'jade submit-jobs [options] $config_file' to execute them.\")\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a Julia script to build and run simulations. It must meet the requirements below. A full example is in the PowerSimulations repository in test/run_partitioned_simulation.jl.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Call using PowerSimulations.\nImplement a build function that matches the signature below. It must construct a Simulation, call build!, and then return the Simulation instance. It must throw an exception if the build fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function build_simulation(\n output_dir::AbstractString,\n simulation_name::AbstractString,\n partitions::SimulationPartitions,\n index::Union{Nothing, Integer}=nothing,\n)","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Here is example code to construct the Simulation with these parameters:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":" sim = Simulation(\n name=simulation_name,\n steps=partitions.num_steps,\n models=models,\n sequence=sequence,\n simulation_folder=output_dir,\n )\n status = build!(sim; partitions=partitions, index=index, serialize=isnothing(index))\n if status != PSI.SimulationBuildStatus.BUILT\n error(\"Failed to build simulation: status=$status\")\n end","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Implement an execute function that matches the signature below. It must throw an exception if the execute fails.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function execute_simulation(sim, args...; kwargs...)\n status = execute!(sim)\n if status != PSI.RunStatus.SUCCESSFULLY_FINALIZED\n error(\"Simulation failed to execute: status=$status\")\n end\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Make the script runnable as a CLI command by including the following code at the bottom of the file.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"function main()\n process_simulation_partition_cli_args(build_simulation, execute_simulation, ARGS...)\nend\n\nif abspath(PROGRAM_FILE) == @__FILE__\n main()\nend","category":"page"},{"location":"modeler_guide/parallel_simulations/#Execution-2","page":"Parallel Simulations","title":"Execution","text":"","category":"section"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Create a Jade configuration that defines the partitioned simulation jobs. Load your Julia environment.\nThis example splits a year-long simulation into weekly partitions for a total of 53 individual jobs.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> include(\"configure_parallel_simulation.jl\")\njulia> num_steps = 365\njulia> period = 7\njulia> num_overlap_steps = 1\njulia> configure_parallel_simulation(\n \"my_simulation.jl\", # this is your build/execute script\n num_steps,\n period,\n num_overlap_steps=1,\n project_path=\".\", # This optionally specifies the Julia project environment to load.\n)\nCreated Jade configuration in config.json. Run 'jade submit-jobs [options] config.json' to execute them.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Exit Julia.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"View the configuration for accuracy.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ jade config show config.json","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Start an interactive session on a debug node. Do not submit the jobs on a login node! The submission step will run a full build of the simulation and that may consume too many CPU and memory resources for the login node.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ salloc -t 01:00:00 -N1 --account= --partition=debug","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Follow the instructions at https://nrel.github.io/jade/tutorial.html to submit the jobs. The example below will configure Jade to run each partition on its own compute node. Depending on the compute and memory constraints of your simulation, you may be able to pack more jobs on each node.\nAdjust the walltime as necessary.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ jade config hpc -c hpc_config.toml -t slurm --walltime=04:00:00 -a \n$ jade submit-jobs config.json --per-node-batch-size=1 -o output","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"If you are unsure about how much memory and CPU resources your simulation consumes, add these options:","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"$ jade submit-jobs config.json --per-node-batch-size=1 -o output --resource-monitor-type periodic --resource-monitor-interval 3","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Jade will create HTML plots of the resource utilization in output/stats. You may be able to customize --per-node-batch-size and --num-processes to finish the simulations more quickly.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Jade will run a final command to join the simulation partitions into one unified file. You can load the results as you normally would.","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"julia> results = SimulationResults(\"/job-outputs/\")","category":"page"},{"location":"modeler_guide/parallel_simulations/","page":"Parallel Simulations","title":"Parallel Simulations","text":"Note the log files and results for each partition are located in /job-outputs//simulation_partitions","category":"page"},{"location":"quick_start_guide/#Quick-Start-Guide","page":"Quick Start Guide","title":"Quick Start Guide","text":"","category":"section"},{"location":"quick_start_guide/","page":"Quick Start Guide","title":"Quick Start Guide","text":"Julia: If this is your first time using Julia visit our Introduction to Julia and the official Getting started with Julia.\nPackage Installation: If you want to install packages check the Package Manager instructions, or you can refer to the PowerSimulations installation instructions.\nPowerSystems: PowerSystems.jl manages the data and is a fundamental dependency of PowerSimulations.jl. Check the PowerSystems.jl Basics Tutorial and PowerSystems.jl documentation to understand how the inputs to the models are organized.\nDataset Library: If you don't have a data set to start using PowerSimulations.jl check the test systems provided in PowerSystemCaseBuilder.jl","category":"page"},{"location":"quick_start_guide/","page":"Quick Start Guide","title":"Quick Start Guide","text":"tip: Tip\nIf you need to develop a dataset for a simulation check the PowerSystems.jl Tutorials on how to parse data and attach time series","category":"page"},{"location":"quick_start_guide/","page":"Quick Start Guide","title":"Quick Start Guide","text":"Tutorial: If you are eager to run your first simulation visit the Solve a Day Ahead Market Scheduling Problem using PowerSimulations.jl tutorial","category":"page"},{"location":"code_base_developer_guide/troubleshooting/#Troubleshooting-code-development","page":"Troubleshooting","title":"Troubleshooting code development","text":"","category":"section"},{"location":"formulation_library/Piecewise/#pwl_cost","page":"Piecewise Linear Cost","title":"Piecewise linear cost functions","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"The choice for piecewise-linear (PWL) cost representation in PowerSimulations.jl is equivalent to the so-called λ-model from the paper The Impacts of Convex Piecewise Linear Cost Formulations on AC Optimal Power Flow. The SOS constraints in each model are only implemented if the data for PWL is not convex.","category":"page"},{"location":"formulation_library/Piecewise/#Special-Ordered-Set-(SOS)-Constraints","page":"Piecewise Linear Cost","title":"Special Ordered Set (SOS) Constraints","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"A special ordered set (SOS) is an ordered set of variables used as an additional way to specify integrality conditions in an optimization model.","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"Special Ordered Sets of type 1 (SOS1) are a set of variables, at most one of which can take a non-zero value, all others being at 0. They most frequently applications is in a a set of variables that are actually binary variables: in other words, we have to choose at most one from a set of possibilities.\nSpecial Ordered Sets of type 2 (SOS2) are an ordered set of non-negative variables, of which at most two can be non-zero, and if two are non-zero these must be consecutive in their ordering. Special Ordered Sets of type 2 are typically used to model non-linear functions of a variable in a linear model, such as non-convex quadratic functions using PWL functions.","category":"page"},{"location":"formulation_library/Piecewise/#Standard-representation-of-PWL-costs","page":"Piecewise Linear Cost","title":"Standard representation of PWL costs","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"Piecewise-linear costs are defined by a sequence of points representing the line segments for each generator: (P_k^textmax C_k) on which we assume C_k is the cost of generating P_k^textmax power, and k in 1dots K are the number of segments each generator cost function has.","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"note: Note\nPowerSystems has more options to specify cost functions for each thermal unit. Independent of which form of the cost data is provided, PowerSimulations.jl will internally transform the data to use the λ-model formulation. See TODO: ADD PSY COST DOCS for more information.","category":"page"},{"location":"formulation_library/Piecewise/#Commitment-formulation","page":"Piecewise Linear Cost","title":"Commitment formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"With this the standard representation of PWL costs for a thermal unit commitment is given by:","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = u_t forall t in mathcalT\n P^textmin u_t leq p_t leq P^textmax u_t forall t in mathcalT\n left delta_1t dots delta_Kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, p is the active power of the generator and u in 01 is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"formulation_library/Piecewise/#Dispatch-formulation","page":"Piecewise Linear Cost","title":"Dispatch formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = texton_t forall t in mathcalT\n P^textmin texton_t leq p_t leq P^textmax texton_t forall t in mathcalT\n left delta_it dots delta_kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, p is the active power of the generator and texton in 01 is the parameter that decides if the generator is available or not. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"formulation_library/Piecewise/#Compact-representation-of-PWL-costs","page":"Piecewise Linear Cost","title":"Compact representation of PWL costs","text":"","category":"section"},{"location":"formulation_library/Piecewise/#Commitment-Formulation","page":"Piecewise Linear Cost","title":"Commitment Formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = P^textmin u_t + Delta p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = u_t forall t in mathcalT\n 0 leq Delta p_t leq left( P^textmax - P^textmin right)u_t forall t in mathcalT\n left delta_it dots delta_kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, Delta p is the active power of the generator above the minimum power and u in 01 is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"formulation_library/Piecewise/#Dispatch-formulation-2","page":"Piecewise Linear Cost","title":"Dispatch formulation","text":"","category":"section"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"beginalign*\n min_substackp_t delta_kt\n sum_t in mathcalT left(sum_k in mathcalK C_kt delta_kt right) Delta t\n sum_k in mathcalK P_k^textmax delta_kt = P^textmin texton_t + Delta p_t forall t in mathcalT\n sum_k in mathcalK delta_kt = texton_t forall t in mathcalT\n 0 leq Delta p_t leq left( P^textmax - P^textmin right)texton_t forall t in mathcalT\n left delta_it dots delta_kt right in textSOS_2 forall t in mathcalT\nendalign*","category":"page"},{"location":"formulation_library/Piecewise/","page":"Piecewise Linear Cost","title":"Piecewise Linear Cost","text":"on which delta_kt in 01 is the interpolation variable, Delta p is the active power of the generator above the minimum power and u in 01 is the commitment variable of the generator. In the case of a PWL convex costs, i.e. increasing slopes, the SOS constraint is omitted.","category":"page"},{"location":"tutorials/decision_problem/#op_problem_tutorial","page":"Single-step Problem","title":"Operations problems with PowerSimulations.jl","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Originally Contributed by: Clayton Barrows","category":"page"},{"location":"tutorials/decision_problem/#Introduction","page":"Single-step Problem","title":"Introduction","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"PowerSimulations.jl supports the construction and solution of optimal power system scheduling problems (Operations Problems). Operations problems form the fundamental building blocks for sequential simulations. This example shows how to specify and customize a the mathematics that will be applied to the data with an ProblemTemplate, build and execute an DecisionModel, and access the results.","category":"page"},{"location":"tutorials/decision_problem/#Load-Packages","page":"Single-step Problem","title":"Load Packages","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"using PowerSystems\nusing PowerSimulations\nusing HydroPowerSimulations\nusing PowerSystemCaseBuilder\nusing HiGHS # solver\nusing Dates","category":"page"},{"location":"tutorials/decision_problem/#Data","page":"Single-step Problem","title":"Data","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"note: Note\nPowerSystemCaseBuilder.jl is a helper library that makes it easier to reproduce examples in the documentation and tutorials. Normally you would pass your local files to create the system data instead of calling the function build_system. For more details visit PowerSystemCaseBuilder Documentation","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"sys = build_system(PSISystems, \"modified_RTS_GMLC_DA_sys\")","category":"page"},{"location":"tutorials/decision_problem/#Define-a-problem-specification-with-an-ProblemTemplate","page":"Single-step Problem","title":"Define a problem specification with an ProblemTemplate","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"You can create an empty template with:","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"template_uc = ProblemTemplate()","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Now, you can add a DeviceModel for each device type to create an assignment between PowerSystems device types and the subtypes of AbstractDeviceFormulation. PowerSimulations has a variety of different AbstractDeviceFormulation subtypes that can be applied to different PowerSystems device types, each dispatching to different methods for populating optimization problem objectives, variables, and constraints. Documentation on the formulation options for various devices can be found in the formulation library docs","category":"page"},{"location":"tutorials/decision_problem/#Branch-Formulations","page":"Single-step Problem","title":"Branch Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Here is an example of relatively standard branch formulations. Other formulations allow for selective enforcement of transmission limits and greater control on transformer settings.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_device_model!(template_uc, Line, StaticBranch)\nset_device_model!(template_uc, Transformer2W, StaticBranch)\nset_device_model!(template_uc, TapTransformer, StaticBranch)","category":"page"},{"location":"tutorials/decision_problem/#Injection-Device-Formulations","page":"Single-step Problem","title":"Injection Device Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Here we define template entries for all devices that inject or withdraw power on the network. For each device type, we can define a distinct AbstractDeviceFormulation. In this case, we're defining a basic unit commitment model for thermal generators, curtailable renewable generators, and fixed dispatch (net-load reduction) formulations for HydroDispatch and RenewableNonDispatch devices.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_device_model!(template_uc, ThermalStandard, ThermalStandardUnitCommitment)\nset_device_model!(template_uc, RenewableDispatch, RenewableFullDispatch)\nset_device_model!(template_uc, PowerLoad, StaticPowerLoad)\nset_device_model!(template_uc, HydroDispatch, HydroDispatchRunOfRiver)\nset_device_model!(template_uc, RenewableNonDispatch, FixedOutput)","category":"page"},{"location":"tutorials/decision_problem/#Service-Formulations","page":"Single-step Problem","title":"Service Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"We have two VariableReserve types, parameterized by their direction. So, similar to creating DeviceModels, we can create ServiceModels. The primary difference being that DeviceModel objects define how constraints get created, while ServiceModel objects define how constraints get modified.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_service_model!(template_uc, VariableReserve{ReserveUp}, RangeReserve)\nset_service_model!(template_uc, VariableReserve{ReserveDown}, RangeReserve)","category":"page"},{"location":"tutorials/decision_problem/#Network-Formulations","page":"Single-step Problem","title":"Network Formulations","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Finally, we can define the transmission network specification that we'd like to model. For simplicity, we'll choose a copper plate formulation. But there are dozens of specifications available through an integration with PowerModels.jl. Note that many formulations will require appropriate data and may be computationally intractable","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"set_network_model!(template_uc, NetworkModel(CopperPlatePowerModel))","category":"page"},{"location":"tutorials/decision_problem/#DecisionModel","page":"Single-step Problem","title":"DecisionModel","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Now that we have a System and an ProblemTemplate, we can put the two together to create an DecisionModel that we solve.","category":"page"},{"location":"tutorials/decision_problem/#Optimizer","page":"Single-step Problem","title":"Optimizer","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"It's most convenient to define an optimizer instance upfront and pass it into the DecisionModel constructor. For this example, we can use the free HiGHS solver with a relatively relaxed MIP gap (ratioGap) setting to improve speed.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"solver = optimizer_with_attributes(HiGHS.Optimizer, \"mip_rel_gap\" => 0.5)","category":"page"},{"location":"tutorials/decision_problem/#Build-an-DecisionModel","page":"Single-step Problem","title":"Build an DecisionModel","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"The construction of an DecisionModel essentially applies an ProblemTemplate to System data to create a JuMP model.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"problem = DecisionModel(template_uc, sys; optimizer = solver, horizon = Hour(24))\nbuild!(problem; output_dir = mktempdir())","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"tip: Tip\nThe principal component of the DecisionModel is the JuMP model. But you can serialize to a file using the following command:serialize_optimization_model(problem, save_path)Keep in mind that if the setting \"storevariablenames\" is set to False then the file won't show the model's names.","category":"page"},{"location":"tutorials/decision_problem/#Solve-an-DecisionModel","page":"Single-step Problem","title":"Solve an DecisionModel","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"solve!(problem)","category":"page"},{"location":"tutorials/decision_problem/#Results-Inspection","page":"Single-step Problem","title":"Results Inspection","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"PowerSimulations collects the DecisionModel results into a OptimizationProblemResults struct:","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"res = OptimizationProblemResults(problem)","category":"page"},{"location":"tutorials/decision_problem/#Optimizer-Stats","page":"Single-step Problem","title":"Optimizer Stats","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"The optimizer summary is included","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"get_optimizer_stats(res)","category":"page"},{"location":"tutorials/decision_problem/#Objective-Function-Value","page":"Single-step Problem","title":"Objective Function Value","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"get_objective_value(res)","category":"page"},{"location":"tutorials/decision_problem/#Variable,-Parameter,-Auxillary-Variable,-Dual,-and-Expression-Values","page":"Single-step Problem","title":"Variable, Parameter, Auxillary Variable, Dual, and Expression Values","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"The solution value data frames for variables, parameters, auxillary variables, duals and expressions can be accessed using the read_ methods:","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"read_variables(res)","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Or, you can read a single parameter values for parameters that exist in the results.","category":"page"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"list_parameter_names(res)\nread_parameter(res, \"ActivePowerTimeSeriesParameter__RenewableDispatch\")","category":"page"},{"location":"tutorials/decision_problem/#Plotting","page":"Single-step Problem","title":"Plotting","text":"","category":"section"},{"location":"tutorials/decision_problem/","page":"Single-step Problem","title":"Single-step Problem","text":"Take a look at the plotting capabilities in PowerGraphics.jl","category":"page"},{"location":"modeler_guide/tips_and_tricks/#Tips-and-tricks","page":"Tips and tricks","title":"Tips and tricks","text":"","category":"section"},{"location":"formulation_library/ThermalGen/#ThermalGen-Formulations","page":"Thermal Generation","title":"ThermalGen Formulations","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Thermal generation formulations define the optimization models that describe thermal units mathematical model in different operational settings, such as economic dispatch and unit commitment.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"note: Note\nThermal units can include multiple terms added to the objective function, such as no-load cost, turn-on/off cost, fixed cost and variable cost. In addition, variable costs can be linear, quadratic or piecewise-linear formulations. These methods are properly described in the cost function page.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"note: Note\nReserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.","category":"page"},{"location":"formulation_library/ThermalGen/#Table-of-Contents","page":"Thermal Generation","title":"Table of Contents","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicDispatch\nThermalDispatchNoMin\nThermalCompactDispatch\nThermalStandardDispatch\nThermalBasicUnitCommitment\nThermalBasicCompactUnitCommitment\nThermalStandardUnitCommitment\nThermalMultiStartUnitCommitment\nValid configurations","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalBasicDispatch","page":"Thermal Generation","title":"ThermalBasicDispatch","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicDispatch","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalBasicDispatch","page":"Thermal Generation","title":"PowerSimulations.ThermalBasicDispatch","text":"Formulation type to enable basic dispatch without any intertemporal (ramp) constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n P^textthmin le p^textth_t le P^textthmax quad forall tin 1 dots T \n Q^textthmin le q^textth_t le Q^textthmax quad forall tin 1 dots T \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalDispatchNoMin","page":"Thermal Generation","title":"ThermalDispatchNoMin","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalDispatchNoMin","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalDispatchNoMin","page":"Thermal Generation","title":"PowerSimulations.ThermalDispatchNoMin","text":"Formulation type to enable basic dispatch without any intertemporal constraints and relaxed minimum generation. May not work with non-convex PWL cost definitions\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign\n 0 le p^textth_t le P^textthmax quad forall tin 1 dots T \n Q^textthmin le q^textth_t le Q^textthmax quad forall tin 1 dots T \nendalign","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalCompactDispatch","page":"Thermal Generation","title":"ThermalCompactDispatch","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalCompactDispatch","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalCompactDispatch","page":"Thermal Generation","title":"PowerSimulations.ThermalCompactDispatch","text":"Formulation type to enable thermal compact dispatch\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = texton^textthP^textmin + Delta p^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variable Value Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"texton^textth: Used in feedforwards to define if the unit is on/off at each time-step from another problem. If no feedforward is used, the parameter takes a {0,1} value if the unit is available or not.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds texton^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also implements ramp constraints for the active power variable.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le texton^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n texton^textth_t Q^textthmin le q^textth_t le texton^textth_t Q^textthmax quad forall tin 1 dots T \n -R^textthdn le Delta p_1^textth - Delta p^textth init le R^textthup \n -R^textthdn le Delta p_t^textth - Delta p_t-1^textth le R^textthup quad forall tin 2 dots T\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalStandardDispatch","page":"Thermal Generation","title":"ThermalStandardDispatch","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalStandardDispatch","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalStandardDispatch","page":"Thermal Generation","title":"PowerSimulations.ThermalStandardDispatch","text":"Formulation type to enable standard dispatch with a range and enforce intertemporal ramp constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n P^textthmin le p^textth_t le P^textthmax quad forall tin 1 dots T \n Q^textthmin le q^textth_t le Q^textthmax quad forall tin 1 dots T \n -R^textthdn le p_1^textth - p^textth init le R^textthup \n -R^textthdn le p_t^textth - p_t-1^textth le R^textthup quad forall tin 2 dots T\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalBasicUnitCommitment","page":"Thermal Generation","title":"ThermalBasicUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalBasicUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalBasicUnitCommitment","text":"Formulation type to enable basic unit commitment representation without any intertemporal (ramp, min on/off time) constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n u_t^textth P^textthmin le p^textth_t le u_t^textth P^textthmax quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalBasicCompactUnitCommitment","page":"Thermal Generation","title":"ThermalBasicCompactUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalBasicCompactUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalBasicCompactUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalBasicCompactUnitCommitment","text":"Formulation type to enable thermal compact commitment without intertemporal (ramp, min on/off time) constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = u^textthP^textmin + Delta p^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds u^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. In addition, it creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le u^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalCompactUnitCommitment","page":"Thermal Generation","title":"ThermalCompactUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalCompactUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalCompactUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalCompactUnitCommitment","text":"Formulation type to enable thermal compact commitment\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = u^textthP^textmin + Delta p^textth\nTimeDurationOn:\nSymbol: V_t^textth\nDefinition: Computed post optimization by adding consecutive turned on variable u_t^textth\nTimeDurationOff:\nSymbol: W_t^textth\nDefinition: Computed post optimization by adding consecutive turned off variable 1 - u_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down\nD^textminup = PowerSystems.get_time_limits(device).up\nD^textmindn = PowerSystems.get_time_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds u^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le u^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n -R^textthdn le Delta p_1^textth - Delta p^textth init le R^textthup \n -R^textthdn le Delta p_t^textth - Delta p_t-1^textth le R^textthup quad forall tin 2 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"In addition, this formulation adds duration constraints, i.e. minimum-up time and minimum-down time constraints. The duration constraints are added over the start times looking backwards.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"The duration times D^textminup and D^textmindn are processed to be used in multiple of the time-steps, given the resolution of the specific problem. In addition, parameters D^textinitup and D^textinitdn are used to identify how long the unit was on or off, respectively, before the simulation started.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum up-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textminup - D^textinitup text and D^textinitup 0 \n 1 + sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum down-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textmindn - D^textinitdn text and D^textinitup 0 \n 1 + sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalStandardUnitCommitment","page":"Thermal Generation","title":"ThermalStandardUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalStandardUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalStandardUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalStandardUnitCommitment","text":"Formulation type to enable standard unit commitment with intertemporal constraints and simplified startup profiles\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"TimeDurationOn:\nSymbol: V_t^textth\nDefinition: Computed post optimization by adding consecutive turned on variable u_t^textth\nTimeDurationOff:\nSymbol: W_t^textth\nDefinition: Computed post optimization by adding consecutive turned off variable 1 - u_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down\nD^textminup = PowerSystems.get_time_limits(device).up\nD^textmindn = PowerSystems.get_time_limits(device).down","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n u^textth_t P^textthmin le p^textth_t le u^textth_t P^textthmax quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n -R^textthdn le p_1^textth - p^textth init le R^textthup \n -R^textthdn le p_t^textth - p_t-1^textth le R^textthup quad forall tin 2 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"In addition, this formulation adds duration constraints, i.e. minimum-up time and minimum-down time constraints. The duration constraints are added over the start times looking backwards.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"The duration times D^textminup and D^textmindn are processed to be used in multiple of the time-steps, given the resolution of the specific problem. In addition, parameters D^textinitup and D^textinitdn are used to identify how long the unit was on or off, respectively, before the simulation started.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum up-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textminup - D^textinitup text and D^textinitup 0 \n 1 + sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum down-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textmindn - D^textinitdn text and D^textinitup 0 \n 1 + sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#ThermalMultiStartUnitCommitment","page":"Thermal Generation","title":"ThermalMultiStartUnitCommitment","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"ThermalMultiStartUnitCommitment","category":"page"},{"location":"formulation_library/ThermalGen/#PowerSimulations.ThermalMultiStartUnitCommitment","page":"Thermal Generation","title":"PowerSimulations.ThermalMultiStartUnitCommitment","text":"Formulation type to enable pg-lib commitment formulation with startup/shutdown profiles\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerAboveMinimumVariable:\nBounds: [0.0, ]\nSymbol: Delta p^textth\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textth\nOnVariable:\nBounds: 01\nSymbol: u_t^textth\nStartVariable:\nBounds: 01\nSymbol: v_t^textth\nStopVariable:\nBounds: 01\nSymbol: w_t^textth\nColdStartVariable:\nBounds: 01\nSymbol: x_t^textth\nWarmStartVariable:\nBounds: 01\nSymbol: y_t^textth\nHotStartVariable:\nBounds: 01\nSymbol: z_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Auxiliary Variables:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"PowerOutput:\nSymbol: P^textth\nDefinition: P^textth = u^textthP^textmin + Delta p^textth\nTimeDurationOn:\nSymbol: V_t^textth\nDefinition: Computed post optimization by adding consecutive turned on variable u_t^textth\nTimeDurationOff:\nSymbol: W_t^textth\nDefinition: Computed post optimization by adding consecutive turned off variable 1 - u_t^textth","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"P^textthmin = PowerSystems.get_active_power_limits(device).min\nP^textthmax = PowerSystems.get_active_power_limits(device).max\nQ^textthmin = PowerSystems.get_reactive_power_limits(device).min\nQ^textthmax = PowerSystems.get_reactive_power_limits(device).max\nR^textthup = PowerSystems.get_ramp_limits(device).up\nR^textthdn = PowerSystems.get_ramp_limits(device).down\nD^textminup = PowerSystems.get_time_limits(device).up\nD^textmindn = PowerSystems.get_time_limits(device).down\nD^textcold = PowerSystems.get_start_time_limits(device).cold\nD^textwarm = PowerSystems.get_start_time_limits(device).warm\nD^texthot = PowerSystems.get_start_time_limits(device).hot\nP^textthstartup = PowerSystems.get_power_trajectory(device).startup\nP^textth shdown = PowerSystems.get_power_trajectory(device).shutdown","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Objective:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Add a cost to the objective function depending on the defined cost structure of the thermal unit by adding it to its ProductionCostExpression.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Adds u^textthP^textthmin + Delta p^textth to the ActivePowerBalance expression and q^textth to the ReactivePowerBalance, to be used in the supply-balance constraint depending on the network model used.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"For each thermal unit creates the range constraints for its active and reactive power depending on its static parameters. It also creates the commitment constraint to turn on/off the device.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n 0 le Delta p^textth_t le u^textth_tleft(P^textthmax - P^textthminright) quad forall tin 1 dots T \n u_t^textth Q^textthmin le q^textth_t le u_t^textth Q^textthmax quad forall tin 1 dots T \n -R^textthdn le Delta p_1^textth - Delta p^textth init le R^textthup \n -R^textthdn le Delta p_t^textth - Delta p_t-1^textth le R^textthup quad forall tin 2 dots T \n u_1^textth = u^textthinit + v_1^textth - w_1^textth \n u_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \n v_t^textth + w_t^textth le 1 quad forall t in 1dotsT \n maxP^textthmax - P^textthshdown 0 cdot w_1^textth le u^textthinit (P^textthmax - P^textthmin) - P^textthinit\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"In addition, this formulation adds duration constraints, i.e. minimum-up time and minimum-down time constraints. The duration constraints are added over the start times looking backwards.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"The duration times D^textminup and D^textmindn are processed to be used in multiple of the time-steps, given the resolution of the specific problem. In addition, parameters D^textinitup and D^textinitdn are used to identify how long the unit was on or off, respectively, before the simulation started.","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum up-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textminup - D^textinitup text and D^textinitup 0 \n 1 + sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textminup + 1^t v_i^textth leq u_t^textth \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Minimum down-time constraint for t in 1dots T:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n textIf t leq D^textmindn - D^textinitdn text and D^textinitup 0 \n 1 + sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth quad text(for i text in the set of time steps) \n textOtherwise \n sum_i=t-D^textmindn + 1^t w_i^textth leq 1 - u_t^textth\nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Finally, multi temperature start/stop constraints are implemented using the following constraints:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"beginalign*\n v_t^textth = x_t^textth + y_t^textth + z_t^textth quad forall t in 1 dots T \n z_t^textth le sum_i in D^texthot D^textwarm)w_t-i^textth quad forall t in D^textwarm dots T \n y_t^textth le sum_i in D^textwarm D^textcold)w_t-i^textth quad forall t in D^textcold dots T \n (D^textwarm - 1) z_t^textth + (1 - z_t^textth) M^textbig ge sum_i=1^t (1 - u_i^textth) + D^textinithot quad forall t in 1 dots T \n D^texthot z_t^textth le sum_i=1^t (1 - u_i^textth) + D^textinithot quad forall t in 1 dots T \n (D^textcold - 1) y_t^textth + (1 - y_t^textth) M^textbig ge sum_i=1^t (1 - u_i^textth) + D^textinitwarm quad forall t in 1 dots T \n D^textwarm y_t^textth le sum_i=1^t (1 - u_i^textth) + D^textinitwarm quad forall t in 1 dots T \nendalign*","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"","category":"page"},{"location":"formulation_library/ThermalGen/#Valid-configurations","page":"Thermal Generation","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"Valid DeviceModels for subtypes of ThermalGen include the following:","category":"page"},{"location":"formulation_library/ThermalGen/","page":"Thermal Generation","title":"Thermal Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> x[\"device_type\"] <: ThermalGen, combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/DCModels/#DC-Models-formulations","page":"DC Models formulations","title":"DC Models formulations","text":"","category":"section"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"note: Note\nMulti-terminal DC models are still in early stages of development and future versions will add a more comprehensive list of formulations","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"","category":"page"},{"location":"formulation_library/DCModels/#LossLessLine","page":"DC Models formulations","title":"LossLessLine","text":"","category":"section"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"LossLessLine models are used with PSY.DCBranch models.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"LossLessLine","category":"page"},{"location":"formulation_library/DCModels/#PowerSimulations.LossLessLine","page":"DC Models formulations","title":"PowerSimulations.LossLessLine","text":"LossLess Line Abstract Model\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Variables:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"FlowActivePowerVariable:\nBounds: (R^textminR^textmax)\nSymbol: f","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Static Parameters","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"R^textfrommin = PowerSystems.get_active_power_limits_from(branch).min\nR^textfrommax = PowerSystems.get_active_power_limits_from(branch).max\nR^texttomin = PowerSystems.get_active_power_limits_to(branch).min\nR^texttomax = PowerSystems.get_active_power_limits_to(branch).max","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Then, the minimum and maximum are computed as R^\\text{min} = \\min(R^\\text{from,min}, R^\\text{to,min}) and R^\\text{max} = \\min(R^\\text{from,max}, R^\\text{to,max})","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Objective:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Expressions:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"The variable FlowActivePowerVariable f is added to the nodal balance expression ActivePowerBalance for DC Buses, by adding the flow f in the receiving DC bus and subtracting it from the sending DC bus.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Constraints:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No constraints are added to the function.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"","category":"page"},{"location":"formulation_library/DCModels/#LossLessConverter","page":"DC Models formulations","title":"LossLessConverter","text":"","category":"section"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Converters are used to interface the AC Buses with DC Buses.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"LossLessConverter","category":"page"},{"location":"formulation_library/DCModels/#PowerSimulations.LossLessConverter","page":"DC Models formulations","title":"PowerSimulations.LossLessConverter","text":"LossLess InterconnectingConverter Model\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Variables:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"ActivePowerVariable:\nBounds: (P^textminP^textmax)\nSymbol: p","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Static Parameters:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"P^textmin = PowerSystems.get_active_power_limits(device).min\nP^textmax = PowerSystems.get_active_power_limits(device).max","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Objective:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Expressions:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"The variable ActivePowerVariable p is added positive to the AC balance expression ActivePowerBalance for AC Buses, and added negative to ActivePowerBalance for DC Buses, balancing both sides.","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"Constraints:","category":"page"},{"location":"formulation_library/DCModels/","page":"DC Models formulations","title":"DC Models formulations","text":"No constraints are added to the function.","category":"page"},{"location":"tutorials/adding_new_problem_model/#Adding-an-Operations-Problem-Model","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"This tutorial will show how to create a custom decision problem model. These cases are the ones where the user want to solve a fully specified problem. Some examples of custom decision models include:","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Solving a custom Security Constrained Unit Commitment Problem\nSolving a market agent utility maximization Problem. See examples of this functionality in HybridSystemsSimulations.jl","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"The tutorial follows the usual steps for operational model building. First, build the decision model in isolation and second, integrate it into a simulation. In most cases there will be more than one way of achieving the same objective when it comes to implementing the model. This guide shows a general set of steps and requirements but it is by no means an exhaustive and detailed guide on developing custom decision models.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"warning: Warning\nAll the code in this tutorial is considered \"pseudo-code\". Copy-paste will likely not work out of the box. You need to develop the internals of the functions correctly for the examples below to work.","category":"page"},{"location":"tutorials/adding_new_problem_model/#General-Rules","page":"Adding an Operations Problem Model","title":"General Rules","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"As a general rule you need to understand Julia's terminology such as multiple dispatch, parametric structs and method overloading, among others. Developing custom models for an operational simulation is a highly technical task and requires skilled development. This tutorial also requires good understanding of PowerSystems.jl data structures and features which are covered in the tutorials section of PowerSystems.jl documentation. Finally, developing a custom model decision model that will employ an optimization model under the hood requires understanding JuMP.jl.\nNeed to employ anonymous constraints and variables in JuMP and register the constraints, variables and other optimization objects into PowerSimulations.jl's optimization container. Otherwise the features to use your problem in the simulation like the coordination with other problems and post processing won't work. More on this in the section How to develop your build_model! function below.\nImplement the required methods for your custom decision models. In some cases it will be possible to re-use some of the other methods that exist in PowerSimulations to make life easier for variable addition and constraint creation but this is not required.","category":"page"},{"location":"tutorials/adding_new_problem_model/#Decision-Problem","page":"Adding an Operations Problem Model","title":"Decision Problem","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/#Step-1:-Define-a-Custom-Decision-Problem","page":"Adding an Operations Problem Model","title":"Step 1: Define a Custom Decision Problem","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Define a decision problem struct as a subtype of PowerSimulations.DecisionProblem. This requirement will enable a lot of the underlying functionality that relies on multiple dispatch. DecisionProblems are used to parameterize the behavior of DecisionModel objects which are just containers for the parameters, references and the optimization problem.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"It is possible to define a Custom Decision Problem that gives the user full control over the build, solve and execution process since it imposes less requirements on the developer. However, with less requirements there are also less checks and validations performed inside of PowerSimulations which might lead to unexpected errors","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"struct MyCustomDecisionProblem <: PSI.DecisionProblem end","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Alternatively, it is possible to define a Custom Decision Problem subtyping from DefaultDecisionProblem which imposes more requirements and structure onto the developer but employs more checks and validations in the process. Be aware that this route will decrease the flexibility of what can be done inside the custom model.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"struct MyCustomDecisionProblem <: PSI.DefaultDecisionProblem end","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"Once the problem type is defined, initialize the decision model container with your custom decision problem passing the solver and some of the settings you need for the solution of the problem. For custom problems some of the settings need manual implementation by the developer. Settings availability is also dependent on wether you choose to subtype from PSI.DecisionProblem or PSI.DefaultDecisionProblem","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"my_model = DecisionModel{MyCustomDecisionProblem}(\n sys;\n name = \"MyModel\",\n optimizer = optimizer_with_attributes(HiGHS.Optimizer),\n optimizer_solve_log_print = true,\n)","category":"page"},{"location":"tutorials/adding_new_problem_model/#Mandatory-Method-Implementations","page":"Adding an Operations Problem Model","title":"Mandatory Method Implementations","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"build_model!: This method build the JuMP optimization model.","category":"page"},{"location":"tutorials/adding_new_problem_model/#Optional-Method-Overloads","page":"Adding an Operations Problem Model","title":"Optional Method Overloads","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"These methods can be defined optionally for your problem. By default for problems subtyped from DecisionProblem these checks are not executed. If the problems are subtyped from DefaultDecisionProblem these checks are always conducted with PowerSimulations defaults and require compliance with those defaults to pass. In any case, these can be overloaded when necessary depending on the problem requirements.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"validate_template\nvalidate_time_series!\nreset!\nsolve_impl!","category":"page"},{"location":"tutorials/adding_new_problem_model/#How-to-develop-your-build_model!-function","page":"Adding an Operations Problem Model","title":"How to develop your build_model! function","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/#Registering-a-variable-in-the-model","page":"Adding an Operations Problem Model","title":"Registering a variable in the model","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"To register a variable in the model, the developer must first allocate the container into the optimization container and then populate it. For example, it require start the build function as follows:","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"info: Info\nWe recommend calling import PowerSimulations and defining the constant CONST PSI = PowerSimulations to make it easier to read the code and determine which package is responsible for defining the functions.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"function PSI.build_model!(model::PSI.DecisionModel{MyCustomDecisionProblem})\n container = PSI.get_optimization_container(model)\n time_steps = 1:24\n PSI.set_time_steps!(container, time_steps)\n system = PSI.get_system(model)\n\n thermal_gens = PSY.get_components(PSY.ThermalStandard, system)\n thermal_gens_names = PSY.get_name.(thermal_gens)\n\n # Create the container for the variable\n variable = PSI.add_variable_container!(\n container,\n PSI.ActivePowerVariable(), # <- This variable is defined in PowerSimulations but the user can define their own\n PSY.ThermalGeneration, # <- Device type for the variable. Can be from PSY or custom defined\n thermal_gens_names, # <- First container dimension\n time_steps, # <- Second container dimension\n )\n\n # Iterate over the devices and time to store the JuMP variables into the container.\n for t in time_steps, d in thermal_gens_names\n name = PSY.get_name(d)\n variable[name, t] = JuMP.@variable(get_jump_model(container))\n # It is possible to use PSY getter functions to retrieve data from the generators\n JuMP.set_upper_bound(variable[name, t], UB_DATA) # <- Optional\n JuMP.set_lower_bound(variable[name, t], LB_DATA) # <- Optional\n end\n\n # Add More Variables.....\n\n return\nend","category":"page"},{"location":"tutorials/adding_new_problem_model/#Registering-a-constraint-in-the-model","page":"Adding an Operations Problem Model","title":"Registering a constraint in the model","text":"","category":"section"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"A similar pattern is used to add constraints to the model, in this example the field meta is used to avoid creating unnecessary duplicate constraint types. For instance to reflect upperbound and lowerbound or upwards and downwards constraints. Meta can take any string value except for the _ character.","category":"page"},{"location":"tutorials/adding_new_problem_model/","page":"Adding an Operations Problem Model","title":"Adding an Operations Problem Model","text":"function PSI.build_model!(model::PSI.DecisionModel{MyCustomDecisionProblem})\n container = PSI.get_optimization_container(model)\n time_steps = 1:24\n PSI.set_time_steps!(container, time_steps)\n system = PSI.get_system(model)\n\n # VARIABLE ADDITION CODE\n\n # Constraint additions\n con_ub = PSI.add_constraints_container!(\n container,\n PSI.RangeLimitConstraint(), # <- Constraint Type defined by PSI or your own\n PSY.ThermalGeneration, # <- Device type for variable. Can be PSY or custom\n thermal_gens_names, # <- First container dimension\n time_steps; # <- Second container dimension\n meta = \"ub\", # <- meta allows to reuse a constraint definition for similar constraints. It only requires to be a string\n )\n\n con_lb = PSI.add_constraints_container!(\n container,\n PSI.RangeLimitConstraint(),\n PSY.ThermalGeneration,\n thermal_gens_names, # <- First container dimension\n time_steps; # <- Second container dimension\n meta = \"lb\", # <- meta allows to reuse a constraint definition for similar constraints. It only requires to be a string\n )\n\n # Retrieve a relevant variable from the container if not defined in\n variable = PSI.get_variable(container, PSI.ActivePowerVariable(), PSY.ThermalGeneration)\n for device in devices, t in time_steps\n ci_name = PSY.get_name(device)\n limits = get_min_max_limits(device) # depends on constraint type and formulation type\n con_ub[ci_name, t] =\n JuMP.@constraint(get_jump_model(container), variable[ci_name, t] >= limits.min)\n con_lb[ci_name, t] =\n JuMP.@constraint(get_jump_model(container), variable[ci_name, t] >= limits.min)\n end\n\n return\nend","category":"page"},{"location":"formulation_library/Branch/#PowerSystems.Branch-Formulations","page":"Branch","title":"PowerSystems.Branch Formulations","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/Branch/#Table-of-contents","page":"Branch","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranch\nStaticBranchBounds\nStaticBranchUnbounded\nHVDCTwoTerminalUnbounded\nHVDCTwoTerminalLossless\nHVDCTwoTerminalDispatch\nPhaseAngleControl\nValid configurations","category":"page"},{"location":"formulation_library/Branch/#StaticBranch","page":"Branch","title":"StaticBranch","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranch","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.StaticBranch","page":"Branch","title":"PowerSimulations.StaticBranch","text":"Branch type to add unbounded flow variables and use flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: (-inftyinfty)\nSymbol: f If Slack variables are enabled:\nFlowActivePowerSlackUpperBound:\nBounds: [0.0, ]\nDefault proportional cost: 2e5\nSymbol: f^textslup\nFlowActivePowerSlackLowerBound:\nBounds: [0.0, ]\nDefault proportional cost: 2e5\nSymbol: f^textsllo","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textmax = PowerSystems.get_rating(branch)","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Add a large proportional cost to the objective function if rate constraint slack variables are used + (f^textslup + f^textsllo) cdot 2 cdot 10^5","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No expressions are used.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\n f_t - f_t^textslup le R^textmaxquad forall t in 1dots T \n f_t + f_t^textsllo ge -R^textmaxquad forall t in 1dots T \nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#StaticBranchBounds","page":"Branch","title":"StaticBranchBounds","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranchBounds","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.StaticBranchBounds","page":"Branch","title":"PowerSimulations.StaticBranchBounds","text":"Branch type to add bounded flow variables and use flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: left-R^textmaxR^textmaxright\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textmax = PowerSystems.get_rating(branch)","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No expressions are used.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#StaticBranchUnbounded","page":"Branch","title":"StaticBranchUnbounded","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"StaticBranchUnbounded","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.StaticBranchUnbounded","page":"Branch","title":"PowerSimulations.StaticBranchUnbounded","text":"Branch type to avoid flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: (-inftyinfty)\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No expressions are used.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#HVDCTwoTerminalUnbounded","page":"Branch","title":"HVDCTwoTerminalUnbounded","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"HVDCTwoTerminalUnbounded","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.HVDCTwoTerminalUnbounded","page":"Branch","title":"PowerSimulations.HVDCTwoTerminalUnbounded","text":"Branch type to avoid flow constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"This model assumes that it can transfer power from two AC buses without losses and no limits.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: left(-inftyinftyright)\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"The variable FlowActivePowerVariable f is added to the nodal balance expression ActivePowerBalance, by adding the flow f in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No constraints are added.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#HVDCTwoTerminalLossless","page":"Branch","title":"HVDCTwoTerminalLossless","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"HVDCTwoTerminalLossless","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.HVDCTwoTerminalLossless","page":"Branch","title":"PowerSimulations.HVDCTwoTerminalLossless","text":"Branch type to represent lossless power flow on DC lines\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"This model assumes that it can transfer power from two AC buses without losses.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: left(-inftyinftyright)\nSymbol: f","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textfrommin = PowerSystems.get_active_power_limits_from(branch).min\nR^textfrommax = PowerSystems.get_active_power_limits_from(branch).max\nR^texttomin = PowerSystems.get_active_power_limits_to(branch).min\nR^texttomax = PowerSystems.get_active_power_limits_to(branch).max","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"The variable FlowActivePowerVariable f is added to the nodal balance expression ActivePowerBalance, by adding the flow f in the receiving bus and subtracting it from the sending bus. This is used then to compute the AC flows using the PTDF equation.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textmin le f_t le R^textmaxquad forall t in 1dots T \nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"where:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textmin = begincases\n\t\t\tminleft(R^textfrommin R^texttominright) textif R^textfrommin ge 0 text and R^texttomin ge 0 \n maxleft(R^textfrommin R^texttominright) textif R^textfrommin le 0 text and R^texttomin le 0 \n R^textfrommin textif R^textfrommin le 0 text and R^texttomin ge 0 \n R^texttomin textif R^textfrommin ge 0 text and R^texttomin le 0\n\t\t endcases\nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"and","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textmax = begincases\n\t\t\tminleft(R^textfrommax R^texttomaxright) textif R^textfrommax ge 0 text and R^texttomax ge 0 \n maxleft(R^textfrommax R^texttomaxright) textif R^textfrommax le 0 text and R^texttomax le 0 \n R^textfrommax textif R^textfrommax le 0 text and R^texttomax ge 0 \n R^texttomax textif R^textfrommax ge 0 text and R^texttomax le 0\n\t\t endcases\nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#HVDCTwoTerminalDispatch","page":"Branch","title":"HVDCTwoTerminalDispatch","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"HVDCTwoTerminalDispatch","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.HVDCTwoTerminalDispatch","page":"Branch","title":"PowerSimulations.HVDCTwoTerminalDispatch","text":"Branch type to represent lossy power flow on DC lines\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerToFromVariable:\nSymbol: f^textto-from\nFlowActivePowerFromToVariable:\nSymbol: f^textfrom-to\nHVDCLosses:\nSymbol: ell\nHVDCFlowDirectionVariable\nBounds: 01\nSymbol: u^textdir","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textfrommin = PowerSystems.get_active_power_limits_from(branch).min\nR^textfrommax = PowerSystems.get_active_power_limits_from(branch).max\nR^texttomin = PowerSystems.get_active_power_limits_to(branch).min\nR^texttomax = PowerSystems.get_active_power_limits_to(branch).max\nL_0 = PowerSystems.get_loss(branch).l0\nL_1 = PowerSystems.get_loss(branch).l1","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No cost is added to the objective function.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Each FlowActivePowerToFromVariable f^textto-from and FlowActivePowerFromToVariable f^textfrom-to is added to the nodal balance expression ActivePowerBalance, by adding the respective flow in the receiving bus and subtracting it from the sending bus. That is, f^textto-from adds the flow to the from bus, and subtracts the flow from the to bus, while f^textfrom-to adds the flow to the to bus, and subtracts the flow from the from bus This is used then to compute the AC flows using the PTDF equation.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"In addition, the HVDCLosses are subtracted to the from bus in the ActivePowerBalance expression.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginalign*\n R^textfrommin le f_t^textfrom-to le R^textfrommax forall t in 1dots T \n R^texttomin le f_t^textto-from le R^texttomaxquad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to le L_1 cdot f_t^textto-from - L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge L_1 cdot f_t^textfrom-to + L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge - M^textbig (1 - u^textdir_t)quad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to ge - M^textbig u^textdir_tquad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to le ell_tquad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from le ell_tquad forall t in 1dots T \nendalign*","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#PhaseAngleControl","page":"Branch","title":"PhaseAngleControl","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Formulation valid for PTDFPowerModel Network model","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"PhaseAngleControl","category":"page"},{"location":"formulation_library/Branch/#PowerSimulations.PhaseAngleControl","page":"Branch","title":"PowerSimulations.PhaseAngleControl","text":"Branch formulation for PhaseShiftingTransformer flow control\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Variables:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"FlowActivePowerVariable:\nBounds: (-inftyinfty)\nSymbol: f\nPhaseShifterAngle:\nSymbol: theta^textshift","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Static Parameters","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"R^textmax = PowerSystems.get_rating(branch)\nTheta^textmin = PowerSystems.get_phase_angle_limits(branch).min\nTheta^textmax = PowerSystems.get_phase_angle_limits(branch).max\nX = PowerSystems.get_x(branch) (series reactance)","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Objective:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"No changes to objective function","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Expressions:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Adds to the ActivePowerBalance expression the term -theta^textshift X to the from bus and +theta^textshift X to the to bus, that the PhaseShiftingTransformer is connected.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Constraints:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"For each branch b in 1dots B (in a system with N buses) the constraints are given by:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"beginaligned\n f_t = sum_i=1^N textPTDF_ib cdot textBal_it + fractheta^textshift_tX quad forall t in 1dots T\n -R^textmax le f_t le R^textmaxquad forall t in 1dots T \nendaligned","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"on which textPTDF is the N times B system Power Transfer Distribution Factors (PTDF) matrix, and textBal_it is the active power bus balance expression (i.e. textGeneration_it - textDemand_it) at bus i at time-step t.","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"","category":"page"},{"location":"formulation_library/Branch/#Valid-configurations","page":"Branch","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"Valid DeviceModels for subtypes of Branch include the following:","category":"page"},{"location":"formulation_library/Branch/","page":"Branch","title":"Branch","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> (x[\"device_type\"] <: Branch) && (x[\"device_type\"] != TModelHVDCLine), combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"modeler_guide/problem_templates/#op_problem_template","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"","category":"section"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"Templates are used to specify the modeling properties of the devices and network that are going to he used to specify a problem. A ProblemTemplate is just a collection of DeviceModels that allows the user to specify the formulations of each set of devices (by device type) independently so that the modeler can adjust the level of detail according to the question of interest and the available data. For more information about valid DeviceModels and their mathematical representations, check out the Formulation Library.","category":"page"},{"location":"modeler_guide/problem_templates/#Building-a-ProblemTemplate","page":"Operations ProblemTemplates","title":"Building a ProblemTemplate","text":"","category":"section"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"You can build a ProblemTemplate by adding a NetworkModel, DeviceModels, and ServiceModels.","category":"page"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"template = ProblemTemplate()\nset_network_model!(template, NetworkModel(CopperPlatePowerModel))\nset_device_model!(template, PowerLoad, StaticPowerLoad)\nset_device_model!(template, ThermalStandard, ThermalBasicUnitCommitment)\nset_service_model!(template, VariableReserve{ReserveUp}, RangeReserve)","category":"page"},{"location":"modeler_guide/problem_templates/#Default-Templates","page":"Operations ProblemTemplates","title":"Default Templates","text":"","category":"section"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"PowerSimulations.jl provides default templates for common operation problems. You can retrieve a default template and modify it according to your requirements. Currently supported default templates are:","category":"page"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"template_economic_dispatch","category":"page"},{"location":"modeler_guide/problem_templates/#PowerSimulations.template_economic_dispatch-modeler_guide-problem_templates","page":"Operations ProblemTemplates","title":"PowerSimulations.template_economic_dispatch","text":"template_economic_dispatch(; kwargs...) -> ProblemTemplate\n\n\ntemplate_economic_dispatch(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for an Economic Dispatch problem.\n\nExample\n\ntemplate = templateeconomicdispatch()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"function"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"using PowerSimulations #hide\ntemplate_economic_dispatch()","category":"page"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"template_unit_commitment","category":"page"},{"location":"modeler_guide/problem_templates/#PowerSimulations.template_unit_commitment-modeler_guide-problem_templates","page":"Operations ProblemTemplates","title":"PowerSimulations.template_unit_commitment","text":"template_unit_commitment(; kwargs...) -> ProblemTemplate\n\n\ntemplate_unit_commitment(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for a Unit Commitment problem.\n\nExample\n\ntemplate = templateunitcommitment()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"function"},{"location":"modeler_guide/problem_templates/","page":"Operations ProblemTemplates","title":"Operations ProblemTemplates","text":"using PowerSimulations #hide\ntemplate_unit_commitment()","category":"page"},{"location":"code_base_developer_guide/developer/#Guidelines-for-Developers","page":"Developer Guide","title":"Guidelines for Developers","text":"","category":"section"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"In order to contribute to PowerSystems.jl repository please read the following sections of InfrastructureSystems.jl documentation in detail:","category":"page"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"Style Guide\nContributing Guidelines","category":"page"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"Pull requests are always welcome to fix bugs or add additional modeling capabilities.","category":"page"},{"location":"code_base_developer_guide/developer/","page":"Developer Guide","title":"Developer Guide","text":"All the code contributions need to include tests with a minimum coverage of 70%","category":"page"},{"location":"modeler_guide/modeling_faq/#Modeling-FAQ","page":"Modeling FAQ","title":"Modeling FAQ","text":"","category":"section"},{"location":"modeler_guide/modeling_faq/","page":"Modeling FAQ","title":"Modeling FAQ","text":"question: How do I reduce the amount of print on my REPL?\nThe print to the REPL is controlled with the logging. Check the Logging documentation page to see how to reduce the print out","category":"page"},{"location":"modeler_guide/modeling_faq/","page":"Modeling FAQ","title":"Modeling FAQ","text":"question: How do I print the optimizer logs to see the solution process?\nWhen specifying the DecisionModel or EmulationModel pass the keyword print_optimizer_log = true","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"CurrentModule = PowerSimulations\nDocTestSetup = quote\n using PowerSimulations\nend","category":"page"},{"location":"api/PowerSimulations/#API-Reference","page":"API Reference","title":"API Reference","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Pages = [\"PowerSimulations.md\"]\nDepth = 3","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/#Device-Models","page":"API Reference","title":"Device Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"List of structures and methods for Device models","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"DeviceModel","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.DeviceModel","page":"API Reference","title":"PowerSimulations.DeviceModel","text":"DeviceModel(\n ::Type{D},\n ::Type{B},\n feedforwards::Vector{<:AbstractAffectFeedforward}\n use_slacks::Bool,\n duals::Vector{DataType},\n services::Vector{ServiceModel}\n attributes::Dict{String, Any}\n)\n\nEstablishes the model for a particular device specified by type. Uses the keyword argument feedforward to enable passing values between operation model at simulation time\n\nArguments\n\n::Type{D} where D<:PSY.Device: Power System Device Type\n::Type{B} where B<:AbstractDeviceFormulation: Abstract Device Formulation\nfeedforward::Array{<:AbstractAffectFeedforward} = Vector{AbstractAffectFeedforward}() : use to pass parameters between models\nuse_slacks::Bool = false : Add slacks to the device model. Implementation is model dependent and not all models feature slacks\nduals::Vector{DataType} = Vector{DataType}(): use to pass constraint type to calculate the duals. The DataType needs to be a valid ConstraintType\ntime_series_names::Dict{Type{<:TimeSeriesParameter}, String} = get_default_time_series_names(D, B) : use to specify time series names associated to the device`\nattributes::Dict{String, Any} = get_default_attributes(D, B) : use to specify attributes to the device\n\nExample\n\nthermal_gens = DeviceModel(ThermalStandard, ThermalBasicUnitCommitment)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Formulations","page":"API Reference","title":"Formulations","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Refer to the Formulations Page for each Abstract Device Formulation.","category":"page"},{"location":"api/PowerSimulations/#Problem-Templates","page":"API Reference","title":"Problem Templates","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"problem_template.jl\",\n \"operation_problem_templates.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ProblemTemplate","page":"API Reference","title":"PowerSimulations.ProblemTemplate","text":"ProblemTemplate(::Type{T}) where {T<:PM.AbstractPowerFormulation}\n\nCreates a model reference of the PowerSimulations Optimization Problem.\n\nArguments\n\nmodel::Type{T<:PM.AbstractPowerFormulation}:\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.set_device_model!-Tuple{ProblemTemplate, DeviceModel}","page":"API Reference","title":"PowerSimulations.set_device_model!","text":"set_device_model!(\n template::ProblemTemplate,\n model::DeviceModel\n)\n\n\nSets the device model in a template using a DeviceModel instance\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_device_model!-Tuple{ProblemTemplate, Type{<:Device}, Type{<:PowerSimulations.AbstractDeviceFormulation}}","page":"API Reference","title":"PowerSimulations.set_device_model!","text":"set_device_model!(\n template::ProblemTemplate,\n component_type::Type{<:Device},\n formulation::Type{<:PowerSimulations.AbstractDeviceFormulation}\n)\n\n\nSets the device model in a template using the component type and formulation. Builds a default DeviceModel\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_network_model!-Tuple{ProblemTemplate, NetworkModel}","page":"API Reference","title":"PowerSimulations.set_network_model!","text":"set_network_model!(\n template::ProblemTemplate,\n model::NetworkModel\n)\n\n\nSets the network model in a template.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_service_model!-Tuple{ProblemTemplate, String, Type{<:Service}, Type{<:PowerSimulations.AbstractServiceFormulation}}","page":"API Reference","title":"PowerSimulations.set_service_model!","text":"set_service_model!(\n template::ProblemTemplate,\n service_name::String,\n service_type::Type{<:Service},\n formulation::Type{<:PowerSimulations.AbstractServiceFormulation}\n)\n\n\nSets the service model in a template using a name and the service type and formulation. Builds a default ServiceModel with useservicename set to true.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_service_model!-Tuple{ProblemTemplate, Type{<:Service}, Type{<:PowerSimulations.AbstractServiceFormulation}}","page":"API Reference","title":"PowerSimulations.set_service_model!","text":"set_service_model!(\n template::ProblemTemplate,\n service_type::Type{<:Service},\n formulation::Type{<:PowerSimulations.AbstractServiceFormulation}\n)\n\n\nSets the service model in a template using a ServiceModel instance.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.template_economic_dispatch-Tuple{}","page":"API Reference","title":"PowerSimulations.template_economic_dispatch","text":"template_economic_dispatch(; kwargs...) -> ProblemTemplate\n\n\ntemplate_economic_dispatch(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for an Economic Dispatch problem.\n\nExample\n\ntemplate = templateeconomicdispatch()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.template_unit_commitment-Tuple{}","page":"API Reference","title":"PowerSimulations.template_unit_commitment","text":"template_unit_commitment(; kwargs...) -> ProblemTemplate\n\n\ntemplate_unit_commitment(; kwargs...)\n\nCreates a ProblemTemplate with default DeviceModels for a Unit Commitment problem.\n\nExample\n\ntemplate = templateunitcommitment()\n\n\n# Accepted Key Words\n- `network::Type{<:PM.AbstractPowerModel}` : override default network model settings\n- `devices::Vector{DeviceModel}` : override default `DeviceModel` settings\n- `services::Vector{ServiceModel}` : override default `ServiceModel` settings\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Decision-Models","page":"API Reference","title":"Decision Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"decision_model.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Tuple{AbstractString, MathOptInterface.OptimizerWithAttributes}","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"DecisionModel(\n directory::AbstractString,\n optimizer::MathOptInterface.OptimizerWithAttributes;\n jump_model,\n system\n) -> Any\n\n\nConstruct an DecisionProblem from a serialized file.\n\nArguments\n\ndirectory::AbstractString: Directory containing a serialized model\njump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.\noptimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\nsystem::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Union{Tuple{M}, Tuple{PowerSimulations.AbstractProblemTemplate, System, PowerSimulations.Settings}, Tuple{PowerSimulations.AbstractProblemTemplate, System, PowerSimulations.Settings, Union{Nothing, JuMP.Model}}} where M<:PowerSimulations.DecisionProblem","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"DecisionModel{M}(\n template::AbstractProblemTemplate,\n sys::PSY.System,\n jump_model::Union{Nothing, JuMP.Model}=nothing;\n kwargs...) where {M<:DecisionProblem}\n\nBuild the optimization problem of type M with the specific system and template.\n\nArguments\n\n::Type{M} where M<:DecisionProblem: The abstract operation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care\nname = nothing: name of model, string or symbol; defaults to the type of template converted to a symbol.\noptimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing : The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\nhorizon::Dates.Period = UNSET_HORIZON: Manually specify the length of the forecast Horizon\nresolution::Dates.Period = UNSET_RESOLUTION: Manually specify the model's resolution\nwarm_start::Bool = true: True will use the current operation point in the system to initialize variable values. False initializes all variables to zero. Default is true\nsystem_to_file::Bool = true:: True to create a copy of the system used in the model.\ninitialize_model::Bool = true: Option to decide to initialize the model or not.\ninitialization_file::String = \"\": This allows to pass pre-existing initialization values to avoid the solution of an optimization problem to find feasible initial conditions.\ndeserialize_initial_conditions::Bool = false: Option to deserialize conditions\nexport_pwl_vars::Bool = false: True to export all the pwl intermediate variables. It can slow down significantly the build and solve time.\nallow_fails::Bool = false: True to allow the simulation to continue even if the optimization step fails. Use with care.\noptimizer_solve_log_print::Bool = false: Uses JuMP.unset_silent() to print the optimizer's log. By default all solvers are set to MOI.Silent()\ndetailed_optimizer_stats::Bool = false: True to save detailed optimizer stats log.\ncalculate_conflict::Bool = false: True to use solver to calculate conflicts for infeasible problems. Only specific solvers are able to calculate conflicts.\ndirect_mode_optimizer::Bool = false: True to use the solver in direct mode. Creates a JuMP.direct_model.\nstore_variable_names::Bool = false: to store variable names in optimization model. Decreases the build times.\nrebuild_model::Bool = false: It will force the rebuild of the underlying JuMP model with each call to update the model. It increases solution times, use only if the model can't be updated in memory.\ninitial_time::Dates.DateTime = UNSET_INI_TIME: Initial Time for the model solve.\ntime_series_cache_size::Int = IS.TIME_SERIES_CACHE_SIZE_BYTES: Size in bytes to cache for each time array. Default is 1 MiB. Set to 0 to disable.\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nOpModel = DecisionModel(MockOperationProblem, template, system)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Union{Tuple{M}, Tuple{Type{M}, PowerSimulations.AbstractProblemTemplate, System}, Tuple{Type{M}, PowerSimulations.AbstractProblemTemplate, System, Union{Nothing, JuMP.Model}}} where M<:PowerSimulations.DecisionProblem","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"DecisionModel(\n ::Type{M<:PowerSimulations.DecisionProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System;\n ...\n) -> DecisionModel\nDecisionModel(\n ::Type{M<:PowerSimulations.DecisionProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System,\n jump_model::Union{Nothing, JuMP.Model};\n kwargs...\n) -> DecisionModel\n\n\nBuild the optimization problem of type M with the specific system and template\n\nArguments\n\n::Type{M} where M<:DecisionProblem: The abstract operation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model} = nothing: Enables passing a custom JuMP model. Use with care.\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nproblem = DecisionModel(MyOpProblemType, template, system, optimizer)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.DecisionModel-Union{Tuple{System}, Tuple{M}, Tuple{System, Union{Nothing, JuMP.Model}}} where M<:PowerSimulations.DecisionProblem","page":"API Reference","title":"PowerSimulations.DecisionModel","text":"Builds an empty decision model. This constructor is used for the implementation of custom decision models that do not require a template.\n\nArguments\n\n::Type{M} where M<:DecisionProblem: The abstract operation model type\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model} = nothing: Enables passing a custom JuMP model. Use with care.\n\nExample\n\nproblem = DecisionModel(system, optimizer)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.GenericOpProblem","page":"API Reference","title":"PowerSimulations.GenericOpProblem","text":"Generic PowerSimulations Operation Problem Type for unspecified models\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.build!-Tuple{DecisionModel}","page":"API Reference","title":"PowerSimulations.build!","text":"build!(\n model::DecisionModel;\n output_dir,\n recorders,\n console_level,\n file_level,\n disable_timer_outputs\n)\n\n\nBuild the Decision Model based on the specified DecisionProblem.\n\nArguments\n\nmodel::DecisionModel{<:DecisionProblem}: DecisionModel object\noutput_dir::String: Output directory for results\nrecorders::Vector{Symbol} = []: recorder names to register\nconsole_level = Logging.Error:\nfile_level = Logging.Info:\ndisable_timer_outputs = false : Enable/Disable timing outputs\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.solve!-Tuple{DecisionModel}","page":"API Reference","title":"PowerSimulations.solve!","text":"solve!(\n model::DecisionModel;\n export_problem_results,\n console_level,\n file_level,\n disable_timer_outputs,\n export_optimization_problem,\n kwargs...\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault solve method for models that conform to the requirements of DecisionModel{<: DecisionProblem}.\n\nThis will call build! on the model if it is not already built. It will forward all keyword arguments to that function.\n\nArguments\n\nmodel::OperationModel = model: operation model\nexport_problem_results::Bool = false: If true, export OptimizationProblemResults DataFrames to CSV files. Reduces solution times during simulation.\nconsole_level = Logging.Error:\nfile_level = Logging.Info:\ndisable_timer_outputs = false : Enable/Disable timing outputs\nexport_optimization_problem::Bool = true: If true, serialize the model to a file to allow re-execution later.\n\nExamples\n\nresults = solve!(OpModel)\nresults = solve!(OpModel, export_problem_results = true)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.solve!-Tuple{Int64, DecisionModel, Dates.DateTime, PowerSimulations.SimulationStore}","page":"API Reference","title":"PowerSimulations.solve!","text":"solve!(\n step::Int64,\n model::DecisionModel,\n start_time::Dates.DateTime,\n store::PowerSimulations.SimulationStore;\n exports\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault solve method for a DecisionModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}\n\nArguments\n\nstep::Int: Simulation Step\nmodel::OperationModel: operation model\nstart_time::Dates.DateTime: Initial Time of the simulation step in Simulation time.\nstore::SimulationStore: Simulation output store\n\nAccepted Key Words\n\nexports: realtime export of output. Use wisely, it can have negative impacts in the simulation times\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Emulation-Models","page":"API Reference","title":"Emulation Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"EmulationModel\nEmulationModel(::Type{M} where {M <: EmulationProblem}, ::ProblemTemplate, ::PSY.System, ::Union{Nothing, JuMP.Model})\nEmulationModel(::AbstractString, ::MOI.OptimizerWithAttributes)\nbuild!(::EmulationModel)\nrun!(::EmulationModel)\nsolve!(::Int, ::EmulationModel{<:EmulationProblem}, ::Dates.DateTime, ::SimulationStore)","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.EmulationModel","page":"API Reference","title":"PowerSimulations.EmulationModel","text":"EmulationModel{M}(\n template::AbstractProblemTemplate,\n sys::PSY.System,\n jump_model::Union{Nothing, JuMP.Model}=nothing;\n kwargs...) where {M<:EmulationProblem}\n\nBuild the optimization problem of type M with the specific system and template.\n\nArguments\n\n::Type{M} where M<:EmulationProblem: The abstract Emulation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care\nname = nothing: name of model, string or symbol; defaults to the type of template converted to a symbol.\noptimizer::Union{Nothing,MOI.OptimizerWithAttributes} = nothing : The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\nwarm_start::Bool = true: True will use the current operation point in the system to initialize variable values. False initializes all variables to zero. Default is true\nsystem_to_file::Bool = true:: True to create a copy of the system used in the model.\ninitialize_model::Bool = true: Option to decide to initialize the model or not.\ninitialization_file::String = \"\": This allows to pass pre-existing initialization values to avoid the solution of an optimization problem to find feasible initial conditions.\ndeserialize_initial_conditions::Bool = false: Option to deserialize conditions\nexport_pwl_vars::Bool = false: True to export all the pwl intermediate variables. It can slow down significantly the build and solve time.\nallow_fails::Bool = false: True to allow the simulation to continue even if the optimization step fails. Use with care.\ncalculate_conflict::Bool = false: True to use solver to calculate conflicts for infeasible problems. Only specific solvers are able to calculate conflicts.\noptimizer_solve_log_print::Bool = false: Uses JuMP.unset_silent() to print the optimizer's log. By default all solvers are set to MOI.Silent()\ndetailed_optimizer_stats::Bool = false: True to save detailed optimizer stats log.\ndirect_mode_optimizer::Bool = false: True to use the solver in direct mode. Creates a JuMP.direct_model.\nstore_variable_names::Bool = false: True to store variable names in optimization model.\nrebuild_model::Bool = false: It will force the rebuild of the underlying JuMP model with each call to update the model. It increases solution times, use only if the model can't be updated in memory.\ninitial_time::Dates.DateTime = UNSET_INI_TIME: Initial Time for the model solve.\ntime_series_cache_size::Int = IS.TIME_SERIES_CACHE_SIZE_BYTES: Size in bytes to cache for each time array. Default is 1 MiB. Set to 0 to disable.\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nOpModel = EmulationModel(MockEmulationProblem, template, system)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.EmulationModel-Tuple{Type{M} where M<:PowerSimulations.EmulationProblem, ProblemTemplate, System, Union{Nothing, JuMP.Model}}","page":"API Reference","title":"PowerSimulations.EmulationModel","text":"EmulationModel(\n ::Type{M<:PowerSimulations.EmulationProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System;\n ...\n) -> EmulationModel\nEmulationModel(\n ::Type{M<:PowerSimulations.EmulationProblem},\n template::PowerSimulations.AbstractProblemTemplate,\n sys::System,\n jump_model::Union{Nothing, JuMP.Model};\n kwargs...\n) -> EmulationModel\n\n\nBuild the optimization problem of type M with the specific system and template\n\nArguments\n\n::Type{M} where M<:EmulationProblem: The abstract Emulation model type\ntemplate::AbstractProblemTemplate: The model reference made up of transmission, devices, branches, and services.\nsys::PSY.System: the system created using Power Systems\njump_model::Union{Nothing, JuMP.Model}: Enables passing a custom JuMP model. Use with care\n\nExample\n\ntemplate = ProblemTemplate(CopperPlatePowerModel, devices, branches, services)\nproblem = EmulationModel(MyEmProblemType, template, system, optimizer)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.EmulationModel-Tuple{AbstractString, MathOptInterface.OptimizerWithAttributes}","page":"API Reference","title":"PowerSimulations.EmulationModel","text":"EmulationModel(\n directory::AbstractString,\n optimizer::MathOptInterface.OptimizerWithAttributes;\n jump_model,\n system,\n kwargs...\n) -> Any\n\n\nConstruct an EmulationProblem from a serialized file.\n\nArguments\n\ndirectory::AbstractString: Directory containing a serialized model.\noptimizer::MOI.OptimizerWithAttributes: The optimizer does not get serialized. Callers should pass whatever they passed to the original problem.\njump_model::Union{Nothing, JuMP.Model} = nothing: The JuMP model does not get serialized. Callers should pass whatever they passed to the original problem.\nsystem::Union{Nothing, PSY.System}: Optionally, the system used for the model. If nothing and systofile was set to true when the model was created, the system will be deserialized from a file.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.build!-Tuple{EmulationModel}","page":"API Reference","title":"PowerSimulations.build!","text":"build!(\n model::EmulationModel;\n executions,\n output_dir,\n recorders,\n console_level,\n file_level,\n disable_timer_outputs\n)\n\n\nImplementation of build for any EmulationProblem\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.run!-Tuple{EmulationModel}","page":"API Reference","title":"PowerSimulations.run!","text":"run!(\n model::EmulationModel;\n export_problem_results,\n console_level,\n file_level,\n disable_timer_outputs,\n export_optimization_model,\n kwargs...\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault run method for problems that conform to the requirements of EmulationModel{<: EmulationProblem}\n\nThis will call build! on the model if it is not already built. It will forward all keyword arguments to that function.\n\nArguments\n\nmodel::EmulationModel = model: Emulation model\noptimizer::MOI.OptimizerWithAttributes: The optimizer that is used to solve the model\nexecutions::Int: Number of executions for the emulator run\nexport_problem_results::Bool: If true, export OptimizationProblemResults DataFrames to CSV files.\noutput_dir::String: Required if the model is not already built, otherwise ignored\nenable_progress_bar::Bool: Enables/Disable progress bar printing\nexport_optimization_model::Bool: If true, serialize the model to a file to allow re-execution later.\n\nExamples\n\nstatus = run!(model; optimizer = GLPK.Optimizer, executions = 10)\nstatus = run!(model; output_dir = ./model_output, optimizer = GLPK.Optimizer, executions = 10)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.solve!-Tuple{Int64, EmulationModel, Dates.DateTime, PowerSimulations.SimulationStore}","page":"API Reference","title":"PowerSimulations.solve!","text":"solve!(\n step::Int64,\n model::EmulationModel,\n start_time::Dates.DateTime,\n store::PowerSimulations.SimulationStore;\n exports\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nDefault solve method for an EmulationModel used inside of a Simulation. Solves problems that conform to the requirements of DecisionModel{<: DecisionProblem}\n\nArguments\n\nstep::Int: Simulation Step\nmodel::OperationModel: operation model\nstart_time::Dates.DateTime: Initial Time of the simulation step in Simulation time.\nstore::SimulationStore: Simulation output store\nexports = nothing: realtime export of output. Use wisely, it can have negative impacts in the simulation times\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Service-Models","page":"API Reference","title":"Service Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"List of structures and methods for Service models","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ServiceModel","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ServiceModel","page":"API Reference","title":"PowerSimulations.ServiceModel","text":"Establishes the model for a particular services specified by type. Uses the keyword argument use_service_name to assign the model to a service with the same name as the name in the template. Uses the keyword argument feedforward to enable passing values between operation model at simulation time\n\nArguments\n\n-::Type{D}: Power System Service Type -::Type{B}: Abstract Service Formulation\n\nAccepted Key Words\n\nfeedforward::Array{<:AbstractAffectFeedforward} : use to pass parameters between models\nuse_service_name::Bool : use the name as the name for the service\n\nExample\n\nreserves = ServiceModel(PSY.VariableReserve{PSY.ReserveUp}, RangeReserve)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Simulation-Models","page":"API Reference","title":"Simulation Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Refer to the Simulations Page to explanations on how to setup a Simulation, with Sequencing and Feedforwards.","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"InitialCondition\nSimulationModels\nSimulationSequence\nSimulation\nSimulation(::AbstractString, ::Dict)\nbuild!(::Simulation)\nexecute!(::Simulation)","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.InitialCondition","page":"API Reference","title":"PowerSimulations.InitialCondition","text":"Container for the initial condition data\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationModels","page":"API Reference","title":"PowerSimulations.SimulationModels","text":"SimulationModels(\n decision_models::Vector{<:DecisionModel},\n emulation_models::Union{Nothing, EmulationModel}\n)\n\nStores the OperationProblem definitions to be used in the simulation. When creating the SimulationModels, the order in which the models are created determines the order on which the simulation is executed.\n\nArguments\n\ndecision_models::Vector{<:DecisionModel}: Vector of decision models.\nemulation_models::Union{Nothing, EmulationModel}: Optional argument to include\n\nan EmulationModel in the Simulation\n\nExample\n\ntemplate_uc = template_unit_commitment()\ntemplate_ed = template_economic_dispatch()\nmy_decision_model_uc = DecisionModel(template_1, sys_uc, optimizer, name = \"UC\")\nmy_decision_model_ed = DecisionModel(template_ed, sys_ed, optimizer, name = \"ED\")\nmodels = SimulationModels(\n decision_models = [\n my_decision_model_uc,\n my_decision_model_ed\n ]\n)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationSequence","page":"API Reference","title":"PowerSimulations.SimulationSequence","text":"SimulationSequence(\n models::SimulationModels,\n feedforward::Dict{String, Vector{<:AbstractAffectFeedforward}}\n ini_cond_chronology::InitialConditionChronology\n)\n\nConstruct the simulation sequence between decision and emulation models.\n\nArguments\n\nmodels::SimulationModels: Vector of decisions and emulation models.\nfeedforward = Dict{String, Vector{<:AbstractAffectFeedforward}}(): Optional dictionary to specify how information and variables are exchanged between decision and emulation models.\nini_cond_chronology::InitialConditionChronology = InterProblemChronology(): Define information sharing model between stages with InterProblemChronology\n\nExample\n\ntemplate_uc = template_unit_commitment()\ntemplate_ed = template_economic_dispatch()\nmy_decision_model_uc = DecisionModel(template_1, sys_uc, optimizer, name = \"UC\")\nmy_decision_model_ed = DecisionModel(template_ed, sys_ed, optimizer, name = \"ED\")\nmodels = SimulationModels(\n decision_models = [\n my_decision_model_uc,\n my_decision_model_ed\n ]\n)\n# The following sequence set the commitment variables (`OnVariable`) for `ThermalStandard` units from UC to ED.\nsequence = SimulationSequence(;\n models = models,\n feedforwards = Dict(\n \"ED\" => [\n SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n ),\n ],\n ),\n)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.Simulation","page":"API Reference","title":"PowerSimulations.Simulation","text":"Simulation(\n sequence::SimulationSequence,\n name::String,\n steps::Int\n models::SimulationModels,\n simulation_folder::String,\n initial_time::Union{Nothing, Dates.DateTime}\n)\n\nConstruct the Simulation structure to run the sequence of decision and emulation models specified.\n\nArguments\n\nsequence::SimulationSequence: Simulation sequence that specify how the decision and emulation models will be executed.\nname::String: Name of the Simulation\nsteps::Int: Number of steps on which the sequence of models will be executed\nmodels::SimulationModels: List of Decision and Emulation Models\nsimulation_folder::String: Folder on which results will be stored\ninitial_time::Union{Nothing, Dates.DateTime} = nothing: Initial time of which the simulation starts. If nothing it will default to the first timestamp of time series of the system.\n\nExample\n\ntemplate_uc = template_unit_commitment()\ntemplate_ed = template_economic_dispatch()\nmy_decision_model_uc = DecisionModel(template_1, sys_uc, optimizer, name = \"UC\")\nmy_decision_model_ed = DecisionModel(template_ed, sys_ed, optimizer, name = \"ED\")\nmodels = SimulationModels(\n decision_models = [\n my_decision_model_uc,\n my_decision_model_ed\n ]\n)\n# The following sequence set the commitment variables (`OnVariable`) for `ThermalStandard` units from UC to ED.\nsequence = SimulationSequence(;\n models = models,\n feedforwards = Dict(\n \"ED\" => [\n SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n ),\n ],\n ),\n)\n\nsim = Simulation(\n sequence = sequence,\n name = \"Sim\",\n steps = 5,\n models = models,\n simulation_folder = mktempdir(cleanup=true),\n)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.Simulation-Tuple{AbstractString, Dict}","page":"API Reference","title":"PowerSimulations.Simulation","text":"Simulation(directory::AbstractString, model_info::Dict)\n\n\nConstructs Simulation from a serialized directory. Callers should pass any kwargs here that they passed to the original Simulation.\n\nArguments\n\ndirectory::AbstractString: the directory returned from the call to serialize\nmodel_info::Dict: Two-level dictionary containing model parameters that cannot be serialized. The outer dict should be keyed by the problem name. The inner dict must contain 'optimizer' and may contain 'jump_model'. These should be the same values used for the original simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.build!-Tuple{Simulation}","page":"API Reference","title":"PowerSimulations.build!","text":"build!(\n sim::Simulation;\n recorders,\n console_level,\n file_level,\n serialize,\n partitions,\n index\n) -> InfrastructureSystems.Simulation.SimulationBuildStatusModule.SimulationBuildStatus\n\n\nBuild the Simulation, problems and the related folder structure.\n\nArguments\n\nsim::Simulation: simulation object\nrecorders::Vector{Symbol} = []: recorder names to register\nserialize::Bool = true: serializes the simulation objects in the simulation\nconsole_level = Logging.Error:\nfile_level = Logging.Info:\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.execute!-Tuple{Simulation}","page":"API Reference","title":"PowerSimulations.execute!","text":"execute!(\n sim::Simulation;\n kwargs...\n) -> InfrastructureSystems.Simulation.RunStatusModule.RunStatus\n\n\nSolves the simulation model for sequential Simulations.\n\nArguments\n\nsim::Simulation=sim: simulation object created by Simulation()\n\nThe optional keyword argument exports controls exporting of results to CSV files as the simulation runs.\n\nExample\n\nsim = Simulation(\"Test\", 7, problems, \"/Users/folder\")\nexecute!(sim::Simulation; kwargs...)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"simulation_partitions.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationPartitions","page":"API Reference","title":"PowerSimulations.SimulationPartitions","text":"Defines how a simulation can be partition into partitions and run in parallel.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.get_num_partitions-Tuple{SimulationPartitions}","page":"API Reference","title":"PowerSimulations.get_num_partitions","text":"get_num_partitions(x::SimulationPartitions) -> Int64\n\n\nReturn the number of partitions in the simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.run_parallel_simulation-Tuple{Any, Any}","page":"API Reference","title":"PowerSimulations.run_parallel_simulation","text":"run_parallel_simulation(\n build_function,\n execute_function;\n script,\n output_dir,\n name,\n num_steps,\n period,\n num_overlap_steps,\n num_parallel_processes,\n exeflags,\n force\n)\n\n\nRun a partitioned simulation in parallel on a local computer.\n\nArguments\n\nbuild_function: Function reference that returns a built Simulation.\nexecute_function: Function reference that executes a Simulation.\nscript::AbstractString: Path to script that includes build_function and execute_function.\noutput_dir::AbstractString: Path for simulation outputs\nname::AbstractString: Simulation name\nnum_steps::Integer: Total number of steps in the simulation\nperiod::Integer: Number of steps in each simulation partition\nnum_overlap_steps::Integer: Number of steps that each partition overlaps with the previous partition\nnum_parallel_processes: Number of partitions to run in parallel. If nothing, use the number of cores.\nexeflags: Path to Julia project. Forwarded to Distributed.addprocs.\nforce: Overwrite the output directory if it already exists.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/#Chronology-Models","page":"API Reference","title":"Chronology Models","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"initial_condition_chronologies.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.InterProblemChronology","page":"API Reference","title":"PowerSimulations.InterProblemChronology","text":"InterProblemChronology()\n\nType struct to select an information sharing model between stages that uses results from the most recent stage executed to calculate the initial conditions. This model takes into account solutions from stages defined with finer temporal resolutions\n\nSee also: IntraProblemChronology\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.IntraProblemChronology","page":"API Reference","title":"PowerSimulations.IntraProblemChronology","text":"IntraProblemChronology()\n\nType struct to select an information sharing model between stages that uses results from the same recent stage to calculate the initial conditions. This model ignores solutions from stages defined with finer temporal resolutions.\n\nSee also: InterProblemChronology\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Variables","page":"API Reference","title":"Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"For a list of variables for each device refer to its Formulations page.","category":"page"},{"location":"api/PowerSimulations/#Common-Variables","page":"API Reference","title":"Common Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerVariable\nReactivePowerVariable\nPieceWiseLinearCostVariable","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerVariable","page":"API Reference","title":"PowerSimulations.ActivePowerVariable","text":"Struct to dispatch the creation of Active Power Variables\n\nDocs abbreviation: p\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReactivePowerVariable","page":"API Reference","title":"PowerSimulations.ReactivePowerVariable","text":"Struct to dispatch the creation of Reactive Power Variables\n\nDocs abbreviation: q\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PieceWiseLinearCostVariable","page":"API Reference","title":"PowerSimulations.PieceWiseLinearCostVariable","text":"Struct to dispatch the creation of piecewise linear cost variables for objective function\n\nDocs abbreviation: delta\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Thermal-Unit-Variables","page":"API Reference","title":"Thermal Unit Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"OnVariable\nStartVariable\nStopVariable\nTimeDurationOn\nTimeDurationOff\nHotStartVariable\nWarmStartVariable\nColdStartVariable\nPowerAboveMinimumVariable\nPowerOutput","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.OnVariable","page":"API Reference","title":"PowerSimulations.OnVariable","text":"Struct to dispatch the creation of a binary commitment status variable\n\nDocs abbreviation: u\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StartVariable","page":"API Reference","title":"PowerSimulations.StartVariable","text":"Struct to dispatch the creation of Binary Start Variables\n\nDocs abbreviation: v\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StopVariable","page":"API Reference","title":"PowerSimulations.StopVariable","text":"Struct to dispatch the creation of Binary Stop Variables\n\nDocs abbreviation: w\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.TimeDurationOn","page":"API Reference","title":"PowerSimulations.TimeDurationOn","text":"Auxiliary Variable for Thermal Generation Models to keep track of time elapsed on\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.TimeDurationOff","page":"API Reference","title":"PowerSimulations.TimeDurationOff","text":"Auxiliary Variable for Thermal Generation Models to keep track of time elapsed off\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HotStartVariable","page":"API Reference","title":"PowerSimulations.HotStartVariable","text":"Struct to dispatch the creation of Hot Start Variable for Thermal units with temperature considerations\n\nDocs abbreviation: z^textth\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.WarmStartVariable","page":"API Reference","title":"PowerSimulations.WarmStartVariable","text":"Struct to dispatch the creation of Warm Start Variable for Thermal units with temperature considerations\n\nDocs abbreviation: y^textth\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ColdStartVariable","page":"API Reference","title":"PowerSimulations.ColdStartVariable","text":"Struct to dispatch the creation of Cold Start Variable for Thermal units with temperature considerations\n\nDocs abbreviation: x^textth\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PowerAboveMinimumVariable","page":"API Reference","title":"PowerSimulations.PowerAboveMinimumVariable","text":"Struct to dispatch the creation of Active Power Variables above minimum power for Thermal Compact formulations\n\nDocs abbreviation: Delta p\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PowerOutput","page":"API Reference","title":"PowerSimulations.PowerOutput","text":"Auxiliary Variable for Thermal Generation Models that solve for power above min\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Storage-Unit-Variables","page":"API Reference","title":"Storage Unit Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ReservationVariable\nEnergyVariable\nActivePowerOutVariable\nActivePowerInVariable","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ReservationVariable","page":"API Reference","title":"PowerSimulations.ReservationVariable","text":"Struct to dispatch the creation of binary storage charge reservation variable\n\nDocs abbreviation: u^textst\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.EnergyVariable","page":"API Reference","title":"PowerSimulations.EnergyVariable","text":"Struct to dispatch the creation of a variable for energy storage level (state of charge)\n\nDocs abbreviation: e\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerOutVariable","page":"API Reference","title":"PowerSimulations.ActivePowerOutVariable","text":"Struct to dispatch the creation of Active Power Output Variables for 2-directional devices. For instance storage or pump-hydro\n\nDocs abbreviation: p^textout\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerInVariable","page":"API Reference","title":"PowerSimulations.ActivePowerInVariable","text":"Struct to dispatch the creation of Active Power Input Variables for 2-directional devices. For instance storage or pump-hydro\n\nDocs abbreviation: p^textin\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Branches-and-Network-Variables","page":"API Reference","title":"Branches and Network Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"FlowActivePowerVariable\nFlowActivePowerSlackUpperBound\nFlowActivePowerSlackLowerBound\nFlowActivePowerFromToVariable\nFlowActivePowerToFromVariable\nFlowReactivePowerFromToVariable\nFlowReactivePowerToFromVariable\nPhaseShifterAngle\nHVDCLosses\nHVDCFlowDirectionVariable\nVoltageMagnitude\nVoltageAngle","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerVariable","page":"API Reference","title":"PowerSimulations.FlowActivePowerVariable","text":"Struct to dispatch the creation of bidirectional Active Power Flow Variables\n\nDocs abbreviation: f\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerSlackUpperBound","page":"API Reference","title":"PowerSimulations.FlowActivePowerSlackUpperBound","text":"Struct to dispatch the creation of active power flow upper bound slack variables. Used when there is not enough flow through the branch in the forward direction.\n\nDocs abbreviation: f^textslup\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerSlackLowerBound","page":"API Reference","title":"PowerSimulations.FlowActivePowerSlackLowerBound","text":"Struct to dispatch the creation of active power flow lower bound slack variables. Used when there is not enough flow through the branch in the reverse direction.\n\nDocs abbreviation: f^textsllo\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerFromToVariable","page":"API Reference","title":"PowerSimulations.FlowActivePowerFromToVariable","text":"Struct to dispatch the creation of unidirectional Active Power Flow Variables\n\nDocs abbreviation: f^textfrom-to\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowActivePowerToFromVariable","page":"API Reference","title":"PowerSimulations.FlowActivePowerToFromVariable","text":"Struct to dispatch the creation of unidirectional Active Power Flow Variables\n\nDocs abbreviation: f^textto-from\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowReactivePowerFromToVariable","page":"API Reference","title":"PowerSimulations.FlowReactivePowerFromToVariable","text":"Struct to dispatch the creation of unidirectional Reactive Power Flow Variables\n\nDocs abbreviation: f^textqfrom-to\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowReactivePowerToFromVariable","page":"API Reference","title":"PowerSimulations.FlowReactivePowerToFromVariable","text":"Struct to dispatch the creation of unidirectional Reactive Power Flow Variables\n\nDocs abbreviation: f^textqto-from\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PhaseShifterAngle","page":"API Reference","title":"PowerSimulations.PhaseShifterAngle","text":"Struct to dispatch the creation of Phase Shifters Variables\n\nDocs abbreviation: theta^textshift\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HVDCLosses","page":"API Reference","title":"PowerSimulations.HVDCLosses","text":"Struct to dispatch the creation of HVDC Losses Auxiliary Variables\n\nDocs abbreviation: ell\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HVDCFlowDirectionVariable","page":"API Reference","title":"PowerSimulations.HVDCFlowDirectionVariable","text":"Struct to dispatch the creation of HVDC Flow Direction Auxiliary Variables\n\nDocs abbreviation: u^textdir\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.VoltageMagnitude","page":"API Reference","title":"PowerSimulations.VoltageMagnitude","text":"Struct to dispatch the creation of Voltage Magnitude Variables for AC formulations\n\nDocs abbreviation: v\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.VoltageAngle","page":"API Reference","title":"PowerSimulations.VoltageAngle","text":"Struct to dispatch the creation of Voltage Angle Variables for AC/DC formulations\n\nDocs abbreviation: theta\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Services-Variables","page":"API Reference","title":"Services Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerReserveVariable\nServiceRequirementVariable\nSystemBalanceSlackUp\nSystemBalanceSlackDown\nReserveRequirementSlack\nInterfaceFlowSlackUp\nInterfaceFlowSlackDown","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerReserveVariable","page":"API Reference","title":"PowerSimulations.ActivePowerReserveVariable","text":"Struct to dispatch the creation of Active Power Reserve Variables\n\nDocs abbreviation: r\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ServiceRequirementVariable","page":"API Reference","title":"PowerSimulations.ServiceRequirementVariable","text":"Struct to dispatch the creation of Service Requirement Variables\n\nDocs abbreviation: textreq\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SystemBalanceSlackUp","page":"API Reference","title":"PowerSimulations.SystemBalanceSlackUp","text":"Struct to dispatch the creation of System-wide slack up variables. Used when there is not enough generation.\n\nDocs abbreviation: p^textslup\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SystemBalanceSlackDown","page":"API Reference","title":"PowerSimulations.SystemBalanceSlackDown","text":"Struct to dispatch the creation of System-wide slack down variables. Used when there is not enough load curtailment.\n\nDocs abbreviation: p^textsldn\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReserveRequirementSlack","page":"API Reference","title":"PowerSimulations.ReserveRequirementSlack","text":"Struct to dispatch the creation of Reserve requirement slack variables. Used when there is not reserves in the system to satisfy the requirement.\n\nDocs abbreviation: r^textsl\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.InterfaceFlowSlackUp","page":"API Reference","title":"PowerSimulations.InterfaceFlowSlackUp","text":"Struct to dispatch the creation of Interface Flow Slack Up variables\n\nDocs abbreviation: f^textslup\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.InterfaceFlowSlackDown","page":"API Reference","title":"PowerSimulations.InterfaceFlowSlackDown","text":"Struct to dispatch the creation of Interface Flow Slack Down variables\n\nDocs abbreviation: f^textsldn\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Feedforward-Variables","page":"API Reference","title":"Feedforward Variables","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"UpperBoundFeedForwardSlack\nLowerBoundFeedForwardSlack","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.UpperBoundFeedForwardSlack","page":"API Reference","title":"PowerSimulations.UpperBoundFeedForwardSlack","text":"Struct to dispatch the creation of Slack variables for UpperBoundFeedforward\n\nDocs abbreviation: p^textffubsl\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.LowerBoundFeedForwardSlack","page":"API Reference","title":"PowerSimulations.LowerBoundFeedForwardSlack","text":"Struct to dispatch the creation of Slack variables for LowerBoundFeedforward\n\nDocs abbreviation: p^textfflbsl\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Constraints","page":"API Reference","title":"Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/#Common-Constraints","page":"API Reference","title":"Common Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"PieceWiseLinearCostConstraint\n","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.PieceWiseLinearCostConstraint","page":"API Reference","title":"PowerSimulations.PieceWiseLinearCostConstraint","text":"Struct to create the PieceWiseLinearCostConstraint associated with a specified variable.\n\nSee Piecewise linear cost functions for more information.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Network-Constraints","page":"API Reference","title":"Network Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"CopperPlateBalanceConstraint\nNodalBalanceActiveConstraint\nNodalBalanceReactiveConstraint\nAreaParticipationAssignmentConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.CopperPlateBalanceConstraint","page":"API Reference","title":"PowerSimulations.CopperPlateBalanceConstraint","text":"Struct to create the constraint to balance power in the copperplate model. For more information check Network Formulations.\n\nThe specified constraint is generally formulated as:\n\nsum_c in textcomponents p_t^c = 0 quad forall t in 1 dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.NodalBalanceActiveConstraint","page":"API Reference","title":"PowerSimulations.NodalBalanceActiveConstraint","text":"Struct to create the constraint to balance active power in nodal formulation. For more information check Network Formulations.\n\nThe specified constraint depends on the network model chosen.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.NodalBalanceReactiveConstraint","page":"API Reference","title":"PowerSimulations.NodalBalanceReactiveConstraint","text":"Struct to create the constraint to balance reactive power in nodal formulation. For more information check Network Formulations.\n\nThe specified constraint depends on the network model chosen.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.AreaParticipationAssignmentConstraint","page":"API Reference","title":"PowerSimulations.AreaParticipationAssignmentConstraint","text":"Struct to create the constraint to balance power across specified areas. For more information check Network Formulations.\n\nThe specified constraint is generally formulated as:\n\nsum_c in textcomponents_a p_t^c = 0 quad forall ain 1dots A t in 1 dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Power-Variable-Limit-Constraints","page":"API Reference","title":"Power Variable Limit Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerVariableLimitsConstraint\nReactivePowerVariableLimitsConstraint\nActivePowerVariableTimeSeriesLimitsConstraint\nInputActivePowerVariableLimitsConstraint\nOutputActivePowerVariableLimitsConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.ActivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit active power expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nP^textmin le p_t le P^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReactivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.ReactivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit reactive power expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nQ^textmin le q_t le Q^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerVariableTimeSeriesLimitsConstraint","page":"API Reference","title":"PowerSimulations.ActivePowerVariableTimeSeriesLimitsConstraint","text":"Struct to create the constraint to limit active power expressions by a time series parameter. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound expressions, but in its most basic formulation is of the form:\n\np_t le textActivePowerTimeSeriesParameter_t quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.InputActivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.InputActivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit active power input expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nP^textmin le p_t^textin le P^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.OutputActivePowerVariableLimitsConstraint","page":"API Reference","title":"PowerSimulations.OutputActivePowerVariableLimitsConstraint","text":"Struct to create the constraint to limit active power output expressions. For more information check Device Formulations.\n\nThe specified constraint depends on the UpperBound and LowerBound expressions, but in its most basic formulation is of the form:\n\nP^textmin le p_t^textout le P^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Services-Constraints","page":"API Reference","title":"Services Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"RequirementConstraint\nParticipationFractionConstraint\nReservePowerConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.RequirementConstraint","page":"API Reference","title":"PowerSimulations.RequirementConstraint","text":"Struct to create the constraint for satisfying active power reserve requirements. For more information check Service Formulations.\n\nThe constraint is as follows:\n\nsum_dinmathcalD_s r_dt + r_t^textsl ge textReqquad forall tin 1dots T quad text(for a ConstantReserve) \nsum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T quad text(for a VariableReserve)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ParticipationFractionConstraint","page":"API Reference","title":"PowerSimulations.ParticipationFractionConstraint","text":"Struct to create the constraint to participation assignments limits in the active power reserves. For more information check Service Formulations.\n\nThe constraint is as follows:\n\nr_dt le textReq cdot textPF quad forall din mathcalD_s forall tin 1dots T quad text(for a ConstantReserve) \nr_dt le textRequirementTimeSeriesParameter_t cdot textPFquad forall din mathcalD_s forall tin 1dots T quad text(for a VariableReserve)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReservePowerConstraint","page":"API Reference","title":"PowerSimulations.ReservePowerConstraint","text":"Struct to create the constraint for ensuring that NonSpinning Reserve can be delivered from turn-off thermal units.\n\nFor more information check Service Formulations for NonSpinningReserve.\n\nThe constraint is as follows:\n\nr_dt le (1 - u_dt^textth) cdot R^textlimit_d quad forall d in mathcalD_s forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Thermal-Unit-Constraints","page":"API Reference","title":"Thermal Unit Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActiveRangeICConstraint\nCommitmentConstraint\nDurationConstraint\nRampConstraint\nStartupInitialConditionConstraint\nStartupTimeLimitTemperatureConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActiveRangeICConstraint","page":"API Reference","title":"PowerSimulations.ActiveRangeICConstraint","text":"Struct to create the constraint for starting up ThermalMultiStart units. For more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.\n\nThe specified constraint is formulated as:\n\nmaxP^textthmax - P^textthshdown 0 cdot w_1^textth le u^textthinit (P^textthmax - P^textthmin) - P^textthinit\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.CommitmentConstraint","page":"API Reference","title":"PowerSimulations.CommitmentConstraint","text":"Struct to create the commitment constraint between the on, start, and stop variables. For more information check ThermalGen Formulations.\n\nThe specified constraints are formulated as:\n\nu_1^textth = u^textthinit + v_1^textth - w_1^textth \nu_t^textth = u_t-1^textth + v_t^textth - w_t^textth quad forall t in 2dotsT \nv_t^textth + w_t^textth le 1 quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.DurationConstraint","page":"API Reference","title":"PowerSimulations.DurationConstraint","text":"Struct to create the duration constraint for commitment formulations, i.e. min-up and min-down.\n\nFor more information check ThermalGen Formulations.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.RampConstraint","page":"API Reference","title":"PowerSimulations.RampConstraint","text":"Struct to create the RampConstraint associated with a specified thermal device or reserve service.\n\nFor thermal units, see more information in Thermal Formulations. The constraint is as follows:\n\n-R^textthdn le p_t^textth - p_t-1^textth le R^textthup quad forall tin 1 dots T\n\nFor Ramp Reserve, see more information in Service Formulations. The constraint is as follows:\n\nr_dt le R^textthup cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveUp) \nr_dt le R^textthdn cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveDown)\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StartupInitialConditionConstraint","page":"API Reference","title":"PowerSimulations.StartupInitialConditionConstraint","text":"Struct to create the start-up initial condition constraints for ThermalMultiStart.\n\nFor more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.StartupTimeLimitTemperatureConstraint","page":"API Reference","title":"PowerSimulations.StartupTimeLimitTemperatureConstraint","text":"Struct to create the start-up time limit constraints for ThermalMultiStart.\n\nFor more information check ThermalGen Formulations for ThermalMultiStartUnitCommitment.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Renewable-Unit-Constraints","page":"API Reference","title":"Renewable Unit Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"EqualityConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.EqualityConstraint","page":"API Reference","title":"PowerSimulations.EqualityConstraint","text":"Struct to create the constraint that sets the reactive power to the power factor in the RenewableConstantPowerFactor formulation for renewable units.\n\nFor more information check RenewableGen Formulations.\n\nThe specified constraint is formulated as:\n\nq_t^textre = textpf cdot p_t^textre quad forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Branches-Constraints","page":"API Reference","title":"Branches Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"FlowLimitConstraint\nFlowRateConstraint\nFlowRateConstraintFromTo\nFlowRateConstraintToFrom\nHVDCPowerBalance\nNetworkFlowConstraint\nRateLimitConstraint\nPhaseAngleControlLimit","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.FlowLimitConstraint","page":"API Reference","title":"PowerSimulations.FlowLimitConstraint","text":"Struct to create the constraint that set the flow limits through a PhaseShiftingTransformer.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\n-R^textmax le f_t le R^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowRateConstraint","page":"API Reference","title":"PowerSimulations.FlowRateConstraint","text":"Struct to create the constraint that set the flow limits through an HVDC two-terminal branch.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nR^textmin le f_t le R^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowRateConstraintFromTo","page":"API Reference","title":"PowerSimulations.FlowRateConstraintFromTo","text":"Struct to create the constraint that set the flow from-to limits through an HVDC two-terminal branch.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nR^textfrommin le f_t^textfrom-to le R^textfrommax forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FlowRateConstraintToFrom","page":"API Reference","title":"PowerSimulations.FlowRateConstraintToFrom","text":"Struct to create the constraint that set the flow to-from limits through an HVDC two-terminal branch.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nR^texttomin le f_t^textto-from le R^texttomaxquad forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.HVDCPowerBalance","page":"API Reference","title":"PowerSimulations.HVDCPowerBalance","text":"Struct to create the constraints that set the power balance across a lossy HVDC two-terminal line.\n\nFor more information check Branch Formulations.\n\nThe specified constraints are formulated as:\n\nbeginalign*\n f_t^textto-from - f_t^textfrom-to le L_1 cdot f_t^textto-from - L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge L_1 cdot f_t^textfrom-to + L_0quad forall t in 1dots T \n f_t^textfrom-to - f_t^textto-from ge - M^textbig (1 - u^textdir_t)quad forall t in 1dots T \n f_t^textto-from - f_t^textfrom-to ge - M^textbig u^textdir_tquad forall t in 1dots T \nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.NetworkFlowConstraint","page":"API Reference","title":"PowerSimulations.NetworkFlowConstraint","text":"Struct to create the constraint the AC branch flows depending on the network model. For more information check Branch Formulations.\n\nThe specified constraint depends on the network model chosen. The most common application is the StaticBranch in a PTDF Network Model:\n\nf_t = sum_i=1^N textPTDF_ib cdot textBal_it quad forall t in 1dots T\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.RateLimitConstraint","page":"API Reference","title":"PowerSimulations.RateLimitConstraint","text":"Struct to create the constraint that set the AC flow limits through branches.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n f_t - f_t^textslup le R^textmaxquad forall t in 1dots T \n f_t + f_t^textsllo ge -R^textmaxquad forall t in 1dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.PhaseAngleControlLimit","page":"API Reference","title":"PowerSimulations.PhaseAngleControlLimit","text":"Struct to create the constraint that set the angle limits through a PhaseShiftingTransformer.\n\nFor more information check Branch Formulations.\n\nThe specified constraint is formulated as:\n\nTheta^textmin le theta^textshift_t le Theta^textmax quad forall t in 1dotsT\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Feedforward-Constraints","page":"API Reference","title":"Feedforward Constraints","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"FeedforwardSemiContinuousConstraint\nFeedforwardUpperBoundConstraint\nFeedforwardLowerBoundConstraint","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.FeedforwardSemiContinuousConstraint","page":"API Reference","title":"PowerSimulations.FeedforwardSemiContinuousConstraint","text":"Struct to create the constraint for semicontinuous feedforward limits.\n\nFor more information check Feedforward Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n textActivePowerRangeExpressionUB_t = p_t^textth - texton_t^textthP^textthmax le 0 quad forall tin 1 dots T \n textActivePowerRangeExpressionLB_t = p_t^textth - texton_t^textthP^textthmin ge 0 quad forall tin 1 dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FeedforwardUpperBoundConstraint","page":"API Reference","title":"PowerSimulations.FeedforwardUpperBoundConstraint","text":"Struct to create the constraint for upper bound feedforward limits.\n\nFor more information check Feedforward Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n textAffectedVariable_t - p_t^textffubsl le textSourceVariableParameter_t quad forall t in 1dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FeedforwardLowerBoundConstraint","page":"API Reference","title":"PowerSimulations.FeedforwardLowerBoundConstraint","text":"Struct to create the constraint for lower bound feedforward limits.\n\nFor more information check Feedforward Formulations.\n\nThe specified constraint is formulated as:\n\nbeginalign*\n textAffectedVariable_t + p_t^textfflbsl ge textSourceVariableParameter_t quad forall t in 1dots T\nendalign*\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":" \n ","category":"page"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"","category":"page"},{"location":"api/PowerSimulations/#Parameters","page":"API Reference","title":"Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/#Time-Series-Parameters","page":"API Reference","title":"Time Series Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"ActivePowerTimeSeriesParameter\nReactivePowerTimeSeriesParameter\nRequirementTimeSeriesParameter","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.ActivePowerTimeSeriesParameter","page":"API Reference","title":"PowerSimulations.ActivePowerTimeSeriesParameter","text":"Parameter to define active power time series\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.ReactivePowerTimeSeriesParameter","page":"API Reference","title":"PowerSimulations.ReactivePowerTimeSeriesParameter","text":"Parameter to define reactive power time series\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.RequirementTimeSeriesParameter","page":"API Reference","title":"PowerSimulations.RequirementTimeSeriesParameter","text":"Parameter to define requirement time series\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Variable-Value-Parameters","page":"API Reference","title":"Variable Value Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"UpperBoundValueParameter\nLowerBoundValueParameter\nOnStatusParameter\nFixValueParameter","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.UpperBoundValueParameter","page":"API Reference","title":"PowerSimulations.UpperBoundValueParameter","text":"Parameter to define variable upper bound\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.LowerBoundValueParameter","page":"API Reference","title":"PowerSimulations.LowerBoundValueParameter","text":"Parameter to define variable lower bound\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.OnStatusParameter","page":"API Reference","title":"PowerSimulations.OnStatusParameter","text":"Parameter to define unit commitment status\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.FixValueParameter","page":"API Reference","title":"PowerSimulations.FixValueParameter","text":"Parameter to FixValueParameter\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Objective-Function-Parameters","page":"API Reference","title":"Objective Function Parameters","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"CostFunctionParameter","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.CostFunctionParameter","page":"API Reference","title":"PowerSimulations.CostFunctionParameter","text":"Parameter to define cost function coefficient\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#Results","page":"API Reference","title":"Results","text":"","category":"section"},{"location":"api/PowerSimulations/#Acessing-Optimization-Model","page":"API Reference","title":"Acessing Optimization Model","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"optimization_container.jl\",\n \"optimization_debugging.jl\"\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.serialize_optimization_model-Tuple{PowerSimulations.OptimizationContainer, String}","page":"API Reference","title":"PowerSimulations.serialize_optimization_model","text":"serialize_optimization_model(\n container::PowerSimulations.OptimizationContainer,\n save_path::String\n)\n\n\nExports the OpModel JuMP object in MathOptFormat\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.get_all_constraint_index-Tuple{PowerSimulations.OperationModel}","page":"API Reference","title":"PowerSimulations.get_all_constraint_index","text":"get_all_constraint_index(\n model::PowerSimulations.OperationModel\n) -> Vector{Tuple{InfrastructureSystems.Optimization.ConstraintKey, Int64, Int64}}\n\n\nEach Tuple corresponds to (conname, internalindex, moi_index)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.get_all_variable_index-Tuple{PowerSimulations.OperationModel}","page":"API Reference","title":"PowerSimulations.get_all_variable_index","text":"get_all_variable_index(\n model::PowerSimulations.OperationModel\n) -> Vector{Tuple{Symbol, Int64, Int64}}\n\n\nEach Tuple corresponds to (conname, internalindex, moi_index)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#Accessing-Problem-Results","page":"API Reference","title":"Accessing Problem Results","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"operation/problem_results.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.OptimizationProblemResults-Tuple{DecisionModel}","page":"API Reference","title":"InfrastructureSystems.Optimization.OptimizationProblemResults","text":"OptimizationProblemResults(\n model::DecisionModel\n) -> OptimizationProblemResults\n\n\nConstruct OptimizationProblemResults from a solved DecisionModel.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.OptimizationProblemResults-Tuple{EmulationModel}","page":"API Reference","title":"InfrastructureSystems.Optimization.OptimizationProblemResults","text":"OptimizationProblemResults(\n model::EmulationModel\n) -> OptimizationProblemResults\n\n\nConstruct OptimizationProblemResults from a solved EmulationModel.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#Accessing-Simulation-Results","page":"API Reference","title":"Accessing Simulation Results","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"simulation_results.jl\",\n \"simulation_problem_results.jl\",\n \"simulation_partition_results.jl\",\n \"hdf_simulation_store.jl\"\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationResults","page":"API Reference","title":"PowerSimulations.SimulationResults","text":"SimulationResults(\n path::AbstractString,\n name::AbstractString;\n ...\n) -> SimulationResults\nSimulationResults(\n path::AbstractString,\n name::AbstractString,\n execution;\n ignore_status\n) -> SimulationResults\n\n\nConstruct SimulationResults from a simulation output directory.\n\nArguments\n\npath::AbstractString: Simulation output directory\nname::AbstractString: Simulation name\nexecution::AbstractString: Execution number. Default is the most recent.\nignore_status::Bool: If true, return results even if the simulation failed.\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationResults-Tuple{Simulation}","page":"API Reference","title":"PowerSimulations.SimulationResults","text":"SimulationResults(\n sim::Simulation;\n ignore_status,\n kwargs...\n) -> SimulationResults\n\n\nConstruct SimulationResults from a simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.export_results-Tuple{SimulationResults, Any}","page":"API Reference","title":"InfrastructureSystems.Optimization.export_results","text":"export_results(results::SimulationResults, exports)\n\n\nExport results to files in the results directory.\n\nArguments\n\nresults::SimulationResults: simulation results\nexports: SimulationResultsExport or anything that can be passed to its constructor. (such as Dict or path to JSON file)\n\nAn example JSON file demonstrating possible options is below. Note that start_time, end_time, path, and format are optional.\n\n{\n \"decision_models\": [\n {\n \"name\": \"ED\",\n \"variables\": [\n \"P__ThermalStandard\",\n ],\n \"parameters\": [\n \"all\"\n ]\n },\n {\n \"name\": \"UC\",\n \"variables\": [\n \"On__ThermalStandard\"\n ],\n \"parameters\": [\n \"all\"\n ],\n \"duals\": [\n \"all\"\n ]\n }\n ],\n \"start_time\": \"2020-01-01T04:00:00\",\n \"end_time\": null,\n \"path\": null,\n \"format\": \"csv\"\n}\n\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_aux_variable-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_aux_variable","text":"read_aux_variable(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_aux_variable_names or args that can be splatted into a AuxVarKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_dual-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_dual","text":"read_dual(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested dual. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_dual_names or args that can be splatted into a ConstraintKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\nstore::SimulationStore: a store that has been opened for reading\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_expression-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_expression","text":"read_expression(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested auxillary variables. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_expression_names or args that can be splatted into a ExpressionKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_parameter-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_parameter","text":"read_parameter(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested parameter. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_parameter_names or args that can be splatted into a ParameterKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_variable-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vararg{Any}}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_variable","text":"read_variable(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n args...;\n initial_time,\n count,\n store\n) -> SortedDict{Any, Any, Base.Order.ForwardOrdering}\n\n\nReturn the values for the requested variable. It keeps requests when performing multiple retrievals.\n\nArguments\n\nargs: Can be a string returned from list_variable_names or args that can be splatted into a VariableKey.\ninitial_time::Dates.DateTime : initial of the requested results\ncount::Int: Number of results\nstore::SimulationStore: a store that has been opened for reading\n\nExamples\n\nread_variable(results, ActivePowerVariable, ThermalStandard)\nread_variable(results, \"ActivePowerVariable__ThermalStandard\")\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.list_decision_problems-Tuple{SimulationResults}","page":"API Reference","title":"PowerSimulations.list_decision_problems","text":"list_decision_problems(\n results::SimulationResults\n) -> Vector{String}\n\n\nReturn the problem names in the simulation.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.load_results!-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Int64}","page":"API Reference","title":"PowerSimulations.load_results!","text":"load_results!(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n count::Int64;\n initial_time,\n variables,\n duals,\n parameters,\n aux_variables,\n expressions,\n store\n)\n\n\nLoad the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections, when reading the same data very many times, etc. Multiple calls augment the cache according to these rules, where \"variable\" means \"variable, expression, etc.\":\n\nRequests for an already cached variable at a lesser count than already cached do not decrease the count of the cached variable\nRequests for an already cached variable at a greater count than already cached do increase the count of the cached variable\nRequests for new variables are fulfilled without evicting existing variables\n\nNote that count is global across all variables, so increasing the count re-reads already cached variables. For each variable, each element must be the name encoded as a string, like \"ActivePowerVariable__ThermalStandard\" or a Tuple with its constituent types, like (ActivePowerVariable, ThermalStandard). To clear the cache, use Base.empty!.\n\nArguments\n\ncount::Int: Number of windows to load.\ninitial_time::Dates.DateTime : Initial time of first window to load. Defaults to first.\naux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.\nduals::Vector{Union{String, Tuple}}: Optional list of duals to load.\nexpressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.\nparameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.\nvariables::Vector{Union{String, Tuple}}: Optional list of variables to load.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.load_results!-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.EmulationModelSimulationResults}}","page":"API Reference","title":"PowerSimulations.load_results!","text":"load_results!(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.EmulationModelSimulationResults};\n aux_variables,\n duals,\n expressions,\n parameters,\n variables\n)\n\n\nLoad the simulation results into memory for repeated reads. This is useful when loading results from remote locations over network connections.\n\nFor each variable/parameter/dual, etc., each element must be the name encoded as a string, like \"ActivePowerVariable__ThermalStandard\"or a Tuple with its constituent types, like(ActivePowerVariable, ThermalStandard)`.\n\nArguments\n\naux_variables::Vector{Union{String, Tuple}}: Optional list of aux variables to load.\nduals::Vector{Union{String, Tuple}}: Optional list of duals to load.\nexpressions::Vector{Union{String, Tuple}}: Optional list of expressions to load.\nparameters::Vector{Union{String, Tuple}}: Optional list of parameters to load.\nvariables::Vector{Union{String, Tuple}}: Optional list of variables to load.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.get_timestamps-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.get_timestamps","text":"get_timestamps(\n result::PowerSimulations.SimulationProblemResults\n) -> StepRange{Dates.DateTime, Dates.Millisecond}\n\n\nReturn a reference to a StepRange of available timestamps.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_aux_variable_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_aux_variable_names","text":"list_aux_variable_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of auxillary variable names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_dual_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_dual_names","text":"list_dual_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of dual names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_expression_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_expression_names","text":"list_expression_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of expression names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_parameter_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_parameter_names","text":"list_parameter_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of parmater names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.list_variable_names-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.list_variable_names","text":"list_variable_names(\n res::PowerSimulations.SimulationProblemResults\n) -> Vector{String}\n\n\nReturn an array of variable names (strings) that are available for reads.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_optimizer_stats-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_optimizer_stats","text":"read_optimizer_stats(\n res::PowerSimulations.SimulationProblemResults;\n store\n) -> Any\n\n\nReturn the optimizer stats for the problem as a DataFrame.\n\nAccepted keywords\n\nstore::SimulationStore: a store that has been opened for reading\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.get_system!-Tuple{Union{OptimizationProblemResults, PowerSimulations.SimulationProblemResults}}","page":"API Reference","title":"PowerSimulations.get_system!","text":"get_system!(\n results::Union{OptimizationProblemResults, PowerSimulations.SimulationProblemResults};\n kwargs...\n) -> Union{Nothing, InfrastructureSystems.InfrastructureSystemsType}\n\n\nReturn the system used for the problem. If the system hasn't already been deserialized or set with set_system! then deserialize and store it.\n\nIf the simulation was configured to serialize all systems to file then the returned system will include all data. If that was not configured then the returned system will include all data except time series data.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_aux_variable-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_aux_variable","text":"read_realized_aux_variable(\n res::PowerSimulations.SimulationProblemResults,\n aux_variable::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested auxiliary variable for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_aux_variables-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_aux_variables","text":"read_realized_aux_variables(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested auxiliary variables for each time step for a problem.\n\nRefer to read_realized_aux_variables for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_dual-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_dual","text":"read_realized_dual(\n res::PowerSimulations.SimulationProblemResults,\n dual::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested dual for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_duals-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_duals","text":"read_realized_duals(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested duals for each time step for a problem.\n\nRefer to read_realized_duals for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_expression-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_expression","text":"read_realized_expression(\n res::PowerSimulations.SimulationProblemResults,\n expression::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested expression for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_expressions-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_expressions","text":"read_realized_expressions(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested expressions for each time step for a problem.\n\nRefer to read_realized_expressions for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_parameter-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_parameter","text":"read_realized_parameter(\n res::PowerSimulations.SimulationProblemResults,\n parameter::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested parameter for each time step for a problem.\n\nRefer to read_realized_variable for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_parameters-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_parameters","text":"read_realized_parameters(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested parameters for each time step for a problem.\n\nRefer to read_realized_parameters for help and examples.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_variable-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.read_realized_variable","text":"read_realized_variable(\n res::PowerSimulations.SimulationProblemResults,\n variable::AbstractString;\n kwargs...\n) -> Any\n\n\nReturn the final values for the requested variable for each time step for a problem.\n\nDecision problem results are returned in a Dict{DateTime, DataFrame}.\n\nEmulation problem results are returned in a DataFrame.\n\nLimit the data sizes returned by specifying initial_time and count for decision problems or start_time and len for emulation problems.\n\nSee also load_results! to preload data into memory.\n\nArguments\n\nvariable::Union{String, Tuple}: Variable name as a string or a Tuple with variable type and device type.\ninitial_time::Dates.DateTime: Initial time of the requested results. Decision problems only.\ncount::Int: Number of results. Decision problems only.\nstart_time::Dates.DateTime: Start time of the requested results. Emulation problems only.\nlen::Int: Number of rows in each DataFrame. Emulation problems only.\n\nExamples\n\njulia > read_realized_variable(results, \"ActivePowerVariable__ThermalStandard\")\njulia > read_realized_variable(results, (ActivePowerVariable, ThermalStandard))\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.read_realized_variables-Tuple{PowerSimulations.SimulationProblemResults}","page":"API Reference","title":"PowerSimulations.read_realized_variables","text":"read_realized_variables(\n res::PowerSimulations.SimulationProblemResults;\n kwargs...\n) -> Dict\n\n\nReturn the final values for the requested variables for each time step for a problem.\n\nDecision problem results are returned in a Dict{String, Dict{DateTime, DataFrame}}.\n\nEmulation problem results are returned in a Dict{String, DataFrame}.\n\nLimit the data sizes returned by specifying initial_time and count for decision problems or start_time and len for emulation problems.\n\nIf the Julia process is started with multiple threads, the code will read the variables in parallel.\n\nSee also load_results! to preload data into memory.\n\nArguments\n\nvariables::Vector{Union{String, Tuple}}: Variable name as a string or a Tuple with variable type and device type. If not provided then return all variables.\ninitial_time::Dates.DateTime: Initial time of the requested results. Decision problems only.\ncount::Int: Number of results. Decision problems only.\nstart_time::Dates.DateTime: Start time of the requested results. Emulation problems only.\nlen::Int: Number of rows in each DataFrame. Emulation problems only.\n\nExamples\n\njulia > variables_as_strings =\n [\"ActivePowerVariable__ThermalStandard\", \"ActivePowerVariable__RenewableDispatch\"]\njulia > variables_as_types =\n [(ActivePowerVariable, ThermalStandard), (ActivePowerVariable, RenewableDispatch)]\njulia > read_realized_variables(results, variables_as_strings)\njulia > read_realized_variables(results, variables_as_types)\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.set_system!-Tuple{PowerSimulations.SimulationProblemResults, AbstractString}","page":"API Reference","title":"PowerSimulations.set_system!","text":"set_system!(\n results::PowerSimulations.SimulationProblemResults,\n system::AbstractString\n)\n\n\nSet the system in the results instance.\n\nThrows InvalidValue if the system UUID is incorrect.\n\nArguments\n\nresults::SimulationProblemResults: Results object\nsystem::AbstractString: Path to the system json file\n\nExamples\n\njulia > set_system!(res, \"my_path/system_data.json\")\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.SimulationPartitionResults","page":"API Reference","title":"PowerSimulations.SimulationPartitionResults","text":"Handles merging of simulation partitions\n\n\n\n\n\n","category":"type"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_optimizer_stats-Tuple{PowerSimulations.HdfSimulationStore, Any}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_optimizer_stats","text":"read_optimizer_stats(\n store::PowerSimulations.HdfSimulationStore,\n model_name\n) -> Any\n\n\nReturn the optimizer stats for a problem as a DataFrame.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#InfrastructureSystems.Optimization.read_optimizer_stats-Tuple{PowerSimulations.HdfSimulationStore, Int64, Symbol, Int64}","page":"API Reference","title":"InfrastructureSystems.Optimization.read_optimizer_stats","text":"read_optimizer_stats(\n store::PowerSimulations.HdfSimulationStore,\n simulation_step::Int64,\n model_name::Symbol,\n execution_index::Int64\n) -> Any\n\n\nRead the optimizer stats for a problem execution.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#Simulation-Recorder","page":"API Reference","title":"Simulation Recorder","text":"","category":"section"},{"location":"api/PowerSimulations/","page":"API Reference","title":"API Reference","text":"Modules = [PowerSimulations]\nPages = [\"utils/recorder_events.jl\",\n ]\nOrder = [:type, :function]\nPublic = true\nPrivate = false","category":"page"},{"location":"api/PowerSimulations/#PowerSimulations.list_simulation_events-Union{Tuple{T}, Tuple{Type{T}, AbstractString}, Tuple{Type{T}, AbstractString, Union{Nothing, Function}}} where T<:InfrastructureSystems.AbstractRecorderEvent","page":"API Reference","title":"PowerSimulations.list_simulation_events","text":"list_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString;\n ...\n) -> Vector{T} where T<:PowerSimulations.AbstractSimulationStatusEvent\nlist_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString,\n filter_func::Union{Nothing, Function};\n step,\n model_name\n) -> Vector{T} where T<:PowerSimulations.AbstractSimulationStatusEvent\n\n\nlist_simulation_events(\n ::Type{T},\n output_dir::AbstractString,\n filter_func::Union{Nothing, Function} = nothing;\n step = nothing,\n model = nothing,\n) where {T <: IS.AbstractRecorderEvent}\n\nList simulation events of type T in a simulation output directory.\n\nArguments\n\noutput_dir::AbstractString: Simulation output directory\nfilter_func::Union{Nothing, Function} = nothing: Refer to show_simulation_events.\nstep::Int = nothing: Filter events by step. Required if model is passed.\nmodel::Int = nothing: Filter events by model.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.show_recorder_events-Union{Tuple{T}, Tuple{Type{T}, AbstractString}, Tuple{Type{T}, AbstractString, Union{Nothing, Function}}} where T<:InfrastructureSystems.AbstractRecorderEvent","page":"API Reference","title":"PowerSimulations.show_recorder_events","text":"show_recorder_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n filename::AbstractString;\n ...\n)\nshow_recorder_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n filename::AbstractString,\n filter_func::Union{Nothing, Function};\n wall_time,\n kwargs...\n)\n\n\nshow_recorder_events(\n ::Type{T},\n filename::AbstractString,\n filter_func::Union{Nothing, Function} = nothing;\n wall_time = false,\n kwargs...,\n) where {T <: IS.AbstractRecorderEvent}\n\nShow the events of type T in a recorder file.\n\nArguments\n\n::Type{T}: Recorder event type\nfilename::AbstractString: recorder filename\nfilter_func::Union{Nothing, Function} = nothing: Optional function that accepts an event of type T and returns a Bool. Apply this function to each event and only return events where the result is true.\nwall_time = false: If true, show the wall_time timestamp.\n\n\n\n\n\n","category":"method"},{"location":"api/PowerSimulations/#PowerSimulations.show_simulation_events-Union{Tuple{T}, Tuple{Type{T}, AbstractString}, Tuple{Type{T}, AbstractString, Union{Nothing, Function}}} where T<:InfrastructureSystems.AbstractRecorderEvent","page":"API Reference","title":"PowerSimulations.show_simulation_events","text":"show_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString;\n ...\n)\nshow_simulation_events(\n ::Type{T<:InfrastructureSystems.AbstractRecorderEvent},\n output_dir::AbstractString,\n filter_func::Union{Nothing, Function};\n step,\n model,\n wall_time,\n kwargs...\n)\n\n\nshow_simulation_events(\n ::Type{T},\n output_dir::AbstractString,\n filter_func::Union{Nothing,Function} = nothing;\n step = nothing,\n model = nothing,\n wall_time = false,\n kwargs...,\n) where { T <: IS.AbstractRecorderEvent}\n\nShow all simulation events of type T in a simulation output directory.\n\nArguments\n\n::Type{T}: Recorder event type\noutput_dir::AbstractString: Simulation output directory\nfilter_func::Union{Nothing, Function} = nothing: Refer to show_recorder_events.\nstep::Int = nothing: Filter events by step. Required if model is passed.\nmodel::Int = nothing: Filter events by model.\nwall_time = false: If true, show the wall_time timestamp.\n\n\n\n\n\n","category":"method"},{"location":"modeler_guide/read_results/#read_results","page":"Read results","title":"Read results","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Once a DecisionModel is solved via solve!(model) or a Simulation is executed (and solved) via execute!(simulation), the results are stored and can be accessed directly in the REPL for result exploration and plotting.","category":"page"},{"location":"modeler_guide/read_results/#Read-results-of-a-Decision-Problem","page":"Read results","title":"Read results of a Decision Problem","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Once a DecisionModel is solved, results are accessed using OptimizationProblemResults(model) as follows:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# The DecisionModel is already constructed\nbuild!(model; output_dir = mktempdir())\nsolve!(model)\n\nresults = OptimizationProblemResults(model)","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"The output will showcase the available expressions, parameters and variables to read. For example it will look like:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Start: 2020-01-01T00:00:00\nEnd: 2020-01-03T23:00:00\nResolution: 60 minutes\n\nPowerSimulations Problem Auxiliary variables Results\n┌──────────────────────────────────────────┐\n│ CumulativeCyclingCharge__HybridSystem │\n│ CumulativeCyclingDischarge__HybridSystem │\n└──────────────────────────────────────────┘\n\nPowerSimulations Problem Expressions Results\n┌─────────────────────────────────────────────┐\n│ ProductionCostExpression__RenewableDispatch │\n│ ProductionCostExpression__ThermalStandard │\n└─────────────────────────────────────────────┘\n\nPowerSimulations Problem Duals Results\n┌──────────────────────────────────────┐\n│ CopperPlateBalanceConstraint__System │\n└──────────────────────────────────────┘\n\nPowerSimulations Problem Parameters Results\n┌────────────────────────────────────────────────────────────────────────┐\n│ ActivePowerTimeSeriesParameter__RenewableNonDispatch │\n│ RenewablePowerTimeSeries__HybridSystem │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3 │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up │\n│ ActivePowerTimeSeriesParameter__PowerLoad │\n│ ActivePowerTimeSeriesParameter__RenewableDispatch │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down │\n│ ActivePowerTimeSeriesParameter__HydroDispatch │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R1 │\n│ RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2 │\n└────────────────────────────────────────────────────────────────────────┘\n\nPowerSimulations Problem Variables Results\n┌────────────────────────────────────────────────────────────────────┐\n│ ActivePowerOutVariable__HybridSystem │\n│ ReservationVariable__HybridSystem │\n│ RenewablePower__HybridSystem │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R1 │\n│ SystemBalanceSlackUp__System │\n│ BatteryEnergyShortageVariable__HybridSystem │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Reg_Up │\n│ StopVariable__ThermalStandard │\n│ BatteryStatus__HybridSystem │\n│ BatteryDischarge__HybridSystem │\n│ ActivePowerInVariable__HybridSystem │\n│ DischargeRegularizationVariable__HybridSystem │\n│ BatteryCharge__HybridSystem │\n│ ActivePowerVariable__RenewableDispatch │\n│ ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down │\n│ EnergyVariable__HybridSystem │\n│ OnVariable__HybridSystem │\n│ BatteryEnergySurplusVariable__HybridSystem │\n│ SystemBalanceSlackDown__System │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R2 │\n│ ThermalPower__HybridSystem │\n│ ActivePowerVariable__ThermalStandard │\n│ StartVariable__ThermalStandard │\n│ ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3 │\n│ OnVariable__ThermalStandard │\n│ ChargeRegularizationVariable__HybridSystem │\n└────────────────────────────────────────────────────────────────────┘","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Then the following code can be used to read results:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# Read active power of Thermal Standard\nthermal_active_power = read_variable(results, \"ActivePowerVariable__ThermalStandard\")\n\n# Read max active power parameter of RenewableDispatch\nrenewable_param =\n read_parameter(results, \"ActivePowerTimeSeriesParameter__RenewableDispatch\")\n\n# Read cost expressions of ThermalStandard units\ncost_thermal = read_expression(results, \"ProductionCostExpression__ThermalStandard\")\n\n# Read dual variables\ndual_balance_constraint = read_dual(results, \"CopperPlateBalanceConstraint__System\")\n\n# Read auxiliary variables\naux_var_result = read_aux_variable(results, \"CumulativeCyclingCharge__HybridSystem\")","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Results will be in the form of DataFrames that can be easily explored.","category":"page"},{"location":"modeler_guide/read_results/#Read-results-of-a-Simulation","page":"Read results","title":"Read results of a Simulation","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# The Simulation is already constructed\nbuild!(sim)\nexecute!(sim; enable_progress_bar = true)\n\nresults_sim = SimulationResults(sim)","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"As an example, the SimulationResults printing will look like:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Decision Problem Results\n┌──────────────┬─────────────────────┬──────────────┬─────────────────────────┐\n│ Problem Name │ Initial Time │ Resolution │ Last Solution Timestamp │\n├──────────────┼─────────────────────┼──────────────┼─────────────────────────┤\n│ ED │ 2020-10-02T00:00:00 │ 60 minutes │ 2020-10-09T23:00:00 │\n│ UC │ 2020-10-02T00:00:00 │ 1440 minutes │ 2020-10-09T00:00:00 │\n└──────────────┴─────────────────────┴──────────────┴─────────────────────────┘\n\nEmulator Results\n┌─────────────────┬───────────┐\n│ Name │ Emulator │\n│ Resolution │ 5 minutes │\n│ Number of steps │ 2304 │\n└─────────────────┴───────────┘","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"With this, it is possible to obtain results of each DecisionModel and EmulationModel as follows:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"# Use the Problem Name for Decision Problems\nresults_uc = get_decision_problem_results(results_sim, \"UC\")\nresults_ed = get_decision_problem_results(results_sim, \"ED\")\nresults_emulator = get_emulation_problem_results(results_sim)","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Once we have each decision (or emulation) problem results, we can explore directly using the approach for Decision Models, mentioned in the previous section.","category":"page"},{"location":"modeler_guide/read_results/#Reading-solutions-for-all-simulation-steps","page":"Read results","title":"Reading solutions for all simulation steps","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"In this case, using read_variable (or read expression, parameter or dual), will return a dictionary of all steps (of that Decision Problem). For example, the following code:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"thermal_active_power = read_variable(results_uc, \"ActivePowerVariable__ThermalStandard\")","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"will return:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"DataStructures.SortedDict{Any, Any, Base.Order.ForwardOrdering} with 8 entries:\n DateTime(\"2020-10-02T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-03T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-04T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-05T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-06T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-07T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-08T00:00:00\") => 72×54 DataFrame…\n DateTime(\"2020-10-09T00:00:00\") => 72×54 DataFrame…","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"That is, a sorted dictionary for each simulation step, using as a key the initial timestamp for that specific simulation step.","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Note that in this case, each DataFrame, has a dimension of 72 times 54, since the horizon is 72 hours (number of rows), but the interval is only 24 hours. Indeed, note the initial timestamp of each simulation step is the beginning of each day, i.e. 24 hours. Finally, there 54 columns, since this example system has 53 ThermalStandard units (plus 1 column for the timestamps). The user is free to explore the solution of any simulation step as needed.","category":"page"},{"location":"modeler_guide/read_results/#Reading-the-\"realized\"-solution-(i.e.-the-interval)","page":"Read results","title":"Reading the \"realized\" solution (i.e. the interval)","text":"","category":"section"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"Using read_realized_variable (or read realized expression, parameter or dual), will return the DataFrame of the realized solution of any specific variable. That is, it will concatenate the corresponding simulation step with the specified interval of that step, to construct a single DataFrame with the \"realized solution\" of the entire simulation.","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"For example, the code:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"th_realized_power =\n read_realized_variable(results_uc, \"ActivePowerVariable__ThermalStandard\")","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"will return:","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"92×54 DataFrame\n Row │ DateTime 322_CT_6 321_CC_1 202_STEAM_3 223_CT_4 123_STEAM_2 213_CT_1 223_CT_6 313_CC_1 101_STEAM_3 123_C ⋯\n │ DateTime Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float ⋯\n─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n 1 │ 2020-10-02T00:00:00 0.0 293.333 0.0 0.0 0.0 0.0 0.0 231.667 76.0 0.0 ⋯\n 2 │ 2020-10-02T01:00:00 0.0 267.552 0.0 0.0 0.0 0.0 0.0 231.667 76.0 0.0\n 3 │ 2020-10-02T02:00:00 0.0 234.255 0.0 0.0 -4.97544e-11 0.0 0.0 231.667 76.0 0.0\n 4 │ 2020-10-02T03:00:00 0.0 249.099 0.0 0.0 -4.97544e-11 0.0 0.0 231.667 76.0 0.0\n 5 │ 2020-10-02T04:00:00 0.0 293.333 0.0 0.0 -4.97544e-11 0.0 0.0 231.667 76.0 0.0 ⋯\n 6 │ 2020-10-02T05:00:00 0.0 293.333 1.27578e-11 0.0 -4.97544e-11 0.0 0.0 293.333 76.0 0.0\n ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱\n 187 │ 2020-10-09T18:00:00 0.0 293.333 76.0 0.0 155.0 0.0 0.0 318.843 76.0 0.0\n 188 │ 2020-10-09T19:00:00 0.0 293.333 76.0 0.0 124.0 0.0 0.0 293.333 76.0 0.0\n 189 │ 2020-10-09T20:00:00 0.0 293.333 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 0.0 ⋯\n 190 │ 2020-10-09T21:00:00 -7.65965e-12 293.333 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 0.0\n 191 │ 2020-10-09T22:00:00 0.0 0.0 60.6667 0.0 124.0 0.0 0.0 0.0 76.0 7.156\n 192 │ 2020-10-09T23:00:00 0.0 0.0 60.6667 0.0 117.81 0.0 0.0 0.0 76.0 0.0\n 44 columns and 180 rows omitted","category":"page"},{"location":"modeler_guide/read_results/","page":"Read results","title":"Read results","text":"In this case, the 8 simulation steps of 24 hours (192 hours), in a single DataFrame, to enable easy exploration of the realized results for the user.","category":"page"},{"location":"tutorials/basics_of_developing_models/#Basics-of-Developing-Operation-Models","page":"Basics of Developing Operation Models","title":"Basics of Developing Operation Models","text":"","category":"section"},{"location":"tutorials/basics_of_developing_models/","page":"Basics of Developing Operation Models","title":"Basics of Developing Operation Models","text":"Check the page PowerSimulations Structure for more background on PowerSimulations.jl","category":"page"},{"location":"code_base_developer_guide/internal/","page":"Internals","title":"Internals","text":"CollapsedDocStrings = true","category":"page"},{"location":"code_base_developer_guide/internal/#Internal-API","page":"Internals","title":"Internal API","text":"","category":"section"},{"location":"code_base_developer_guide/internal/","page":"Internals","title":"Internals","text":"Modules = [PowerSimulations]\nPublic = false","category":"page"},{"location":"code_base_developer_guide/internal/#PowerSimulations.IGNORABLE_FILES","page":"Internals","title":"PowerSimulations.IGNORABLE_FILES","text":"If the name of an extraneous file that appears in simulation results matches one of these regexes, it is safe to ignore\n\n\n\n\n\n","category":"constant"},{"location":"code_base_developer_guide/internal/#PowerSimulations.AbstractDeviceFormulation","page":"Internals","title":"PowerSimulations.AbstractDeviceFormulation","text":"Abstract type for Device Formulations (a.k.a Models)\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyCustomDeviceFormulation <: PSI.AbstractDeviceFormulation\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.AbstractServiceFormulation","page":"Internals","title":"PowerSimulations.AbstractServiceFormulation","text":"Abstract type for Service Formulations (a.k.a Models)\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyServiceFormulation <: PSI.AbstractServiceFormulation\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.AbstractSimulationStatusEvent","page":"Internals","title":"PowerSimulations.AbstractSimulationStatusEvent","text":"All events subtyped from this need to be recorded under :simulation_status.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.CacheFlushRules","page":"Internals","title":"PowerSimulations.CacheFlushRules","text":"Informs the flusher on what data to keep in cache.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DecisionModelStore","page":"Internals","title":"PowerSimulations.DecisionModelStore","text":"Stores results data for one DecisionModel\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DecisionProblem","page":"Internals","title":"PowerSimulations.DecisionProblem","text":"Abstract type for Decision Problems\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyCustomProblem <: PSI.DecisionProblem\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DefaultDecisionProblem","page":"Internals","title":"PowerSimulations.DefaultDecisionProblem","text":"Abstract type for models than employ PowerSimulations methods. For custom decision problems use DecisionProblem as the super type.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.DefaultEmulationProblem","page":"Internals","title":"PowerSimulations.DefaultEmulationProblem","text":"Abstract type for models than employ PowerSimulations methods. For custom emulation problems use EmulationProblem as the super type.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.EmulationModelStore","page":"Internals","title":"PowerSimulations.EmulationModelStore","text":"Stores results data for one EmulationModel\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.EmulationProblem","page":"Internals","title":"PowerSimulations.EmulationProblem","text":"Abstract type for Emulation Problems\n\nExample\n\nimport PowerSimulations const PSI = PowerSimulations struct MyCustomEmulator <: PSI.EmulationProblem\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.FromToFlowLimitParameter","page":"Internals","title":"PowerSimulations.FromToFlowLimitParameter","text":"Parameter to define Flow From_To limit time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.GenericEmulationProblem","page":"Internals","title":"PowerSimulations.GenericEmulationProblem","text":"Default PowerSimulations Emulation Problem Type for unspecified problems\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCActivePowerReceivedFromVariable","page":"Internals","title":"PowerSimulations.HVDCActivePowerReceivedFromVariable","text":"Struct to dispatch the creation of HVDC Received Flow at From Bus Variables for PWL formulations\n\nDocs abbreviation: x\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCActivePowerReceivedToVariable","page":"Internals","title":"PowerSimulations.HVDCActivePowerReceivedToVariable","text":"Struct to dispatch the creation of HVDC Received Flow at To Bus Variables for PWL formulations\n\nDocs abbreviation: y\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCPiecewiseBinaryLossVariable","page":"Internals","title":"PowerSimulations.HVDCPiecewiseBinaryLossVariable","text":"Struct to dispatch the creation of HVDC Piecewise Binary Loss Variables\n\nDocs abbreviation: z\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCPiecewiseLossVariable","page":"Internals","title":"PowerSimulations.HVDCPiecewiseLossVariable","text":"Struct to dispatch the creation of HVDC Piecewise Loss Variables\n\nDocs abbreviation: h or w\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HVDCTwoTerminalPiecewiseLoss","page":"Internals","title":"PowerSimulations.HVDCTwoTerminalPiecewiseLoss","text":"Branch type to represent piecewise lossy power flow on two terminal DC lines\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.HdfSimulationStore","page":"Internals","title":"PowerSimulations.HdfSimulationStore","text":"Stores simulation data in an HDF file.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.InMemorySimulationStore","page":"Internals","title":"PowerSimulations.InMemorySimulationStore","text":"Stores simulation data in memory\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.InitialConditionChronology","page":"Internals","title":"PowerSimulations.InitialConditionChronology","text":"Supertype for initial condition chronologies \n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.InitialConditionsData","page":"Internals","title":"PowerSimulations.InitialConditionsData","text":"Stores data to populate initial conditions before the build call\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.MaxInterfaceFlowLimitParameter","page":"Internals","title":"PowerSimulations.MaxInterfaceFlowLimitParameter","text":"Parameter to define Max Flow limit for interface time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.MinInterfaceFlowLimitParameter","page":"Internals","title":"PowerSimulations.MinInterfaceFlowLimitParameter","text":"Parameter to define Min Flow limit for interface time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.OperationModel","page":"Internals","title":"PowerSimulations.OperationModel","text":"Abstract type for Decision Model and Emulation Model. OperationModel structs are parameterized with DecisionProblem or Emulation Problem structs\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.OptimizationOutputCache","page":"Internals","title":"PowerSimulations.OptimizationOutputCache","text":"Cache for a single parameter/variable/dual. Stores arrays chronologically by simulation timestamp.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.OptimizationOutputCaches","page":"Internals","title":"PowerSimulations.OptimizationOutputCaches","text":"Cache for all model results\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.PieceWiseLinearBlockOffer","page":"Internals","title":"PowerSimulations.PieceWiseLinearBlockOffer","text":"Struct to dispatch the creation of piecewise linear block offer variables for objective function\n\nDocs abbreviation: delta\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.PieceWiseLinearBlockOfferConstraint","page":"Internals","title":"PowerSimulations.PieceWiseLinearBlockOfferConstraint","text":"Struct to create the PieceWiseLinearBlockOfferConstraint associated with a specified variable.\n\nSee Piecewise linear cost functions for more information.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.PieceWiseLinearUpperBoundConstraint","page":"Internals","title":"PowerSimulations.PieceWiseLinearUpperBoundConstraint","text":"Struct to create the PieceWiseLinearUpperBoundConstraint associated with a specified variable.\n\nSee Piecewise linear cost functions for more information.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.SimulationProblemResults","page":"Internals","title":"PowerSimulations.SimulationProblemResults","text":"Holds the results of a simulation problem for plotting or exporting.\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.SimulationStore","page":"Internals","title":"PowerSimulations.SimulationStore","text":"Provides storage of simulation data\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#PowerSimulations.ToFromFlowLimitParameter","page":"Internals","title":"PowerSimulations.ToFromFlowLimitParameter","text":"Parameter to define Flow To_From limit time series\n\n\n\n\n\n","category":"type"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{PowerSimulations.EmulationModelStore}","page":"Internals","title":"Base.empty!","text":"empty!(store::PowerSimulations.EmulationModelStore)\n\n\nBase.empty!(store::EmulationModelStore)\n\nEmpty the EmulationModelStore\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{PowerSimulations.OptimizationOutputCaches}","page":"Internals","title":"Base.empty!","text":"empty!(cache::PowerSimulations.OptimizationOutputCaches)\n\n\nBase.empty!(cache::OptimizationOutputCaches)\n\nEmpty the OptimizationOutputCaches\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{PowerSimulations.OptimizationOutputCache}","page":"Internals","title":"Base.empty!","text":"empty!(cache::PowerSimulations.OptimizationOutputCache)\n\n\nBase.empty!(cache::OptimizationOutputCache)\n\nEmpty the OptimizationOutputCache\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#Base.empty!-Tuple{SimulationResults}","page":"Internals","title":"Base.empty!","text":"empty!(res::SimulationResults)\n\n\nBase.empty!(res::SimulationResults)\n\nEmpty the SimulationResults\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#InfrastructureSystems.Optimization.read_results_with_keys-Tuple{PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults}, Vector{<:InfrastructureSystems.Optimization.OptimizationContainerKey}}","page":"Internals","title":"InfrastructureSystems.Optimization.read_results_with_keys","text":"read_results_with_keys(\n res::PowerSimulations.SimulationProblemResults{PowerSimulations.DecisionModelSimulationResults},\n result_keys::Vector{<:InfrastructureSystems.Optimization.OptimizationContainerKey};\n start_time,\n len,\n cols\n) -> Dict{InfrastructureSystems.Optimization.OptimizationContainerKey, DataFrames.DataFrame}\n\n\nHigh-level function to read a DataFrame of results.\n\nArguments\n\nres: the results to read.\nresult_keys::Vector{<:OptimizationContainerKey}: the keys to read. Output will be a Dict{OptimizationContainerKey, DataFrame} with these as the keys\nstart_time::Union{Nothing, Dates.DateTime} = nothing: the time at which the resulting time series should begin; nothing indicates the first time in the results\nlen::Union{Int, Nothing} = nothing: the number of steps in the resulting time series; nothing indicates up to the end of the results\ncols::Union{Colon, Vector{String}} = (:): which columns to fetch; defaults to :, i.e., all the columns\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, Int64}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::InfrastructureSystems.Optimization.VariableType,\n break_points::Vector{Float64},\n period::Int64\n)\n\n\nImplement the constraints for PWL Block Offer variables. That is:\n\nsum_kinmathcalK delta_kt = p_t \nsum_kinmathcalK delta_kt = P_k+1t^max - P_kt^max\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::InfrastructureSystems.Optimization.VariableType,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the constraints for PWL variables. That is:\n\nsum_kinmathcalK P_k^max delta_kt = p_t \nsum_kinmathcalK delta_kt = on_t\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:Component, U<:PowerAboveMinimumVariable}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::PowerAboveMinimumVariable,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the constraints for PWL variables for Compact form. That is:\n\nsum_kinmathcalK P_k^max delta_kt = p_t + P_min * u_t \nsum_kinmathcalK delta_kt = on_t\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:ReserveDemandCurve, U<:ServiceRequirementVariable}","page":"Internals","title":"PowerSimulations._add_pwl_constraint!","text":"_add_pwl_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::ReserveDemandCurve,\n _::ServiceRequirementVariable,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the constraints for PWL Block Offer variables for ORDC. That is:\n\nsum_kinmathcalK delta_kt = p_t \nsum_kinmathcalK delta_kt = P_k+1t^max - P_kt^max\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_sos_constraint!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, U, Vector{Float64}, PowerSimulations.SOSStatusVariableModule.SOSStatusVariable, Int64}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType}","page":"Internals","title":"PowerSimulations._add_pwl_sos_constraint!","text":"_add_pwl_sos_constraint!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n _::InfrastructureSystems.Optimization.VariableType,\n break_points::Vector{Float64},\n sos_status::PowerSimulations.SOSStatusVariableModule.SOSStatusVariable,\n period::Int64\n)\n\n\nImplement the SOS for PWL variables. That is:\n\ndelta_it delta_kt in textSOS_2\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_term!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, MarketBidCost, CostCurve{PiecewiseIncrementalCurve}, U, V}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType, V<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_pwl_term!","text":"_add_pwl_term!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n cost_function::MarketBidCost,\n _::CostCurve{PiecewiseIncrementalCurve},\n _::InfrastructureSystems.Optimization.VariableType,\n _::PowerSimulations.AbstractDeviceFormulation\n) -> Vector{JuMP.AffExpr}\n\n\nAdd PWL cost terms for data coming from the MarketBidCost with a fixed incremental offer curve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_term!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}}, U, V}} where {T<:Component, U<:InfrastructureSystems.Optimization.VariableType, V<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_pwl_term!","text":"_add_pwl_term!(\n container::PowerSimulations.OptimizationContainer,\n component::Component,\n cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},\n _::InfrastructureSystems.Optimization.VariableType,\n _::PowerSimulations.AbstractDeviceFormulation\n) -> Vector{JuMP.AffExpr}\n\n\nAdd PWL cost terms for data coming from a PiecewisePointCurve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_pwl_term!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}}, U, V}} where {T<:ThermalGen, U<:InfrastructureSystems.Optimization.VariableType, V<:ThermalDispatchNoMin}","page":"Internals","title":"PowerSimulations._add_pwl_term!","text":"_add_pwl_term!(\n container::PowerSimulations.OptimizationContainer,\n component::ThermalGen,\n cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},\n _::InfrastructureSystems.Optimization.VariableType,\n _::ThermalDispatchNoMin\n) -> Vector{JuMP.AffExpr}\n\n\nAdd PWL cost terms for data coming from a PiecewisePointCurve for ThermalDispatchNoMin formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, CostCurve{LinearCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::CostCurve{LinearCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.CostCurve{PSY.LinearCurve} : container for cost to be associated with variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, CostCurve{QuadraticCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::CostCurve{QuadraticCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nEquation\n\ngen_cost = dt*sign*(sum(variable.^2)*cost_data[1] + sum(variable)*cost_data[2])\n\nLaTeX\n\ncost = dttimes sign (sum_iin I c_1 v_i^2 + sum_iin I c_2 v_i )\n\nfor quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.CostCurve{PSY.QuadraticCurve} : container for quadratic factors\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, FuelCurve{LinearCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::FuelCurve{LinearCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.FuelCurve{PSY.LinearCurve} : container for cost to be associated with variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, FuelCurve{QuadraticCurve}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::FuelCurve{QuadraticCurve},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nAdds to the cost function cost terms for sum of variables with common factor to be used for cost expression for optimization_container model.\n\nEquation\n\ngen_cost = dt*(sum(variable.^2)*cost_data[1]*fuel_cost + sum(variable)*cost_data[2]*fuel_cost)\n\nLaTeX\n\ncost = dttimes (sum_iin I c_f c_1 v_i^2 + sum_iin I c_f c_2 v_i )\n\nfor quadratic factor large enough. If the first term of the quadratic objective is 0.0, adds a linear cost term sum(variable)*cost_data[2]\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_component::PSY.FuelCurve{PSY.QuadraticCurve} : container for quadratic factors\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, MarketBidCost, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::MarketBidCost,\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear market bid function using a sum of variables and expression for market participants. Decremental offers are not accepted for most components, except Storage systems and loads.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::MarketBidCost : container for market bid cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}}, U}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::Union{CostCurve{PiecewisePointCurve}, FuelCurve{PiecewisePointCurve}},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear cost function using a sum of variables and expression with sign and time step included.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::PSY.CostCurve{PSY.PiecewisePointCurve}: container for piecewise linear cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{V}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, V, U}} where {T<:InfrastructureSystems.Optimization.VariableType, V<:Union{CostCurve{PiecewiseAverageCurve}, CostCurve{PiecewiseIncrementalCurve}}, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::Union{CostCurve{PiecewiseAverageCurve}, CostCurve{PiecewiseIncrementalCurve}},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear cost function using a sum of variables and expression with sign and time step included.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::PSY.Union{PSY.CostCurve{PSY.PiecewiseIncrementalCurve}, PSY.CostCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._add_variable_cost_to_objective!-Union{Tuple{U}, Tuple{V}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Component, V, U}} where {T<:InfrastructureSystems.Optimization.VariableType, V<:Union{FuelCurve{PiecewiseAverageCurve}, FuelCurve{PiecewiseIncrementalCurve}}, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations._add_variable_cost_to_objective!","text":"_add_variable_cost_to_objective!(\n container::PowerSimulations.OptimizationContainer,\n _::InfrastructureSystems.Optimization.VariableType,\n component::Component,\n cost_function::Union{FuelCurve{PiecewiseAverageCurve}, FuelCurve{PiecewiseIncrementalCurve}},\n _::PowerSimulations.AbstractDeviceFormulation\n)\n\n\nCreates piecewise linear fuel cost function using a sum of variables and expression with sign and time step included.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nvar_key::VariableKey: The variable name\ncomponentname::String: The componentname of the variable container\ncost_function::PSY.Union{PSY.FuelCurve{PSY.PiecewiseIncrementalCurve}, PSY.FuelCurve{PSY.PiecewiseAverageCurve}}: container for piecewise linear cost\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._allocate_execution_order-Tuple{Vector{Int64}}","page":"Internals","title":"PowerSimulations._allocate_execution_order","text":"_allocate_execution_order(\n interval_run_counts::Vector{Int64}\n) -> Vector{Int64}\n\n\nFunction calculates the total number of problem executions in the simulation and allocates the appropiate vector\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._calculate_interval_inner_counts-Tuple{OrderedDict{Symbol, Dates.Millisecond}}","page":"Internals","title":"PowerSimulations._calculate_interval_inner_counts","text":"_calculate_interval_inner_counts(\n intervals::OrderedDict{Symbol, Dates.Millisecond}\n) -> Vector{Int64}\n\n\ncalculateintervalinnercounts(intervals::OrderedDict{String,<:Dates.TimePeriod})\n\nCalculates how many times a problem is executed for every interval of the previous problem\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._create_time_series_multiplier_index-Union{Tuple{T}, Tuple{Any, Type{T}}} where T<:InfrastructureSystems.Optimization.TimeSeriesParameter","page":"Internals","title":"PowerSimulations._create_time_series_multiplier_index","text":"_create_time_series_multiplier_index(\n model,\n _::Type{T<:InfrastructureSystems.Optimization.TimeSeriesParameter}\n) -> Union{Nothing, Int64}\n\n\nFunction to create a unique index of time series names for each device model. For example, if two parameters each reference the same time series name, this function will return a different value for each parameter entry\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._get_data_for_tdc-Union{Tuple{U}, Tuple{T}, Tuple{Vector{T}, Vector{U}, Dates.TimePeriod}} where {T<:InitialCondition, U<:InitialCondition}","page":"Internals","title":"PowerSimulations._get_data_for_tdc","text":"_get_data_for_tdc(\n initial_conditions_on::Array{T<:InitialCondition, 1},\n initial_conditions_off::Array{U<:InitialCondition, 1},\n resolution::Dates.TimePeriod\n) -> Tuple{Matrix{InitialCondition}, Vector{@NamedTuple{up::Float64, down::Float64}}}\n\n\nIf the fraction of hours that a generator has a duration constraint is less than the fraction of hours that a single time_step represents then it is not binding.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._get_initial_condition_type-Tuple{Type{RampConstraint}, Type{<:ThermalGen}, Type{<:PowerSimulations.AbstractThermalFormulation}}","page":"Internals","title":"PowerSimulations._get_initial_condition_type","text":"_get_initial_condition_type(\n _::Type{RampConstraint},\n _::Type{<:ThermalGen},\n _::Type{<:PowerSimulations.AbstractThermalFormulation}\n) -> Type{PowerSimulations.DeviceAboveMinPower}\n\n\nThis function gets the data for the generators for ramping constraints of thermal generators\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._get_pwl_cost_expression-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, Int64, PiecewiseStepData, Float64}} where T<:ReserveDemandCurve","page":"Internals","title":"PowerSimulations._get_pwl_cost_expression","text":"_get_pwl_cost_expression(\n container::PowerSimulations.OptimizationContainer,\n component::ReserveDemandCurve,\n time_period::Int64,\n cost_data::PiecewiseStepData,\n multiplier::Float64\n) -> JuMP.AffExpr\n\n\nGet cost expression for StepwiseCostReserve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations._summary_to_dict!-Tuple{OptimizerStats, JuMP.Model}","page":"Internals","title":"PowerSimulations._summary_to_dict!","text":"_summary_to_dict!(\n optimizer_stats::OptimizerStats,\n jump_model::JuMP.Model\n)\n\n\nRun this function only when getting detailed solver stats\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{B}, Tuple{PowerSimulations.OptimizationContainer, Type{NetworkFlowConstraint}, InfrastructureSystems.FlattenIteratorWrapper{B}, DeviceModel{B, <:PowerSimulations.AbstractBranchFormulation}, NetworkModel{<:PowerSimulations.AbstractPTDFModel}}} where B<:ACBranch","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{NetworkFlowConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},\n model::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nAdd network flow constraints for ACBranch and NetworkModel with <: AbstractPTDFModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{SR}, Tuple{PowerSimulations.OptimizationContainer, Type{RequirementConstraint}, SR, Vector{<:Service}, ServiceModel{SR, GroupReserve}}} where SR<:ConstantReserveGroup","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{RequirementConstraint},\n service::ConstantReserveGroup,\n contributing_services::Vector{<:Service},\n model::ServiceModel{SR<:ConstantReserveGroup, GroupReserve}\n)\n\n\nThis function creates the requirement constraint that will be attained by the appropriate services\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{B}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraintFromTo}, InfrastructureSystems.FlattenIteratorWrapper{B}, DeviceModel{B, <:PowerSimulations.AbstractBranchFormulation}, NetworkModel{T}}} where {B<:ACBranch, T<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n cons_type::Type{RateLimitConstraintFromTo},\n devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},\n device_model::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{T<:PowerModels.AbstractPowerModel}\n)\n\n\nAdd rate limit from to constraints for ACBranch with AbstractPowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{B}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraintToFrom}, InfrastructureSystems.FlattenIteratorWrapper{B}, DeviceModel{B, <:PowerSimulations.AbstractBranchFormulation}, NetworkModel{T}}} where {B<:ACBranch, T<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n cons_type::Type{RateLimitConstraintToFrom},\n devices::InfrastructureSystems.FlattenIteratorWrapper{B<:ACBranch},\n _::DeviceModel{B<:ACBranch, <:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{T<:PowerModels.AbstractPowerModel}\n)\n\n\nAdd rate limit to from constraints for ACBranch with AbstractPowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{FlowLimitConstraint}, InfrastructureSystems.FlattenIteratorWrapper{AreaInterchange}, DeviceModel{AreaInterchange, StaticBranch}, NetworkModel{T}}} where T<:PowerModels.AbstractActivePowerModel","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{FlowLimitConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{AreaInterchange},\n model::DeviceModel{AreaInterchange, StaticBranch},\n _::NetworkModel{T<:PowerModels.AbstractActivePowerModel}\n)\n\n\nAdd flow constraints for area interchanges\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{NetworkFlowConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, PhaseAngleControl}, NetworkModel{<:PowerSimulations.AbstractPTDFModel}}} where T<:PhaseShiftingTransformer","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{NetworkFlowConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},\n model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},\n network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nAdd network flow constraints for PhaseShiftingTransformer and NetworkModel with <: AbstractPTDFModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{NetworkFlowConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, PhaseAngleControl}, NetworkModel{DCPPowerModel}}} where T<:PhaseShiftingTransformer","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{NetworkFlowConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},\n model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},\n _::NetworkModel{DCPPowerModel}\n)\n\n\nAdd network flow constraints for PhaseShiftingTransformer and NetworkModel with PM.DCPPowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{StartTypeConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, ThermalMultiStartUnitCommitment}, NetworkModel}} where T<:ThermalMultiStart","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{StartTypeConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},\n model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},\n _::NetworkModel\n)\n\n\nConstructs contraints that restricts devices to one type of start at a time\n\nEquations\n\nsum(var_starts[name, s, t] for s in starts) = var_start[name, t]\n\nLaTeX\n\nsum^S_g_s=1 δ^s(t) eq x^start(t)\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{StartupInitialConditionConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, ThermalMultiStartUnitCommitment}, NetworkModel}} where T<:ThermalMultiStart","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{StartupInitialConditionConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},\n model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},\n _::NetworkModel\n)\n\n\nConstructs contraints that restricts devices to one type of start at a time\n\nEquations\n\nub: (time_limits[st+1]-1)*δ^{s}(t) + (1 - δ^{s}(t)) * M_VALUE >= sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime lb: (time_limits[st]-1)*δ^{s}(t) =< sum(1-varbin[name, i]) for i in 1:t) + initial_condition_offtime\n\nLaTeX\n\nTS^s+1_g δ^s(t) + (1-δ^s(t)) M_VALUE geq sum^t_i=1 x^status(i) + DT_g^0 forall t in 1 ldots TS^s+1_g\n\nTS^s_g δ^s(t) leq sum^t_i=1 x^status(i) + DT_g^0 forall t in 1 ldots TS^s+1_g\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{StartupTimeLimitTemperatureConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, ThermalMultiStartUnitCommitment}, NetworkModel}} where T<:ThermalMultiStart","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{StartupTimeLimitTemperatureConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ThermalMultiStart},\n model::DeviceModel{T<:ThermalMultiStart, ThermalMultiStartUnitCommitment},\n _::NetworkModel\n)\n\n\nConstructs contraints for different types of starts based on generator down-time\n\nEquations\n\nfor t in time_limits[s+1]:T\n\nvar_starts[name, s, t] <= sum( var_stop[name, t-i] for i in time_limits[s]:(time_limits[s+1]-1)\n\nLaTeX\n\nδ^s(t) leq sum_i=TS^s_g^TS^s+1_g x^stop(t-i)\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{PhaseAngleControlLimit}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, PhaseAngleControl}, NetworkModel{U}}} where {T<:PhaseShiftingTransformer, U<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{PhaseAngleControlLimit},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:PhaseShiftingTransformer},\n model::DeviceModel{T<:PhaseShiftingTransformer, PhaseAngleControl},\n _::NetworkModel{U<:PowerModels.AbstractActivePowerModel}\n)\n\n\nAdd phase angle limits for phase shifters\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{FlowLimitConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:Union{MonitoredLine, PhaseShiftingTransformer}, U<:PowerSimulations.AbstractBranchFormulation, V<:PowerModels.AbstractDCPModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{FlowLimitConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Union{MonitoredLine, PhaseShiftingTransformer}},\n model::DeviceModel{T<:Union{MonitoredLine, PhaseShiftingTransformer}, U<:PowerSimulations.AbstractBranchFormulation},\n _::NetworkModel{V<:PowerModels.AbstractDCPModel}\n)\n\n\nAdd branch flow constraints for monitored lines with DC Power Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{FlowLimitToFromConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:MonitoredLine, U<:StaticBranchUnbounded, V<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n _::PowerSimulations.OptimizationContainer,\n _::Type{FlowLimitToFromConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:MonitoredLine},\n model::DeviceModel{T<:MonitoredLine, U<:StaticBranchUnbounded},\n _::NetworkModel{V<:PowerModels.AbstractActivePowerModel}\n)\n\n\nDon't add branch flow constraints for monitored lines if formulation is StaticBranchUnbounded\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraintFromTo}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:MonitoredLine, U<:StaticBranchUnbounded, V<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n _::PowerSimulations.OptimizationContainer,\n _::Type{RateLimitConstraintFromTo},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:MonitoredLine},\n model::DeviceModel{T<:MonitoredLine, U<:StaticBranchUnbounded},\n _::NetworkModel{V<:PowerModels.AbstractActivePowerModel}\n)\n\n\nDon't add branch flow constraints for monitored lines if formulation is StaticBranchUnbounded\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{RateLimitConstraint}, InfrastructureSystems.FlattenIteratorWrapper{T}, DeviceModel{T, U}, NetworkModel{V}}} where {T<:ACBranch, U<:PowerSimulations.AbstractBranchFormulation, V<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n cons_type::Type{RateLimitConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:ACBranch},\n device_model::DeviceModel{T<:ACBranch, U<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{V<:PowerModels.AbstractActivePowerModel}\n)\n\n\nAdd branch rate limit constraints for ACBranch with AbstractActivePowerModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{PowerSimulations.OptimizationContainer, Type{RampConstraint}, InfrastructureSystems.FlattenIteratorWrapper{U}, DeviceModel{U, V}, NetworkModel{W}}} where {U<:ThermalGen, V<:PowerSimulations.AbstractThermalUnitCommitment, W<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{RampConstraint},\n devices::InfrastructureSystems.FlattenIteratorWrapper{U<:ThermalGen},\n model::DeviceModel{U<:ThermalGen, V<:PowerSimulations.AbstractThermalUnitCommitment},\n _::NetworkModel{W<:PowerModels.AbstractPowerModel}\n)\n\n\nThis function adds the ramping limits of generators when there are CommitmentVariables\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:ActivePowerVariableLimitsConstraint}, Type{<:InfrastructureSystems.Optimization.VariableType}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalMultiStart, W<:ThermalMultiStartUnitCommitment, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:ActivePowerVariableLimitsConstraint},\n U::Type{<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalMultiStart},\n _::DeviceModel{V<:ThermalMultiStart, W<:ThermalMultiStartUnitCommitment},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nThis function adds range constraint for the first time period. Constraint (10) from PGLIB formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:PowerSimulations.PowerVariableLimitsConstraint}, Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalGen, W<:PowerSimulations.AbstractThermalDispatchFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},\n U::Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalGen},\n model::DeviceModel{V<:ThermalGen, W<:PowerSimulations.AbstractThermalDispatchFormulation},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nSemicontinuous range constraints for thermal dispatch formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:PowerSimulations.PowerVariableLimitsConstraint}, Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalGen, W<:PowerSimulations.AbstractThermalUnitCommitment, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},\n U::Type{<:Union{InfrastructureSystems.Optimization.ExpressionType, InfrastructureSystems.Optimization.VariableType}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalGen},\n model::DeviceModel{V<:ThermalGen, W<:PowerSimulations.AbstractThermalUnitCommitment},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nSemicontinuous range constraints for unit commitment formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:PowerSimulations.PowerVariableLimitsConstraint}, Type{<:Union{PowerAboveMinimumVariable, InfrastructureSystems.Optimization.ExpressionType}}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ThermalGen, W<:ThermalCompactDispatch, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:PowerSimulations.PowerVariableLimitsConstraint},\n U::Type{<:Union{PowerAboveMinimumVariable, InfrastructureSystems.Optimization.ExpressionType}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ThermalGen},\n model::DeviceModel{V<:ThermalGen, W<:ThermalCompactDispatch},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nRange constraints for thermal compact dispatch\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:ReactivePowerVariableLimitsConstraint}, Type{<:ReactivePowerVariable}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:ElectricLoad, W<:PowerSimulations.AbstractControllablePowerLoadFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:ReactivePowerVariableLimitsConstraint},\n U::Type{<:ReactivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ElectricLoad},\n _::DeviceModel{V<:ElectricLoad, W<:PowerSimulations.AbstractControllablePowerLoadFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nReactive Power Constraints on Controllable Loads Assume Constant power_factor\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{PowerSimulations.OptimizationContainer, Type{<:ReactivePowerVariableLimitsConstraint}, Type{<:ReactivePowerVariable}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {V<:RenewableGen, W<:RenewableConstantPowerFactor, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_constraints!","text":"add_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{<:ReactivePowerVariableLimitsConstraint},\n _::Type{<:ReactivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:RenewableGen},\n _::DeviceModel{V<:RenewableGen, W<:RenewableConstantPowerFactor},\n _::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nReactive Power Constraints on Renewable Gen Constant power_factor\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_feedforward_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, DeviceModel, InfrastructureSystems.FlattenIteratorWrapper{T}, UpperBoundFeedforward}} where T<:Component","page":"Internals","title":"PowerSimulations.add_feedforward_constraints!","text":"add_feedforward_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::DeviceModel,\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Component},\n ff::UpperBoundFeedforward\n)\n\n\n ub_ff(container::OptimizationContainer,\n cons_name::Symbol,\n constraint_infos,\n param_reference,\n var_key::VariableKey)\n\nConstructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.\n\nvariable[var_name, t] <= param_reference[var_name]\n\nLaTeX\n\nx leq param^max\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\ncons_name::Symbol : name of the constraint\nparam_reference : Reference to the JuMP.VariableRef used to determine the upperbound\nvar_key::VariableKey : the name of the continuous variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_feedforward_constraints!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, DeviceModel, Union{InfrastructureSystems.FlattenIteratorWrapper{T}, Vector{T}}, FixValueFeedforward}} where T<:Component","page":"Internals","title":"PowerSimulations.add_feedforward_constraints!","text":"add_feedforward_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::DeviceModel,\n devices::Union{Array{T<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{T<:Component}},\n ff::FixValueFeedforward\n)\n\n\n add_feedforward_constraints(\n container::OptimizationContainer,\n ::DeviceModel,\n devices::IS.FlattenIteratorWrapper{T},\n ff::FixValueFeedforward,\n ) where {T <: PSY.Component}\n\nConstructs a equality constraint to a fix a variable in one model using the variable value from other model results.\n\nvariable[var_name, t] == param[var_name, t]\n\nLaTeX\n\nx == param\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nmodel::DeviceModel : the device model\ndevices::IS.FlattenIteratorWrapper{T} : list of devices\nff::FixValueFeedforward : a instance of the FixValue Feedforward\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_feedforward_constraints!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, DeviceModel{T, U}, InfrastructureSystems.FlattenIteratorWrapper{T}, LowerBoundFeedforward}} where {T<:Component, U<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_feedforward_constraints!","text":"add_feedforward_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::DeviceModel{T<:Component, U<:PowerSimulations.AbstractDeviceFormulation},\n devices::InfrastructureSystems.FlattenIteratorWrapper{T<:Component},\n ff::LowerBoundFeedforward\n)\n\n\n lb_ff(container::OptimizationContainer,\n cons_name::Symbol,\n constraint_infos,\n param_reference,\n var_key::VariableKey)\n\nConstructs a parameterized upper bound constraint to implement feedforward from other models. The Parameters are initialized using the uppper boundary values of the provided variables.\n\nvariable[var_name, t] <= param_reference[var_name]\n\nLaTeX\n\nx leq param^max\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\ncons_name::Symbol : name of the constraint\nparam_reference : Reference to the JuMP.VariableRef used to determine the upperbound\nvar_key::VariableKey : the name of the continuous variable\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_linear_ramp_constraints!-Union{Tuple{W}, Tuple{V}, Tuple{S}, Tuple{PowerSimulations.OptimizationContainer, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{S}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{<:PowerModels.AbstractPowerModel}}} where {S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_linear_ramp_constraints!","text":"add_linear_ramp_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n U::Type{S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs allowed rate-of-change constraints from variables, initial condtions, and rate data.\n\nIf t = 1:\n\nvariable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up\n\ninitial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down\n\nIf t > 1:\n\nvariable[name, t] - variable[name, t-1] <= rate_data[1][ix].up\n\nvariable[name, t-1] - variable[name, t] <= rate_data[1][ix].down\n\nLaTeX\n\nr^down leq x_1 - x_init leq r^up text for t = 1\n\nr^down leq x_t - x_t-1 leq r^up forall t geq 2\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_range_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{X}}} where {T<:InfrastructureSystems.Optimization.ConstraintType, U<:InfrastructureSystems.Optimization.VariableType, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_range_constraints!","text":"add_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{X<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable.\n\nIf min and max within an epsilon width:\n\nvariable[name, t] == limits.max\n\nOtherwise:\n\nlimits.min <= variable[name, t] <= limits.max\n\nwhere limits in constraint_infos.\n\nLaTeX\n\nx = limits^max text for limits^max - limits^min varepsilon\n\nlimits^min leq x leq limits^max text otherwise \n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_reserve_range_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{X}}} where {T<:InputActivePowerVariableLimitsConstraint, U<:InfrastructureSystems.Optimization.VariableType, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_reserve_range_constraints!","text":"add_reserve_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InputActivePowerVariableLimitsConstraint},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{X<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and reservation decision variable.\n\nvarcts[name, t] <= limits.max * (1 - varbin[name, t])\n\nvarcts[name, t] >= limits.min * (1 - varbin[name, t])\n\nwhere limits in constraint_infos.\n\nLaTeX\n\n0 leq x^cts leq limits^max (1 - x^bin) text for limits^min = 0\n\nlimits^min (1 - x^bin) leq x^cts leq limits^max (1 - x^bin) text otherwise \n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_reserve_range_constraints!-Union{Tuple{Y}, Tuple{X}, Tuple{W}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{W}, DeviceModel{W, X}, Type{Y}}} where {T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}, U<:InfrastructureSystems.Optimization.ExpressionType, W<:Component, X<:PowerSimulations.AbstractDeviceFormulation, Y<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_reserve_range_constraints!","text":"add_reserve_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}},\n _::Type{U<:InfrastructureSystems.Optimization.ExpressionType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{W<:Component},\n model::DeviceModel{W<:Component, X<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{Y<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and reservation decision variable.\n\nvarcts[name, t] <= limits.max * varbin[name, t]\n\nvarcts[name, t] >= limits.min * varbin[name, t]\n\nwhere limits in constraint_infos.\n\nLaTeX\n\nlimits^min x^bin leq x^cts leq limits^max x^bin\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_reserve_range_constraints!-Union{Tuple{Y}, Tuple{X}, Tuple{W}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{W}, DeviceModel{W, X}, Type{Y}}} where {T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}, U<:InfrastructureSystems.Optimization.VariableType, W<:Component, X<:PowerSimulations.AbstractDeviceFormulation, Y<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_reserve_range_constraints!","text":"add_reserve_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:Union{OutputActivePowerVariableLimitsConstraint, ReactivePowerVariableLimitsConstraint}},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{W<:Component},\n model::DeviceModel{W<:Component, X<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{Y<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and reservation decision variable.\n\nvarcts[name, t] <= limits.max * varbin[name, t]\n\nvarcts[name, t] >= limits.min * varbin[name, t]\n\nwhere limits in constraint_infos.\n\nLaTeX\n\nlimits^min x^bin leq x^cts leq limits^max x^bin\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_result!-Tuple{PowerSimulations.OptimizationOutputCache, Dates.DateTime, Array{Float64}, Bool}","page":"Internals","title":"PowerSimulations.add_result!","text":"add_result!(\n cache::PowerSimulations.OptimizationOutputCache,\n timestamp::Dates.DateTime,\n array::Array{Float64},\n system_cache_is_full::Bool\n) -> Int64\n\n\nAdd result to the cache.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_semicontinuous_ramp_constraints!-Union{Tuple{W}, Tuple{V}, Tuple{S}, Tuple{PowerSimulations.OptimizationContainer, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{S}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{<:PowerModels.AbstractPowerModel}}} where {S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_semicontinuous_ramp_constraints!","text":"add_semicontinuous_ramp_constraints!(\n container::PowerSimulations.OptimizationContainer,\n T::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n U::Type{S<:Union{ActivePowerVariable, PowerAboveMinimumVariable}},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n _::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs allowed rate-of-change constraints from variables, initial condtions, start/stop status, and rate data\n\nEquations\n\nIf t = 1:\n\nvariable[name, 1] - initial_conditions[ix].value <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, 1]\n\ninitial_conditions[ix].value - variable[name, 1] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, 1]\n\nIf t > 1:\n\nvariable[name, t] - variable[name, t-1] <= rate_data[1][ix].up + rate_data[2][ix].max*varstart[name, t]\n\nvariable[name, t-1] - variable[name, t] <= rate_data[1][ix].down + rate_data[2][ix].min*varstop[name, t]\n\nLaTeX\n\nr^down + r^min x^stop_1 leq x_1 - x_init leq r^up + r^max x^start_1 text for t = 1\n\nr^down + r^min x^stop_t leq x_t - x_t-1 leq r^up + r^max x^start_t forall t geq 2\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_semicontinuous_range_constraints!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, Type{X}}} where {T<:InfrastructureSystems.Optimization.ConstraintType, U<:InfrastructureSystems.Optimization.VariableType, V<:Component, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_semicontinuous_range_constraints!","text":"add_semicontinuous_range_constraints!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Component},\n model::DeviceModel{V<:Component, W<:PowerSimulations.AbstractDeviceFormulation},\n _::Type{X<:PowerModels.AbstractPowerModel}\n)\n\n\nConstructs min/max range constraint from device variable and on/off decision variable.\n\nIf device min = 0:\n\nvarcts[name, t] <= limits.max*varbin[name, t])\n\nvarcts[name, t] >= 0.0\n\nOtherwise:\n\nvarcts[name, t] <= limits.max*varbin[name, t]\n\nvarcts[name, t] >= limits.min*varbin[name, t]\n\nwhere limits in constraint_infos.\n\nLaTeX\n\n0 leq x^cts leq limits^max x^bin text for limits^min = 0\n\nlimits^min x^bin leq x^cts leq limits^max x^bin text otherwise \n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{PhaseShiftingTransformer}, DeviceModel{PhaseShiftingTransformer, V}, NetworkModel{<:PowerSimulations.AbstractPTDFModel}}} where {T<:ActivePowerBalance, U<:PhaseShifterAngle, V<:PhaseAngleControl}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:PhaseShifterAngle},\n devices::InfrastructureSystems.FlattenIteratorWrapper{PhaseShiftingTransformer},\n _::DeviceModel{PhaseShiftingTransformer, V<:PhaseAngleControl},\n network_model::NetworkModel{<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{CopperPlatePowerModel}}} where {T<:ActivePowerBalance, U<:FlowActivePowerVariable, V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{CopperPlatePowerModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{CopperPlatePowerModel}}} where {T<:ActivePowerBalance, U<:InfrastructureSystems.Optimization.VariableType, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{CopperPlatePowerModel}\n)\n\n\nDefault implementation to add variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{PTDFPowerModel}}} where {T<:ActivePowerBalance, U<:FlowActivePowerToFromVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerToFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{PTDFPowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{PTDFPowerModel}}} where {T<:ActivePowerBalance, U<:FlowActivePowerVariable, V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{PTDFPowerModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{PTDFPowerModel}}} where {T<:ActivePowerBalance, U<:InfrastructureSystems.Optimization.VariableType, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{PTDFPowerModel}\n)\n\n\nDefault implementation to add variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerFromToVariable, V<:Branch, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerFromToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Branch},\n _::DeviceModel{V<:Branch, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerFromToVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation, X<:CopperPlatePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerFromToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{X<:CopperPlatePowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerFromToVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerFromToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerToFromVariable, V<:ACBranch, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerToFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerToFromVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation, X<:CopperPlatePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerToFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.AbstractTwoTerminalDCLineFormulation},\n network_model::NetworkModel{X<:CopperPlatePowerModel}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:FlowActivePowerVariable, V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation, X<:PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:FlowActivePowerVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:ACBranch},\n _::DeviceModel{V<:ACBranch, W<:PowerSimulations.AbstractBranchFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractActivePowerModel}\n)\n\n\nImplementation of addtoexpression! for lossless branch/network models\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:HVDCLosses, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:HVDCTwoTerminalDispatch, X<:Union{CopperPlatePowerModel, PTDFPowerModel}}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:HVDCLosses},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:HVDCTwoTerminalDispatch},\n network_model::NetworkModel{X<:Union{CopperPlatePowerModel, PTDFPowerModel}}\n)\n\n\nDefault implementation to add branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:PowerSimulations.HVDCActivePowerReceivedFromVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:PowerSimulations.HVDCActivePowerReceivedFromVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nPWL implementation to add FromTo branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:ActivePowerBalance, U<:PowerSimulations.HVDCActivePowerReceivedToVariable, V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:ActivePowerBalance},\n _::Type{U<:PowerSimulations.HVDCActivePowerReceivedToVariable},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}},\n _::DeviceModel{V<:Union{TwoTerminalHVDCLine, TwoTerminalVSCDCLine}, W<:PowerSimulations.HVDCTwoTerminalPiecewiseLoss},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nPWL implementation to add FromTo branch variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.TimeSeriesParameter, V<:Device, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:Device},\n model::DeviceModel{V<:Device, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add parameters to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.TimeSeriesParameter, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation, X<:CopperPlatePowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:CopperPlatePowerModel}\n)\n\n\nDefault implementation to add parameters to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.TimeSeriesParameter, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerSimulations.AbstractPTDFModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.TimeSeriesParameter},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n device_model::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerSimulations.AbstractPTDFModel}\n)\n\n\nDefault implementation to add parameters to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_to_expression!-Union{Tuple{X}, Tuple{W}, Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Type{U}, InfrastructureSystems.FlattenIteratorWrapper{V}, DeviceModel{V, W}, NetworkModel{X}}} where {T<:SystemBalanceExpressions, U<:InfrastructureSystems.Optimization.VariableType, V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation, X<:PowerModels.AbstractPowerModel}","page":"Internals","title":"PowerSimulations.add_to_expression!","text":"add_to_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:SystemBalanceExpressions},\n _::Type{U<:InfrastructureSystems.Optimization.VariableType},\n devices::InfrastructureSystems.FlattenIteratorWrapper{V<:StaticInjection},\n _::DeviceModel{V<:StaticInjection, W<:PowerSimulations.AbstractDeviceFormulation},\n network_model::NetworkModel{X<:PowerModels.AbstractPowerModel}\n)\n\n\nDefault implementation to add device variables to SystemBalanceExpressions\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{D}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, T, D, Any}} where {T<:ServiceRequirementVariable, D<:ReserveDemandCurve}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n variable_type::ServiceRequirementVariable,\n service::ReserveDemandCurve,\n formulation\n)\n\n\nAdd variables for ServiceRequirementVariable for StepWiseCostReserve\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{U}, Tuple{D}, Tuple{PowerSimulations.OptimizationContainer, InfrastructureSystems.Optimization.AuxVariableType, U, Any}} where {D<:Component, U<:Union{InfrastructureSystems.FlattenIteratorWrapper{D}, Vector{D}}}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n var_type::InfrastructureSystems.Optimization.AuxVariableType,\n devices::Union{Array{D<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:Component}},\n formulation\n)\n\n\nDefault implementation of adding auxiliary variable to the model.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{U}, Tuple{T}, Tuple{D}, Tuple{PowerSimulations.OptimizationContainer, T, U, Any}} where {D<:Component, T<:InfrastructureSystems.Optimization.VariableType, U<:Union{InfrastructureSystems.FlattenIteratorWrapper{D}, Vector{D}}}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n variable_type::InfrastructureSystems.Optimization.VariableType,\n devices::Union{Array{D<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:Component}},\n formulation\n)\n\n\nAdds a variable to the optimization model and to the affine expressions contained in the optimization_container model according to the specified sign. Based on the inputs, the variable can be specified as binary.\n\nBounds\n\nlb_value_function <= varstart[name, t] <= ub_value_function\n\nIf binary = true:\n\nvarstart[name, t] in {0,1}\n\nLaTeX\n\nlb ge x^device_t le ub forall t\n\nx^device_t in 01 forall t iff textbinary = true\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\ndevices : Vector or Iterator with the devices\nvar_key::VariableKey : Base Name for the variable\nbinary::Bool : Select if the variable is binary\nexpressionname::Symbol : Expressionname name stored in container.expressions to add the variable\nsign::Float64 : sign of the addition of the variable to the expression_name. Default Value is 1.0\n\nAccepted Keyword Arguments\n\nubvalue : Provides the function over device to obtain the value for a upperbound\nlbvalue : Provides the function over device to obtain the value for a lowerbound. If the variable is meant to be positive define lb = x -> 0.0\ninitial_value : Provides the function over device to obtain the warm start value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variable!-Union{Tuple{U}, Tuple{T}, Tuple{D}, Tuple{PowerSimulations.OptimizationContainer, T, U, PowerSimulations.AbstractThermalFormulation}} where {D<:ThermalGen, T<:Union{OnVariable, StartVariable, StopVariable}, U<:Union{InfrastructureSystems.FlattenIteratorWrapper{D}, Vector{D}}}","page":"Internals","title":"PowerSimulations.add_variable!","text":"add_variable!(\n container::PowerSimulations.OptimizationContainer,\n variable_type::Union{OnVariable, StartVariable, StopVariable},\n devices::Union{Array{D<:ThermalGen, 1}, InfrastructureSystems.FlattenIteratorWrapper{D<:ThermalGen}},\n formulation::PowerSimulations.AbstractThermalFormulation\n)\n\n\nAdds a variable to the optimization model for the OnVariable of Thermal Units\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variables!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Union{InfrastructureSystems.FlattenIteratorWrapper{U}, Vector{U}}, Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}}} where {T<:InfrastructureSystems.Optimization.AuxVariableType, U<:Component}","page":"Internals","title":"PowerSimulations.add_variables!","text":"add_variables!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.AuxVariableType},\n devices::Union{Array{U<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{U<:Component}},\n formulation::Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}\n)\n\n\nAdd variables to the OptimizationContainer for any component.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variables!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, Union{InfrastructureSystems.FlattenIteratorWrapper{U}, Vector{U}}, Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:Component}","page":"Internals","title":"PowerSimulations.add_variables!","text":"add_variables!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.VariableType},\n devices::Union{Array{U<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{U<:Component}},\n formulation::Union{PowerSimulations.AbstractDeviceFormulation, PowerSimulations.AbstractServiceFormulation}\n)\n\n\nAdd variables to the OptimizationContainer for any component.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.add_variables!-Union{Tuple{V}, Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Type{T}, U, Union{InfrastructureSystems.FlattenIteratorWrapper{V}, Vector{V}}, PowerSimulations.AbstractReservesFormulation}} where {T<:InfrastructureSystems.Optimization.VariableType, U<:AbstractReserve, V<:Component}","page":"Internals","title":"PowerSimulations.add_variables!","text":"add_variables!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{T<:InfrastructureSystems.Optimization.VariableType},\n service::AbstractReserve,\n contributing_devices::Union{Array{V<:Component, 1}, InfrastructureSystems.FlattenIteratorWrapper{V<:Component}},\n formulation::PowerSimulations.AbstractReservesFormulation\n)\n\n\nAdd variables to the OptimizationContainer for a service.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.build_model!-Tuple{DecisionModel{<:PowerSimulations.DefaultDecisionProblem}}","page":"Internals","title":"PowerSimulations.build_model!","text":"build_model!(\n model::DecisionModel{<:PowerSimulations.DefaultDecisionProblem}\n)\n\n\nDefault implementation of build method for Operational Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.build_model!-Tuple{EmulationModel}","page":"Internals","title":"PowerSimulations.build_model!","text":"build_model!(model::EmulationModel)\n\n\nDefault implementation of build method for Emulation Problems for models conforming with DecisionProblem specification. Overload this function to implement a custom build method\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.check_activeservice_variables-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{T}}} where T<:Service","page":"Internals","title":"PowerSimulations.check_activeservice_variables","text":"check_activeservice_variables(\n container::PowerSimulations.OptimizationContainer,\n contributing_services::Array{T<:Service, 1}\n)\n\n\nThis function checks if the variables for reserves were created\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.check_file_integrity-Tuple{String}","page":"Internals","title":"PowerSimulations.check_file_integrity","text":"check_file_integrity(path::String)\n\n\ncheck_file_integrity(path::String)\n\nChecks the hash value for each file made with the file is written with the new hash_value to verify the file hasn't been tampered with since written\n\nArguments\n\npath::String: this is the folder path that contains the results and the check.sha256 file\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{D}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, D}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where {T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment}","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the arguments model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{D}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, D}, NetworkModel}} where {T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment}","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, D<:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the arguments for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, <:PowerSimulations.AbstractStandardUnitCommitment}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, <:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, <:PowerSimulations.AbstractStandardUnitCommitment}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, <:PowerSimulations.AbstractStandardUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalBasicUnitCommitment}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalBasicUnitCommitment},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel{<:PowerModels.AbstractActivePowerModel}}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel{<:PowerModels.AbstractActivePowerModel}\n)\n\n\nThis function creates the constraints for the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_device!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ModelConstructStage, DeviceModel{T, ThermalStandardDispatch}, NetworkModel}} where T<:ThermalGen","page":"Internals","title":"PowerSimulations.construct_device!","text":"construct_device!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ModelConstructStage,\n model::DeviceModel{T<:ThermalGen, ThermalStandardDispatch},\n network_model::NetworkModel\n)\n\n\nThis function creates the model for a full thermal dispatch formulation depending on combination of devices, deviceformulation and systemformulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.construct_service!-Union{Tuple{SR}, Tuple{PowerSimulations.OptimizationContainer, System, InfrastructureSystems.Optimization.ArgumentConstructStage, ServiceModel{SR, GroupReserve}, Dict{Symbol, DeviceModel}, Set{<:DataType}, NetworkModel}} where SR<:ConstantReserveGroup","page":"Internals","title":"PowerSimulations.construct_service!","text":"construct_service!(\n container::PowerSimulations.OptimizationContainer,\n sys::System,\n _::InfrastructureSystems.Optimization.ArgumentConstructStage,\n model::ServiceModel{SR<:ConstantReserveGroup, GroupReserve},\n _::Dict{Symbol, DeviceModel},\n _::Set{<:DataType},\n _::NetworkModel\n)\n\n\nConstructs a service for ConstantReserveGroup.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.container_spec-Tuple{Type{Float64}, Vararg{Any}}","page":"Internals","title":"PowerSimulations.container_spec","text":"container_spec(\n _::Type{Float64},\n axs...\n) -> JuMP.Containers.DenseAxisArray\n\n\nReturns the correct container specification for the selected type of JuMP Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.container_spec-Union{Tuple{T}, Tuple{Type{T}, Vararg{Any}}} where T","page":"Internals","title":"PowerSimulations.container_spec","text":"container_spec(\n _::Type{T},\n axs...\n) -> JuMP.Containers.DenseAxisArray\n\n\nReturns the correct container specification for the selected type of JuMP Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_compact_retrospective!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_compact_retrospective!","text":"device_duration_compact_retrospective!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints adds over the start times looking backwards.\n\nLaTeX\n\nMinimum up-time constraint:\n\nsum_i=t-min(d_min^up T)+ 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nsum_i=t-min(d_min^down T) + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_look_ahead!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_look_ahead!","text":"device_duration_look_ahead!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type_up::InfrastructureSystems.Optimization.ConstraintType,\n cons_type_down::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints looks ahead in the time frame of the model.\n\nLaTeX\n\nMinimum up-time constraint:\n\nIf t leq d_min^up\n\nd_min^downx_t^stop - sum_i=t-d_min^up + 1^t x_i^on - x_init^up leq 0\n\nfor i in the set of time steps. Otherwise:\n\nd_min^downx_t^stop - sum_i=t-d_min^up + 1^t x_i^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nIf t leq d_min^down\n\nd_min^upx_t^start - sum_i=t-d_min^down + 1^t (1 - x_i^on) - x_init^down leq 0\n\nfor i in the set of time steps. Otherwise:\n\nd_min^upx_t^start - sum_i=t-d_min^down + 1^t (1 - x_i^on) leq 0\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_parameters!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_parameters!","text":"device_duration_parameters!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints considers parameters.\n\nLaTeX\n\nMinimum up-time constraint:\n\nIf t leq d_min^up\n\nd_min^downx_t^stop - sum_i=t-d_min^up + 1^t x_i^on - x_init^up leq 0\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^up + 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nIf t leq d_min^down\n\nd_min^upx_t^start - sum_i=t-d_min^down + 1^t (1 - x_i^on) - x_init^down leq 0\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^down + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitialdurationon::Vector{InitialCondition} : gives initial number of time steps variable is up\ninitialdurationoff::Vector{InitialCondition} : gives initial number of time steps variable is down\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.device_duration_retrospective!-Union{Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, Vector{@NamedTuple{up::Float64, down::Float64}}, Matrix{InitialCondition}, InfrastructureSystems.Optimization.ConstraintType, Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType}, Type{T}}} where T<:Component","page":"Internals","title":"PowerSimulations.device_duration_retrospective!","text":"device_duration_retrospective!(\n container::PowerSimulations.OptimizationContainer,\n duration_data::Vector{@NamedTuple{up::Float64, down::Float64}},\n initial_duration::Matrix{InitialCondition},\n cons_type::InfrastructureSystems.Optimization.ConstraintType,\n var_types::Tuple{InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType, InfrastructureSystems.Optimization.VariableType},\n _::Type{T<:Component}\n)\n\n\nThis formulation of the duration constraints adds over the start times looking backwards.\n\nLaTeX\n\nMinimum up-time constraint:\n\nIf t leq d_min^up - d_init^up and d_init^up 0\n\n1 + sum_i=t-d_min^up + 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^up + 1^t x_i^start - x_t^on leq 0\n\nfor i in the set of time steps.\n\nMinimum down-time constraint:\n\nIf t leq d_min^down - d_init^down and d_init^down 0\n\n1 + sum_i=t-d_min^down + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps. Otherwise:\n\nsum_i=t-d_min^down + 1^t x_i^stop + x_t^on leq 1\n\nfor i in the set of time steps.\n\nArguments\n\ncontainer::OptimizationContainer : the optimization_container model built in PowerSimulations\nduration_data::Vector{UpDown} : gives how many time steps variable needs to be up or down\ninitial_duration::Matrix{InitialCondition} : gives initial conditions for up (column 1) and down (column 2)\ncons_name::Symbol : name of the constraint\nvar_keys::Tuple{VariableKey, VariableKey, VariableKey}) : names of the variables\n: var_keys[1] : varon\n: var_keys[2] : varstart\n: var_keys[3] : varstop\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.find_key_with_value-Tuple{Any, Any}","page":"Internals","title":"PowerSimulations.find_key_with_value","text":"find_key_with_value(d, value) -> Any\n\n\nReturn the key for the given value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.find_timestamp_index-Tuple{Union{StepRange{Dates.DateTime, Dates.Millisecond}, Vector{Dates.DateTime}}, Dates.DateTime}","page":"Internals","title":"PowerSimulations.find_timestamp_index","text":"find_timestamp_index(\n dates::Union{StepRange{Dates.DateTime, Dates.Millisecond}, Vector{Dates.DateTime}},\n date::Dates.DateTime\n) -> Int64\n\n\ncalculates the index in the time series corresponding to the data. Assumes that the dates vector is sorted.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.generate_formulation_combinations","page":"Internals","title":"PowerSimulations.generate_formulation_combinations","text":"generate_formulation_combinations(\n\n) -> Dict{String, Vector{Any}}\ngenerate_formulation_combinations(\n sys\n) -> Dict{String, Vector{Any}}\n\n\nGenerate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types.\n\nArguments\n\nsys::Union{Nothing, System}: If set, only include component types present in the system.\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_absolute_step_range-Tuple{SimulationPartitions, Int64}","page":"Internals","title":"PowerSimulations.get_absolute_step_range","text":"get_absolute_step_range(\n partitions::SimulationPartitions,\n index::Int64\n) -> UnitRange{Int64}\n\n\nReturn a UnitRange for the steps in the partition with the given index. Includes overlap.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_dirty_data_to_flush!-Tuple{PowerSimulations.OptimizationOutputCache}","page":"Internals","title":"PowerSimulations.get_dirty_data_to_flush!","text":"get_dirty_data_to_flush!(\n cache::PowerSimulations.OptimizationOutputCache\n) -> Tuple{Vector{Dates.DateTime}, Any}\n\n\nReturn all dirty data from the cache. Mark the timestamps as clean.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_enum_value-Tuple{Any, String}","page":"Internals","title":"PowerSimulations.get_enum_value","text":"get_enum_value(enum, value::String) -> Any\n\n\nGet the enum value for the string. Case insensitive.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_last_updated_timestamp-Tuple{PowerSimulations.DatasetContainer, InfrastructureSystems.Optimization.OptimizationContainerKey}","page":"Internals","title":"PowerSimulations.get_last_updated_timestamp","text":"get_last_updated_timestamp(\n container::PowerSimulations.DatasetContainer,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey\n) -> Dates.DateTime\n\n\nReturn the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_last_updated_timestamp-Tuple{PowerSimulations.HDF5Dataset}","page":"Internals","title":"PowerSimulations.get_last_updated_timestamp","text":"get_last_updated_timestamp(\n s::PowerSimulations.HDF5Dataset\n) -> Dates.DateTime\n\n\nReturn the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_last_updated_timestamp-Tuple{PowerSimulations.InMemoryDataset}","page":"Internals","title":"PowerSimulations.get_last_updated_timestamp","text":"get_last_updated_timestamp(\n s::PowerSimulations.InMemoryDataset\n) -> Dates.DateTime\n\n\nReturn the timestamp from most recent data row updated in the dataset. This value may not be the same as the result from get_update_timestamp\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{ACBranch, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::ACBranch,\n _::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}\n\n\nMin and max limits for Abstract Branch Formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractCompactUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractCompactUnitCommitment}\n) -> Any\n\n\nMin and Max active power limits for Compact Unit Commitment\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalDispatchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalDispatchFormulation}\n) -> Any\n\n\nMin and max active power limits of generators for thermal dispatch formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalUnitCommitment}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits of generators for thermal unit commitment formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalCompactDispatch}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalCompactDispatch}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits of generators for thermal dispatch compact formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalDispatchNoMin}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalDispatchNoMin}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits of generators for thermal dispatch no minimum formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalMultiStartUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalMultiStartUnitCommitment}\n) -> NamedTuple{(:min, :max), <:Tuple{Float64, Any}}\n\n\nMin and max active power limits for multi-start unit commitment formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ReactivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalDispatchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ReactivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalDispatchFormulation}\n) -> Any\n\n\nReactive power limits of generators for all dispatch formulations\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{Any, Type{ReactivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractThermalUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device,\n _::Type{ReactivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractThermalUnitCommitment}\n) -> Any\n\n\nReactive power limits of generators when there CommitmentVariables\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{MonitoredLine, Type{<:InfrastructureSystems.Optimization.ConstraintType}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::MonitoredLine,\n _::Type{<:InfrastructureSystems.Optimization.ConstraintType},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}\n\n\nMin and max limits for monitored line\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{MonitoredLine, Type{FlowLimitFromToConstraint}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::MonitoredLine,\n _::Type{FlowLimitFromToConstraint},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}\n\n\nMin and max limits for flow limit from-to constraint\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{MonitoredLine, Type{FlowLimitToFromConstraint}, Type{<:PowerSimulations.AbstractBranchFormulation}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n device::MonitoredLine,\n _::Type{FlowLimitToFromConstraint},\n _::Type{<:PowerSimulations.AbstractBranchFormulation}\n) -> NamedTuple{(:min, :max), <:Tuple{Any, Any}}\n\n\nMin and max limits for flow limit to-from constraint\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_min_max_limits-Tuple{PhaseShiftingTransformer, Type{PhaseAngleControlLimit}, Type{PhaseAngleControl}}","page":"Internals","title":"PowerSimulations.get_min_max_limits","text":"get_min_max_limits(\n _::PhaseShiftingTransformer,\n _::Type{PhaseAngleControlLimit},\n _::Type{PhaseAngleControl}\n) -> @NamedTuple{min::Float64, max::Float64}\n\n\nMin and max limits for Abstract Branch Formulation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_piecewise_incrementalcurve_per_system_unit-Tuple{PiecewiseStepData, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_piecewise_incrementalcurve_per_system_unit","text":"get_piecewise_incrementalcurve_per_system_unit(\n cost_component::PiecewiseStepData,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> PiecewiseStepData\n\n\nObtain the normalized PiecewiseStep cost data in system base per unit depending on the specified power units.\n\nNote that the costs (y-axis) are in /MWh, /(sys pu h) or /(device pu h), so they also require transformation.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_piecewise_pointcurve_per_system_unit-Tuple{PiecewiseLinearData, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_piecewise_pointcurve_per_system_unit","text":"get_piecewise_pointcurve_per_system_unit(\n cost_component::PiecewiseLinearData,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> PiecewiseLinearData\n\n\nObtain the normalized PiecewiseLinear cost data in system base per unit depending on the specified power units.\n\nNote that the costs (y-axis) are always in /h so they do not require transformation\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_proportional_cost_per_system_unit-Tuple{Float64, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_proportional_cost_per_system_unit","text":"get_proportional_cost_per_system_unit(\n cost_term::Float64,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> Float64\n\n\nObtain proportional (marginal or slope) cost data in system base per unit depending on the specified power units\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_quadratic_cost_per_system_unit-Tuple{Float64, UnitSystem, Float64, Float64}","page":"Internals","title":"PowerSimulations.get_quadratic_cost_per_system_unit","text":"get_quadratic_cost_per_system_unit(\n cost_term::Float64,\n unit_system::UnitSystem,\n system_base_power::Float64,\n device_base_power::Float64\n) -> Float64\n\n\nObtain quadratic cost data in system base per unit depending on the specified power units\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_startup_shutdown_limits-Tuple{Any, Type{ActivePowerVariableLimitsConstraint}, Type{<:PowerSimulations.AbstractCompactUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_startup_shutdown_limits","text":"get_startup_shutdown_limits(\n device,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{<:PowerSimulations.AbstractCompactUnitCommitment}\n) -> NamedTuple{(:startup, :shutdown), <:Tuple{Any, Any}}\n\n\nStartup shutdown limits for Compact Unit Commitment\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_startup_shutdown_limits-Tuple{ThermalMultiStart, Type{ActivePowerVariableLimitsConstraint}, Type{ThermalMultiStartUnitCommitment}}","page":"Internals","title":"PowerSimulations.get_startup_shutdown_limits","text":"get_startup_shutdown_limits(\n device::ThermalMultiStart,\n _::Type{ActivePowerVariableLimitsConstraint},\n _::Type{ThermalMultiStartUnitCommitment}\n) -> NamedTuple{(:startup, :shutdown), <:Tuple{Any, Any}}\n\n\nStartup and shutdown active power limits for Compact Unit Commitment\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_update_timestamp-Tuple{PowerSimulations.AbstractDataset}","page":"Internals","title":"PowerSimulations.get_update_timestamp","text":"get_update_timestamp(\n s::PowerSimulations.AbstractDataset\n) -> Any\n\n\nReturn the timestamp from the data used in the last update\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_update_timestamp-Tuple{PowerSimulations.DatasetContainer, InfrastructureSystems.Optimization.OptimizationContainerKey}","page":"Internals","title":"PowerSimulations.get_update_timestamp","text":"get_update_timestamp(\n container::PowerSimulations.DatasetContainer,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey\n) -> Any\n\n\nReturn the timestamp from the data used in the last update\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_valid_step_length-Tuple{SimulationPartitions, Int64}","page":"Internals","title":"PowerSimulations.get_valid_step_length","text":"get_valid_step_length(\n partitions::SimulationPartitions,\n index::Int64\n) -> Int64\n\n\nReturn the length of valid data at the given index.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.get_valid_step_offset-Tuple{SimulationPartitions, Int64}","page":"Internals","title":"PowerSimulations.get_valid_step_offset","text":"get_valid_step_offset(\n partitions::SimulationPartitions,\n index::Int64\n) -> Int64\n\n\nReturn the step offset for valid data at the given index.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.has_dirty-Tuple{PowerSimulations.OptimizationOutputCaches}","page":"Internals","title":"PowerSimulations.has_dirty","text":"has_dirty(\n cache::PowerSimulations.OptimizationOutputCaches\n) -> Bool\n\n\nReturn true if the cache has data that has not been flushed to storage.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.is_cached-Tuple{PowerSimulations.OptimizationOutputCaches, Any, Any, Any}","page":"Internals","title":"PowerSimulations.is_cached","text":"is_cached(\n cache::PowerSimulations.OptimizationOutputCaches,\n model_name,\n key,\n index\n) -> Bool\n\n\nReturn true if the data for timestamp is stored in cache.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.join_simulation-Tuple{AbstractString}","page":"Internals","title":"PowerSimulations.join_simulation","text":"join_simulation(path::AbstractString)\n\n\nCombine all partition simulation files.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.list_decision_model_keys-Tuple{PowerSimulations.HdfSimulationStore, Symbol, Symbol}","page":"Internals","title":"PowerSimulations.list_decision_model_keys","text":"list_decision_model_keys(\n store::PowerSimulations.HdfSimulationStore,\n model::Symbol,\n container_type::Symbol\n) -> Vector\n\n\nReturn the fields stored for the problem and container_type (duals/parameters/variables).\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.list_decision_models-Tuple{PowerSimulations.HdfSimulationStore}","page":"Internals","title":"PowerSimulations.list_decision_models","text":"list_decision_models(\n store::PowerSimulations.HdfSimulationStore\n) -> Base.KeySet{Symbol, OrderedDict{Symbol, PowerSimulations.DatasetContainer{PowerSimulations.HDF5Dataset}}}\n\n\nReturn the problem names in order of execution.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.log_cache_hit_percentages-Tuple{PowerSimulations.OptimizationOutputCaches}","page":"Internals","title":"PowerSimulations.log_cache_hit_percentages","text":"log_cache_hit_percentages(\n cache::PowerSimulations.OptimizationOutputCaches\n)\n\n\nLog the cache hit percentages for all caches.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.onvar_cost-Tuple{ThermalGenerationCost, OnVariable, ThermalGen, PowerSimulations.AbstractThermalFormulation}","page":"Internals","title":"PowerSimulations.onvar_cost","text":"onvar_cost(\n cost::ThermalGenerationCost,\n S::OnVariable,\n d::ThermalGen,\n U::PowerSimulations.AbstractThermalFormulation\n) -> Any\n\n\nTheoretical Cost at power output zero. Mathematically is the intercept with the y-axis\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.open_store","page":"Internals","title":"PowerSimulations.open_store","text":"open_store(\n ::Type{PowerSimulations.HdfSimulationStore},\n directory::AbstractString;\n ...\n) -> PowerSimulations.HdfSimulationStore\nopen_store(\n ::Type{PowerSimulations.HdfSimulationStore},\n directory::AbstractString,\n mode;\n filename\n) -> PowerSimulations.HdfSimulationStore\n\n\nConstruct and open an HdfSimulationStore.\n\nWhen reading or writing results in a program you should use the method that accepts a function in order to guarantee that the file handle gets closed.\n\nArguments\n\ndirectory::AbstractString: Directory containing the store file\nmode::AbstractString: Mode to use to open the store file\nfilename::AbstractString: Base name of the store file\n\nExamples\n\n# Assumes a simulation has been executed in the './rts' directory with these parameters.\npath = \"./rts\"\nproblem = :ED\nvar_name = :P__ThermalStandard\ntimestamp = DateTime(\"2020-01-01T05:00:00\")\nstore = open_store(HdfSimulationStore, path)\ndf = PowerSimulations.read_result(DataFrame, store, model, :variables, var_name, timestamp)\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_dataframe-Tuple{AbstractString}","page":"Internals","title":"PowerSimulations.read_dataframe","text":"read_dataframe(\n filename::AbstractString\n) -> DataFrames.DataFrame\n\n\nReturn a DataFrame from a CSV file.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_json-Tuple{AbstractString}","page":"Internals","title":"PowerSimulations.read_json","text":"read_json(\n filename::AbstractString\n) -> Union{Nothing, Bool, Float64, Int64, String, JSON3.Array, JSON3.Object}\n\n\nReturn a decoded JSON file.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_result-Tuple{PowerSimulations.OptimizationOutputCaches, Any, Any, Any}","page":"Internals","title":"PowerSimulations.read_result","text":"read_result(\n cache::PowerSimulations.OptimizationOutputCaches,\n model_name,\n key,\n timestamp\n) -> Array\n\n\nRead the result from cache. Callers must first call is_cached to check if the timestamp is present.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.read_result-Tuple{Type{DataFrames.DataFrame}, PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Union{Int64, Dates.DateTime}}","page":"Internals","title":"PowerSimulations.read_result","text":"read_result(\n _::Type{DataFrames.DataFrame},\n store::PowerSimulations.HdfSimulationStore,\n model_name::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Union{Int64, Dates.DateTime}\n) -> DataFrames.DataFrame\n\n\nReturn DataFrame, DenseAxisArray, or Array for a model result at a timestamp.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.serialize_formulation_combinations","page":"Internals","title":"PowerSimulations.serialize_formulation_combinations","text":"serialize_formulation_combinations(\n\n) -> Dict{String, Vector{Any}}\nserialize_formulation_combinations(\n sys\n) -> Dict{String, Vector{Any}}\n\n\nGenerate valid combinations of devicetype/formulation and servicetype/formulation. Return vectors of dictionaries with Julia types encoded as strings.\n\nArguments\n\nsys::Union{Nothing, System}: If set, only include component types present in the system.\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.serialize_jump_optimization_model-Tuple{JuMP.Model, String}","page":"Internals","title":"PowerSimulations.serialize_jump_optimization_model","text":"serialize_jump_optimization_model(\n jump_model::JuMP.Model,\n save_path::String\n)\n\n\nExports the JuMP object in MathOptFormat\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.serialize_simulation-Tuple{Simulation}","page":"Internals","title":"PowerSimulations.serialize_simulation","text":"serialize_simulation(sim::Simulation; path, force) -> String\n\n\nserialize_simulation(sim::Simulation, path = \".\")\n\nSerialize the simulation to a directory in path.\n\nReturn the serialized simulation directory name that is created.\n\nArguments\n\nsim::Simulation: simulation to serialize\npath = \".\": path in which to create the serialzed directory\nforce = false: If true, delete the directory if it already exists. Otherwise, it will throw an exception.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.set_expression!-Union{Tuple{T}, Tuple{S}, Tuple{PowerSimulations.OptimizationContainer, Type{S}, JuMP.AbstractJuMPScalar, T, Int64}} where {S<:CostExpressions, T<:Component}","page":"Internals","title":"PowerSimulations.set_expression!","text":"set_expression!(\n container::PowerSimulations.OptimizationContainer,\n _::Type{S<:CostExpressions},\n cost_expression::JuMP.AbstractJuMPScalar,\n component::Component,\n time_period::Int64\n)\n\n\nReplaces an expression value in the expression container if the key exists\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.set_ic_quantity!-Union{Tuple{T}, Tuple{InitialCondition{T, Float64}, Float64}} where T<:InfrastructureSystems.Optimization.InitialConditionType","page":"Internals","title":"PowerSimulations.set_ic_quantity!","text":"set_ic_quantity!(\n ic::InitialCondition{T<:InfrastructureSystems.Optimization.InitialConditionType, Float64},\n var_value::Float64\n)\n\n\nDefault implementation of setinitialcondition_value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.set_ic_quantity!-Union{Tuple{T}, Tuple{InitialCondition{T, JuMP.VariableRef}, Float64}} where T<:InfrastructureSystems.Optimization.InitialConditionType","page":"Internals","title":"PowerSimulations.set_ic_quantity!","text":"set_ic_quantity!(\n ic::InitialCondition{T<:InfrastructureSystems.Optimization.InitialConditionType, JuMP.VariableRef},\n var_value::Float64\n)\n\n\nDefault implementation of setinitialcondition_value\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.solve_impl!-Tuple{PowerSimulations.OptimizationContainer, System}","page":"Internals","title":"PowerSimulations.solve_impl!","text":"solve_impl!(\n container::PowerSimulations.OptimizationContainer,\n system::System\n) -> Any\n\n\nDefault solve method for OptimizationContainer\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.sparse_container_spec-Union{Tuple{T}, Tuple{Type{T}, Vararg{Any}}} where T<:JuMP.AbstractJuMPScalar","page":"Internals","title":"PowerSimulations.sparse_container_spec","text":"sparse_container_spec(\n _::Type{T<:JuMP.AbstractJuMPScalar},\n axs...\n) -> JuMP.Containers.SparseAxisArray\n\n\nReturns the correct container specification for the selected type of JuMP Model\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.to_dataframe-Union{Tuple{T}, Tuple{JuMP.Containers.DenseAxisArray{T, 2, Ax, L} where {Ax, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}}, InfrastructureSystems.Optimization.OptimizationContainerKey}} where T<:Number","page":"Internals","title":"PowerSimulations.to_dataframe","text":"to_dataframe(\n array::JuMP.Containers.DenseAxisArray{T<:Number, 2, Ax, L} where {Ax, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}},\n key::InfrastructureSystems.Optimization.OptimizationContainerKey\n) -> DataFrames.DataFrame\n\n\nCreates a DataFrame from a JuMP DenseAxisArray or SparseAxisArray.\n\nArguments\n\narray: JuMP DenseAxisArray or SparseAxisArray to convert\nkey::OptimizationContainerKey:\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_container_parameter_values!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OptimizationContainer, PowerSimulations.OperationModel, InfrastructureSystems.Optimization.ParameterKey{T, U}, PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}}} where {T<:InfrastructureSystems.Optimization.ParameterType, U<:Component}","page":"Internals","title":"PowerSimulations.update_container_parameter_values!","text":"update_container_parameter_values!(\n optimization_container::PowerSimulations.OptimizationContainer,\n model::PowerSimulations.OperationModel,\n key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},\n input::PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}\n)\n\n\nUpdate parameter function an OperationModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_model!-Tuple{PowerSimulations.OperationModel, Simulation}","page":"Internals","title":"PowerSimulations.update_model!","text":"update_model!(\n model::PowerSimulations.OperationModel,\n sim::Simulation\n)\n\n\nDefault problem update function for most problems with no customization\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_parameter_values!-Union{Tuple{U}, Tuple{T}, Tuple{EmulationModel, InfrastructureSystems.Optimization.ParameterKey{T, U}, PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}}} where {T<:InfrastructureSystems.Optimization.ParameterType, U<:Component}","page":"Internals","title":"PowerSimulations.update_parameter_values!","text":"update_parameter_values!(\n model::EmulationModel,\n key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},\n input::PowerSimulations.DatasetContainer{PowerSimulations.InMemoryDataset}\n)\n\n\nUpdate parameter function an OperationModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.update_parameter_values!-Union{Tuple{U}, Tuple{T}, Tuple{PowerSimulations.OperationModel, InfrastructureSystems.Optimization.ParameterKey{T, U}, PowerSimulations.SimulationState}} where {T<:InfrastructureSystems.Optimization.ParameterType, U<:Component}","page":"Internals","title":"PowerSimulations.update_parameter_values!","text":"update_parameter_values!(\n model::PowerSimulations.OperationModel,\n key::InfrastructureSystems.Optimization.ParameterKey{T<:InfrastructureSystems.Optimization.ParameterType, U<:Component},\n simulation_state::PowerSimulations.SimulationState\n)\n\n\nUpdate parameter function an OperationModel\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.variable_reactive_net_injection-Tuple{PowerModels.AbstractActivePowerModel}","page":"Internals","title":"PowerSimulations.variable_reactive_net_injection","text":"variable_reactive_net_injection(\n pm::PowerModels.AbstractActivePowerModel;\n kwargs...\n)\n\n\nactive power only models ignore reactive power variables\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_formulation_combinations","page":"Internals","title":"PowerSimulations.write_formulation_combinations","text":"write_formulation_combinations(filename::AbstractString)\nwrite_formulation_combinations(\n filename::AbstractString,\n sys\n)\n\n\nGenerate valid combinations of devicetype/formulation and servicetype/formulation and write the result to a JSON file.\n\nArguments\n\nsys::Union{Nothing, System}: If set, only include component types present in the system.\n\n\n\n\n\n","category":"function"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_result!-Tuple{PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Dates.DateTime, Dates.DateTime, JuMP.Containers.DenseAxisArray{Float64, 3, var\"#s547\", L} where {var\"#s547\"<:Tuple{Any, Any, Any}, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}}}","page":"Internals","title":"PowerSimulations.write_result!","text":"write_result!(\n store::PowerSimulations.HdfSimulationStore,\n model_name::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Dates.DateTime,\n _::Dates.DateTime,\n data::JuMP.Containers.DenseAxisArray{Float64, 3, var\"#s547\", L} where {var\"#s547\"<:Tuple{Any, Any, Any}, L<:Tuple{JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup, JuMP.Containers._AxisLookup}}\n)\n\n\nWrite a decision model result for a timestamp to the store.\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_result!-Tuple{PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Int64, Dates.DateTime, JuMP.Containers.DenseAxisArray}","page":"Internals","title":"PowerSimulations.write_result!","text":"write_result!(\n store::PowerSimulations.HdfSimulationStore,\n _::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Int64,\n simulation_time::Dates.DateTime,\n data::JuMP.Containers.DenseAxisArray\n)\n\n\nWrite an emulation model result for an execution index value and the timestamp of the update\n\n\n\n\n\n","category":"method"},{"location":"code_base_developer_guide/internal/#PowerSimulations.write_result!-Union{Tuple{N}, Tuple{PowerSimulations.HdfSimulationStore, Symbol, InfrastructureSystems.Optimization.OptimizationContainerKey, Dates.DateTime, Dates.DateTime, JuMP.Containers.DenseAxisArray{Float64, N, var\"#s547\", L} where {var\"#s547\"<:NTuple{N, Any}, L<:NTuple{N, JuMP.Containers._AxisLookup}}}} where N","page":"Internals","title":"PowerSimulations.write_result!","text":"write_result!(\n store::PowerSimulations.HdfSimulationStore,\n model_name::Symbol,\n key::InfrastructureSystems.Optimization.OptimizationContainerKey,\n index::Dates.DateTime,\n _::Dates.DateTime,\n data::JuMP.Containers.DenseAxisArray{Float64, N, var\"#s547\", L} where {var\"#s547\"<:NTuple{N, Any}, L<:NTuple{N, JuMP.Containers._AxisLookup}}\n)\n\n\nWrite a decision model result for a timestamp to the store.\n\n\n\n\n\n","category":"method"},{"location":"formulation_library/Introduction/#formulation_intro","page":"Introduction","title":"Formulations Introduction","text":"","category":"section"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"PowerSimulations.jl enables modularity in its formulations by assigning a DeviceModel to each PowerSystems.jl component type existing in a defined system.","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"PowerSimulations.jl has a multiple AbstractDeviceFormulation subtypes that can be applied to different PowerSystems.jl device types, each dispatching to different methods for populating the optimization problem variables, objective function, expressions and constraints.","category":"page"},{"location":"formulation_library/Introduction/#Example-Formulation","page":"Introduction","title":"Example Formulation","text":"","category":"section"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"For example a typical optimization problem in a DecisionModel in PowerSimulations.jl with three DeviceModel has the abstract form of:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"beginalign*\n min_boldsymbolx textObjective_DeviceModelA + textObjective_DeviceModelB + textObjective_DeviceModelC \n textst \n hspace09cm textConstraints_NetworkModel \n hspace09cm textConstraints_DeviceModelA \n hspace09cm textConstraints_DeviceModelB \n hspace09cm textConstraints_DeviceModelC \nendalign*","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Suppose this is a system with the following characteristics:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Horizon: 48 hours\nInterval: 24 hours\nResolution: 1 hour\nThree Buses: 1, 2 and 3\nOne ThermalStandard (device A) unit at bus 1\nOne RenewableDispatch (device B) unit at bus 2\nOne PowerLoad (device C) at bus 3\nThree Line that connects all the buses","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Now, we assign the following DeviceModel to each PowerSystems.jl with:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Type Formulation\nNetwork CopperPlatePowerModel\nThermalStandard ThermalDispatchNoMin\nRenewableDispatch RenewableFullDispatch\nPowerLoad StaticPowerLoad","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Note that we did not assign any DeviceModel to Line since the CopperPlatePowerModel used for the network assumes that everything is lumped in the same node (like a copper plate with infinite capacity), and hence there are no flows between buses that branches can limit.","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Each DeviceModel formulation is described in specific in their respective page, but the overall optimization problem will end-up as:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"beginalign*\n min_boldsymbolp^textth boldsymbolp^textre sum_t=1^48 C^textth p_t^textth - C^textre p_t^textre \n textst \n hspace09cm p_t^textth + p_t^textre = P_t^textload quad forall t in 1dots 48 \n hspace09cm 0 le p_t^textth le P^textthmax \n hspace09cm 0 le p_t^textre le textActivePowerTimeSeriesParameter_t \nendalign*","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Note that the StaticPowerLoad does not impose any cost to the objective function or constraint but adds its power demand to the supply-balance demand of the CopperPlatePowerModel used. Since we are using the ThermalDispatchNoMin formulation for the thermal generation, the lower bound for the power is 0, instead of P^textthmin. In addition, we are assuming a linear cost C^textth. Finally, the RenewableFullDispatch formulation allows the dispatch of the renewable unit between 0 and its maximum injection time series p_t^textreparam.","category":"page"},{"location":"formulation_library/Introduction/#Nomenclature","page":"Introduction","title":"Nomenclature","text":"","category":"section"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"In the formulations described in the other pages, the nomenclature is as follows:","category":"page"},{"location":"formulation_library/Introduction/","page":"Introduction","title":"Introduction","text":"Lowercase letters are used for variables, e.g., p for power.\nUppercase letters are used for parameters, e.g., C for costs.\nSubscripts are used for indexing, e.g., (cdot)_t for indexing at time t.\nSuperscripts are used for descriptions, e.g., (cdot)^textth to describe a thermal (th) variable/parameter.\nBold letters are used for vectors, e.g., boldsymbolp = p_1dots24.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Debugging-infeasible-models","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Getting infeasible solutions to models is a common occurrence in operations simulations, there are multiple reasons why this can happen. PowerSimulations.jl has several tools to help debug this situation.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Adding-slacks-to-the-model","page":"Debugging infeasible models","title":"Adding slacks to the model","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"One of the most common infeasibility issues observed is due to not enough generation to supply demand, or conversely, excessive fixed (non-curtailable) generation in a low demand scenario.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"The recommended solution for any of these cases is adding slack variables to the network model, for example:","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"template_uc = ProblemTemplate(\n NetworkModel(\n CopperPlatePowerModel;\n use_slacks = true,\n ),\n)","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"will add slack variables to the ActivePowerBalance expression.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"In this case, if the problem is now feasible, the user can check the solution of the variables SystemBalanceSlackUp and SystemBalanceSlackDown, and if one value is greater than zero, it represents that not enough generation (for Slack Up) or not enough demand (for Slack Down) in the optimization problem.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Services-cases","page":"Debugging infeasible models","title":"Services cases","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"In many scenarios, certain units are also required to provide reserve requirements, e.g. thermal units mandated to provide up-regulation. In such scenarios, it is also possible to add slack variables, by specifying the service model (RangeReserve) for the specific service type (VariableReserve{ReserveUp}) as:","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"set_service_model!(\n template_uc,\n ServiceModel(\n VariableReserve{ReserveUp},\n RangeReserve;\n use_slacks = true,\n ),\n)","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Again, if the problem is now feasible, check the solution of ReserveRequirementSlack variable, and if it is larger than zero in a specific time-step, then it is evidence that there is not enough reserve available to satisfy the requirement.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/#Getting-the-infeasibility-conflict","page":"Debugging infeasible models","title":"Getting the infeasibility conflict","text":"","category":"section"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Some solvers allows to identify which constraints and variables are producing the infeasibility, by finding the irreducible infeasible set (IIS), that is the subset of constraints and variable bounds that will become feasible if any single constraint or variable bound is removed.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"To enable this feature in PowerSimulations the keyword argument calculate_conflict must be set to true, when creating the DecisionModel. Note that not all solvers allow the computation of the IIS, but most commercial solvers have this capability. It is also recommended to enable the keyword argument store_variable_names=true to help understanding which variables are with infeasibility issues.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"The following code creates a decision model with the Xpress optimizer, and enabling the calculate_conflict=true keyword argument.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"DecisionModel(\n template_ed,\n sys_rts_rt;\n name = \"ED\",\n optimizer = optimizer_with_attributes(Xpress.Optimizer, \"MIPRELSTOP\" => 1e-2),\n optimizer_solve_log_print = true,\n calculate_conflict = true,\n store_variable_names = true,\n)","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Here is an example on how the IIS will be displayed as:","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Error: Constraints participating in conflict basis (IIS) \n│ \n│ ┌──────────────────────────────────────┐\n│ │ CopperPlateBalanceConstraint__System │\n│ ├──────────────────────────────────────┤\n│ │ (113, 26) │\n│ └──────────────────────────────────────┘\n│ ┌──────────────────────────────────┐\n│ │ EnergyAssetBalance__HybridSystem │\n│ ├──────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └──────────────────────────────────┘\n│ ┌─────────────────────────────────────────────┐\n│ │ PieceWiseLinearCostConstraint__HybridSystem │\n│ ├─────────────────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └─────────────────────────────────────────────┘\n│ ┌────────────────────────────────────────────────┐\n│ │ PieceWiseLinearCostConstraint__ThermalStandard │\n│ ├────────────────────────────────────────────────┤\n│ │ (\"202_STEAM_3\", 26) │\n│ │ (\"101_STEAM_3\", 26) │\n│ │ (\"118_CC_1\", 26) │\n│ │ (\"202_STEAM_4\", 26) │\n│ │ (\"315_CT_6\", 26) │\n│ │ (\"201_STEAM_3\", 26) │\n│ │ (\"102_STEAM_4\", 26) │\n│ └────────────────────────────────────────────────┘\n│ ┌──────────────────────────────────────────────────────────────────────┐\n│ │ ActivePowerVariableTimeSeriesLimitsConstraint__RenewableDispatch__ub │\n│ ├──────────────────────────────────────────────────────────────────────┤\n│ │ (\"122_WIND_1\", 26) │\n│ │ (\"324_PV_3\", 26) │\n│ │ (\"312_PV_1\", 26) │\n│ │ (\"102_PV_1\", 26) │\n│ │ (\"101_PV_1\", 26) │\n│ │ (\"324_PV_2\", 26) │\n│ │ (\"313_PV_2\", 26) │\n│ │ (\"104_PV_1\", 26) │\n│ │ (\"101_PV_2\", 26) │\n│ │ (\"309_WIND_1\", 26) │\n│ │ (\"310_PV_2\", 26) │\n│ │ (\"113_PV_1\", 26) │\n│ │ (\"314_PV_1\", 26) │\n│ │ (\"324_PV_1\", 26) │\n│ │ (\"103_PV_1\", 26) │\n│ │ (\"303_WIND_1\", 26) │\n│ │ (\"314_PV_2\", 26) │\n│ │ (\"102_PV_2\", 26) │\n│ │ (\"314_PV_3\", 26) │\n│ │ (\"320_PV_1\", 26) │\n│ │ (\"101_PV_3\", 26) │\n│ │ (\"319_PV_1\", 26) │\n│ │ (\"314_PV_4\", 26) │\n│ │ (\"310_PV_1\", 26) │\n│ │ (\"215_PV_1\", 26) │\n│ │ (\"313_PV_1\", 26) │\n│ │ (\"101_PV_4\", 26) │\n│ │ (\"119_PV_1\", 26) │\n│ └──────────────────────────────────────────────────────────────────────┘\n│ ┌─────────────────────────────────────────────────────────────────────────────┐\n│ │ FeedforwardSemiContinuousConstraint__ThermalStandard__ActivePowerVariable_ub │\n│ ├─────────────────────────────────────────────────────────────────────────────┤\n│ │ (\"322_CT_6\", 26) │\n│ │ (\"321_CC_1\", 26) │\n│ │ (\"223_CT_4\", 26) │\n│ │ (\"213_CT_1\", 26) │\n│ │ (\"223_CT_6\", 26) │\n│ │ (\"123_CT_1\", 26) │\n│ │ (\"113_CT_3\", 26) │\n│ │ (\"302_CT_3\", 26) │\n│ │ (\"215_CT_4\", 26) │\n│ │ (\"301_CT_4\", 26) │\n│ │ (\"113_CT_2\", 26) │\n│ │ (\"221_CC_1\", 26) │\n│ │ (\"223_CT_5\", 26) │\n│ │ (\"315_CT_7\", 26) │\n│ │ (\"215_CT_5\", 26) │\n│ │ (\"113_CT_1\", 26) │\n│ │ (\"307_CT_2\", 26) │\n│ │ (\"213_CT_2\", 26) │\n│ │ (\"113_CT_4\", 26) │\n│ │ (\"218_CC_1\", 26) │\n│ │ (\"213_CC_3\", 26) │\n│ │ (\"323_CC_2\", 26) │\n│ │ (\"322_CT_5\", 26) │\n│ │ (\"207_CT_2\", 26) │\n│ │ (\"123_CT_5\", 26) │\n│ │ (\"123_CT_4\", 26) │\n│ │ (\"207_CT_1\", 26) │\n│ │ (\"301_CT_3\", 26) │\n│ │ (\"302_CT_4\", 26) │\n│ │ (\"307_CT_1\", 26) │\n│ └─────────────────────────────────────────────────────────────────────────────┘\n│ ┌───────────────────────────────────────────────────────┐\n│ │ RenewableActivePowerLimitConstraint__HybridSystem__ub │\n│ ├───────────────────────────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └───────────────────────────────────────────────────────┘\n│ ┌───────────────────────────────────────┐\n│ │ ThermalOnVariableUb__HybridSystem__ub │\n│ ├───────────────────────────────────────┤\n│ │ (\"317_Hybrid\", 26) │\n│ └───────────────────────────────────────┘\n\n Error: Serializing Infeasible Problem at /var/folders/1v/t69qyl0n5059n6c1nn7sp8zm7g8s6z/T/jl_jNSREb/compact_sim/problems/ED/infeasible_ED_2020-10-06T15:00:00.json","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Note that the IIS clearly identify that the issue is happening at time step 26, and constraints are related with the CopperPlateBalanceConstraint__System, with multiple upper bound constraints, for the hybrid system, renewable units and thermal units. This highlights that there may not be enough generation in the system. Indeed, by enabling system slacks, the problem become feasible.","category":"page"},{"location":"modeler_guide/debugging_infeasible_models/","page":"Debugging infeasible models","title":"Debugging infeasible models","text":"Finally, the infeasible model is exported in a json file that can be loaded directly in JuMP to be explored. More information about this is available here.","category":"page"},{"location":"modeler_guide/definitions/#Definitions","page":"Definitions","title":"Definitions","text":"","category":"section"},{"location":"modeler_guide/definitions/#A","page":"Definitions","title":"A","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Attributes: Certain device formulations can be customized by specifying attributes that will include/remove certain variables, expressions and/or constraints. For example, in StorageSystemsSimulations.jl, the device formulation of StorageDispatchWithReserves can be specified with the following dictionary of attributes:","category":"page"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"set_device_model!(\n template,\n DeviceModel(\n GenericBattery,\n StorageDispatchWithReserves;\n attributes = Dict{String, Any}(\n \"reservation\" => false,\n \"cycling_limits\" => false,\n \"energy_target\" => false,\n \"complete_coverage\" => false,\n \"regularization\" => false,\n ),\n ),\n)","category":"page"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Changing the attributes between true or false can enable/disable multiple aspects of the formulation.","category":"page"},{"location":"modeler_guide/definitions/#C","page":"Definitions","title":"C","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Chronologies: In PowerSimulations.jl, chronologies define where information is flowing. There are two types of chronologies. 1) inter-stage chronologies (InterProblemChronology) that define how information flows between stages. e.g. day-ahead solutions are used to inform economic dispatch problems; and 2) intra-stage chronologies (IntraProblemChronology) that define how information flows between multiple executions of a single stage. e.g. the dispatch setpoints of the first period of an economic dispatch problem are constrained by the ramping limits from setpoints in the final period of the previous problem.","category":"page"},{"location":"modeler_guide/definitions/#D","page":"Definitions","title":"D","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Decision Problem: A decision problem calculates the desired system operation based on forecasts of uncertain inputs and information about the state of the system. The output of a decision problem represents the policies used to drive the set-points of the system's devices, like generators or switches, and depends on the purpose of the problem. See the Decision Model Tutorial to learn more about solving individual problems.\nDevice Formulation: The model of a device that is incorporated into a large system optimization models. For instance, the storage device model used inside of a Unit Commitment (UC) problem. A device model needs to follow some requirements to be integrated into operation problems. For more information about valid DeviceModels and their mathematical representations, check out the Formulation Library.","category":"page"},{"location":"modeler_guide/definitions/#E","page":"Definitions","title":"E","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Emulation Problem: An emulation problem is used to mimic the system's behavior subject to an incoming decision and the realization of a forecasted inputs. The solution of the emulator produces outputs representative of the system performance when operating subject the policies resulting from the decision models.","category":"page"},{"location":"modeler_guide/definitions/#F","page":"Definitions","title":"F","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"FeedForward: The definition of exactly what information is passed using the defined chronologies is accomplished using FeedForwards. Specifically, a FeedForward is used to define what to do with information being passed with an inter-stage chronology in a Simulation. The most common FeedForward is the SemiContinuousFeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the (already solved) unit-commitment variables.","category":"page"},{"location":"modeler_guide/definitions/#H","page":"Definitions","title":"H","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Horizon: The number of steps in the look-ahead of a decision problem. For instance, a Day-Ahead problem usually has a 48 step horizon. Check the time Time Series Data Section in PowerSystems.jl","category":"page"},{"location":"modeler_guide/definitions/#I","page":"Definitions","title":"I","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Interval: The amount of time between updates to the decision problem. For instance, Day-Ahead problems usually have a 24-hour intervals and Real-Time problems have 5-minute intervals. Check the time Time Series Data Section in PowerSystems.jl","category":"page"},{"location":"modeler_guide/definitions/#R","page":"Definitions","title":"R","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Resolution: The amount of time between time steps in a simulation. For instance 1-hour or 5-minutes. In Julia these are defined using the syntax Hour(1) and Minute(5). Check the time Time Series Data Section in PowerSystems.jl\nResults vs Realized Results: In PowerSimulations.jl the term results is used to refer to the solution of all optimization problems in a Simulation. When using read_variable(results, Variable) in a DecisionModel of a simulation, the output is a dictionary with the values of such variable for every optimization problem solved, while read_realized_variable(results, Variable) will return the values of the specified interval and number of steps in the simulation. See the Read Results page for more details.","category":"page"},{"location":"modeler_guide/definitions/#S","page":"Definitions","title":"S","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Service Formulation: The model of a service that is incorporated into a large system optimization models. Services (or ancillary services) are models used to ensure that there is necessary support to the power grid from generators to consumers, in order to ensure reliable operation of the system. The most common application for ancillary services are reserves, i.e., generation (or load) that is not currently being used, but can be quickly made available in case of unexpected changes of grid conditions, for example a sudden loss of load or generation. A service model needs to follow some requirements to be integrated into operation problems. For more information about valid ServiceModels and their mathematical representations, check out the Formulation Library.\nSimulation: A simulation is a pre-determined sequence of decision problems in a way that solving it, resembles the solution procedures commonly used by operators. The most common simulation model is the solution of a Unit Commitment and Economic Dispatch sequence of problems.\nSolver: A solver is a software package that incorporates algorithms for finding solutions to one or more classes of optimization problem. For example, FICO Xpress is a commercial optimization solver for linear programming (LP), convex quadratic programming (QP) problems, convex quadratically constrained quadratic programming (QCQP), second-order cone programming (SOCP) and their mixed integer counterparts. A solver is required to be specified in order to solve any computer optimization problem.","category":"page"},{"location":"modeler_guide/definitions/#T","page":"Definitions","title":"T","text":"","category":"section"},{"location":"modeler_guide/definitions/","page":"Definitions","title":"Definitions","text":"Template: A ProblemTemplate is just a collection of DeviceModels that allows the user to specify the formulations of each set of devices (by device type) independently so that the modeler can adjust the level of detail according to the question of interest and the available data. For more information about valid DeviceModels and their mathematical representations, check out the Formulation Library.","category":"page"},{"location":"modeler_guide/psi_structure/#psi_structure","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"","category":"section"},{"location":"modeler_guide/psi_structure/","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"PowerSimulations enables the simulation of a sequence of power systems optimization problems and provides user control over each aspect of the simulation configuration. Specifically:","category":"page"},{"location":"modeler_guide/psi_structure/","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"mathematical formulations can be selected for each component with DeviceModel and ServiceModel\na problem can be defined by creating model entries in a Operations ProblemTemplates\nmodels (DecisionModel or EmulationModel) can be built by applying a ProblemTemplate to a System and can be executed/solved in isolation or as part of a Simulation\nSimulations can be defined and executed by sequencing one or more models and defining how and when data flows between models.","category":"page"},{"location":"modeler_guide/psi_structure/","page":"PowerSimulations.jl Modeling Structure","title":"PowerSimulations.jl Modeling Structure","text":"question: What is the difference between a Model and a Problem?\nA \"Problem\" is an abstract mathematical description of how to represent power system behavior, whereas a \"Model\" is a concrete representation of a \"Problem\" applied to a dataset. I.e. once a Problem is populated with data describing all the loads, generators, lines, etc., it becomes a Model.","category":"page"},{"location":"formulation_library/General/#formulation_library","page":"General","title":"Formulations","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Modeling formulations are created by dispatching on abstract subtypes of PowerSimulations.AbstractDeviceFormulation","category":"page"},{"location":"formulation_library/General/#FixedOutput","page":"General","title":"FixedOutput","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"FixedOutput","category":"page"},{"location":"formulation_library/General/#PowerSimulations.FixedOutput","page":"General","title":"PowerSimulations.FixedOutput","text":"Formulation type to augment the power balance constraint expression with a time series parameter\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Variables:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"No variables are created for DeviceModel(<:DeviceType, FixedOutput)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Static Parameters:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"ThermalGen:\nP^textthmax = PowerSystems.get_max_active_power(device)\nQ^textthmax = PowerSystems.get_max_reactive_power(device)\nStorage:\nP^textstmax = PowerSystems.get_max_active_power(device)\nQ^textstmax = PowerSystems.get_max_reactive_power(device)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"using PowerSimulations\nusing HydroPowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombo_tables = []\nfor t in [RenewableGen, ThermalGen, HydroGen, ElectricLoad]\n combos = PowerSimulations.get_default_time_series_names(t, FixedOutput)\n combo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n )\n insertcols!(combo_table, 1, \"Device Type\" => fill(string(t), length(combos)))\n push!(combo_tables, combo_table)\nend\nmdtable(vcat(combo_tables...); latex = false)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Objective:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"No objective terms are created for DeviceModel(<:DeviceType, FixedOutput)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Expressions:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Adds the active and reactive parameters listed for specific device types above to the respective active and reactive power balance expressions created by the selected Network Formulations.","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Constraints:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"No constraints are created for DeviceModel(<:DeviceType, FixedOutput)","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"","category":"page"},{"location":"formulation_library/General/#FunctionData-Options","page":"General","title":"FunctionData Options","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"PowerSimulations can represent variable costs using a variety of different methods depending on the data available in each device. The following describes the objective function terms that are populated for each variable cost option.","category":"page"},{"location":"formulation_library/General/#LinearFunctionData","page":"General","title":"LinearFunctionData","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"variable_cost = LinearFunctionData(c): creates a fixed marginal cost term in the objective function","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t c * G_t\nendaligned","category":"page"},{"location":"formulation_library/General/#QuadraticFunctionData-and-PolynomialFunctionData","page":"General","title":"QuadraticFunctionData and PolynomialFunctionData","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"variable_cost::QuadraticFunctionData and variable_cost::PolynomialFunctionData: create a polynomial cost term in the objective function","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t sum_n C_n * G_t^n\nendaligned","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"where","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"For QuadraticFunctionData:\nC_0 = get_constant_term(variable_cost)\nC_1 = get_proportional_term(variable_cost)\nC_2 = get_quadratic_term(variable_cost)\nFor PolynomialFunctionData:\nC_n = get_coefficients(variable_cost)[n]","category":"page"},{"location":"formulation_library/General/#andPiecewiseLinearSlopeData","page":"General","title":"`andPiecewiseLinearSlopeData`","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"variable_cost::PiecewiseLinearData and variable_cost::PiecewiseLinearSlopeData: create a piecewise linear cost term in the objective function","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t f(G_t)\nendaligned","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"where","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"For variable_cost::PiecewiseLinearData, f(x) is the piecewise linear function obtained by connecting the (x, y) points get_points(variable_cost) in order.\nFor variable_cost = PiecewiseLinearSlopeData([x0, x1, x2, ...], y0, [s0, s1, s2, ...]), f(x) is the piecewise linear function obtained by starting at (x0, y0), drawing a segment at slope s0 to x=x1, drawing a segment at slope s1 to x=x2, etc.\n","category":"page"},{"location":"formulation_library/General/#StorageCost","page":"General","title":"StorageCost","text":"","category":"section"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Adds an objective function cost term according to:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"beginaligned\n textmin sum_t quad E^surplus_t * C^penalty - E^shortage_t * C^value\nendaligned","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Impact of different cost configurations:","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"The following table describes all possible configurations of the StorageCost with the target constraint in hydro or storage device models. Cases 1(a) & 2(a) will not impact the model's operations, and the target constraint will be rendered useless. In most cases that have no energy target and a non-zero value for C^value, if this cost is too high (C^value 0) or too low (C^value 0) can result in either the model holding on to stored energy till the end of the model not storing any energy in the device. This is caused by the fact that when the energy target is zero, we have E_t = - E^shortage_t, and - E^shortage_t * C^value in the objective function is replaced by E_t * C^value, thus resulting in C^value to be seen as the cost of stored energy.","category":"page"},{"location":"formulation_library/General/","page":"General","title":"General","text":"Case Energy Target Energy Shortage Cost Energy Value / Energy Surplus cost Effect\nCase 1(a) hatE=0 C^penalty=0 C^value=0 no change\nCase 1(b) hatE=0 C^penalty=0 C^value0 penalty for storing energy\nCase 1(c) hatE=0 C^penalty0 C^value=0 no penalties or incentives applied\nCase 1(d) hatE=0 C^penalty=0 C^value0 incentive for storing energy\nCase 1(e) hatE=0 C^penalty0 C^value0 penalty for storing energy\nCase 1(f) hatE=0 C^penalty0 C^value0 incentive for storing energy\nCase 2(a) hatE0 C^penalty=0 C^value=0 no change\nCase 2(b) hatE0 C^penalty=0 C^value0 penalty on energy storage in excess of target\nCase 2(c) hatE0 C^penalty0 C^value=0 penalty on energy storage short of target\nCase 2(d) hatE0 C^penalty=0 C^value0 incentive on excess energy\nCase 2(e) hatE0 C^penalty0 C^value0 penalty on both excess/shortage of energy\nCase 2(f) hatE0 C^penalty0 C^value0 penalty for shortage, incentive for excess energy","category":"page"},{"location":"modeler_guide/logging/#Logging","page":"Logging","title":"Logging","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"PowerSimulations.jl will output many log messages when building systems and running simulations. You may want to customize what gets logged to the console and, optionally, a file.","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"By default all log messages of level Logging.Info or higher will get displayed to the console. When you run a simulation a simulation-specific logger will take over and log its messages to a file in the logs directory in the simulation output directory. When finished it will relinquish control back to the global logger.","category":"page"},{"location":"modeler_guide/logging/#Configuring-the-global-logger","page":"Logging","title":"Configuring the global logger","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"To configure the global logger in a Jupyter Notebook or REPL you may configure your own logger with the Julia Logging standard library or use the convenience function provided by PowerSimulations. This example will log messages of level Logging.Error to console and Logging.Info and higher to the file power-simulations.log in the current directory.","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"import Logging\nusing PowerSimulations\nlogger = configure_logging(;\n console_level = Logging.Error,\n file_level = Logging.Info,\n filename = \"power-simulations.log\",\n)","category":"page"},{"location":"modeler_guide/logging/#Configuring-the-simulation-logger","page":"Logging","title":"Configuring the simulation logger","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"You can configure the logging level used by the simulation logger when you call build!(simulation). Here is an example that increases logging verbosity:","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"import Logging\nusing PowerSimulations\nsimulation = Simulation(...)\nbuild!(simulation; console_level = Logging.Info, file_level = Logging.Debug)","category":"page"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"The log file will be located at ///logs/simulation.log.","category":"page"},{"location":"modeler_guide/logging/#Solver-logs","page":"Logging","title":"Solver logs","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"You can configure logging for the solver you use. Refer to the solver documentation. PowerSimulations does not redirect or intercept prints to stdout or stderr from other libraries.","category":"page"},{"location":"modeler_guide/logging/#Recorder-events","page":"Logging","title":"Recorder events","text":"","category":"section"},{"location":"modeler_guide/logging/","page":"Logging","title":"Logging","text":"PowerSimulations uses the InfrastructureSystems.Recorder to store simulation events in a log file. Refer to this link for more information.","category":"page"},{"location":"formulation_library/RenewableGen/#PowerSystems.RenewableGen-Formulations","page":"Renewable Generation","title":"PowerSystems.RenewableGen Formulations","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Renewable generation formulations define the optimization models that describe renewable units mathematical model in different operational settings, such as economic dispatch and unit commitment.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"note: Note\nReserve variables for services are not included in the formulation, albeit their inclusion change the variables, expressions, constraints and objective functions created. A detailed description of the implications in the optimization models is described in the Service formulation section.","category":"page"},{"location":"formulation_library/RenewableGen/#Table-of-contents","page":"Renewable Generation","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"RenewableFullDispatch\nRenewableConstantPowerFactor\nValid configurations","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"","category":"page"},{"location":"formulation_library/RenewableGen/#RenewableFullDispatch","page":"Renewable Generation","title":"RenewableFullDispatch","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"RenewableFullDispatch","category":"page"},{"location":"formulation_library/RenewableGen/#PowerSimulations.RenewableFullDispatch","page":"Renewable Generation","title":"PowerSimulations.RenewableFullDispatch","text":"Formulation type to add injection variables constrained by a maximum injection time series for RenewableGen\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Variables:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nSymbol: p^textre\nReactivePowerVariable:\nBounds: [0.0, ]\nSymbol: q^textre","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"P^textremin = PowerSystems.get_active_power_limits(device).min\nQ^textremin = PowerSystems.get_reactive_power_limits(device).min\nQ^textremax = PowerSystems.get_reactive_power_limits(device).max","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Uses the max_active_power timeseries parameter to limit the available active power at each time-step.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(RenewableGen, RenewableFullDispatch)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Objective:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as - p^textre to incentivize generation from RenewableGen devices.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Adds p^textre and q^textre terms to the respective active and reactive power balance expressions created by the selected Network Formulations.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"beginaligned\n P^textremin le p_t^textre le textActivePowerTimeSeriesParameter_t quad forall t in 1dots T \n Q^textremin le q_t^textre le Q^textremax quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"","category":"page"},{"location":"formulation_library/RenewableGen/#RenewableConstantPowerFactor","page":"Renewable Generation","title":"RenewableConstantPowerFactor","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"RenewableConstantPowerFactor","category":"page"},{"location":"formulation_library/RenewableGen/#PowerSimulations.RenewableConstantPowerFactor","page":"Renewable Generation","title":"PowerSimulations.RenewableConstantPowerFactor","text":"Formulation type to add real and reactive injection variables with constant power factor with maximum real power injections constrained by a time series for RenewableGen\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Variables:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"ActivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_active_power(device)\nSymbol: p^textre\nReactivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_reactive_power(device)\nSymbol: q^textre","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Static Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"P^textremin = PowerSystems.get_active_power_limits(device).min\nQ^textremin = PowerSystems.get_reactive_power_limits(device).min\nQ^textremax = PowerSystems.get_reactive_power_limits(device).max\ntextpf = PowerSystems.get_power_factor(device)","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(\n RenewableGen,\n RenewableConstantPowerFactor,\n)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Objective:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as - p_t^textre to incentivize generation from RenewableGen devices.","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Expressions:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Adds p^textre and q^textre terms to the respective active and reactive power balance expressions created by the selected Network Formulations","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Constraints:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"beginaligned\n P^textremin le p_t^textre le textActivePowerTimeSeriesParameter_t quad forall t in 1dots T \n q_t^textre = textpf cdot p_t^textre quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"","category":"page"},{"location":"formulation_library/RenewableGen/#Valid-configurations","page":"Renewable Generation","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"Valid DeviceModels for subtypes of RenewableGen include the following:","category":"page"},{"location":"formulation_library/RenewableGen/","page":"Renewable Generation","title":"Renewable Generation","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> x[\"device_type\"] <: RenewableGen, combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/#service_formulations","page":"Services","title":"PowerSystems.Service Formulations","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Services (or ancillary services) are models used to ensure that there is necessary support to the power grid from generators to consumers, in order to ensure reliable operation of the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"The most common application for ancillary services are reserves, i.e., generation (or load) that is not currently being used, but can be quickly made available in case of unexpected changes of grid conditions, for example a sudden loss of load or generation.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A key challenge of adding services to a system, from a mathematical perspective, is specifying which units contribute to the specified requirement of a service, that implies the creation of new variables (such as reserve variables) and modification of constraints.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"In this documentation, we first specify the available Services in the grid, and what requirements impose in the system, and later we discuss the implication on device formulations for specific units.","category":"page"},{"location":"formulation_library/Service/#Table-of-contents","page":"Services","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RangeReserve\nStepwiseCostReserve\nGroupReserve\nRampReserve\nNonSpinningReserve\nConstantMaxInterfaceFlow\nVariableMaxInterfaceFlow\nChanges on Expressions","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#RangeReserve","page":"Services","title":"RangeReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RangeReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.RangeReserve","page":"Services","title":"PowerSimulations.RangeReserve","text":"Struct for to add reserves to be larger than a specified requirement\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type RangeReserve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nDefault proportional cost: 10 textSystemBasePower\nSymbol: r_d for d in contributing devices to the service s If slacks are enabled:\nReserveRequirementSlack:\nBounds: [0.0, ]\nDefault proportional cost: 1e5\nSymbol: r^textsl","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Depending on the PowerSystems.jl type associated to the RangeReserve formulation model, the parameters are:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textPF = PowerSystems.get_max_participation_factor(service)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a ConstantReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textReq = PowerSystems.get_requirement(service)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a VariableReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(VariableReserve, RangeReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add a large proportional cost to the objective function if slack variables are used + r^textsl cdot 10^5. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A RangeReserve implements two fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RangeReserve requirement. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt + r_t^textsl ge textReqquad forall tin 1dots T quad text(for a ConstantReserve) \nsum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T quad text(for a VariableReserve)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"In addition, there is a restriction on how much each contributing device d can contribute to the requirement, based on the max participation factor allowed.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le textReq cdot textPF quad forall din mathcalD_s forall tin 1dots T quad text(for a ConstantReserve) \nr_dt le textRequirementTimeSeriesParameter_t cdot textPFquad forall din mathcalD_s forall tin 1dots T quad text(for a VariableReserve)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#StepwiseCostReserve","page":"Services","title":"StepwiseCostReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Service must be used with ReserveDemandCurve PowerSystems.jl type. This service model is used to model ORDC (Operating Reserve Demand Curve) in ERCOT.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"StepwiseCostReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.StepwiseCostReserve","page":"Services","title":"PowerSimulations.StepwiseCostReserve","text":"Struct for to add reserves to be larger than a variable requirement depending of costs\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type ReserveDemandCurve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nSymbol: r_d for d in contributing devices to the service s\nServiceRequirementVariable:\nBounds: [0.0, ]\nSymbol: textreq","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a ReserveDemandCurve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos =\n PowerSimulations.get_default_time_series_names(ReserveDemandCurve, StepwiseCostReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"The ServiceRequirementVariable is added as a piecewise linear cost based on the decreasing offers listed in the variable_cost time series. These decreasing cost represent the scarcity prices of not having sufficient reserves. For example, if the variable textreq = 0, then a really high cost is paid for not having enough reserves, and if textreq is larger, then a lower cost (or even zero) is paid.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A StepwiseCostReserve implements a single constraint, such that the sum of all reserves of contributing devices must be larger than the ServiceRequirementVariable variable. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt ge textreq_tquad forall tin 1dots T ","category":"page"},{"location":"formulation_library/Service/#GroupReserve","page":"Services","title":"GroupReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Service must be used with ConstantReserveGroup PowerSystems.jl type. This service model is used to model an aggregation of services.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"GroupReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.GroupReserve","page":"Services","title":"PowerSimulations.GroupReserve","text":"Struct to add reserves to be larger than a specified requirement for an aggregated collection of services\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type GroupReserve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"No variables are created, but the services associated with the GroupReserve must have created variables.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textReq = PowerSystems.get_requirement(service)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalS_s = PowerSystems.get_contributing_services(system, service): Set (vector) of all contributing services to the group service s in the system.\nmathcalD_s_i = PowerSystems.get_contributing_devices(system, service_aux): Set (vector) of all contributing devices to the service s_i in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Does not modify the objective function, besides the changes to the objective function due to the other services associated to the group service.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"No changes, besides the changes to the expressions due to the other services associated to the group service.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A GroupReserve implements that the sum of all reserves of contributing devices, of all contributing services, must be larger than the GroupReserve requirement. Thus, for a GroupReserve service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s_i sum_i in mathcalS_s r_dt ge textReqquad forall tin 1dots T ","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#RampReserve","page":"Services","title":"RampReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RampReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.RampReserve","page":"Services","title":"PowerSimulations.RampReserve","text":"Struct to add reserves to be larger than a specified requirement, with ramp constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type RampReserve the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nDefault proportional cost: 10 textSystemBasePower\nSymbol: r_d for d in contributing devices to the service s If slacks are enabled:\nReserveRequirementSlack:\nBounds: [0.0, ]\nDefault proportional cost: 1e5\nSymbol: r^textsl","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"RampReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textTF = PowerSystems.get_time_frame(service)\nR^textthup = PowerSystems.get_ramp_limits(device).up for thermal contributing devices\nR^textthdn = PowerSystems.get_ramp_limits(device).down for thermal contributing devices","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a VariableReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(VariableReserve, RampReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add a large proportional cost to the objective function if slack variables are used + r^textsl cdot 10^5. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A RampReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the RampReserve requirement. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Finally, there is a restriction based on the ramp limits of the contributing devices:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le R^textthup cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveUp) \nr_dt le R^textthdn cdot textTFquad forall din mathcalD_s forall tin 1dots T quad text(for ReserveDown)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#NonSpinningReserve","page":"Services","title":"NonSpinningReserve","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"NonSpinningReserve","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.NonSpinningReserve","page":"Services","title":"PowerSimulations.NonSpinningReserve","text":"Struct to add non spinning reserve requirements larger than specified requirement\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For each service s of the model type NonSpinningReserve, the following variables are created:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ActivePowerReserveVariable:\nBounds: [0.0, ]\nDefault proportional cost: 10 textSystemBasePower\nSymbol: r_d for d in contributing devices to the service s If slacks are enabled:\nReserveRequirementSlack:\nBounds: [0.0, ]\nDefault proportional cost: 1e5\nSymbol: r^textsl","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"NonSpinningReserve only accepts VariableReserve PowerSystems.jl type. With that, the parameters are:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textPF = PowerSystems.get_max_participation_factor(service)\ntextTF = PowerSystems.get_time_frame(service)\nP^textthmin = PowerSystems.get_active_power_limits(device).min for thermal contributing devices\nT^textstup = PowerSystems.get_time_limits(d).up for thermal contributing devices\nR^textthup = PowerSystems.get_ramp_limits(device).down for thermal contributing devices","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Other parameters:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Delta T: Resolution of the problem in minutes.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a VariableReserve PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(VariableReserve, NonSpinningReserve)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing devices to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add a large proportional cost to the objective function if slack variables are used + r^textsl cdot 10^5. In addition adds the default cost for ActivePowerReserveVariables as a proportional cost.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Adds the ActivePowerReserveVariable for upper/lower bound expressions of contributing devices.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For ReserveUp types, the variable is added to ActivePowerRangeExpressionUB, such that this expression considers both the ActivePowerVariable and its reserve variable. Similarly, For ReserveDown types, the variable is added to ActivePowerRangeExpressionLB, such that this expression considers both the ActivePowerVariable and its reserve variable","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Example: for a thermal unit d contributing to two different ReserveUp s_1 s_2 services (e.g. Reg-Up and Spin):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t = p_t^textth + r_s_1t + r_s_2 t le P^textthmax","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"similarly if s_3 is a ReserveDown service (e.g. Reg-Down):","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionLB_t = p_t^textth - r_s_3t ge P^textthmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"A NonSpinningReserve implements three fundamental constraints. The first is that the sum of all reserves of contributing devices must be larger than the NonSpinningReserve requirement. Thus, for a service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"sum_dinmathcalD_s r_dt + r_t^textsl ge textRequirementTimeSeriesParameter_tquad forall tin 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"In addition, there is a restriction on how much each contributing device d can contribute to the requirement, based on the max participation factor allowed.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le textRequirementTimeSeriesParameter_t cdot textPFquad forall din mathcalD_s forall tin 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Finally, there is a restriction based on the reserve response time for the non-spinning reserve if the unit is off. To do so, compute R^textlimit_d as the reserve response limit as:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"R^textlimit_d = begincases\n0 text if TF le T^textstup_d \nP^textthmin_d + (textTF_s - T^textstup_d) cdot R^textthup_d Delta T cdot R^textthup_d text if TF T^textstup_d\nendcases quad forall din mathcalD_s","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Then, the constraint depends on the commitment variable u_t^textth as:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_dt le (1 - u_dt^textth) cdot R^textlimit_d quad forall d in mathcalD_s forall t in 1dots T","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"","category":"page"},{"location":"formulation_library/Service/#ConstantMaxInterfaceFlow","page":"Services","title":"ConstantMaxInterfaceFlow","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ConstantMaxInterfaceFlow","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.ConstantMaxInterfaceFlow","page":"Services","title":"PowerSimulations.ConstantMaxInterfaceFlow","text":"Struct to add a constant maximum transmission flow for specified interface\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"If slacks are used:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"InterfaceFlowSlackUp:\nBounds: [0.0, ]\nSymbol: f^textslup\nInterfaceFlowSlackDown:\nBounds: [0.0, ]\nSymbol: f^textsldn","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmax = PowerSystems.get_active_power_flow_limits(service).max\nF^textmin = PowerSystems.get_active_power_flow_limits(service).min\nC^textflow = PowerSystems.get_violation_penalty(service)\nmathcalM_s = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction (textDir_d = 1 or textDir_d = -1) with respect to the interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add the violation penalty proportional cost to the objective function if slack variables are used + (f^textslup + f^textsldn) cdot C^textflow.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmin le f^textslup_t - f^textsldn_t + sum_dinmathcalD_s textDir_d f_dt le F^textmax quad forall t in 1dotsT","category":"page"},{"location":"formulation_library/Service/#VariableMaxInterfaceFlow","page":"Services","title":"VariableMaxInterfaceFlow","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"This Service model only accepts the PowerSystems.jl TransmissionInterface type to properly function. It is used to model a collection of branches that make up an interface or corridor with a maximum transfer of power.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"VariableMaxInterfaceFlow","category":"page"},{"location":"formulation_library/Service/#PowerSimulations.VariableMaxInterfaceFlow","page":"Services","title":"PowerSimulations.VariableMaxInterfaceFlow","text":"Struct to add a variable maximum transmission flow for specified interface\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Variables","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"If slacks are used:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"InterfaceFlowSlackUp:\nBounds: [0.0, ]\nSymbol: f^textslup\nInterfaceFlowSlackDown:\nBounds: [0.0, ]\nSymbol: f^textsldn","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Static Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmax = PowerSystems.get_active_power_flow_limits(service).max\nF^textmin = PowerSystems.get_active_power_flow_limits(service).min\nC^textflow = PowerSystems.get_violation_penalty(service)\nmathcalM_s = PowerSystems.get_direction_mapping(service). Dictionary of contributing branches with its specified direction (textDir_d = 1 or textDir_d = -1) with respect to the interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Time Series Parameters","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For a TransmissionInterface PowerSystems type:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(\n TransmissionInterface,\n VariableMaxInterfaceFlow,\n)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Relevant Methods","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"mathcalD_s = PowerSystems.get_contributing_devices(system, service): Set (vector) of all contributing branches to the service s in the system.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Objective:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Add the violation penalty proportional cost to the objective function if slack variables are used + (f^textslup + f^textsldn) cdot C^textflow.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Expressions:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Creates the expression InterfaceTotalFlow to keep track of all FlowActivePowerVariable of contributing branches to the transmission interface.","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Constraints:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"It adds the constraint to limit the InterfaceTotalFlow by the specified bounds of the service s:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"F^textmin cdot textMinInterfaceFlowLimitParameter_t le f^textslup_t - f^textsldn_t + sum_dinmathcalD_s textDir_d f_dt le F^textmaxcdot textMaxInterfaceFlowLimitParameter_t quad forall t in 1dotsT","category":"page"},{"location":"formulation_library/Service/#Changes-on-Expressions-due-to-Service-models","page":"Services","title":"Changes on Expressions due to Service models","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"It is important to note that by adding a service to a Optimization Problem, variables for each contributing device must be created. For example, for every contributing generator d in mathcalD that is participating in services s_1s_2s_3, it is required to create three set of ActivePowerReserveVariable variables:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"r_s_1dt r_s_2dt r_s_3dtquad forall d in mathcalD forall t in 1dots T","category":"page"},{"location":"formulation_library/Service/#Changes-on-UpperBound-(UB)-and-LowerBound-(LB)-limits","page":"Services","title":"Changes on UpperBound (UB) and LowerBound (LB) limits","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"Each contributing generator d has active power limits that the reserve variables affect. In simple terms, the limits are implemented using expressions ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB as:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"textActivePowerRangeExpressionUB_t le P^textmax \ntextActivePowerRangeExpressionLB_t ge P^textmin","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"ReserveUp type variables contribute to the upper bound expression, while ReserveDown variables contribute to the lower bound expressions. So if s_1s_2 are ReserveUp services, and s_3 is a ReserveDown service, then for a thermal generator d using a ThermalStandardDispatch:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"beginalign*\n p_dt^textth + r_s_1dt + r_s_2dt le P^textthmaxquad forall din mathcalD^textth forall t in 1dotsT \n p_dt^textth - r_s_3dt ge P^textthminquad forall din mathcalD^textth forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"while for a renewable generator d using a RenewableFullDispatch:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"beginalign*\n p_dt^textre + r_s_1dt + r_s_2dt le textActivePowerTimeSeriesParameter_tquad forall din mathcalD^textre forall t in 1dotsT\n p_dt^textre - r_s_3dt ge 0quad forall din mathcalD^textre forall t in 1dotsT\nendalign*","category":"page"},{"location":"formulation_library/Service/#Changes-in-Ramp-limits","page":"Services","title":"Changes in Ramp limits","text":"","category":"section"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"For the case of Ramp Limits (of formulation that model these limits), the reserve variables only affect the current time, and not the previous time. Then, for the same example as before:","category":"page"},{"location":"formulation_library/Service/","page":"Services","title":"Services","text":"beginalign*\n p_dt^textth + r_s_1dt + r_s_2dt - p_dt-1^textthle R^textthupquad forall din mathcalD^textth forall t in 1dotsT\n p_dt^textth - r_s_3dt - p_dt-1^textth ge -R^textthdnquad forall din mathcalD^textth forall t in 1dotsT\nendalign*","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/#Structure-of-an-operations-problem-model","page":"Operation Problem Structure","title":"Structure of an operations problem model","text":"","category":"section"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"In most cases operation problem models are optimization models. Although in PowerSimulations.jl it is possible to define arbitrary problems that can reflect heuristic decision rules, this is not the common case. This page focuses on explaining the structure of operations problems that employ an optimization problem and solver.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"The first aspect to consider when thinking about developing a model compatible with PowerSimulations.jl is that although we support all of JuMP.jl objects, you need to employ anonymous constraints and variables in JuMP and register the constraints, variables and other optimization objects into PowerSimulations.jl's optimization container. Otherwise the features to use your problem in the simulation like the coordination with other problems and post processing won't work.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"info: Info\nThe requirements for the simulation of Power Systems operations are more strict than solving an optimization problem once with just JuMP.jl. The requirements imposed by PowerSimulations.jl to integrate your models in a simulation are designed to help with other complex operations that go beyond JuMP.jl scope.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"warning: Warning\nAll the code in this page is considered \"pseudo-code\". Copy-paste will likely not work out of the box. You need to develop the internals of the functions correctly for the examples below to work.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/#Registering-a-variable-in-the-model","page":"Operation Problem Structure","title":"Registering a variable in the model","text":"","category":"section"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"To register a variable in the model, the developer must first allocate the container into the optimization container and then populate it. For example, it require start the build function as follows:","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"info: Info\nWe recommend calling import PowerSimulations and defining the constant CONST PSI = PowerSimulations to make it easier to read the code and determine which package is responsible for defining the functions.","category":"page"},{"location":"model_developer_guide/structure_of_operation_problem/","page":"Operation Problem Structure","title":"Operation Problem Structure","text":"function PSI.build_model!(model::PSI.DecisionModel{MyCustomModel})\n container = PSI.get_optimization_container(model)\n PSI.set_time_steps!(container, 1:24)\n\n # Create the container for the variable\n variable = PSI.add_variable_container!(\n container,\n PSI.ActivePowerVariable(), # <- This variable is defined in PowerSimulations but the user can define their own\n PSY.ThermalGeneration, # <- Device type for the variable. Can be from PSY or custom defined\n devices_names, # <- First container dimension\n time_steps, # <- Second container dimension\n )\n\n # Iterate over the devices and time to store the JuMP variables into the container.\n for t in time_steps, d in devices\n name = PSY.get_name(d)\n variable[name, t] = JuMP.@variable(get_jump_model(container))\n # It is possible to use PSY getter functions to retrieve data from the generators\n # Any other variable property can be specified inside this loop.\n JuMP.set_upper_bound(variable[name, t], UB_DATA) # <- Optional\n JuMP.set_lower_bound(variable[name, t], LB_DATA) # <- Optional\n end\n\n return\nend","category":"page"},{"location":"model_developer_guide/troubleshooting/#Troubleshooting-model-development","page":"Troubleshooting","title":"Troubleshooting model development","text":"","category":"section"},{"location":"formulation_library/README/#Formulation-documentation-guide","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"","category":"section"},{"location":"formulation_library/README/","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"Formulation documentation should roughly follow the template established by RenewableGen.md","category":"page"},{"location":"formulation_library/README/#Auto-generated-items","page":"Formulation documentation guide","title":"Auto generated items","text":"","category":"section"},{"location":"formulation_library/README/","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"Valid DeviceModel table: just change the device category in the filter function\nTime Series Parameters: just change the device category and formulation in the get_default_time_series_names method call","category":"page"},{"location":"formulation_library/README/#Linked-items","page":"Formulation documentation guide","title":"Linked items","text":"","category":"section"},{"location":"formulation_library/README/","page":"Formulation documentation guide","title":"Formulation documentation guide","text":"Formulations in the Valid DeviceModel table must have a docstring in src/core/formulations.jl\nThe Formulation in the @docs block must have a docstring in src/core/formulations.jl\nThe Variables must have docstrings in src/core/variables.jl \nThe Time Series Parameters must have docstrings in src/core/parameters.jl","category":"page"},{"location":"tutorials/pcm_simulation/#pcm_tutorial","page":"Multi-stage Production Cost Simulation","title":"Sequential Simulations with PowerSimulations.jl","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Originally Contributed by: Clayton Barrows","category":"page"},{"location":"tutorials/pcm_simulation/#Introduction","page":"Multi-stage Production Cost Simulation","title":"Introduction","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"PowerSimulations.jl supports simulations that consist of sequential optimization problems where results from previous problems inform subsequent problems in a variety of ways. This example demonstrates some of these capabilities to represent electricity market clearing. This example is intended to be an extension of the OperationsProblem tutorial.","category":"page"},{"location":"tutorials/pcm_simulation/#Load-Packages","page":"Multi-stage Production Cost Simulation","title":"Load Packages","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"using PowerSystems\nusing PowerSimulations\nusing HydroPowerSimulations\nconst PSI = PowerSimulations\nusing PowerSystemCaseBuilder\nusing Dates\nusing HiGHS #solver","category":"page"},{"location":"tutorials/pcm_simulation/#Optimizer","page":"Multi-stage Production Cost Simulation","title":"Optimizer","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"It's most convenient to define an optimizer instance upfront and pass it into the DecisionModel constructor. For this example, we can use the free HiGHS solver with a relatively relaxed MIP gap (ratioGap) setting to improve speed.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"solver = optimizer_with_attributes(HiGHS.Optimizer, \"mip_rel_gap\" => 0.5)","category":"page"},{"location":"tutorials/pcm_simulation/#Hourly-day-ahead-system","page":"Multi-stage Production Cost Simulation","title":"Hourly day-ahead system","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"First, we'll create a System with hourly data to represent day-ahead forecasted wind, solar, and load profiles:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"sys_DA = build_system(PSISystems, \"modified_RTS_GMLC_DA_sys\"; skip_serialization = true)","category":"page"},{"location":"tutorials/pcm_simulation/#5-Minute-system","page":"Multi-stage Production Cost Simulation","title":"5-Minute system","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"The RTS data also includes 5-minute resolution time series data. So, we can create another System to represent 15 minute ahead forecasted data for a \"real-time\" market:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"sys_RT = build_system(PSISystems, \"modified_RTS_GMLC_RT_sys\"; skip_serialization = true)","category":"page"},{"location":"tutorials/pcm_simulation/#ProblemTemplates-define-stages","page":"Multi-stage Production Cost Simulation","title":"ProblemTemplates define stages","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Sequential simulations in PowerSimulations are created by defining OperationsProblems that represent stages, and how information flows between executions of a stage and between different stages.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Let's start by defining a two stage simulation that might look like a typical day-Ahead and real-time electricity market clearing process.","category":"page"},{"location":"tutorials/pcm_simulation/#Day-ahead-unit-commitment-stage","page":"Multi-stage Production Cost Simulation","title":"Day-ahead unit commitment stage","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"First, we can define a unit commitment template for the day ahead problem. We can use the included UC template, but in this example, we'll replace the ThermalBasicUnitCommitment with the slightly more complex ThermalStandardUnitCommitment for the thermal generators.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"template_uc = template_unit_commitment()\nset_device_model!(template_uc, ThermalStandard, ThermalStandardUnitCommitment)\nset_device_model!(template_uc, HydroDispatch, HydroDispatchRunOfRiver)","category":"page"},{"location":"tutorials/pcm_simulation/#Define-the-reference-model-for-the-real-time-economic-dispatch","page":"Multi-stage Production Cost Simulation","title":"Define the reference model for the real-time economic dispatch","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"In addition to the manual specification process demonstrated in the OperationsProblem example, PSI also provides pre-specified templates for some standard problems:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"template_ed = template_economic_dispatch(;\n network = NetworkModel(PTDFPowerModel; use_slacks = true),\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Define-the-SimulationModels","page":"Multi-stage Production Cost Simulation","title":"Define the SimulationModels","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"DecisionModels define the problems that are executed in the simulation. The actual problem will change as the stage gets updated to represent different time periods, but the formulations applied to the components is constant within a stage. In this case, we want to define two stages with the ProblemTemplates and the Systems that we've already created.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"models = SimulationModels(;\n decision_models = [\n DecisionModel(template_uc, sys_DA; optimizer = solver, name = \"UC\"),\n DecisionModel(template_ed, sys_RT; optimizer = solver, name = \"ED\"),\n ],\n)","category":"page"},{"location":"tutorials/pcm_simulation/#SimulationSequence","page":"Multi-stage Production Cost Simulation","title":"SimulationSequence","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Similar to an ProblemTemplate, the SimulationSequence provides a template of how to execute a sequential set of operations problems.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Let's review some of the SimulationSequence arguments.","category":"page"},{"location":"tutorials/pcm_simulation/#Chronologies","page":"Multi-stage Production Cost Simulation","title":"Chronologies","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"In PowerSimulations, chronologies define where information is flowing. There are two types of chronologies.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"inter-stage chronologies: Define how information flows between stages. e.g. day-ahead solutions are used to inform economic dispatch problems\nintra-stage chronologies: Define how information flows between multiple executions of a single stage. e.g. the dispatch setpoints of the first period of an economic dispatch problem are constrained by the ramping limits from setpoints in the final period of the previous problem.","category":"page"},{"location":"tutorials/pcm_simulation/#FeedForward","page":"Multi-stage Production Cost Simulation","title":"FeedForward","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"The definition of exactly what information is passed using the defined chronologies is accomplished with FeedForward. Specifically, FeedForward is used to define what to do with information being passed with an inter-stage chronology. Let's define a FeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the unit-commitment variables.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"feedforward = Dict(\n \"ED\" => [\n SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n ),\n ],\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Sequencing","page":"Multi-stage Production Cost Simulation","title":"Sequencing","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"The stage problem length, look-ahead, and other details surrounding the temporal Sequencing of stages are controlled using the structure of the time series data in the Systems. So, to define a typical day-ahead - real-time sequence:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Day ahead problems should represent 48 hours, advancing 24 hours after each execution (24-hour look-ahead)\nReal time problems should represent 1 hour (12 5-minute periods), advancing 15 min after each execution (15 min look-ahead)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"We can adjust the time series data to reflect this structure in each System:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"transform_single_time_series!(sys_DA, 48, Hour(1))\ntransform_single_time_series!(sys_RT, 12, Minute(15))","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Now we can put it all together to define a SimulationSequence","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"DA_RT_sequence = SimulationSequence(;\n models = models,\n ini_cond_chronology = InterProblemChronology(),\n feedforwards = feedforward,\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Simulation","page":"Multi-stage Production Cost Simulation","title":"Simulation","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Now, we can build and execute a simulation using the SimulationSequence and Stages that we've defined.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"path = mkdir(joinpath(\".\", \"rts-store\")) #hide\nsim = Simulation(;\n name = \"rts-test\",\n steps = 2,\n models = models,\n sequence = DA_RT_sequence,\n simulation_folder = joinpath(\".\", \"rts-store\"),\n)","category":"page"},{"location":"tutorials/pcm_simulation/#Build-simulation","page":"Multi-stage Production Cost Simulation","title":"Build simulation","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"build!(sim)","category":"page"},{"location":"tutorials/pcm_simulation/#Execute-simulation","page":"Multi-stage Production Cost Simulation","title":"Execute simulation","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"the following command returns the status of the simulation (0: is proper execution) and stores the results in a set of HDF5 files on disk.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"execute!(sim; enable_progress_bar = false)","category":"page"},{"location":"tutorials/pcm_simulation/#Results","page":"Multi-stage Production Cost Simulation","title":"Results","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"To access the results, we need to load the simulation result metadata and then make requests to the specific data of interest. This allows you to efficiently access the results of interest without overloading resources.","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"results = SimulationResults(sim);\nuc_results = get_decision_problem_results(results, \"UC\"); # UC stage result metadata\ned_results = get_decision_problem_results(results, \"ED\"); # ED stage result metadata","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"We can read all the result variables","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_variables(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"or all the parameters","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_parameters(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"We can just list the variable names contained in uc_results:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"list_variable_names(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"and a number of parameters (this pattern also works for aux_variables, expressions, and duals)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"list_parameter_names(uc_results)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Now we can read the specific results of interest for a specific problem, time window (optional), and set of variables, duals, or parameters (optional)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Dict([\n v => read_variable(uc_results, v) for v in [\n \"ActivePowerVariable__RenewableDispatch\",\n \"ActivePowerVariable__HydroDispatch\",\n \"StopVariable__ThermalStandard\",\n ]\n])","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Or if we want the result of just one variable, parameter, or dual (must be defined in the problem definition), we can use:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_parameter(\n ed_results,\n \"ActivePowerTimeSeriesParameter__RenewableNonDispatch\";\n initial_time = DateTime(\"2020-01-01T06:00:00\"),\n count = 5,\n)","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"info: Info\n","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"note that this returns the results of each execution step in a separate dataframe If you want the realized results (without lookahead periods), you can call read_realized_*:","category":"page"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"read_realized_variables(\n uc_results,\n [\"ActivePowerVariable__ThermalStandard\", \"ActivePowerVariable__RenewableDispatch\"],\n)\nrm(path; force = true, recursive = true) #hide","category":"page"},{"location":"tutorials/pcm_simulation/#Plotting","page":"Multi-stage Production Cost Simulation","title":"Plotting","text":"","category":"section"},{"location":"tutorials/pcm_simulation/","page":"Multi-stage Production Cost Simulation","title":"Multi-stage Production Cost Simulation","text":"Take a look at the plotting capabilities in PowerGraphics.jl","category":"page"},{"location":"modeler_guide/running_a_simulation/#running_a_simulation","page":"Simulation","title":"Simulation","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"tip: Always try to solve the operations problem first before putting together the simulation\nIt is not uncommon that when trying to solve a complex simulation the resulting models are infeasible. This situation can be the result of many factors like the input data, the incorrect specification of the initial conditions for models with time dependencies or a poorly specified model. Therefore, it's highly recommended to run and analyze an Operations Problems that reflect the problems that will be included in a simulation prior to executing a simulation.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Check out the Operations Problem Tutorial","category":"page"},{"location":"modeler_guide/running_a_simulation/#Feedforward","page":"Simulation","title":"Feedforward","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The definition of exactly what information is passed using the defined chronologies is accomplished using FeedForwards.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Specifically, a FeedForward is used to define what to do with information being passed with an inter-stage chronology in a Simulation. The most common FeedForward is the SemiContinuousFeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the (already solved) unit-commitment variables.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The creation of a FeedForward requires at least to specify the component_type on which the FeedForward will be applied. The source variable specify which variable will be taken from the problem solved, for example the commitment variable of the thermal unit in the unit commitment problem. Finally, the affected_values specify which variables will be affected in the problem to be solved, for example the next economic dispatch problem.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The following code specify the creation of semi-continuous range constraints on the ActivePowerVariable based on the solution of the commitment variable OnVariable for all ThermalStandard units.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n)","category":"page"},{"location":"modeler_guide/running_a_simulation/#Chronologies","page":"Simulation","title":"Chronologies","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"In PowerSimulations, chronologies define where information is flowing. There are two types of chronologies.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"inter-stage chronologies: Define how information flows between stages. e.g. day-ahead solutions are used to inform economic dispatch problems\nintra-stage chronologies: Define how information flows between multiple executions of a single stage. e.g. the dispatch setpoints of the first period of an economic dispatch problem are constrained by the ramping limits from setpoints in the final period of the previous problem.","category":"page"},{"location":"modeler_guide/running_a_simulation/#Sequencing","page":"Simulation","title":"Sequencing","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"In a typical simulation pipeline, we want to connect daily (24-hours) day-ahead unit commitment problems, with multiple economic dispatch problems. Usually, our day-ahead unit commitment problem will have an hourly (1-hour) resolution, while the economic dispatch will have a 5-minute resolution.","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Depending on your problem, it is common to use a 2-day look-ahead for unit commitment problems, so in this case, the Day-Ahead problem will have: resolution = Hour(1) with interval = Hour(24) and horizon = Hour(48). In the case of the economic dispatch problem, it is common to use a look-ahead of two hours. Thus, the Real-Time problem will have: resolution = Minute(5), with interval = Minute(5) (we only store the first operating point) and horizon = 24 (24 time steps of 5 minutes are 120 minutes, that is 2 hours).","category":"page"},{"location":"modeler_guide/running_a_simulation/#Simulation-Setup","page":"Simulation","title":"Simulation Setup","text":"","category":"section"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"The following code creates the entire simulation pipeline:","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"# We assume that the templates for UC and ED are ready\n# sys_da has the resolution of 1 hour:\n# with the 24 hours interval and horizon of 48 hours.\n# sys_rt has the resolution of 5 minutes:\n# with a 5-minute interval and horizon of 2 hours (24 time steps)\n\n# Create the UC Decision Model\ndecision_model_uc = DecisionModel(\n template_uc,\n sys_da;\n name = \"UC\",\n optimizer = optimizer_with_attributes(\n Xpress.Optimizer,\n \"MIPRELSTOP\" => 1e-1,\n ),\n)\n\n# Create the ED Decision Model\ndecision_model_ed = DecisionModel(\n template_ed,\n sys_rt;\n name = \"ED\",\n optimizer = optimizer_with_attributes(Xpress.Optimizer),\n)\n\n# Specify the SimulationModels using a Vector of decision_models: UC, ED\nsim_models = SimulationModels(;\n decision_models = [\n decision_model_uc,\n decision_model_ed,\n ],\n)\n\n# Create the FeedForwards:\nsemi_ff = SemiContinuousFeedforward(;\n component_type = ThermalStandard,\n source = OnVariable,\n affected_values = [ActivePowerVariable],\n)\n\n# Specify the sequencing:\nsim_sequence = SimulationSequence(;\n # Specify the vector of decision models: sim_models\n models = sim_models,\n # Specify a Dict of feedforwards on which the FF applies\n # based on the DecisionModel name, in this case \"ED\"\n feedforwards = Dict(\n \"ED\" => [semi_ff],\n ),\n # Specify the chronology, in this case inter-stage\n ini_cond_chronology = InterProblemChronology(),\n)\n\n# Construct the simulation:\nsim = Simulation(;\n name = \"compact_sim\",\n steps = 10, # 10 days\n models = sim_models,\n sequence = sim_sequence,\n # Specify the start_time as a DateTime: e.g. DateTime(\"2020-10-01T00:00:00\")\n initial_time = start_time,\n # Specify a temporary folder to avoid storing logs if not needed\n simulation_folder = mktempdir(; cleanup = true),\n)\n\n# Build the decision models and simulation setup\nbuild!(sim)\n\n# Execute the simulation using the Optimizer specified in each DecisionModel\nexecute!(sim; enable_progress_bar = true)","category":"page"},{"location":"modeler_guide/running_a_simulation/","page":"Simulation","title":"Simulation","text":"Check the PCM tutorial for a more detailed tutorial on executing a simulation in a production cost modeling (PCM) environment.","category":"page"},{"location":"tutorials/adding_new_device_formulation/#Adding-Device-Formulations","page":"Adding Device Formulations","title":"Adding Device Formulations","text":"","category":"section"},{"location":"formulation_library/Feedforward/#ff_formulations","page":"Feedforwards","title":"FeedForward Formulations","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"FeedForwards are the mechanism to define how information is shared between models. Specifically, a FeedForward defines what to do with information passed with an inter-stage chronology in a Simulation. The most common FeedForward is the SemiContinuousFeedForward that affects the semi-continuous range constraints of thermal generators in the economic dispatch problems based on the value of the (already solved) unit-commitment variables.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The creation of a FeedForward requires at least specifying the component_type on which the FeedForward will be applied. The source variable specifies which variable will be taken from the problem solved, for example, the commitment variable of the thermal unit in the unit commitment problem. Finally, the affected_values specify which variables will be affected in the problem to be solved, for example, the next economic dispatch problem.","category":"page"},{"location":"formulation_library/Feedforward/#Table-of-contents","page":"Feedforwards","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"SemiContinuousFeedforward\nFixValueFeedforward\nUpperBoundFeedforward\nLowerBoundFeedforward","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#SemiContinuousFeedforward","page":"Feedforwards","title":"SemiContinuousFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"SemiContinuousFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.SemiContinuousFeedforward","page":"Feedforwards","title":"PowerSimulations.SemiContinuousFeedforward","text":"SemiContinuousFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nIt allows to enable/disable bounds to 0.0 for a specified variable. Commonly used to limit the ActivePowerVariable in an Economic Dispatch problem by the commitment decision taken in an another problem (typically a Unit Commitment problem).\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the semicontinuous limit will be applied using the source values\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No variables are created","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"texton^textth = OnStatusParameter obtained from the source variable, typically the commitment variable of the unit commitment problem u^textth.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes to the objective function.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Adds -texton^textthP^textthmax to the ActivePowerRangeExpressionUB expression and -texton^textthP^textthmin to the ActivePowerRangeExpressionLB expression.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Limits the ActivePowerRangeExpressionUB and ActivePowerRangeExpressionLB by zero as:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textActivePowerRangeExpressionUB_t = p_t^textth - texton_t^textthP^textthmax le 0 quad forall tin 1 dots T \n textActivePowerRangeExpressionLB_t = p_t^textth - texton_t^textthP^textthmin ge 0 quad forall tin 1 dots T \nendalign*","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Thus, if the commitment parameter is zero, the dispatch is limited to zero, forcing to turn off the generator without introducing binary variables in the economic dispatch problem.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#FixValueFeedforward","page":"Feedforwards","title":"FixValueFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"FixValueFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.FixValueFeedforward","page":"Feedforwards","title":"PowerSimulations.FixValueFeedforward","text":"FixValueFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nFixes a Variable or Parameter Value in the model from another problem. Is the only Feed Forward that can be used with a Parameter or a Variable as the affected value.\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the fix value will be applied using the source values\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No variables are created","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The parameter FixValueParameter is used to match the result obtained from the source variable (from the simulation state).","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes to the objective function.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes on expressions.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Set the VariableType from the affected_values to be equal to the source parameter store in FixValueParameter","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textAffectedVariable_t = textSourceVariableParameter_t quad forall t in 1dots T\nendalign*","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#UpperBoundFeedforward","page":"Feedforwards","title":"UpperBoundFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"UpperBoundFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.UpperBoundFeedforward","page":"Feedforwards","title":"PowerSimulations.UpperBoundFeedforward","text":"UpperBoundFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n add_slacks::Bool = false,\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nConstructs a parameterized upper bound constraint to implement feedforward from other models.\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the upper bound will be applied using the source values\nadd_slacks::Bool = false : Add slacks variables to relax the upper bound constraint.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"If slack variables are enabled:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"UpperBoundFeedForwardSlack\nBounds: [0.0, ]\nDefault proportional cost: 1e6\nSymbol: p^textffubsl","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The parameter UpperBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as an upper bound to the affected variable.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The slack variable is added to the objective function using its large default cost + p^textffubsl cdot 10^6","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes on expressions.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Set the VariableType from the affected_values to be lower than the source parameter store in UpperBoundValueParameter.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textAffectedVariable_t - p_t^textffubsl le textSourceVariableParameter_t quad forall t in 1dots T\nendalign*","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"","category":"page"},{"location":"formulation_library/Feedforward/#LowerBoundFeedforward","page":"Feedforwards","title":"LowerBoundFeedforward","text":"","category":"section"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"LowerBoundFeedforward","category":"page"},{"location":"formulation_library/Feedforward/#PowerSimulations.LowerBoundFeedforward","page":"Feedforwards","title":"PowerSimulations.LowerBoundFeedforward","text":"LowerBoundFeedforward(\n component_type::Type{<:PSY.Component},\n source::Type{T},\n affected_values::Vector{DataType},\n add_slacks::Bool = false,\n meta = CONTAINER_KEY_EMPTY_META\n) where {T}\n\nConstructs a parameterized lower bound constraint to implement feedforward from other models.\n\nArguments:\n\ncomponent_type::Type{<:PSY.Component} : Specify the type of component on which the Feedforward will be applied\nsource::Type{T} : Specify the VariableType, ParameterType or AuxVariableType as the source of values for the Feedforward\naffected_values::Vector{DataType} : Specify the variable on which the lower bound will be applied using the source values\nadd_slacks::Bool = false : Add slacks variables to relax the lower bound constraint.\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Variables:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"If slack variables are enabled:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"LowerBoundFeedForwardSlack\nBounds: [0.0, ]\nDefault proportional cost: 1e6\nSymbol: p^textfflbsl","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Parameters:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The parameter LowerBoundValueParameter stores the result obtained from the source variable (from the simulation state) that will be used as a lower bound to the affected variable.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Objective:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"The slack variable is added to the objective function using its large default cost + p^textfflbsl cdot 10^6","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Expressions:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"No changes on expressions.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Constraints:","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"Set the VariableType from the affected_values to be greater than the source parameter store in LowerBoundValueParameter.","category":"page"},{"location":"formulation_library/Feedforward/","page":"Feedforwards","title":"Feedforwards","text":"beginalign*\n textAffectedVariable_t + p_t^textfflbsl ge textSourceVariableParameter_t quad forall t in 1dots T\nendalign*","category":"page"},{"location":"#PowerSimulations.jl","page":"Welcome Page","title":"PowerSimulations.jl","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"CurrentModule = PowerSimulations","category":"page"},{"location":"#Overview","page":"Welcome Page","title":"Overview","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl is a power system operations simulation tool developed as a flexible and open source software for quasi-static power systems simulations including Production Cost Models. PowerSimulations.jl tackles the issues of developing a simulation model in a modular way providing tools for the formulation of decision models and emulation models that can be solved independently or in an interconnected fashion.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl supports the workflows to develop simulations by separating the development of operations models and simulation models.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Operation Models: Optimization model used to find the solution of an operation problem.\nSimulations Models: Defined the requirements to find solutions to a sequence of operation problems in a way that resembles the procedures followed by operators.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"The most common Simulation Model is the solution of a Unit Commitment and Economic Dispatch sequence of problems. This model is used in commercial Production Cost Modeling tools, but it has a limited scope of analysis.","category":"page"},{"location":"#How-the-documentation-is-structured","page":"Welcome Page","title":"How the documentation is structured","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl documentation and code are organized according to the needs of different users depending on their skillset and requirements. In broad terms there are three categories:","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Modeler: Users that want to solve an operations problem or run a simulation using the existing models in PowerSimulations.jl. For instance, answer questions about the change in operation costs in future fuel mixes. Check the formulations library page to choose a modeling strategy that fits your needs.\nModel Developer: Users that want to develop custom models and workflows for the simulation of a power system operation. For instance, study the impacts of an stochastic optimization problem over a deterministic.\nCode Base Developers: Users that want to add new core functionalities or fix bugs in the core capabilities of PowerSimulations.jl.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSimulations.jl is an active project under development, and we welcome your feedback, suggestions, and bug reports.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Note: PowerSimulations.jl uses the data model implemented in PowerSystems.jl to construct optimization models. In most cases, you need to add PowerSystems.jl to your scripts.","category":"page"},{"location":"#Installation","page":"Welcome Page","title":"Installation","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"The latest stable release of PowerSimulations can be installed using the Julia package manager with","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"] add PowerSimulations","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"For the current development version, \"checkout\" this package with","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"] add PowerSimulations#main","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"An appropriate optimization solver is required for running PowerSimulations models. Refer to JuMP.jl solver's page to select the most appropriate for the application of interest.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PowerSystems has been developed as part of the Scalable Integrated Infrastructure Planning (SIIP) initiative at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL).","category":"page"},{"location":"formulation_library/Load/#PowerSystems.ElectricLoad-Formulations","page":"Load","title":"PowerSystems.ElectricLoad Formulations","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Electric load formulations define the optimization models that describe load units (demand) mathematical model in different operational settings, such as economic dispatch and unit commitment.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"note: Note\nThe use of reactive power variables and constraints will depend on the network model used, i.e., whether it uses (or does not use) reactive power. If the network model is purely active power-based, reactive power variables and related constraints are not created.","category":"page"},{"location":"formulation_library/Load/#Table-of-contents","page":"Load","title":"Table of contents","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"StaticPowerLoad\nPowerLoadInterruption\nPowerLoadDispatch\nValid configurations","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"","category":"page"},{"location":"formulation_library/Load/#StaticPowerLoad","page":"Load","title":"StaticPowerLoad","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"StaticPowerLoad","category":"page"},{"location":"formulation_library/Load/#PowerSimulations.StaticPowerLoad","page":"Load","title":"PowerSimulations.StaticPowerLoad","text":"Formulation type to add a time series parameter for non-dispatchable ElectricLoad withdrawals to power balance constraints\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Variables:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"No variables are created","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Uses the max_active_power timeseries parameter to determine the demand value at each time-step","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(ElectricLoad, StaticPowerLoad)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Expressions:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Subtracts the parameters listed above from the respective active and reactive power balance expressions created by the selected Network Formulations.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Constraints:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"No constraints are created","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"","category":"page"},{"location":"formulation_library/Load/#PowerLoadInterruption","page":"Load","title":"PowerLoadInterruption","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"PowerLoadInterruption","category":"page"},{"location":"formulation_library/Load/#PowerSimulations.PowerLoadInterruption","page":"Load","title":"PowerSimulations.PowerLoadInterruption","text":"Formulation type to enable (binary) load interruptions\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Variables:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"ActivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: 0.0\nSymbol: p^textld\nReactivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: 0.0\nSymbol: q^textld\nOnVariable:\nBounds: 01\nDefault initial value: 1\nSymbol: u^textld","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Static Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"P^textldmax = PowerSystems.get_max_active_power(device)\nQ^textldmax = PowerSystems.get_max_reactive_power(device)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(ElectricLoad, PowerLoadInterruption)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Objective:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as p^textld.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Expressions:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Subtractp^textld and q^textld terms and to the respective active and reactive power balance expressions created by the selected Network Formulations","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Constraints:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"beginaligned\n p_t^textld le u_t^textld cdot textActivePowerTimeSeriesParameter_t quad forall t in 1dots T \n q_t^textre = textpf cdot p_t^textre quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"on which textpf = sin(arctan(Q^textldmaxP^textldmax)).","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"","category":"page"},{"location":"formulation_library/Load/#PowerLoadDispatch","page":"Load","title":"PowerLoadDispatch","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"PowerLoadDispatch","category":"page"},{"location":"formulation_library/Load/#PowerSimulations.PowerLoadDispatch","page":"Load","title":"PowerSimulations.PowerLoadDispatch","text":"Formulation type to enable (continuous) load interruption dispatch\n\n\n\n\n\n","category":"type"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Variables:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"ActivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_active_power(device)\nSymbol: p^textld\nReactivePowerVariable:\nBounds: [0.0, ]\nDefault initial value: PowerSystems.get_reactive_power(device)\nSymbol: q^textld","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Static Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"P^textldmax = PowerSystems.get_max_active_power(device)\nQ^textldmax = PowerSystems.get_max_reactive_power(device)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Time Series Parameters:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.get_default_time_series_names(ElectricLoad, PowerLoadDispatch)\ncombo_table = DataFrame(\n \"Parameter\" => map(x -> \"[`$x`](@ref)\", collect(keys(combos))),\n \"Default Time Series Name\" => map(x -> \"`$x`\", collect(values(combos))),\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Objective:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Creates an objective function term based on the FunctionData Options where the quantity term is defined as p^textld.","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Expressions:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Subtractp^textld and q^textld terms and to the respective active and reactive power balance expressions created by the selected Network Formulations","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Constraints:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"beginaligned\n p_t^textld le textActivePowerTimeSeriesParameter_t quad forall t in 1dots T\n q_t^textld = textpf cdot p_t^textld quad forall t in 1dots T\nendaligned","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"on which textpf = sin(arctan(Q^textldmaxP^textldmax)).","category":"page"},{"location":"formulation_library/Load/#Valid-configurations","page":"Load","title":"Valid configurations","text":"","category":"section"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"Valid DeviceModels for subtypes of ElectricLoad include the following:","category":"page"},{"location":"formulation_library/Load/","page":"Load","title":"Load","text":"using PowerSimulations\nusing PowerSystems\nusing DataFrames\nusing Latexify\ncombos = PowerSimulations.generate_device_formulation_combinations()\nfilter!(x -> x[\"device_type\"] <: ElectricLoad, combos)\ncombo_table = DataFrame(\n \"Valid DeviceModel\" =>\n [\"`DeviceModel($(c[\"device_type\"]), $(c[\"formulation\"]))`\" for c in combos],\n \"Device Type\" => [\n \"[$(c[\"device_type\"])](https://nrel-Sienna.github.io/PowerSystems.jl/stable/model_library/generated_$(c[\"device_type\"])/)\"\n for c in combos\n ],\n \"Formulation\" => [\"[$(c[\"formulation\"])](@ref)\" for c in combos],\n)\nmdtable(combo_table; latex = false)","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/#Extending-Source-Code-Functionalities","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"","category":"section"},{"location":"code_base_developer_guide/extending_powersimulations/#Enable-other-recorder-events","page":"Extending Source Code Functionalities","title":"Enable other recorder events","text":"","category":"section"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"Other types of recorder events can be enabled with a possible performance impact. To do this pass in the specific recorder names to be enabled when you call build.","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"sim = Simulation(...)\nrecorders = [:execution]\nbuild!(sim; recorders = recorders)\nexecute!(sim)","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"Now we can examine InitialConditionUpdateEvents for specific steps and stages.","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"show_simulation_events(\n PSI.InitialConditionUpdateEvent,\n \"./output/aggregation/1\",\n x -> x.initial_condition_type == \"DeviceStatus\";\n step = 2,\n stage = 1\n)\n┌─────────────────────────────┬─────────────────────┬────────────────────────┬─────────────────┬─────────────┬─────┬──────────────┐\n│ name │ simulation_time │ initial_condition_type │ device_type │ device_name │ val │ stage_number │\n├─────────────────────────────┼─────────────────────┼────────────────────────┼─────────────────┼─────────────┼─────┼──────────────┤\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Solitude │ 0.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Park City │ 1.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Alta │ 1.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Brighton │ 1.0 │ 1 │\n│ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Sundance │ 0.0 │ 1 │\n└─────────────────────────────┴─────────────────────┴────────────────────────┴─────────────────┴─────────────┴─────┴──────────────┘","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/#Show-the-wall-time-with-your-events","page":"Extending Source Code Functionalities","title":"Show the wall time with your events","text":"","category":"section"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"Sometimes you might want to see how the events line up with the wall time.","category":"page"},{"location":"code_base_developer_guide/extending_powersimulations/","page":"Extending Source Code Functionalities","title":"Extending Source Code Functionalities","text":"show_simulation_events(\n PSI.InitialConditionUpdateEvent,\n \"./output/aggregation/1\",\n x -> x.initial_condition_type == \"DeviceStatus\";\n step = 2,\n stage = 1,\n wall_time = true\n)\n┌─────────────────────────┬─────────────────────────────┬─────────────────────┬────────────────────────┬─────────────────┬─────────────┬─────┬──────────────┐\n│ timestamp │ name │ simulation_time │ initial_condition_type │ device_type │ device_name │ val │ stage_number │\n├─────────────────────────┼─────────────────────────────┼─────────────────────┼────────────────────────┼─────────────────┼─────────────┼─────┼──────────────┤\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Solitude │ 0.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Park City │ 1.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Alta │ 1.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Brighton │ 1.0 │ 1 │\n│ 2020-04-07T15:08:32.711 │ InitialConditionUpdateEvent │ 2024-01-02T00:00:00 │ DeviceStatus │ ThermalStandard │ Sundance │ 0.0 │ 1 │\n└─────────────────────────┴─────────────────────────────┴─────────────────────┴────────────────────────┴─────────────────┴─────────────┴─────┴──────────────┘","category":"page"}] } diff --git a/dev/tutorials/adding_new_device_formulation/index.html b/dev/tutorials/adding_new_device_formulation/index.html index 211c5fa42..ba1d5cf7d 100644 --- a/dev/tutorials/adding_new_device_formulation/index.html +++ b/dev/tutorials/adding_new_device_formulation/index.html @@ -1,2 +1,2 @@ -Adding Device Formulations · PowerSimulations.jl +Adding Device Formulations · PowerSimulations.jl diff --git a/dev/tutorials/adding_new_problem_model/index.html b/dev/tutorials/adding_new_problem_model/index.html index dd2639ee4..800a3d728 100644 --- a/dev/tutorials/adding_new_problem_model/index.html +++ b/dev/tutorials/adding_new_problem_model/index.html @@ -73,4 +73,4 @@ end return -end +end diff --git a/dev/tutorials/basics_of_developing_models/index.html b/dev/tutorials/basics_of_developing_models/index.html index 8842b479b..f1fb5a16d 100644 --- a/dev/tutorials/basics_of_developing_models/index.html +++ b/dev/tutorials/basics_of_developing_models/index.html @@ -1,2 +1,2 @@ -Basics of Developing Operation Models · PowerSimulations.jl
+Basics of Developing Operation Models · PowerSimulations.jl
diff --git a/dev/tutorials/decision_problem/index.html b/dev/tutorials/decision_problem/index.html index 756b94c78..21929aea5 100644 --- a/dev/tutorials/decision_problem/index.html +++ b/dev/tutorials/decision_problem/index.html @@ -313,10 +313,10 @@

PowerSimulations Problem Auxiliary variables Results - TimeDurationOff__ThermalStandard + TimeDurationOn__ThermalStandard - TimeDurationOn__ThermalStandard + TimeDurationOff__ThermalStandard HydroEnergyOutput__HydroDispatch @@ -327,15 +327,15 @@

PowerSimulations Problem Expressions Results - - ProductionCostExpression__HydroDispatch - ActivePowerBalance__System ProductionCostExpression__RenewableDispatch + + ProductionCostExpression__HydroDispatch + ProductionCostExpression__ThermalStandard @@ -349,28 +349,28 @@

ActivePowerTimeSeriesParameter__HydroDispatch - ActivePowerTimeSeriesParameter__PowerLoad + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R1 - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3 + ActivePowerTimeSeriesParameter__PowerLoad - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2 + ActivePowerTimeSeriesParameter__RenewableNonDispatch - ActivePowerTimeSeriesParameter__RenewableDispatch + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R1 + ActivePowerTimeSeriesParameter__RenewableDispatch - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up + RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down - ActivePowerTimeSeriesParameter__RenewableNonDispatch + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2 - RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3 @@ -382,41 +382,41 @@

ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R1 - ActivePowerVariable__RenewableDispatch + StopVariable__ThermalStandard - ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down + ActivePowerReserveVariable__VariableReserve__ReserveUp__Reg_Up - ActivePowerVariable__HydroDispatch + ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R2 - ActivePowerReserveVariable__VariableReserve__ReserveUp__Reg_Up + ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down - ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R2 + StartVariable__ThermalStandard - ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3 + ActivePowerVariable__ThermalStandard - StartVariable__ThermalStandard + ActivePowerVariable__HydroDispatch - OnVariable__ThermalStandard + ActivePowerVariable__RenewableDispatch - StopVariable__ThermalStandard + ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3 - ActivePowerVariable__ThermalStandard + OnVariable__ThermalStandard -

Optimizer Stats

The optimizer summary is included

get_optimizer_stats(res)
1×21 DataFrame
Rowdetailed_statsobjective_valuetermination_statusprimal_statusdual_statussolver_solve_timeresult_counthas_valueshas_dualsobjective_boundrelative_gapdual_objective_valuesolve_timebarrier_iterationssimplex_iterationsnode_counttimed_solve_timetimed_calculate_aux_variablestimed_calculate_dual_variablessolve_bytes_allocsec_in_gc
BoolFloat64Int64Int64Int64Float64Int64BoolBoolMissingMissingMissingFloat64MissingMissingMissingFloat64Float64Float64Float64Float64
1false2.3571e6110NaN1falsefalsemissingmissingmissing0.625256missingmissingmissing0.6921340.4592760.0004088332.41018e70.0

Objective Function Value

get_objective_value(res)
2.357099085649291e6

Variable, Parameter, Auxillary Variable, Dual, and Expression Values

The solution value data frames for variables, parameters, auxillary variables, duals and expressions can be accessed using the read_ methods:

read_variables(res)
Dict{String, DataFrames.DataFrame} with 11 entries:
-  "ActivePowerReserveVaria… => 24×52 DataFrame…
+

Optimizer Stats

The optimizer summary is included

get_optimizer_stats(res)
1×21 DataFrame
Rowdetailed_statsobjective_valuetermination_statusprimal_statusdual_statussolver_solve_timeresult_counthas_valueshas_dualsobjective_boundrelative_gapdual_objective_valuesolve_timebarrier_iterationssimplex_iterationsnode_counttimed_solve_timetimed_calculate_aux_variablestimed_calculate_dual_variablessolve_bytes_allocsec_in_gc
BoolFloat64Int64Int64Int64Float64Int64BoolBoolMissingMissingMissingFloat64MissingMissingMissingFloat64Float64Float64Float64Float64
1false2.3571e6110NaN1falsefalsemissingmissingmissing0.613904missingmissingmissing0.6784060.4382980.0004104142.41018e70.0

Objective Function Value

get_objective_value(res)
2.357099085649291e6

Variable, Parameter, Auxillary Variable, Dual, and Expression Values

The solution value data frames for variables, parameters, auxillary variables, duals and expressions can be accessed using the read_ methods:

read_variables(res)
Dict{String, DataFrames.DataFrame} with 11 entries:
   "ActivePowerReserveVaria… => 24×52 DataFrame…
   "StopVariable__ThermalSt… => 24×55 DataFrame…
+  "ActivePowerReserveVaria… => 24×52 DataFrame…
   "OnVariable__ThermalStan… => 24×55 DataFrame…
   "ActivePowerVariable__Hy… => 24×2 DataFrame…
   "ActivePowerReserveVaria… => 24×19 DataFrame…
@@ -425,4 +425,4 @@ 

"ActivePowerVariable__Re… => 24×30 DataFrame… "ActivePowerReserveVaria… => 24×18 DataFrame… "ActivePowerReserveVaria… => 24×17 DataFrame

Or, you can read a single parameter values for parameters that exist in the results.

list_parameter_names(res)
-read_parameter(res, "ActivePowerTimeSeriesParameter__RenewableDispatch")
RowDateTime122_WIND_1324_PV_3312_PV_1102_PV_1101_PV_1324_PV_2313_PV_2104_PV_1101_PV_2309_WIND_1310_PV_2113_PV_1317_WIND_1314_PV_1324_PV_1103_PV_1303_WIND_1314_PV_2102_PV_2314_PV_3320_PV_1101_PV_3319_PV_1314_PV_4310_PV_1215_PV_1313_PV_1101_PV_4119_PV_1
DateTimeFloat64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
12020-01-01T00:00:00713.20.00.00.00.00.00.00.00.0142.80.00.0795.10.00.00.0480.80.00.00.00.00.00.00.00.00.00.00.00.0
22020-01-01T01:00:00712.80.00.00.00.00.00.00.00.0139.10.00.0794.40.00.00.0634.90.00.00.00.00.00.00.00.00.00.00.00.0
32020-01-01T02:00:00708.40.00.00.00.00.00.00.00.0145.30.00.0773.60.00.00.0487.30.00.00.00.00.00.00.00.00.00.00.00.0
42020-01-01T03:00:00710.70.00.00.00.00.00.00.00.0144.80.00.0767.30.00.00.0432.70.00.00.00.00.00.00.00.00.00.00.00.0
52020-01-01T04:00:00701.40.00.00.00.00.00.00.00.0137.10.00.0752.20.00.00.0407.90.00.00.00.00.00.00.00.00.00.00.00.0
62020-01-01T05:00:00682.50.00.00.00.00.00.00.00.098.60.00.0719.40.00.00.0440.20.00.00.00.00.00.00.00.00.00.00.00.0
72020-01-01T06:00:00614.70.00.00.00.00.00.00.00.062.20.00.0655.30.00.00.0377.30.00.00.00.00.00.00.00.00.00.00.00.0
82020-01-01T07:00:00517.736.452.230.629.636.462.229.830.447.338.299.4594.647.444.829.8199.346.630.063.847.830.6179.246.438.2127.662.228.827.2
92020-01-01T08:00:00426.663.497.436.834.863.496.035.037.048.961.4126.2579.161.265.258.4110.667.036.4100.061.437.4248.067.061.4164.695.635.456.6
102020-01-01T09:00:00274.271.2118.038.036.471.4117.636.638.230.766.8133.2466.869.068.076.63.669.837.6121.869.838.8273.469.866.8172.2116.835.874.8
112020-01-01T10:00:0093.072.2132.037.836.472.2130.836.638.027.470.2134.2301.470.270.289.82.472.237.4129.070.438.6277.872.270.4173.2128.437.488.2
122020-01-01T11:00:006.370.6135.237.035.070.6134.235.437.260.969.8135.2110.767.070.298.056.272.436.6128.667.237.6263.272.469.6170.0133.238.691.6
132020-01-01T12:00:003.867.4131.036.235.467.4129.635.636.420.467.8133.078.967.268.294.091.570.235.8128.267.437.0267.470.267.6169.0128.837.890.6
142020-01-01T13:00:001.165.2125.435.235.065.2123.635.435.41.667.2126.6107.967.065.881.4103.067.634.8119.667.035.8258.867.667.0161.8122.835.879.2
152020-01-01T14:00:000.060.2109.631.031.060.4108.031.431.20.063.2110.222.359.462.659.439.764.230.8107.059.431.6227.864.262.8143.2106.831.459.0
162020-01-01T15:00:000.042.069.020.219.242.065.620.620.22.645.062.824.642.444.825.487.746.220.065.843.420.6151.646.243.882.262.820.427.8
172020-01-01T16:00:000.90.00.00.00.00.00.00.00.037.90.00.010.80.00.00.092.30.00.00.00.00.00.00.00.00.00.00.00.0
182020-01-01T17:00:00276.30.00.00.00.00.00.00.00.046.90.00.0243.20.00.00.089.40.00.00.00.00.00.00.00.00.00.00.00.0
192020-01-01T18:00:00272.90.00.00.00.00.00.00.00.024.00.00.0375.20.00.00.090.40.00.00.00.00.00.00.00.00.00.00.00.0
202020-01-01T19:00:00345.60.00.00.00.00.00.00.00.024.00.00.0568.40.00.00.081.10.00.00.00.00.00.00.00.00.00.00.00.0
212020-01-01T20:00:00411.70.00.00.00.00.00.00.00.027.40.00.0636.10.00.00.0172.90.00.00.00.00.00.00.00.00.00.00.00.0
222020-01-01T21:00:00376.60.00.00.00.00.00.00.00.06.50.00.0719.20.00.00.0326.90.00.00.00.00.00.00.00.00.00.00.00.0
232020-01-01T22:00:00561.30.00.00.00.00.00.00.00.01.30.00.0734.90.00.00.0256.70.00.00.00.00.00.00.00.00.00.00.00.0
242020-01-01T23:00:00568.40.00.00.00.00.00.00.00.00.10.00.0729.10.00.00.0141.10.00.00.00.00.00.00.00.00.00.00.00.0

Plotting

Take a look at the plotting capabilities in PowerGraphics.jl

+read_parameter(res, "ActivePowerTimeSeriesParameter__RenewableDispatch")
24×30 DataFrame
RowDateTime122_WIND_1324_PV_3312_PV_1102_PV_1101_PV_1324_PV_2313_PV_2104_PV_1101_PV_2309_WIND_1310_PV_2113_PV_1317_WIND_1314_PV_1324_PV_1103_PV_1303_WIND_1314_PV_2102_PV_2314_PV_3320_PV_1101_PV_3319_PV_1314_PV_4310_PV_1215_PV_1313_PV_1101_PV_4119_PV_1
DateTimeFloat64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64
12020-01-01T00:00:00713.20.00.00.00.00.00.00.00.0142.80.00.0795.10.00.00.0480.80.00.00.00.00.00.00.00.00.00.00.00.0
22020-01-01T01:00:00712.80.00.00.00.00.00.00.00.0139.10.00.0794.40.00.00.0634.90.00.00.00.00.00.00.00.00.00.00.00.0
32020-01-01T02:00:00708.40.00.00.00.00.00.00.00.0145.30.00.0773.60.00.00.0487.30.00.00.00.00.00.00.00.00.00.00.00.0
42020-01-01T03:00:00710.70.00.00.00.00.00.00.00.0144.80.00.0767.30.00.00.0432.70.00.00.00.00.00.00.00.00.00.00.00.0
52020-01-01T04:00:00701.40.00.00.00.00.00.00.00.0137.10.00.0752.20.00.00.0407.90.00.00.00.00.00.00.00.00.00.00.00.0
62020-01-01T05:00:00682.50.00.00.00.00.00.00.00.098.60.00.0719.40.00.00.0440.20.00.00.00.00.00.00.00.00.00.00.00.0
72020-01-01T06:00:00614.70.00.00.00.00.00.00.00.062.20.00.0655.30.00.00.0377.30.00.00.00.00.00.00.00.00.00.00.00.0
82020-01-01T07:00:00517.736.452.230.629.636.462.229.830.447.338.299.4594.647.444.829.8199.346.630.063.847.830.6179.246.438.2127.662.228.827.2
92020-01-01T08:00:00426.663.497.436.834.863.496.035.037.048.961.4126.2579.161.265.258.4110.667.036.4100.061.437.4248.067.061.4164.695.635.456.6
102020-01-01T09:00:00274.271.2118.038.036.471.4117.636.638.230.766.8133.2466.869.068.076.63.669.837.6121.869.838.8273.469.866.8172.2116.835.874.8
112020-01-01T10:00:0093.072.2132.037.836.472.2130.836.638.027.470.2134.2301.470.270.289.82.472.237.4129.070.438.6277.872.270.4173.2128.437.488.2
122020-01-01T11:00:006.370.6135.237.035.070.6134.235.437.260.969.8135.2110.767.070.298.056.272.436.6128.667.237.6263.272.469.6170.0133.238.691.6
132020-01-01T12:00:003.867.4131.036.235.467.4129.635.636.420.467.8133.078.967.268.294.091.570.235.8128.267.437.0267.470.267.6169.0128.837.890.6
142020-01-01T13:00:001.165.2125.435.235.065.2123.635.435.41.667.2126.6107.967.065.881.4103.067.634.8119.667.035.8258.867.667.0161.8122.835.879.2
152020-01-01T14:00:000.060.2109.631.031.060.4108.031.431.20.063.2110.222.359.462.659.439.764.230.8107.059.431.6227.864.262.8143.2106.831.459.0
162020-01-01T15:00:000.042.069.020.219.242.065.620.620.22.645.062.824.642.444.825.487.746.220.065.843.420.6151.646.243.882.262.820.427.8
172020-01-01T16:00:000.90.00.00.00.00.00.00.00.037.90.00.010.80.00.00.092.30.00.00.00.00.00.00.00.00.00.00.00.0
182020-01-01T17:00:00276.30.00.00.00.00.00.00.00.046.90.00.0243.20.00.00.089.40.00.00.00.00.00.00.00.00.00.00.00.0
192020-01-01T18:00:00272.90.00.00.00.00.00.00.00.024.00.00.0375.20.00.00.090.40.00.00.00.00.00.00.00.00.00.00.00.0
202020-01-01T19:00:00345.60.00.00.00.00.00.00.00.024.00.00.0568.40.00.00.081.10.00.00.00.00.00.00.00.00.00.00.00.0
212020-01-01T20:00:00411.70.00.00.00.00.00.00.00.027.40.00.0636.10.00.00.0172.90.00.00.00.00.00.00.00.00.00.00.00.0
222020-01-01T21:00:00376.60.00.00.00.00.00.00.00.06.50.00.0719.20.00.00.0326.90.00.00.00.00.00.00.00.00.00.00.00.0
232020-01-01T22:00:00561.30.00.00.00.00.00.00.00.01.30.00.0734.90.00.00.0256.70.00.00.00.00.00.00.00.00.00.00.00.0
242020-01-01T23:00:00568.40.00.00.00.00.00.00.00.00.10.00.0729.10.00.00.0141.10.00.00.00.00.00.00.00.00.00.00.00.0

Plotting

Take a look at the plotting capabilities in PowerGraphics.jl

diff --git a/dev/tutorials/pcm_simulation/index.html b/dev/tutorials/pcm_simulation/index.html index acbcf0ff7..bbbbaa7e0 100644 --- a/dev/tutorials/pcm_simulation/index.html +++ b/dev/tutorials/pcm_simulation/index.html @@ -876,10 +876,10 @@

ActivePowerBalance__System - ActivePowerBalance__ACBus + ProductionCostExpression__RenewableDispatch - ProductionCostExpression__RenewableDispatch + ActivePowerBalance__ACBus ProductionCostExpression__ThermalStandard @@ -894,28 +894,28 @@

OnStatusParameter__ThermalStandard - ActivePowerTimeSeriesParameter__PowerLoad + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R1 - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3 + ActivePowerTimeSeriesParameter__PowerLoad - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2 + ActivePowerTimeSeriesParameter__RenewableNonDispatch - ActivePowerTimeSeriesParameter__RenewableDispatch + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R1 + ActivePowerTimeSeriesParameter__RenewableDispatch - RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up + RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down - ActivePowerTimeSeriesParameter__RenewableNonDispatch + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2 - RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down + RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3 @@ -924,65 +924,65 @@

ED Problem Variables Results - ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R1 + FlowActivePowerVariable__TapTransformer - HVDCFlowDirectionVariable__TwoTerminalHVDCLine + ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R1 - ActivePowerVariable__RenewableDispatch + ActivePowerReserveVariable__VariableReserve__ReserveUp__Reg_Up - ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down + ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R2 - FlowActivePowerVariable__TapTransformer + ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down - SystemBalanceSlackUp__System + HVDCFlowDirectionVariable__TwoTerminalHVDCLine - ActivePowerReserveVariable__VariableReserve__ReserveUp__Reg_Up + SystemBalanceSlackDown__System - ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R2 + ActivePowerVariable__ThermalStandard - FlowActivePowerVariable__Line + SystemBalanceSlackUp__System - ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3 + FlowActivePowerToFromVariable__TwoTerminalHVDCLine - SystemBalanceSlackDown__System + ActivePowerVariable__RenewableDispatch - FlowActivePowerToFromVariable__TwoTerminalHVDCLine + HVDCLosses__TwoTerminalHVDCLine - HVDCLosses__TwoTerminalHVDCLine + FlowActivePowerFromToVariable__TwoTerminalHVDCLine - ActivePowerVariable__ThermalStandard + ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3 - FlowActivePowerFromToVariable__TwoTerminalHVDCLine + FlowActivePowerVariable__Line

We can read all the result variables

read_variables(uc_results)
Dict{String, SortedDict{Any, Any, Base.Order.ForwardOrdering}} with 15 entries:
   "ActivePowerReserveVaria… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×5…
   "FlowActivePowerToFromVa… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×2…
-  "ActivePowerReserveVaria… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×5…
   "StopVariable__ThermalSt… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×5…
+  "ActivePowerReserveVaria… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×5…
   "OnVariable__ThermalStan… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×5…
   "ActivePowerVariable__Hy… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×2…
   "ActivePowerReserveVaria… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×1…
   "StartVariable__ThermalS… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×5…
   "ActivePowerVariable__Th… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×5…
   "ActivePowerVariable__Re… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×3…
-  "ActivePowerReserveVaria… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×1…
   "FlowActivePowerFromToVa… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×2…
+  "ActivePowerReserveVaria… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×1…
   "HVDCLosses__TwoTerminal… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×2…
   "ActivePowerReserveVaria… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×1…
   "HVDCFlowDirectionVariab… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×2

or all the parameters

read_parameters(uc_results)
Dict{String, SortedDict{Any, Any, Base.Order.ForwardOrdering}} with 9 entries:
@@ -996,29 +996,29 @@ 

48×2… "RequirementTimeSeriesPa… => SortedDict(DateTime("2020-01-01T00:00:00")=>48×2

We can just list the variable names contained in uc_results:

list_variable_names(uc_results)
15-element Vector{String}:
  "ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R1"
- "HVDCFlowDirectionVariable__TwoTerminalHVDCLine"
- "ActivePowerVariable__RenewableDispatch"
- "ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down"
- "ActivePowerVariable__HydroDispatch"
+ "StopVariable__ThermalStandard"
  "ActivePowerReserveVariable__VariableReserve__ReserveUp__Reg_Up"
  "ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R2"
- "ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3"
- "FlowActivePowerToFromVariable__TwoTerminalHVDCLine"
+ "ActivePowerReserveVariable__VariableReserve__ReserveDown__Reg_Down"
+ "HVDCFlowDirectionVariable__TwoTerminalHVDCLine"
  "StartVariable__ThermalStandard"
- "HVDCLosses__TwoTerminalHVDCLine"
- "OnVariable__ThermalStandard"
- "StopVariable__ThermalStandard"
  "ActivePowerVariable__ThermalStandard"
- "FlowActivePowerFromToVariable__TwoTerminalHVDCLine"

and a number of parameters (this pattern also works for aux_variables, expressions, and duals)

list_parameter_names(uc_results)
9-element Vector{String}:
+ "ActivePowerVariable__HydroDispatch"
+ "FlowActivePowerToFromVariable__TwoTerminalHVDCLine"
+ "ActivePowerVariable__RenewableDispatch"
+ "HVDCLosses__TwoTerminalHVDCLine"
+ "FlowActivePowerFromToVariable__TwoTerminalHVDCLine"
+ "ActivePowerReserveVariable__VariableReserve__ReserveUp__Spin_Up_R3"
+ "OnVariable__ThermalStandard"

and a number of parameters (this pattern also works for aux_variables, expressions, and duals)

list_parameter_names(uc_results)
9-element Vector{String}:
  "ActivePowerTimeSeriesParameter__HydroDispatch"
- "ActivePowerTimeSeriesParameter__PowerLoad"
- "RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3"
- "RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2"
- "ActivePowerTimeSeriesParameter__RenewableDispatch"
  "RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R1"
- "RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up"
+ "ActivePowerTimeSeriesParameter__PowerLoad"
  "ActivePowerTimeSeriesParameter__RenewableNonDispatch"
- "RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down"

Now we can read the specific results of interest for a specific problem, time window (optional), and set of variables, duals, or parameters (optional)

Dict([
+ "RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Reg_Up"
+ "ActivePowerTimeSeriesParameter__RenewableDispatch"
+ "RequirementTimeSeriesParameter__VariableReserve__ReserveDown__Reg_Down"
+ "RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R2"
+ "RequirementTimeSeriesParameter__VariableReserve__ReserveUp__Spin_Up_R3"

Now we can read the specific results of interest for a specific problem, time window (optional), and set of variables, duals, or parameters (optional)

Dict([
     v => read_variable(uc_results, v) for v in [
         "ActivePowerVariable__RenewableDispatch",
         "ActivePowerVariable__HydroDispatch",
@@ -1040,4 +1040,4 @@ 

12×32 DataFrame…

note that this returns the results of each execution step in a separate dataframe If you want the realized results (without lookahead periods), you can call read_realized_*:

read_realized_variables(
     uc_results,
     ["ActivePowerVariable__ThermalStandard", "ActivePowerVariable__RenewableDispatch"],
-)

Plotting

Take a look at the plotting capabilities in PowerGraphics.jl

+)

Plotting

Take a look at the plotting capabilities in PowerGraphics.jl