first_allcation.asv

来自「电力系统考虑网损的经济调度程序」· ASV 代码 · 共 23 行

ASV
23
字号
clc
fun='50*(x(1)^2)+245*x(1)+50*(x(2)^2)+351*x(2)+50*(x(3)^2)+389*x(3)';
x0=[0,0,0];
lb=[0.5;0.1;0.1];
ub=[2;1;1];
aeq=[1,1,1];
beq=[2.66];
[x,fval,exitflag]=fmincon(fun,x0,[],[],aeq,beq,lb,ub,[]);
a1=x(1,1);
b1=x(1,2);
c1=x(1,3);
[beq_loss,loss_active,loss_marix]=loss(a1,b1,c1)
% aeq=[aeq;aeq_loss];
% beq=[beq;beq_loss];
beq=[beq-beq_loss];
loss_allocation=loss_marix*loss_active
% x0=x;
[x,fval,exitflag]=fmincon(fun,x0,[],[],aeq,beq,lb,ub,[])
y=
p2=x(1,1)+loss_allocation(1,1);
p3=x(1,2)+loss_allocation(2,1);
p5=x(1,3)+loss_allocation(3,1);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?