I am solving 20 nonlinear equation using fsolve to find 20 variables' value. But i previously know one of variable's value. That variable is x(17) in eqn F(17). x(17)=1200. Based on this fixed variable i want to find remaining variables' value.
3 次查看(过去 30 天)
显示 更早的评论
function F = root16d(x)
Qs_ref=0;
Pw_ref=0.322;
F(1) = -0.5*((x(1)*x(2))-(x(3)*x(4)))-Qs_ref; %Qr=0.5*((x(5)*x(8))-(x(7)*x(6))
F(2) = 0.5*((x(1)*x(4))+(x(3)*x(2)))+0.5*((x(5)*x(6))+(x(7)*x(8)))+Pw_ref;
%% Algebric Equation
F(3) = 0.5*((x(1)*x(9))+(x(3)*x(10)))+0.5*((x(1)*x(4))+(x(3)*x(2)))-0.5*((x(11)*x(15))+(x(12)*x(16)));
F(4) = 0.5*((x(1)*x(2))-(x(3)*x(4)))+0.5*((x(1)*x(10))-(x(3)*x(9)))+0.5*((x(11)*x(16))-(x(12)*x(15)));
%% SS of Tr line
delta=0.1049;
Rl=0.02; we=2*pi*60;
Xl=0.5; wb=2*pi*60;
Xc=0.75*0.5;
EB=1;
Ebq=EB*cos(delta);
Ebd=EB*sin(delta);
%
F(5) = -(Rl*wb/Xl)*x(9)-we*x(10)-(wb/Xl)*x(13)+(wb/Xl)*(x(1)-Ebq);
F(6) = we*x(9)-(Rl*wb/Xl)*(x(10))-(wb/Xl)*x(14)+(wb/Xl)*(x(3)-Ebd);
F(7) = (wb*x(9)*Xc)-(we*x(13));
F(8) = (wb*x(10)*Xc)+(we*x(13));
%% two aglebric equation
Xtg=0.3;
F(13)= x(1)-x(11)+(Xtg*x(16));
F(14)= x(3)-x(12)-(Xtg*x(15));
F(15)= x(15)-x(4)-x(9);
F(16)= x(16)-x(2)-x(10);
%% Power flow equation for DC capacitor placed between GSC and RSC
C=50*14000e-6;%C=1;
F(17)= (100e6*((0.5*(x(5)*x(6)+x(7)*x(8)))+(0.5*(x(11)*x(15)+x(12)*x(16))))/(-C*1200));%100e6**x(17)
%% State Space model of Generator Turbine shaft model
Dt=0; Ht=4.29;
Dtg=1.5; Hg=0.9; Ktg=0.15;
Xm=3.95279; Tw=0.322/(0.75);
Wbase=2*pi*60; Te=0.5*Xm*(((x(4)+x(6))*x(8))-((x(2)+x(8))*x(6)));
F(18)= ((-Dt-Dtg)/(2*Ht))*x(18)+((Dtg/(2*Ht))*x(19))-(x(20)/(2*Ht))+(Tw/(2*Ht));
F(19)= ((Dtg/(2*Hg))*x(18))+((-Dt-Dtg)/(2*Hg))*x(19)+(x(20)/(2*Hg))-(Te/(2*Hg));
F(20)=(Ktg*Wbase)*x(18)-(Ktg*Wbase)*x(19);
%% State Space model of DFIG
Rs = 0.00488; Wb= 2*pi*60%2*pi*60;
Rr = 0.00549; We= 2*pi*60;%2*pi*60;
Xls = 0.09231; Wr= 2*pi*60*x(19);%2*pi*60*x(19)
Xlr = 0.09955;
Xm = 3.95279;
Xss = Xls+Xm; Xrr = Xlr+Xm;
F(9)=x(2)*((Xm^2*(We - Wr))/(Xlr*Xls + Xlr*Xm + Xls*Xm) - (We*(Xlr + Xm)*(Xls + Xm))/(Xlr*Xls + Xlr*Xm + Xls*Xm)) - x(8)*((We*Xm*(Xlr + Xm))/(Xlr*Xls + Xlr*Xm + Xls*Xm) - (Xm*(Xlr + Xm)*(We - Wr))/(Xlr*Xls + Xlr*Xm + Xls*Xm)) + (Wb*x(1)*(Xlr + Xm))/(Xlr*Xls + Xlr*Xm + Xls*Xm) - (Wb*Xm*x(5))/(Xlr*Xls + Xlr*Xm + Xls*Xm) - (Rs*Wb*x(4)*(Xlr + Xm))/(Xlr*Xls + Xlr*Xm + Xls*Xm) + (Rr*Wb*Xm*x(6))/(Xlr*Xls + Xlr*Xm + Xls*Xm)
F(10)= x(6)*((We*Xm*(Xlr + Xm))/(Xlr*Xls + Xlr*Xm + Xls*Xm) - (Xm*(Xlr + Xm)*(We - Wr))/(Xlr*Xls + Xlr*Xm + Xls*Xm)) - x(4)*((Xm^2*(We - Wr))/(Xlr*Xls + Xlr*Xm + Xls*Xm) - (We*(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xls*Xm)
1 个评论
Walter Roberson
2019-1-2
Please do not close questions that have an Answer.
I spent a number of hours investigating this for you, and it is frustrating to have my work vanish.
采纳的回答
Walter Roberson
2019-1-1
x(17) does not appear in your function, so setting a particular value for it does not make any difference.
What does make a difference is that you have 20 equations in 19 variables (since x(17) is unused). That is either going to have no solutions or an infinite number of solutions. My tests suggest that this particular set of equations has no consistent solutions.
7 个评论
Walter Roberson
2019-1-2
I continued to analyze the equations you posted. It is feasible to use calculas techniques on sum(F.^2) to reduce down to 12 variables, with the other 7 being closed form solutions based on the 12. The best sequence is to eliminate X6, X5, X12, X9, X3, X4, X2. It is not feasible to find closed form solutions for the remaining variables.
Having reduced to 12 variables, I did sort of semi-intelligent monte carlo simulation of the residue that remained. It did not appear to be possible to reduce the residue to 0. The best I found so far was at
[ X1 == 0.6529759180536074, X15 == 4.144202714116702, X16 == -2.679195707057889, X19 == -0.7587878291303904, X2 == 0.5740191093184646, X3 == 0.4596545081443212, X4 == 0.8911261003071187, X5 == 0.9678333808777941, X6 == -1.027511586190954, X7 == 1.125758319506284, X8 == -0.4233336402438206, X9 == 3.252655602042921]
with a SSE of 0.000396420099420918 .
But when you substitute these back into F, the system you get is definitely inconsistent.
更多回答(1 个)
Alex Sha
2020-2-28
The equation F(17) seems to be meanless:
F(17)= (100e6*((0.5*(x(5)*x(6)+x(7)*x(8)))+(0.5*(x(11)*x(15)+x(12)*x(16))))/(-C*x(17)))
equal to:
(100e6*((0.5*(x(5)*x(6)+x(7)*x(8)))+(0.5*(x(11)*x(15)+x(12)*x(16))))/(-C*x(17)))=0
equal to:
(100e6*((0.5*(x(5)*x(6)+x(7)*x(8)))+(0.5*(x(11)*x(15)+x(12)*x(16))))=0
equal to:
(0.5*(x(5)*x(6)+x(7)*x(8)))+(0.5*(x(11)*x(15)+x(12)*x(16)))=0
equal to:
x(5)*x(6)+x(7)*x(8)+x(11)*x(15)+x(12)*x(16)=0
so x(17) actually do nothing, it leads to 19 variables but 20 equations, and there is no idea solution.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surrogate Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!