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
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
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
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
DecisionModel{M}(
template::ProblemTemplate,
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::ProblemTemplate: 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::Int = UNSET_HORIZON: Manually specify the length of the forecast Horizon
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.
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.
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.
EmulationModel{M}(
template::ProblemTemplate,
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::ProblemTemplate: 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.
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.
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.
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.
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.
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. Refer to export_results for a description of this argument.