📄 psotest.m
字号:
% the data matrix should have 5 columns of fuel cost coefficients and plant limits.
% 1.a ($/MW^2) 2. b $/MW 3. c ($) 4.lower lomit(MW) 5.Upper limit(MW)
% This Example system is taken from the book Power System Analysis by Prof Haadi Sadaat Example 7.8
%no of rows denote the no of plants(n)
clear
clc;
format long;
global data B Pd
data=[0.15247 38.53973 756.79886 10 125
0.10587 46.15916 451.32513 10 150
0.02803 40.3965 1049.9977 35 225
0.03546 38.30553 1243.5311 35 210
0.02111 36.32782 1658.569 130 325
0.01799 38.27041 1356.6592 125 315];
B=1e-4*[1.4 .17 .15 .19 .26 .22;.17 .60 .13 .16 .15 .20;.15 .13 .65 .17 .24 .19;.19 .16 .17 .71 .30 .25;.26 .15 .24 .30 .69 .32;.22 .20 .19 .25 .32 .85];
Pd=700;
l=data(:,4)';
u=data(:,5)';
ran=[l' u'];
n=length(data(:,1));
Pdef = [50 1000 10 2 2 0.9 0.4 1500 1e-6 5000 NaN 0 0];
[OUT]=pso_Trelea_vectorized('psoeld',n,1,ran,0,Pdef);
out=abs(OUT)
P=out(1:n)
[F P Pl]=psoeld(P')
% comparision by quadratic programming
[P1 Fcost1 Pl1]=eld(data,B,Pd)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -