Sir thanks 4 ur reply but still i m having problems in optimizing this. I want to optimize [Y] for getting F,Xm.Sir below is mr matlab code along with the constraints.Sir do help me regarding this hoe to optimize [Y] for F,Xm values using Fmincon

1 view (last 30 days)
function f=objfunc(Xm,F)
Rs1=0.05385;
Rs2=0.05385;
Xs1=0.0885;
Xs2=0.0885;
Rr=0.11475;
Xr=0.1775;
Xlm=0.00973;
Xm=3;
F=50;
v=1500;
Xl2=0.012;
Xl1=0.02;
v=200;
csh=38.5;
cse=108;
Rl1=0.0673;
Rl2=0.0673;
Xl1=0.087;
j=-1;
Xcp1=1/(2*3.14*50*38.5e-06)
Xcs1=1/(2*3.14*50*108e-06)
Xcp2=1/(2*3.14*50*38.5e-06)
Xcs2=1/(2*3.14*50*108e-06)
Z1=((Rr/F-v)+j*Xr)
Z2=-j*Xm
Z3=-j*Xlm
Z4=((Rs2/F)+j*Xs2)
Z5=(Rs1/F)+j*Xs1
Z6=(-j*Xcp2/F*2)
Z7=((Rl2/F)+j*(Xl2-(Xcs2/F*2)))
Z8=(-j*Xcp2/F*2)
Z9=((Rl1/F)+j*(Xl1-(Xcs1/F*2)))
fprintf('Impedances\n Z1 = %d \n Z2 = %d \n Z3 = %d \n Z4 = %d \n Z5 = %d \n Z6 = %d \n Z7 = %d \n Z8 = %d \n Z9 = %d \n', Z1, Z2, Z3, Z4, Z5, Z6, Z7, Z8, Z9);
Y1=(1/Z1)
Y2=1/Z2
Y3=1/Z3
Y4=1/Z4
Y5=1/Z5
Y6=1/Z6
Y7=1/Z7
Y8=1/Z8
Y9=1/Z9
f=[Y1+Y2+Y3 Y1+Y2 0 Y1+Y2;Y1+Y1 Y1+Y2+Y4+Y8+Y9 -Y8-Y9 Y1+Y2+Y8+Y9;0 -Y8-Y9 Y5+Y8+Y9 -Y8-Y9;Y1+Y2 Y1+Y2+Y8+Y9 -Y8-Y9 Y1+Y2+Y6+Y7+Y8+Y9]
Xm=[2.93,3]; % Starting guess
F=[40,50];%Starting guess
options=optimset('LargeScale','off');
[F,fval,exitflag,output]=fminunc(@objfun,F,options)
E=1.503-0.3001*Xm
The constraints are:
Load voltage should not go below 0.9 p.u. and above 1.0 p.u.,
Machine terminal voltage should not exceed 1.0 p.u.,
Stator current should not exceed 1.0 p.u.,
Voltage across series capacitor should not exceed 1.0 p.u.,
Power output should not go below 80% of rated full load power.
Where their values are
Is1={E/F}/{(Rs1/F)+j*Xs1-[(j*Xcs1*Rl1)/(F^2*Rl1-j*F*Xcs1)]+j*Xls};
Is2={E/F}/{(Rs2/F)+j*Xs2-[(j*Xcs2*Rl2)/(F^2*Rl2-j*F*Xcs2)]+j*Xls};
Ir={(E)/(Rr/F-v)+j*Xr};
I2=(-j*Xcs1)*(Is1);
Il1=I2/[(Rl1*F)-j*Xcs1];
Il2=(-j*Xcs2*Is2)/[(Rl2*F)-j*Xcs2];
Vt1=[Il1*Rl1];
Vt2=[Il2*Rl2];
Var1=[3*(Vt1^2)*F^2]/Xcs1;
Var2=[3*(Vt2^2)*F^2]/Xcs2;
Pout1=3*(Il1^2)*Rl1;
Pout2=3*(Il2^2)*Rl2;

Answers (1)

Walter Roberson
Walter Roberson on 29 Jan 2014
If you manage to call objfun the first time then it is going to get called recursively until eventually MATLAB decides you have gone too many levels of recursion. Your objfun function calls fzero, specifying the handle of objfun as an argument. That will cause fzero to invoke objfun. Which will call fzero. Which will call objfun. Which will call fzero...

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!