How can I solve multivariable Newton`s Method with implicit functions?
Show older comments
I am trying to solve a system of non linear equations using Newton`s Method. The function F(X), the unknown variables X and the initial guess X0 are presented below:
F(X)=[V1+V2+Vblk-Vstring; I1(V1)-I2(V2); I1(V1)-Iblk(V3)];
X = [V1; V2; Vblk;];
X0 = [Voc; Voc; 0;];
Vstring is assigned from 91.1 to 0 so that Newtons`s Method must be applied for each value of Vstring to return the contribution of V1, V2 and Vblk across Vstring. However, in F(2) and F(3) the variables V1, V2 and Vblk are implicit functions of I1, I2 and Iblk. Before running Newton`s Method, the variables I1, I2 and Iblk are calculated by means of Lambert W function and then stored in arrays, so that variables I1, I2 and Iblk are known for any V1, V2 and Vblk values before Newton`s Method is applied. How could I solve the Newton`s Method considering these implicit functions for all Vstring values? I appreciate any help!
8 Comments
James Tursa
on 14 Sep 2022
What do the functions I1( ), I2( ), and Iblk( ) look like?
Eric Bernard Dilger
on 14 Sep 2022
Did you try "fsolve" for the solution ?
X0 = [Voc; Voc; 0];
Vstring = ...;
X = fsolve(@(X)fun(X,Vstring),X0)
V1 = X(1)
V2 = X(2)
Vblk = X(3)
function res = fun(X,Vstring)
V1 = X(1);
V2 = X(2);
Vblk = X(3);
Iblk = Isblk * (exp(Vblk/Vtblk)-1);
theta1 = (Rh*Rs/(Rs+Rh))*(Isd/(Ns*Vtd))*exp( ( (Rs+Rh)*(Iph+Isd) + Rh*V1 ) /(Vtd*(Rs+Rh)));
theta2 = (Rh*Rs/(Rs+Rh))*(Isd/(Ns*Vtd))*exp( ( (Rs+Rh)*(Iph+Isd) + Rh*V2 ) /(Vtd*(Rs+Rh)));
I1 = ( ( Rh * ( Iph + Isd ) - V1 ) / ( Rh + Rs ) ) + Is_db * ( exp(-V1/Vtdb) - 1 ) - ( Vtd / Rs ) * lambertw(theta1);
I2 = ( ( Rh * ( Iph + Isd ) - V2 ) / ( Rh + Rs ) ) + Is_db * ( exp(-V2/Vtdb) - 1 ) - ( Vtd / Rs ) * lambertw(theta2);
res(1) = V1 + V2 + Vblk - Vstring;
res(2) = I1 - I2;
res(3) = I1 - Iblk;
end
Eric Bernard Dilger
on 15 Sep 2022
Eric Bernard Dilger
on 15 Sep 2022
Torsten
on 15 Sep 2022
I modified the code above.
function res = fun(X)
had to be replaced by
function res = fun(X,Vstring)
Eric Bernard Dilger
on 16 Sep 2022
Torsten
on 16 Sep 2022
As far as I know, it's the only MATLAB tool available for systems with as many equations as variables.
All depends on the initial guesses for the variables. If they are far away from the true values, every nonlinear solver will have problems.
Answers (0)
Categories
Find more on Systems of Nonlinear Equations 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!