Hello, I am having some issues with Matpower results structure while calling a DC OPF. I disconnect one branch at a time (for loop) and solve for a couple of variables. I note that disconnection of branch (7-8) creates an island. This should change the Minimal cost. My algorithm gives the wrong results. Any help will be appreciated.
define_constants; mpc=case24_ieee_rts_Reduced; nl=size(mpc.branch,1); for lines=1:nl mpc.branch(lines,BR_STATUS)=0; r=rundcopf(mpc); if r.success ==1 %p(:,lines)=r.branch(:,PF); %% Powerflow %p(:,lines)=r.bus(:,LAM_P); %% LMP MCost(:,lines) =r.f; %% Minimal Cost function end mpc.branch(lines,BR_STATUS)=1; end figure; hold on for ii = 1:lines plot(abs(MCost(:,ii))) end grid on Cheers Tochi