Multi-period scheduling API
The multi-period OPF example calculates a battery schedule with energy balances between intervals. It explains the time-step weights and returned quantities. The battery and EV guides describe the device parameters.
PowerOptLab.solve_multiperiod_opf — Function
solve_multiperiod_opf(nets, devices; kwargs...) -> MultiperiodResultCo-optimise a sequence of network snapshots nets (one BMOPFTools net dict per period, in chronological order) with a set of storage/EV devices whose state of charge couples the periods. The snapshots share one JuMP model and one objective (the sum of each snapshot's generation cost); the devices arbitrage across time subject to their power, energy, efficiency, and terminal/departure constraints.
Per-period economics come from the snapshots themselves — e.g. a time-varying slack import price set via each net's voltage_source cost, or differing loads.
Arguments
nets::Vector—Tnetwork dicts (parse_bmopfoutput), one per period.devices::Vector—AbstractDeviceinstances implementing the validation/stamp/link/extract lifecycle. Built-in storage and EV devices require their bus/terminals to exist in every snapshot.
Keywords
dt_h=1.0— uniform period duration in hours (compatibility shorthand).time_grid=nothing— passTimeGrid([Δt₁, Δt₂, ...])for nonuniform durations. When supplied it takes precedence overdt_h.per_unit=true,s_base=1e6— engine unit handling (results are SI regardless).optimizer=Ipopt.Optimizer,verbose=false,solver_options=()— solver control.configure! = identity— callback on the empty JuMP model before optimizer attachment, e.g.MathOptComplements.Bridges.add_all_bridgesfor CCOpt.
Bidirectional PE devices default to an explicitly approximate normalized product relaxation. Exact mode exclusion uses operation=:complementarity and a suitable backend. Published status does not certify exact complementarity or global optimality. Inspect dispatch[id].diagnostics in physical units.
Returns
A MultiperiodResult with the per-period solutions and each device's SI charge/discharge/SOC trajectory.
PowerOptLab.MultiperiodResult — Type
MultiperiodResultResult of solve_multiperiod_opf.
Fields
termination_status::String— JuMP status of the single shared solve.objective::Float64— optimal objective value.snapshots::Vector{Dict{String,Any}}— the per-period BMOPFTools result dict (SI), one per input net, in order.dispatch::Dict{String,NamedTuple}— per device id, SI trajectories over the horizon:p_charge,p_discharge,p_net(discharge positive),q(each lengthT), andsoc(lengthT+1, energy in Wh at each step boundary,soc[1]= initial).energy_whis the explicit energy name (socis retained for compatibility). PE devices also report phase P/Q, conductor currents, operating-mode metadata and independent physical residuals indiagnostics.solve::SolveStatus— exact normalized status and publication decision.