I want to optimize a charging schedule for Battery Electric Vehicles (BEV) along a grid line, taking into account customer wishes (when to be done with charging with what State of Charge (SOC)) and other loads like households. So the goal is to load the BEV -- if possible meet the customer's wishes -- and assure that the grid is not overloaded.
I will first try to explain some background. The actual question is at the end.
I use python and pyomo as an optimization framework, as a solver I use glpk.
That's what a generic grid line with 4 nodes looks like:
Here is, what my formulation looks like:
Symbols
Indices
Symbol | Meaning |
---|---|
$n$ | node |
$t$ | timestep |
$l$ | line |
Sets
Symbol | Meaning |
---|---|
$\mathcal{N}$ | set of all nodes |
$\mathcal{N}_\mathrm{BEV}$ | set of nodes with attached charger |
$\mathcal{T}$ | set of all timesteps |
$\mathcal{L}$ | set of all lines |
Decision Variables
Symbol | Meaning |
---|---|
$I^\mathrm{BEV}_{t,n}$ | BEV charging current |
$SOC_{t,n}$ | BEV SOC |
Parameters
Symbol | Meaning |
---|---|
$I^\mathrm{HH}_{t,n}$ | household current |
$Z_l$ | line impedance |
$u_0$ | voltage at transformer low voltage side |
$u_n$ | voltage at node $n$ |
$u_\mathrm{min}$ | minimum permitted voltage |
$i_\mathrm{max}$ | maximum permitted current |
$P_\mathrm{trafo}$ | transformer power |
$E_n$ | BEV battery capacity |
$\Delta t$ | lenght of timestep |
$\Delta SOC_\mathrm{max}$ | maximum tolerable SOC difference |
Target Function:
Maximize the charging current for each node at each timestep $$ \mathrm{max.}\quad\sum_{t\in\mathcal{T}}\bigg(\sum_{n\in\mathcal{% N_\mathrm{BEV}}}\!\!\!\Big( I^\mathrm{BEV}_{t,n} \Big) \bigg) $$
Constraints
Don't fall below permitted voltage $$u_0-\sum_{l\in\mathcal{L}}\bigg( Z_l\cdot\sum_{\substack{% n\in\mathcal{N} \\ n>l}}\Big( I^\mathrm{BEV}_{t,n}+% I^\mathrm{HH}_{t,n} \Big) \bigg)\geq u_\mathrm{min}\quad \forall t \in\mathcal{T}$$
Don't exceed permitted current $i_\mathrm{max}=P_\mathrm{trafo}/u_0$ $$\sum_{n\in\mathcal{N}}\Big( I^\mathrm{BEV}_{t,n}+% I^\mathrm{HH}_{t,n} \Big)\leq i_\mathrm{max}\quad \forall t\in\mathcal{T}$$
Ensure energy conservation while charging $$SOC_{t,n}+\frac{I^\mathrm{BEV}_{t,n}\cdot u_n\cdot\Delta t}{% E_{n}}\cdot 100\%=SOC_{t+1,n}\quad\forall t\in\mathcal{T}\quad\forall n\in\mathcal{% N_\mathrm{BEV}}$$
Ensure equal SOCs after charging $$\frac{SOC_{t_\mathrm{end},n}-SOC^\mathrm{start}_n}{SOC^\mathrm{target}_n-% SOC^\mathrm{start}_n}-\frac{SOC_{t_\mathrm{end},n-1}-SOC^\mathrm{start}% _{n-1}}{SOC^\mathrm{target}_{n-1}-SOC^\mathrm{start}_{n-1}}\leq\Delta SOC_\mathrm{max}\quad\forall n\in\mathcal{N}_\mathrm{BEV}$$
Results
Let's consider the following scenario: a gridline with 6 nodes, 2 charging stations (11kW each, one at the first and one at the last node). The household currents are just taken from some standard load profile. Both BEVs arrive at 15pm with 20% SOC and wish to finish charging at 20pm with 100% SOC. The transformer is only 15kVA, thus not enough to allow both BEVs to concurrently charge at nominal power.
Now when I start the optimizer without the equal-SOCs-constraint activated, I get the following result:
The optimizer clearly favors the BEV at node 6, which is not fair.
Now when I activate the equal-SOCs-constraint ($\Delta SOC_\mathrm{max}=0$) and rerun, I get the following result:
Okay, both end up with the same SOC, that's nice. But the optimizer switches the chargers on and off all the time -- that's annoying and also not good for the batteries I guess.
Finally, my Question
Is there any other way to formulate the equal-SOCs-constraint, to achieve a smooth loading? E.g. something like (sorry for my bad drawing):