DC OPF Setup

The E4ST.jl DC OPF is set up as a cost minimization problem. Costs are added to the objective function and benefits are subtracted. setupdcopf!() adds VOM, Fuel Cost, FOM, Capex, and Curtialment Cost to the objective function. Other terms can be added to the objective in Modifications before the model is optimized. A dictionary of the terms added to the objective function can be found in data[:objvars].

Constraints and expressions can also be defined outside of setup_dcopf!() before the model is optimized. This will also be done in Modifications.

Get Model Variable Function

These functions get or use model variables. To get the value after optimizing the model they must be wrapped in value.().

E4ST.get_pgen_busFunction
get_pgen_bus(data, model, bus_idx, year_idx, hour_idx)

Returns total power generation for a bus at a time * To use this to retieve the variable values after the model has been optimized, wrap the function with value() like this: value.(getpgenbus).

source
E4ST.get_pflow_busFunction
get_pflow_bus(data, model, f_bus_idx, year_idx, hour_idx)

Returns net power flow out of the bus

  • To use this to retieve the variable values after the model has been optimized, wrap the function with value() like this: value.(getpflowbus).
source
E4ST.get_pflow_branchFunction
get_pflow_branch(data, model, branch_idx, year_idx, hour_idx)

Return total power flow on a branch.

  • If branchidxsigned is positive then positive power flow is in the direction fbus -> tbus listed in the branch table. It is measuring the power flow out of f_bus.
  • If branchidxsigned is negative then positive power flow is in the opposite direction, tbus -> fbus listed in the branch table. It is measuring the power flow out of t_bus.
  • To use this to retieve the variable values after the model has been optimized, wrap the function with value() like this: value.(getpflowbranch).
source

Constriant/Expression Info Function

These functions are used in defining the model constraints.

Missing docstring.

Missing docstring for get_pgen_max. Check Documenter's build log for details.

E4ST.get_egen_genFunction
get_egen_gen(data, model, gen_idx)

Returns the total energy generation from a gen summed over all rep time.

get_egen_gen(data, model, gen_idx, year_idx)

Returns the total energy generation from a gen summed over rep time for the given year.

get_egen_gen(data, model, gen_idx, year_idx, hour_idx)

Returns the total energy generation from a gen for the given year and hour. This is pgengen multiplied by the number of hours spent at that representative hour. See [`gethour_weight`](@ref)

  • To use this to retieve the variable values after the model has been optimized, wrap the function with value() like this: value.(get_egen_gen(args...)).
source

Model Mutation Functions

These functions are used to modify the model, specifically creating and adding terms to the objective expression. The Term abstract type is used to determine how the term (cost or benefit) should be added to the objective function.

E4ST.TermType
abstract type Term

Abstract type Term is used to add variables (terms) to the objective function or other functions. Subtypes include PerMWhGen, PerMWCap, and PerMWhCurtailed.

source
Missing docstring.

Missing docstring for PerMWhGen. Check Documenter's build log for details.

Missing docstring.

Missing docstring for PerMWCap. Check Documenter's build log for details.

Missing docstring.

Missing docstring for PerMWhCurtailed. Check Documenter's build log for details.

Missing docstring.

Missing docstring for PerMWCapInv. Check Documenter's build log for details.

E4ST.add_obj_term!Function
add_obj_term!(data, model, ::Term, s::Symbol; oper)

Adds or subtracts cost/revenue s to the objective function of the model based on the operator oper. Adds the cost/revenue to the objective variables list in data.

source
E4ST.add_obj_exp!Function
function add_obj_exp!(data, model, term::Term, s::Symbol; oper)

Adds expression s (already defined in model) to the objective expression model[:obj]. Adds the name, oper, and type of the term to data[:obj_vars].

source