Multiperiod OPF, inventory control, and storage

Multiperiod OPF, inventory control, and storage
Josh Taylor
Section 4.1 in Convex Optimization of Power Systems
1
Basic storage modeling
Parameters:
• Energy capacity, C̄ > 0
• Power capacity, T̄ > 0
• Leakage, 0 ≤ α ≤ 1
• Injection and extraction losses, 0 ≤ ηin ≤ 1, ηout ≥ 1
Variables:
• State of charge, S t
t
t
(Energy: E t = ∆U t )
, Uout
• Grid side power in/out, Uin
Model:
• Dynamics:
t
t
S t+1 = αS t + ηin Uin
+ ηout Uout
• Constraints:
0 ≤ S t ≤ C̄,
t
0 ≤ Uin
≤ T̄ ,
t
−T̄ ≤ Uout
≤0
• Apparent power limit instead of real power limit:
t
t
(Uin
+ Uout
)2 + Qt2 ≤ T̄ 2
• Injection extraction complementarity:
t
t
Uin
Uout
=0
1
ECE1094H
Multiperiod OPF, inventory control, and storage
JAT
Smarter way - disjunctive constraint:
t
0 ≤ Uin
≤ σ T̄ ,
t
−T̄ (1 − σ) ≤ Uout
≤ 0,
σ ∈ {0, 1}
Opinion - allow simultaneous injection/extraction. When would this happen? Negative nodal price.
What can we do with this?
• Convex optimization: MP-OPF, trajectory
• Dynamic programming: Inventory control, policy
• Also: LQR, state-space control
2
Multiperiod optimal power flow
• Optimal power flow is solved every 5 minutes (real-time dispatch) or
faster
• Storage is a dynamic constraint between time periods
• Storage couples constraints across periods
SDP relaxation version:
X
min
fit (Pit )
t
t
t
P ,Q ,V
s.t.
i,t
Pijt
+ jQtij = (Wiit − Wijt )yij∗
X
t
t
Pit + jQti = Ui,in
+ Ui,out
+
Pijt + jQtij
j
P ti ≤ Pit ≤
Qti ≤ Qti ≤
t
Pi
t
Qi
t2
t
V t2
i ≤ Wii ≤ V i
t2
Pijt2 + Qt2
ij ≤ S ij
Wt 0
Page 2 of 6
ECE1094H
Multiperiod OPF, inventory control, and storage
JAT
Storage constraints:
Linear
t
t
S t+1 = αSit + ηi,in Ui,in
+ ηi,out Ui,out
Linear
0 ≤ Sit ≤ Ci
Linear
t
0 ≤ Ui,in
≤ T̄i ,
Convex quadratic
t
−T̄i ≤ Ui,out
≤ 0,
or
2
t
t
(Ui,in
+ Ui,out
)2 + Qt2
i ≤ Ti
Additional dynamics:
• Ramp constraints: |Pit+1 − Pit | ≤ R̄i
• Rate of change-based costs: fit (Pit , Pit+1 )
What does this capture?
• Reactive power support
• Load-shifting
2.1
Load-shifting
Intuition: simple example
• Power generated over two time periods: P 1 + P 2 = D
• Cost: a(P 1 )2 + a(P 2 )2 + b(P 1 + P 2 )
• Optimum: P 1 = P 2 = D/2
• In general, flatter load yields more efficient generation.
• Also accommodates resource availability - remember duck curve
Draw picture of load shifting
Multiperiod OPF gives us
• Optimal load shifting and reactive power support
• Does not capture: stability (regulation), power balancing (reserves) require uncertainty modeling
Page 3 of 6
ECE1094H
3
Multiperiod OPF, inventory control, and storage
JAT
Dynamic programming
Discrete-time dynamic system:
xt+1 = ft (xt , ut , dt ),
t = 0, ..., N
(switch to subscript t)
Cost/value function that’s additive over time:
"
#
N
−1
X
J0 (x0 ) = min E gN (xN ) +
gt (xt , ut , dt )
u∈U
t=0
Components:
State: xt
Control: ut
Random input: dt
Dynamics: ft
Stage cost: gt
A policy: ut = σt (xt ) - an instruction for any state.
• More flexible than trajectories (MOPF), valid under uncertainty
• Harder to obtain
• DP is a general formalism
Cost/value function from k onwards:
"
Jk (xk ) =
min
uk ,...,uN −1 ∈U
E gN (xN ) +
N
−1
X
#
gt (xt , ut , dt )
t=k
• Principle of optimality: Tail policy is optimal for the tail problem.
• First solve N − 1, then N − 2, so on. – less work than solving all at once.
(Informally) observe:
Jk (xk ) = min E [gk (xk , uk , dk ) + Jk+1 (fk (xk , uk , dk )]
uk ∈U
Page 4 of 6
ECE1094H
Multiperiod OPF, inventory control, and storage
JAT
• The DP recursion
• Since we solve for uk for all xk , it is a policy uk = σk (xk ).
DP:
• Very general, but often intractable
• Often leads to analytical insights when they exist
• Popular starting point for computational approximations
4
DP for a single storage
Simplifications
• Neglect inject/extract inefficiencies (leakage ok)
• No power (ramp) constraints
Recall model:
St+1 = αSt + Ut ,
0 ≤ St ≤ C̄
Uncertainty:
• Dt - random (possibly non-Gaussian) energy, e.g. power imbalance
• Assume Ut chosen before Dt known
• Dt limited by capacity.
Augmented (nonlinear!) dynamics:
St+1 = [αSt + Ut + Dt ]C̄0 = max{min{αSt + Ut + Dt , C̄}, 0}.
DP recursion
Jk (Sk ) =
min
Uk : 0≤αSk +Uk ≤C̄
h
i
C̄
E gk (Sk , Uk , Dk ) + Jk+1 [αSk + Uk + Dk ]0
What is the cost?
P
• Arbitrage: t λt Ut , λt is price. Same as load-shifting, why?
C̄−αSt −Ut • Spillover: Dt − [Dt ]−αSt −Ut ... explain.
Page 5 of 6
ECE1094H
Multiperiod OPF, inventory control, and storage
JAT
Solution trick: 1-to-1 substitution.
Yt ←→ αSt + Ut
DP becomes:
Jk (Sk ) =
min
Yk : 0≤Yk ≤C̄
i
h
C̄−Yk C̄
E λk (Yk − αSk ) + Dk − [Dk ]−Yk + Jk+1 [Yk + Dk ]0
State only appears in one place, rewrite:
i
h
C̄−Yk C̄
Jk (Sk ) = −λk αSk + min E λk Yk + Dk − [Dk ]−Yk + Jk+1 [Yk + Dk ]0
Yk : 0≤Yk ≤C̄
Observe: minimization doesn’t depend on Sk . Define:
h
i
C̄−Yk C̄
Gk (Yk ) = E λk Yk + Dk − [Dk ]−Yk + Jk+1 [Yk + Dk ]0
Zk = argminGk (Yk )
Yk
Then
Jk (Sk ) = −λk αSk + Gk (Zk )
Optimal policy: reverse substitution:
Uk∗ = σ(Sk ) = Zk − αSk
Properties:
• Optimal policy is affine in state: setpoint interpretation
• Optimal value fn. in each period affine - can solve backwards for Z with
no enumeration over Sk :
• Heuristic basis for more detailed models
Same structure as classic inventory control
• A store/warehouse buys inventory (Uk )
• Random demand each day (Dk )
• Limited storage capacity (0 ≤ Sk ≤ C̄)
• Unsold inventory, Sk , is stored (dynamics).
Page 6 of 6