再生可能エネルギーによる電力供給最適化モデル
🇯🇵🇬🇧
Optimization Model of Electrical Energy Supply System by Renewable Energy
This document introduces a simple example of energy management systems by mathematical programminng. We consider the power supply model utilizing renewable energy as depicted below. The optimal facility sizing and operation is derived by the linear programming.
https://scrapbox.io/files/67c1cd306363ee3f972d5107.png
ESS: Energy storage system
図 電気エネルギーの流れ / Fig. Electrical power flow.
使用する変数・定数 / Variables and Constants
まず,ここで使用する変数や定数を下にまとめる。$ (i)が付いているものは時間帯や季節(月)数の分だけ変数を持つベクトルであることを示す。ここでは,1日を$ Nの時間帯に分けるが,簡単のため季節や月による変化等を考慮しない。よって,$ i=1,2,\cdots,Nである。 The variables and constants are listed below. The variable/constant with$ (i)implies that it is a vector with a value for each time range, month, and season. Here, a day is divided into $ N time ranges, but seasonal/monthly variations are ignored to simplify the model. Namely, $ i=1,2,\cdots,N.
$ P_{cb} kW : 契約電力の大きさ / Contract power
$ P_{cp} kW : 太陽光発電の設備容量(定格発電量)/ Rated power of solar generator $ P_{cw} kW : 風力発電の設備容量(定格発電量)/ Rated power of wind generator $ Q_{c} kWh :蓄電装置の設備容量(定格貯蔵量)/ Rated capacity of ESS $ C_{p} 円/kW : 太陽光の単位容量あたり設備コスト / Equipment cost of solar per kW
$ C_{w} 円/kW : 風力の単位容量あたり設備コスト / Equipment cost of wind per kW
$ C_{q} 円/kWh : 蓄電装置の単位容量あたり設備コスト / Equipment cost of ESS per kWh
$ P_{b}(i) kWh/h : 電力会社から購入する電力量(1時間平均)/ Purchased energy from the grid (1h average)
$ P_{s}(i) kWh/h : 電力会社に売る電力量(1時間平均)/ Sold energy to the grid (1h average)
$ C_{e}(i) 円/kWh : 電力会社の買電料金 / / Electricity buying charge per kWh
$ C_{es}(i) 円/kWh : 電力会社の売電料金 / Electricity selling charge per kWh
$ P_{d}(i) kWh/h : 電力需要(1時間平均)/ Power demand (1h average)
$ P_{p}(i) kWh/h : 太陽光で発電した電力量(1時間平均)/ Energy generated by solar (1h average)
$ P_{w}(i) kWh/h : 風力で発電した電力量(1時間平均)/ Energy generated by wind (1h average)
$ P_{i}(i) kWh/h : 蓄電装置に充電された電力量(1時間平均)/ Charged energy to ESS (1h average)
$ P_{o}(i) kWh/h : 蓄電装置が放電した電力量(1時間平均)/ Discharged energy from ESS (1h average)
$ Q(i) kWh : 蓄電装置が蓄えている電力量 / Stored energy in ESS
$ \kappa_{p}(i) : 太陽光発電の時間帯ごとの出力を定格で割った比(天候や設置条件に依存した定数)/ Fraction of solar output power divided by rated power
$ \kappa_{w}(i) : 風力発電の時間帯ごとの出力を定格で割った比(天候や設置条件に依存した定数)/ Fraction of wind output power divided by rated power
$ \alpha : 1時間後の蓄電装置残量比 / Remained amount of ESS stored energy 1 hour after (considering self-discharging)
$ \gamma : 蓄電装置充放電時の最大Cレート / Maximum C rate in ESS charging/discharging
$ \eta : 蓄電装置充放電用コンバータ効率 / ESS power converte efficiency
$ N : 1日の時間帯数 / Number of time range per day
$ T=24/N h : 1時間帯分の時間 / Hours in a time range
$ Y year : 使用年数 / Number of expected year to use
$ I_{\max}円 : 初期投資額の上限 / Limit of initial investment
ここでは,時間帯により電気料金が異なることを想定している。なお,kWh/hという単位は,1つの時間帯の電力量を$ Tで割って1時間あたりにしたものを意味し,実質的には平均電力と同じである。
It is assumed here that the electricity charge may differ in each time range. The unit kWh/h is the energy divided by $ Tthat is equivalent to the average power.
制約条件式 / Equations of Constraints
需要と供給のエネルギーバランス / Energy Balance between Demand and Supply
電力の供給量は需要量以上でなくてはならない。左辺を供給,右辺を需要として,次式の関係が得られる。なお,本来は等式であるべきだが,等式より不等式の方が拘束が緩く,問題として解きやすいのであえてこうしている。(以下同様)
The supply energy is the same as or larger than the demand. The left and right side of the following equation is the supply and demand, respectively. Physically, they should be equal, but it is formulated as inequality constraints for relaxation (the same hereinafter).
$ P_{b}(i) - P_{s}(i) + P_{p}(i) + P_{w}(i) - P_{i}(i) + P_{o}(i) \geq P_{d}(i)
再生可能エネルギー / Renewable Energy Sources
太陽光の発電量に関しては,設備量,則ち定格出力に対して時間帯ごとに日射量や設置条件から予め決められた割合$ \kappa_{p}(i)で発電するものとする。$ \kappa_{p}(i)は1より小さい定数で,昼間は大きく,夜には0となるであろう。このとき,次式の関係が得られる。
About the amount of electricity generated by solar power, the amount of electricity generated shall be a predetermined percentage $ \kappa_{p}(i) of the rated output for each time period, based on the amount of solar radiation and installation conditions. $ \kappa_{p}(i) is a constant that is less than 1, and it will be large during the day and 0 at night. At this time, the following relationship is obtained.
$ P_{p}(i) \leq \kappa_{p}(i) P_{cp}\\
風力の発電量に関しても,設備量,則ち定格出力に対して時間帯ごとに風況や設置条件から予め決められた割合$ \kappa_{w}(i)で発電するものとする。$ \kappa_{w}(i)は1より小さい定数である。このとき,次式の関係が得られる。
Concerning the amount of electricity generated by wind power, the amount of equipment, or the rated output, shall generate electricity at a predetermined rate $ \kappa_{w}(i) for each time period, based on wind conditions and installation conditions. $ \kappa_{w}(i) is a constant that is less than 1. At this time, the following relationship is obtained.
$ P_{w}(i) \leq \kappa_{w}(i) P_{cw}
蓄電装置 / Energy Storage System
蓄電装置の貯蔵量は,設備容量を超えてはならない。
The stored energy in ESS must not be higher than its rated capacity.
$ Q(i) \leq Q_{c}
蓄電装置の貯蔵量を1日単位で周期的とし,自己放電と充放電効率を考慮すると,入出力との間には次式の関係がある。これは,充放電電力を積分したものが貯蔵量であるという関係を,後退オイラー法で離散化した式に相当する。
The following equation for the relation between input/output energy and stored energy is derived by assuming the 1-day periodic operation in the stored energy, the self-discharge and charging/discharging efficiency.
$ Q(i) \leq \alpha^{T} Q(i-1)+T\{\eta P_{i}(i) - \frac{1}{\eta} P_{o}(i)\}
ここでは1日単位での周期的な運用を仮定しているため,上式において$ i=1のときに$ Q(N)=Q(0)とする。また,自己放電は十分に緩やかと仮定し,$ \alpha^{T}を$ T時間での残存エネルギーの割合とする。
Since 1-day periodic operation is assumed here, $ Q(N)=Q(0)is satisfied. The ratio of the remaining amount of stored energy in $ T hours is $ \alpha^{T} when the self-discharge is assumed to be slow.
蓄電装置は過度に急速な充放電は不可能であり,入出力エネルギーには容量に比例した大きさの上限があり,Cレートを使って記述できる。充電と放電の最大Cレートは$ \gammaで同じとする。
Since ESS cannot accept extremely rapid charging/discharging, $ P_{i}(i) and $ P_{o}(i) have the limit proportional to the rated capacity. The proportional coefficient is $ \gamma called "C rate." The same C rate for charging and discharging is assumed.
$ P_{i}(i) \leq \gamma Q_{c}
$ P_{o}(i) \leq \gamma Q_{c}
売電量の制約 / Constraints in Selling Electricity
売電量は,再生可能エネルギー発電量を超えないものとする。この制約を付けないと,大量の蓄電装置を購入して,電気料金の安い夜に電気を大量に買って,昼に電力会社に大量の電力を売る,という状況が発生する場合がある。
Selling power is not larger than the renewable power. This constraint prevents to introduce too much ESS to buy cheap electricity at night and sell it in the day time with expensive charge.
$ P_{s}(i) \leq P_{p}(i) + P_{w}(i)
また,契約電力 $ P_{pc} 以上の売買電もできないものとする。これを追加しないと,大量の再生可能エネルギー装置を用意して,それを大量に電力会社に売るような解が出る。
The power larger than $ P_{pc} cannot be bought/sold. These constraints prevent to introduce too much renewable energy and selling the generated power to the grid.
$ P_{b}(i) \leq P_{cb}
$ P_{s}(i) \leq P_{cb}
初期投資額の制約 / Constraints in Initial Investment
最初の手持ちの資金に制限がある場合,それを超えた投資ができないとする。
If the initial capital is limited, the investment is not larger than it.
$ C_{p}P_{cp} + C_{w}P_{cw} + C_{q}Q_{c} \leq I_{\max}
変数そのものの非負制約 / Non-negative Constraints of All Variables
全変数は非負である。
All variables are non-negative.
$ (全変数/\mathrm{All\ variables}) \geq 0
目的関数 / Objective Function
全設備を$ Y年間使用するとし,設備コスト(太陽光,風力,蓄電装置は$ Y年間の最初に買い取るとした時の購入代金)と$ Y年間の運用コスト($ Y年間の電気料金)の和を最小化する。目的関数は次式の通りとなる。年間の平均コストは $ E / Y で求められる。
The investment cost to buy solar, wind, and ESS and the variable cost to buy electricity minus the price to sell electricity is minimized when all the equipment is bought initially and used for $ Y years. The objective function is formulated as the following equation.
$ E=\underbrace{C_{p}P_{cp} + C_{w}P_{cw} + C_{q}Q_{c}}_{設備コスト/\mathrm{Equipment\ cost}} + \underbrace{ T \cdot 365 \cdot Y\cdot\sum_{i=1}^{N} \left\{ C_{e}(i) P_{b}(i) - C_{es}(i)P_{s}(i) \right\}}_{運用コスト/\mathrm{Operational\ cost}}
ただし,日本は超低金利が続いていたため,今と$ Y年後の貨幣価値が金利によって変わることは考慮しない。考慮する場合は資本回収係数が用いられる。 We do not consider that the monetary value of money now and in $ Y years' time will change depending on interest rates. The capital recovery factor is used to consider it.
なお,売電単価が買電単価よりも高い場合,$ P_{b}(i)-P_{s}(i) さえ同じなら $ P_{b}(i), P_{s}(i) の値自体は何でもよいため,買電と売電とを同時にして儲けようとしてしまう(実際は売電の上限に引っかかる)。非負変数を使うとこのような表現になってしまうのだが,買電と売電は同じ配電線によって合計して$ P_{b}(i)-P_{s}(i)分だけなされるため,物理的にはナンセンスである。 このため,$ P_{b}(i), P_{s}(i)はどちらかが 0 であるべきであり,例えば$ P_{b}(i)P_{s}(i)=0の制約を入れるなどしてそれを防いだ方が良い。ただし,この式は非線形であるため,非線形最適化問題となり,途端にシンプレックス法で解けなくなってしまう。 If the unit price of electricity sold is higher than the unit price of electricity purchased, then as long as $ P_{b}(i)-P_{s}(i) is the same, the values of $ P_{b}(i)and $ P_{s}(i) themselves can be anything, so the user will try to make a profit by selling and buying electricity at the same time (in reality, this will hit the upper limit for selling electricity). Using non-negative variables leads to an expression like this, but because electricity purchased and sold are added together via the same power distribution line, and only $ P_{b}(i)-P_{s}(i) is done, it is physically nonsensical.
For this reason, either $ P_{b}(i)or $ P_{s}(i) should be 0, and it is better to prevent this by, for example, adding a constraint such as $ P_{b}(i)P_{s}(i)=0. However, because this equation is nonlinear, it becomes a nonlinear optimization problem, and suddenly becomes impossible to solve using the simplex method.
Excelソルバーの利用 / Utilization of the Excel Solver
著作権は放棄しませんが,ご自由にお使い下さい。
The xlsx file to solve the problem at $ N=4 by the solver equipped in Excel can be downloaded for your reference. We do not waive copyright, but please feel free to use it as you wish.
2023/06/09 Opening
2025/03/02 Tentative version in English