嗨,我有以下使用 linprog 的代码
for K = 1:3;
for M = 1:3;
PV_output(:,:,K) = real(PV_power_output(:,:,K));
PV =reshape(PV_output(:,:,1),8760,1);
WT_output(:,:,M) = WT_power_output(:,:,M);
WT = reshape(WT_output(:,:,1),8760,1);
PVenergy = sum(sum(PV_output(:,:,1)));
WTenergy = sum(sum(WT_power_output(:,:,1)));
% Linprog
f = [((CRF*CC_PV)/PVenergy)+OM_PV; ((CRF*CC_WT)/WTenergy)+OM_WT];
A(:,:) = [-PV -WT];
b(:,:) = -0.25.*Demand(:);
lb = zeros(2,1);
ub = [max_PV_area/PV_area; max_WT_area/WT_area]';
[x(:,K,M), fval, exitflag] = linprog(f,A,b,[],[],lb,ub)
end
end
其中 PV = 8760x2,WT = 8760 x 2 和 x = 2x1。当我运行这个程序时,优化会以退出标志 1 收敛,但我要么得到 x1 =0 的值,要么得到等于某个整数的 x2 值。
为什么输出不给出混合结果(即 x1 和 x2 的非零值?