👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
能源管理系统(EMS)有助于优化微电网中分布式能源(DER)的使用,特别是在涉及可变定价和发电时。本文使用预测定价和负荷条件来优化存储/销售来自电网规模电池系统的能量。演示了两种方法:启发式状态机策略和基于线性程序的优化方法。
📚2 运行结果
for i = 1:numSim
if i <= numOffset*numel(pvDataSet)
heuristicCost(end+1) = out(i).logsout{1}.Values.Data(end);
else
optCost(end+1)= out(i).logsout{1}.Values.Data(end);
end
end
histogram(heuristicCost); hold on;
histogram(optCost);
legend('Heuristic','Optimization');
xlabel('Cost per Day ($)'); hold off;
部分代码:
function [Pgrid,Pbatt,Ebatt] = battSolarOptimize(N,dt,Ppv,Pload,Einit,Cost,FinalWeight,batteryMinMax)
% Minimize the cost of power from the grid while meeting load with power
% from PV, battery and grid
prob = optimproblem;
% Decision variables
PgridV = optimvar('PgridV',N);
PbattV = optimvar('PbattV',N,'LowerBound',batteryMinMax.Pmin,'UpperBound',batteryMinMax.Pmax);
EbattV = optimvar('EbattV',N,'LowerBound',batteryMinMax.Emin,'UpperBound',batteryMinMax.Emax);
% Minimize cost of electricity from the grid
prob.ObjectiveSense = 'minimize';
prob.Objective = dt*Cost'*PgridV - FinalWeight*EbattV(N);
% Power input/output to battery
prob.Constraints.energyBalance = optimconstr(N);
prob.Constraints.energyBalance(1) = EbattV(1) == Einit;
prob.Constraints.energyBalance(2:N) = EbattV(2:N) == EbattV(1:N-1) - PbattV(1:N-1)*dt;
% Satisfy power load with power from PV, grid and battery
prob.Constraints.loadBalance = Ppv + PgridV + PbattV == Pload;
% Solve the linear program
options = optimoptions(prob.optimoptions,'Display','none');
[values,~,exitflag] = solve(prob,'Options',options);
% Parse optmization results
if exitflag <= 0
Pgrid = zeros(N,1);
Pbatt = zeros(N,1);
Ebatt = zeros(N,1);
else
Pgrid = values.PgridV;
Pbatt = values.PbattV;
Ebatt = values.EbattV;
end
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]Jonathan LeSage (2023). Microgrid Energy Management System (EMS) using Optimization.