住宅电池管理Matlab工具(RBMT)
住宅电池管理Matlab工具(RBMT)
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
1 简介
Behind the meter battery energy storage systems are attracting more customers due to their ability to achieve a profitable energy arbitrage in the presence of heat-pumps, electric vehicles (EV) and solar photovoltaics (PV) with time of use tariffs. From the distribution system operator’s perspective, these units can be utilized to support the network, especially with the rapid deployment of microgeneration and the electrification of transportation and heat. This code contains three different management strategies for the residential behind the meter battery energy storage systems (BESS) to maximize the customer’s profitability and enhance the network performance. The three algorithms are briefly explained as:
1- Conventional Rule-Based Algorithm (CRBA): This is the conventional method of (dis)charging the BESS according to upper and lower thresholds that maximizes the customers profitability only through maximizing the PV self-consumption.
2- Proposed Day-Ahead Scheduling Algorithm (PDSA): This is an optimization-based algorithm aims to optimize the electricity bill and load variance using the WORHP solver. Optimizing the load variance supports the network through flattening the household net profile.
3- Proposed Rule-Based Algorithm (PRBA): This is a rule-based algorithm that does not require any optimizer however, it optimizes the electricity bill and load variance according to a set of inputs. This tool can be used to generate the power dispatch of residential batteries (with any specifications) to minimize the household’s electricity bill for any time series data (single day to multiple years) with any temporal resolution. The outputs of the RBMT are:
1. The net household demand with and without the battery.
2. Electricity bill with and without the battery.
3. Battery power dispatch.
4. Battery state of charge.
5. Battery degradation.
6. Household’s voltage.
7. Household’s losses.
8. PV self-consumption
9. Self-sufficiency
10. Exported energy 11. Curtailed energy Two plots are developed after the program converges:
1) the net demand with the battery state of charge;
2) the battery degradation.
2 部分代码
% ===================================================== %
clc; close all; clear;
tic;
warning(’off’)
format long g
global RE T D EV PV EX PRP BESSU tau gf TD BESSRR k BESSDD XX BESSP SOCG BESS SOCMIN SOCMAX
%% Main Inputs
SaveR=0; %if 1=save results in excel files, other values=don’t save : (saving results will reduce excution time)
Prog=1; %1 for the conventional rule-based method (CRBA), 2 for the proposed day-ahead scheduling (PDSA), 3 for the proposed rule-based algorithm (PRBA)
DataRes=10; %Data resolution 10 for 10 minutes reso, 30 for 30 minutes reso, 60 for 60 minutes(1 hour) reso and so on...
%% Call Data
Profile=readmatrix(’Inputs.csv’); % Insert the simulation data as explained in the Inputs.csv file
T=length(Profile(:,1));
ND=round((DataRes/60)*(T/24)); %Number of days
TD=T/ND; %Length of one day
D=Profile(:,1); %Demand
PV=Profile(:,2);
EV=Profile(:,3);
tau=TD/(24); % {Time interval=1/tau}
PE=24; %end time of peak
%% BESS Inputs
BESS=9.8; %Actual BESS Capacity
DOD=0.8; %BESS DOD
SOCMAX=1; %Max SoC
BESSP=5; %BESS Power
RE=0.95*0.95; %= 0.95(BESS) * 0.95(Inverter)
SOCMIN=SOCMAX-DOD; %Min SoC
BESSU=BESS*DOD; %Usable BESS Capacity
SOCI=SOCMIN; %Initial SOC that the simulations will start with.
%% Utility Inputs - Tariffs are in pence/kWh or cent/kWh
EXP=3.68; %Export Power Limit =3.68kW
SC=20; % Standing tariff p/day
HR=17.19; %Day Rate 8am-1am
LR=9.59; % Night Rate 1am-8am
TLS=1; %Night rate start time
TLE=8; %Night Rate end time
EX=5; %Export Tariff = 5p/kWh
TPR=[HR LR LR LR LR LR LR LR HR HR HR HR HR HR HR HR HR HR HR HR HR HR HR HR];%Tariff Profile
PRP = repelem(TPR,tau);
%% Network Inputs for the voltage calculations %% Voltage / Load variance / Losses before BESS
VT=240; %Transformer Voltage
PF=0.95; % Power Factor
R=0.240979; %Resistance from transformer bus to the household
X=0.0030569; %Reactance from the transformer bus to the household
%% Program 1 Inputs: Conventional Rule-based Algorithm (CRBA)
PTHD=0; % Specify the Upper threshold for BESS Discharge
PTHC=-0; % Specify the Lower threshold for BESS Charge
PCN=0.1; %Percentage of the BESS capacity to charge at night with low tariff (The ToU Tariff data is being used), set it to 0 if you don’t want to use this option.
ETOC=5; % End overnight charging time (in hours); Default=0 if you don’t want to charge the battery overnight
DIA=1; %= 1: if you want the algorithm to start discharging after the end of low tariff period, =0: to discharge whenever the demand exceeds the generation at any time of the day
PCN=PCN*ones(1,ND);
% PCN=[0.5, 0.1]; %Use this option of you want to add different values at
% each day, insert values according to the number of the days for your data.
%% Program 3 Inputs: Proposed Rule-based Algorithm (PRBA)
EVS=3.8; % EV charger in kW
AVGD=10.3; %average daily consumption in kWh
Season=1; % 1 for High PV season - Summer, 0 for Low PV season - Winter
PTHDn=0; %Normal upper threshold
EVA=3.5;%Average Cahrging hours of the EV
EVC=1;%Electric Vehicle charging next day ? yes:1 , No:0
FPV=9.8; %Forecasted PV daily generation in day ahead
PVS=7; %start time of PV
PVe=18; %end time of PV
PVL=(PVe-PVS); %Number of hours of PV generation period
EVA=ones(1,ND)*EVA;EVC=ones(1,ND)*EVC;FPV=ones(1,ND)*FPV; PVL=ones(1,ND)*PVL;PVS=ones(1,ND)*PVS*tau;PVe=ones(1,ND)*PVe*tau;
%% Extra part to extract the value of EVC, EVA, and FPV automatically From the data
% Also, it captures the start and end time and the number
% of hours forthe PV instead of inserting them manually and the season.
% x=0;FPV=zeros(1,ND);EVC=zeros(1,ND);PVS=zeros(1,ND);PVe=zeros(1,ND);PVL=zeros(1,ND);EVA=zeros(1,ND);
% for i=1:ND
% FPV(i)=sum(PV(1+TD*x:TD*i))/tau;
% if sum(EV(1+TD*x:TD*i))>0
% EVC(i)=1;
% elseif sum(EV(1+TD*x:TD*i))==0
% EVC(i)=2;
% end
% v=find(PV(1+TD*x:TD*i)>0);
% PVS(i)=min(v); %Start time of PV
% PVe(i)=max(v); %End time of PV
% PVL(i)=(PVe(i)-PVS(i));
% vE=((EV(1+TD*x:TD*i)>0));
% EVA(i)=round(sum(vE)/tau,1);% Number of charging hours EV
% if i<4320
% Season=0;
% elseif i>=5760 && i <12960
% Season=1;
% elseif i>=12960
% Season=0;
% end
% x=x+1;
% end
%%
MAINCODE
3 仿真结果
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
-
2023年血糖新标准公布,不是3.9-6.1,快来看看你的血糖正常吗? 2023-02-07
-
2023年各省最新电价一览!8省中午执行谷段电价! 2023-01-03
-
GB 55009-2021《燃气工程项目规范》(含条文说明),2022年1月1日起实施 2021-11-07
-
PPT导出高分辨率图片的四种方法 2022-09-22
-
2023年最新!国家电网27家省级电力公司负责人大盘点 2023-03-14
-
全国消防救援总队主官及简历(2023.2) 2023-02-10
-
盘点 l 中国石油大庆油田现任领导班子 2023-02-28
-
我们的前辈!历届全国工程勘察设计大师完整名单! 2022-11-18
-
关于某送变电公司“4·22”人身死亡事故的快报 2022-04-26
