目錄
1.課題概述
2.系統(tǒng)仿真結(jié)果
3.核心程序與模型
4.系統(tǒng)原理簡介
4.1遺傳算法基本原理
4.2 混合發(fā)電系統(tǒng)優(yōu)化配置問題
4.3 基于GA的優(yōu)化配置算法
染色體編碼
初始種群生成
適應(yīng)度函數(shù)
選擇操作
交叉操作
變異操作
5.完整工程文件
1.課題概述
? ? ? 基于GA遺傳優(yōu)化的混合發(fā)電系統(tǒng)優(yōu)化配置算法,優(yōu)化風(fēng)力發(fā)電,光伏發(fā)電以及蓄電池發(fā)電。
2.系統(tǒng)仿真結(jié)果
3.核心程序與模型
版本:MATLAB2022a
...................................................................................
[Apv,Aw,Cb,CT,LPSP,Pdump,Pdeficit,SOC,Iteration,BestJ,Bfi]=GASolveHybirdSystemSize(WindDataPV,SolarDataPVR,LoadDataPV,Apv_max,Aw_max,Cb_max);
Apv,Aw,Cb,CT,LPSP
figure(1);
plot(Iteration,BestJ);
xlabel('Number of generations');ylabel('Total cost($)');
grid on;
figure(2);
plot(Iteration,Bfi);
xlabel('Number of generations');ylabel('Best F');
grid on;
i=1:1:8760;
figure(3);
subplot(311);
plot(i,LoadDataPV,'r');
xlabel('Time(h)');ylabel('Load data(kW) ');
grid on;
subplot(312);
func_plot_phist(LoadDataPV,50);
xlabel('Load data(kW)');
ylabel('Percent(%)');
title('原數(shù)據(jù)概論圖');
subplot(313);
func_plot_phist2(LoadDataPV,50);
xlabel('Load data(kW)');
ylabel('Percent(%)');
title('去掉兩端極值后概論圖');
figure(4);
subplot(311);
plot(i,WindDataPV,'y');
xlabel('Time(h)');ylabel('Wind speed(m/s)');
grid on;
subplot(312);
func_plot_phist(WindDataPV,50);
xlabel('Wind speed(m/s)');
ylabel('Percent(%)');
title('原數(shù)據(jù)概論圖');
subplot(313);
func_plot_phist2(WindDataPV,50);
xlabel('Wind speed(m/s)');
ylabel('Percent(%)');
title('去掉兩端極值后概論圖');
figure(5);
subplot(311);
plot(i,SolarDataPVR,'g');
xlabel('Time(h)');ylabel('Hourly solar irradiation(kWh/m2)');
grid on;
subplot(312);
func_plot_phist(SolarDataPVR,50);
xlabel('Hourly solar irradiation(kWh/m2)');
ylabel('Percent(%)');
title('原數(shù)據(jù)概論圖');
subplot(313);
func_plot_phist2(SolarDataPVR,50);
xlabel('Hourly solar irradiation(kWh/m2)');
ylabel('Percent(%)');
title('去掉兩端極值后概論圖');
i=1:1:8760+1;
figure(6);
subplot(311);
plot(i,Pdump,'m');
xlabel('Time(h)');ylabel('Excess power(W)');
subplot(312);
func_plot_phist(Pdump,50);
xlabel('Excess power(W)');
ylabel('Percent(%)');
title('原數(shù)據(jù)概論圖');
subplot(313);
func_plot_phist2(Pdump,50);
xlabel('Excess power(W)');
ylabel('Percent(%)');
title('去掉兩端極值后概論圖');
figure(7);
subplot(311);
plot(i,Pdeficit,'k');
xlabel('Time(h)');ylabel('Deficient power(W)');
grid on;
subplot(312);
func_plot_phist(Pdeficit,50);
xlabel('Deficient power(W)');
ylabel('Percent(%)');
title('原數(shù)據(jù)概論圖');
subplot(313);
func_plot_phist2(Pdeficit,50);
xlabel('Deficient power(W)');
ylabel('Percent(%)');
title('去掉兩端極值后概論圖');
figure(8);
Pdeficit_month = zeros(floor(length(Pdeficit)/720),1);
for mm = 1:length(Pdeficit_month)
Pdeficit_month(mm) = sum(Pdeficit(720*(mm-1)+1:720*mm));
end
j = 1:length(Pdeficit_month);
subplot(311);
plot(j,Pdeficit_month,'k-o');
xlabel('Month');ylabel('Deficient power(W)');
grid on;
subplot(312);
func_plot_phist(Pdeficit_month,50);
xlabel('Deficient power(W)');
ylabel('Percent(%)');
title('原數(shù)據(jù)概論圖');
subplot(313);
func_plot_phist2(Pdeficit_month,50);
xlabel('Deficient power(W)');
ylabel('Percent(%)');
title('去掉兩端極值后概論圖');
figure(9);
subplot(311);
plot(i,SOC,'g');
xlabel('Time(h)');ylabel('SOC(%)');
grid on;
subplot(312);
func_plot_phist(SOC,50);
xlabel('SOC');
ylabel('Percent(%)');
title('原數(shù)據(jù)概論圖');
subplot(313);
func_plot_phist2(SOC,50);
xlabel('SOC');
ylabel('Percent(%)');
title('去掉兩端極值后概論圖');
figure(10);
plot3(i,Pdump,SOC,'g');
xlabel('Time(h)');ylabel('Pdump(W)');zlabel('SOC(%)');
grid on;
%7、畫出風(fēng)力發(fā)電機(jī)在這一年中產(chǎn)生的功率圖
load WindTurbingPower.mat
figure(11);
j = 1:length(Pw)
subplot(311);
plot(j,Pw,'k-');
xlabel('hour');ylabel('WindTurbingPower(W)');
grid on;
Pw_month = zeros(floor(length(Pw)/720),1);
for mm = 1:length(Pw_month)
Pw_month(mm) = sum(Pw(720*(mm-1)+1:720*mm));
end
j = 1:length(Pw_month);
subplot(312);
plot(j,Pw_month,'k-');
xlabel('Month');ylabel('WindTurbingPower(W)');
grid on;
subplot(313);
func_plot_phist(Pw,50);
xlabel('WindTurbingPower(W)');
ylabel('Percent(%)');
%8、畫出光伏發(fā)電機(jī)在這一年中產(chǎn)生的功率圖
load SolarPower.mat
figure(12);
j = 1:length(Ppv)
subplot(311);
plot(j,Ppv,'k-');
xlabel('hour');ylabel('SolarPower(W)');
grid on;
Ppv_month = zeros(floor(length(Ppv)/720),1);
for mm = 1:length(Ppv_month)
Ppv_month(mm) = sum(Ppv(720*(mm-1)+1:720*mm));
end
j = 1:length(Ppv_month);
subplot(312);
plot(j,Ppv_month,'k-');
xlabel('Month');ylabel('SolarPower(W)');
grid on;
subplot(313);
func_plot_phist(Ppv,50);
xlabel('SolarPower(W)');
ylabel('Percent(%)');
%9、畫出風(fēng)力發(fā)電機(jī)和光伏發(fā)電機(jī)在這一年中產(chǎn)生的總功率圖
figure(13);
PP= Pw + Ppv;
j = 1:length(PP)
subplot(311);
plot(j,PP,'k-');
xlabel('hour');ylabel('總功率(W)');
grid on;
PP_month = zeros(floor(length(PP)/720),1);
for mm = 1:length(PP_month)
PP_month(mm) = sum(PP(720*(mm-1)+1:720*mm));
end
j = 1:length(PP_month);
subplot(312);
plot(j,PP_month,'k-');
xlabel('Month');ylabel('總功率(W)');
grid on;
subplot(313);
func_plot_phist(PP,50);
xlabel('總功率(W)');
ylabel('Percent(%)');
02_020m
4.系統(tǒng)原理簡介
? ? ? ? 基于遺傳算法(Genetic Algorithm, GA)的混合發(fā)電系統(tǒng)優(yōu)化配置算法是一種通過模擬自然進(jìn)化過程來求解優(yōu)化問題的方法。在混合發(fā)電系統(tǒng)中,通常包含多種不同類型的發(fā)電單元,如風(fēng)力發(fā)電、光伏發(fā)電、柴油發(fā)電機(jī)等。這些發(fā)電單元在成本、效率、可靠性等方面存在差異,因此需要通過優(yōu)化配置來實現(xiàn)系統(tǒng)的經(jīng)濟(jì)性、可靠性和環(huán)保性等目標(biāo)。
4.1遺傳算法基本原理
? ? ? ?遺傳算法是一種啟發(fā)式搜索算法,它模擬了生物進(jìn)化過程中的自然選擇和遺傳學(xué)原理。在遺傳算法中,問題的解被編碼成“染色體”(或稱為“基因串”),每個染色體代表問題的一個潛在解。算法通過選擇、交叉(雜交)和變異等操作來不斷迭代優(yōu)化染色體,最終找到問題的最優(yōu)解或近似最優(yōu)解。
4.2 混合發(fā)電系統(tǒng)優(yōu)化配置問題
? ? ? ?混合發(fā)電系統(tǒng)的優(yōu)化配置問題可以描述為:在給定的負(fù)荷需求、資源條件和技術(shù)經(jīng)濟(jì)參數(shù)的約束下,確定各種發(fā)電單元的最優(yōu)容量配置,以最小化系統(tǒng)的總成本(包括投資成本、運行維護(hù)成本、燃料成本等),同時滿足系統(tǒng)的可靠性、環(huán)保性等要求。
4.3 基于GA的優(yōu)化配置算法
染色體編碼
? ? ? ? 在混合發(fā)電系統(tǒng)的優(yōu)化配置問題中,每個染色體可以表示為一個發(fā)電單元的容量配置方案。例如,對于一個包含風(fēng)力發(fā)電、光伏發(fā)電和柴油發(fā)電機(jī)的系統(tǒng),染色體可以編碼為 [風(fēng)力發(fā)電機(jī)容量, 光伏發(fā)電容量, 柴油發(fā)電機(jī)容量]。
初始種群生成
? ? ? ? 初始種群是遺傳算法的起點,它由一定數(shù)量的隨機(jī)生成的染色體組成。這些染色體代表了問題的潛在解。
適應(yīng)度函數(shù)
? ? ? ?適應(yīng)度函數(shù)用于評估染色體的優(yōu)劣。在混合發(fā)電系統(tǒng)的優(yōu)化配置問題中,適應(yīng)度函數(shù)通常與系統(tǒng)的總成本成反比。即,成本越低的配置方案具有更高的適應(yīng)度。
選擇操作
? ? ? ? 選擇操作根據(jù)染色體的適應(yīng)度來選擇優(yōu)秀的染色體進(jìn)入下一代。常用的選擇方法有輪盤賭選擇、錦標(biāo)賽選擇等。
交叉操作
? ? ? ?交叉操作模擬了生物進(jìn)化中的基因重組過程。在遺傳算法中,通過交換兩個染色體的部分基因來生成新的染色體。
變異操作
? ? ? ? 變異操作模擬了生物進(jìn)化中的基因突變過程。在遺傳算法中,通過隨機(jī)改變?nèi)旧w中的某個基因來引入新的遺傳信息。
? ? ? ?例如,對于染色體 [風(fēng)力發(fā)電機(jī)容量, 光伏發(fā)電容量, 柴油發(fā)電機(jī)容量],可以選擇變異其中的光伏發(fā)電容量部分,將其替換為一個隨機(jī)生成的新值。
5.完整工程文件
v文章來源地址http://www.zghlxwxcb.cn/news/detail-822971.html文章來源:http://www.zghlxwxcb.cn/news/detail-822971.html
v
到了這里,關(guān)于基于GA遺傳優(yōu)化的混合發(fā)電系統(tǒng)優(yōu)化配置算法matlab仿真的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!