Hi Frederico
1.
Actually, command fsolve works pretty well here, let me explain:
Since V(5) unknown only shows up in the 1st equation I decided to put off the 1st equation, let's solve the remaining system with fsolve
clear all;clc;close all
syms m Rsh Rs Io Is
Vmp = 31.1;
Imp = 8.67;
Voc = 38.2;
Isc = 9.19;
K = 1.38 * 10^-23;
T = 298.15;
q = -1.6 * 10^-19;
Vt = K*T/q;
V = [m, Rsh, Rs, Io];
F = @(V) [ (Isc - (Voc - V(3)*Isc)/ V(2)) * exp(-Voc/ (V(1)*Vt)) - V(4);
Isc - (Vmp + V(3)*Imp + V(3)*Isc)/ V(2) - (Isc - (Voc - V(3)*Isc)/ V(2)) * exp((Vmp + V(3)*Imp - Voc)/ (V(1)*Vt)) - Imp;
Imp + ((-(V(2)*Isc - Voc + V(3)*Isc) * exp((Vmp + V(3)*Imp - Voc)/ (V(1)*Vt))/ (V(2) * V(1)*Vt) - 1/V(2))/ (1 + V(3) * (V(2)*Isc - Voc + V(3)*Isc) * exp((Vmp + V(3)*Imp - Voc)/ (V(1)*Vt))/ (V(2) * V(1)*Vt) + V(3)/V(2))) * Vmp;
(-(V(2)*Isc - Voc + V(3)*Isc) * exp((V(3)*Isc - Voc)/ (V(1)*Vt))/ (V(2) * V(1)*Vt) - 1/V(2))/ (1 + V(3) * (V(2)*Isc - Voc + V(3)*Isc) * exp((V(3)*Isc - Voc)/ (V(1)*Vt))/ (V(2) * V(1)*Vt) + V(3)/V(2)) + 1/V(2)];
InitialGuess = [50; 0.1; .01; 1];
options = optimoptions('fsolve','Display','none','PlotFcn',@optimplotfirstorderopt,'MaxFunctionEvaluations',2000);
XY = fsolve(F, InitialGuess,options);
XY =
51.755945628868020
3.071518542695716
1.085173513887406
-1.062922141399835
2.
These are semiconductor equations, I like reading what is what, so I am putting back the initial variable names
m=XY(1)
Rsh=XY(2)
Rs=XY(3)
Io=XY(4)
3.
Now the initial equation is trivial
Is= Io * exp(Voc/ (m*Vt) )+ Voc/Rsh
Is =
12.436844990189343
4.
fsolve even produces the optimality graph ending up in 3.5e9 quite high.
5.
I was wondering, should your 1st equation have an inverted polarity, then Is would be
Is= Io * exp(-Voc/ (m*Vt) )+ Voc/Rsh
Is =
-3.101249033198816e+12
6.
Please note that function fsolve has a default amount if iterations equal to 400. If not changed, for this equations system, fsolve completes all the loops, without a solution, but warns that it may have a solution if increasing such default value.
To so, just change in advance the options field
to for instance
.
Frederico
Cosi fan tutte :)
If you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG
Best Answer