Info

This question is closed. Reopen it to edit or answer.

. My matlab code is written below in which i want to optimize matrix Y using constrained optimizer Fmincon to get F,Xm.Can you please help regarding this. i am having problems regarding this so please help me regarding this

1 view (last 30 days)
clc
clear
Rs1=0.05385;
Rs2=0.05385;
Xs1=0.0885;
Xs2=0.0885;
Rr=0.11475;
Xr=0.1775;
Xlm=0.00973;
F=50;
v=1500;
Xl2=0.012;
Xl1=0.02;
Xls=0.3;
csh=38.5;
cse=108;
Rl1=0.0673;
Rl2=0.0673;
Xl1=0.087;
j=-1;
Xm=2.93;
F=50;
Xcp1=1/(2*3.14*F*0.1);
Xcs1=1/(2*3.14*F*0.2);
Xcp2=1/(2*3.14*F*0.3);
Xcs2=1/(2*3.14*F*0.4) ;
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
Y=[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]
  2 Comments
Walter Roberson
Walter Roberson on 27 Jan 2014
You seem to have fully specified the inputs to Y. What is it that you want to vary and how would you calculate that the matrix is "optimized" ?
Are you wanting to let F and Xm be unknown? If so then we would still need to know how you want to optimize or minimize the matrix Y.
Walter Roberson
Walter Roberson on 27 Jan 2014
Technical note for my own reference: Maple
Q := v-> convert(v, rational);
Rs1 := Q(0.5385e-1);
Rs2 := Q(0.5385e-1);
Xs1 := Q(0.885e-1);
Xs2 := Q(0.885e-1);
Rr := Q(.11475);
Xr := Q(.1775);
Xlm := Q(0.973e-2);
v := Q(1500);
Xl2 := Q(0.12e-1);
Xl1 := Q(0.2e-1);
Xls := Q(.3);
csh := Q(38.5);
cse := Q(108);
Rl1 := Q(0.673e-1);
Rl2 := Q(0.673e-1);
Xl1 := Q(0.87e-1);
j := Q(-1);
Xcp1 := 1/(2*Pi*F*Q(.1));
Xcs1 := 1/(2*Pi*F*Q(.2));
Xcp2 := 1/(2*Pi*F*Q(.3));
Xcs2 := 1/(2*Q*F*Q(.4));
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);
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;
T1 := `<|>`(Y1+Y2+Y3, Y1+Y2, 0, Y1+Y2);
T2 := `<|>`(Y1+Y1, Y1+Y2+Y4+Y8+Y9, -Y8-Y9, Y1+Y2+Y8+Y9);
T3 := `<|>`(0, -Y8-Y9, Y5+Y8+Y9, -Y8-Y9);
T4 := `<|>`(Y1+Y2, Y1+Y2+Y8+Y9, -Y8-Y9, Y1+Y2+Y6+Y7+Y8+Y9);
Y := `<,>`(T1, T2, T3, T4);

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!