Contents
In this m file we simulate the comparison ITC Method
clc;clear all; warning off;format long;
tic
A = [];
b = [];
Aeq = [];
beq = [];
lb = [0.05*ones(1,68)];
x0 = [0.05*ones(1,68)];
ub = [1*ones(1,68)];
options = optimset('Display','iter','MaxIter',100000,'MaxFunEvals',10000000);
[x,fval,exitflag,output,lambda,grad,hessian]=fmincon(@myfun_24bus,x0,A,b,Aeq,beq,lb,ub,@const_fun_24bus,options);
TDS = x(1,:);
load('Ip.mat');
Ip=Ipp;
load('Fault_analysis_24bus_8dfig.mat');
first_fl=1;
last_fl=29;
time_sum=0;
for i=1:4
for j=1:3
clear ISC t ISCb ISCc
if i==1 || i==4
ISC=Fault_analysis.(['ISCa' num2str(i) num2str(j)]);
elseif i==2 || i==3
ISCb=Fault_analysis.(['ISCb' num2str(i) num2str(j)]);
ISCc=Fault_analysis.(['ISCc' num2str(i) num2str(j)]);
ISC=max(ISCb,ISCc);
end
flx=1;
for fl=first_fl:last_fl
MAP=MAPPING(fl,first_fl);
for k=1:2
indp(k)=MAP(k,1);
indb1(k)=MAP(k,2);
indb2(k)=MAP(k,3);
indb3(k)=MAP(k,4);
indb4(k)=MAP(k,5);
if indp(k)~=0
t(indp(k),fl)=0.14*TDS(indp(k))/(-1 + (ISC(indp(k),fl)/Ip(indp(k)))^.02 );
time_sum=time_sum+ t(indp(k),fl);
if k==1
All_time.(['t' num2str(i) num2str(j)])(2*flx-1,1)=t(indp(k),fl);
else
All_time.(['t' num2str(i) num2str(j)])(2*flx,1)=t(indp(k),fl);
end
end
if indb1(k)~=0
t(indb1(k),fl)=0.14*TDS(indb1(k))/(-1 + (ISC(indb1(k),fl)/Ip(indb1(k)))^.02 );
time_sum=time_sum+ t(indb1(k),fl);
if k==1
All_time.(['t' num2str(i) num2str(j)])(2*flx-1,2)=t(indb1(k),fl);
else
All_time.(['t' num2str(i) num2str(j)])(2*flx,2)=t(indb1(k),fl);
end
end
if indb2(k)~=0
t(indb2(k),fl)=0.14*TDS(indb2(k))/(-1 + (ISC(indb2(k),fl)/Ip(indb2(k)))^.02 );
time_sum=time_sum+ t(indb2(k),fl);
if k==1
All_time.(['t' num2str(i) num2str(j)])(2*flx-1,3)=t(indb2(k),fl);
else
All_time.(['t' num2str(i) num2str(j)])(2*flx,3)=t(indb2(k),fl);
end
end
if indb3(k)~=0
t(indb3(k),fl)=0.14*TDS(indb3(k))/(-1 + (ISC(indb3(k),fl)/Ip(indb3(k)))^.02 );
time_sum=time_sum+ t(indb3(k),fl);
if k==1
All_time.(['t' num2str(i) num2str(j)])(2*flx-1,4)=t(indb3(k),fl);
else
All_time.(['t' num2str(i) num2str(j)])(2*flx,4)=t(indb3(k),fl);
end
end
if indb4(k)~=0
t(indb4(k),fl)=0.14*TDS(indb4(k))/(-1 + (ISC(indb4(k),fl)/Ip(indb4(k)))^.02 );
time_sum=time_sum+ t(indb4(k),fl);
if k==1
All_time.(['t' num2str(i) num2str(j)])(2*flx-1,5)=t(indb4(k),fl);
else
All_time.(['t' num2str(i) num2str(j)])(2*flx,5)=t(indb4(k),fl);
end
end
end
flx=flx+1;
end
Op_time.(['t' num2str(i) num2str(j)])= t;
end
end
save('Results24bus_TC.mat','All_time','Op_time', 'TDS','k');
exitflag
toc
Your initial point x0 is not between bounds lb and ub; FMINCON
shifted x0 to strictly satisfy the bounds.
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 69 2.692857e+03 1.575e+00 2.699e+02
1 138 2.101026e+03 1.019e+00 2.140e+02 8.871e-01
2 207 2.034679e+03 9.266e-01 1.190e+02 1.012e-01
3 276 2.008288e+03 8.516e-01 1.076e+02 4.665e-02
4 345 1.942296e+03 6.102e-01 8.714e+01 1.331e-01
5 414 1.940115e+03 5.226e-01 6.378e+01 3.327e-02
6 483 1.961537e+03 3.163e-01 4.387e+01 8.740e-02
7 552 2.016413e+03 2.697e-01 3.516e+01 1.348e-01
8 621 2.077468e+03 2.356e-01 2.480e+01 1.253e-01
9 690 2.208528e+03 2.078e-01 2.042e+01 2.515e-01
10 759 2.259293e+03 1.757e-01 1.567e+01 9.531e-02
11 828 2.269994e+03 1.708e-01 1.356e+01 1.984e-02
12 897 2.357329e+03 1.301e-01 1.274e+01 1.694e-01
13 966 2.433846e+03 9.342e-02 9.948e+00 1.491e-01
14 1035 2.528511e+03 5.108e-02 9.027e+00 1.803e-01
15 1104 2.547184e+03 4.065e-02 4.507e+00 4.162e-02
16 1173 2.574275e+03 2.784e-02 1.688e+00 5.403e-02
17 1242 2.594308e+03 1.896e-02 4.211e-02 3.822e-02
18 1311 2.636085e+03 9.757e-04 2.570e-02 7.838e-02
19 1380 2.636383e+03 5.585e-04 6.676e-03 1.445e-03
20 1449 2.636786e+03 2.118e-04 1.513e-03 1.184e-03
21 1518 2.636990e+03 5.303e-05 2.351e-04 5.481e-04
22 1587 2.637047e+03 1.027e-05 1.885e-04 1.465e-04
23 1656 2.637059e+03 0.000e+00 1.583e-04 3.424e-05
24 1725 2.637059e+03 0.000e+00 2.416e-04 1.055e-06
25 1794 2.637059e+03 0.000e+00 2.334e-04 2.272e-10
26 1863 2.637059e+03 0.000e+00 6.141e-05 7.462e-15
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the default value of the optimality tolerance,
and constraints are satisfied to within the default value of the constraint tolerance.
exitflag =
1
Elapsed time is 111.767542 seconds.