System of 4 non-linear equations yields Empty sym: 0-by-1
1 view (last 30 days)
Show older comments
I am trying to resolve a system of 4 non-linear (exponential) equations using vpasolve. The system reprensents the 4 equations needed to characterize the electrical model of a solar cell from the values given in datasheets (
, and
). However, the solutions for the 4 desired values (
and
) are all "Empty sym: 0-by-1".
, and
). However, the solutions for the 4 desired values (
and
) are all "Empty sym: 0-by-1". The equations forming the system are:
1) 
2) 
3) 
4) 

My code is
%parameters
I_sc = 0.473;
V_oc = 2.6;
V_m = 2.32;
I_m = 0.455;
R_s = 0.001;
T = 313.5;
k = 1.38e-23;
e = 1.6e-19;
c = 1;
g = k*T;
%unknowns : a = I_in, b = I_diode, c = gamma, d = R_sh
syms a b c d
eq1= a - b * (exp(e*(R_s*I_sc)/c*g)-1) - (1/d)*R_s*I_sc == I_sc;
eq2= a - b * (exp(e*(V_oc)/c*g)-1) - (1/d)*V_oc == 0;
eq3= a - b * (exp(e*(V_m + R_s*I_m)/c*g)-1) - (1/d)*(V_m + R_s*I_m) == I_m;
eq4= I_m + V_m * ((-b) * (e*exp(e*(V_m + R_s * I_m)/(c * g))/c * g) - (1/d)) == 0;
sol = vpasolve(eq1,eq2,eq3,eq4);
sol.a
sol.b
sol.c
sol.d
Is there no way to obtain values for this system of equation ? The value of
can vary between 0 and 0.615.
can vary between 0 and 0.615.Thanks
0 Comments
Answers (2)
Torsten
on 14 Jul 2022
%parameters
I_sc = 0.473;
V_oc = 2.6;
V_m = 2.32;
I_m = 0.455;
R_s = 0.001;
T = 313.5;
k = 1.38e-23;
e = 1.6e-19;
c = 1;
g = k*T;
%unknowns : a = I_in, b = I_diode, c = gamma, d = R_sh
fun = @(a,b,c,d)[a - b * exp(e*(R_s*I_sc)/(c*g)-1) - 1/d*R_s*I_sc - I_sc;...
a - b * exp(e*(V_oc)/(c*g)-1) - 1/d*V_oc;...
a - b * exp(e*(V_m + R_s*I_m)/(c*g)-1) - 1/d*(V_m + R_s*I_m) - I_m;...
I_m + V_m * (-b * e*exp(e*(V_m + R_s * I_m)/(c * g))/(c * g) - 1/d)];
x0 = [2 4 6 8];
options = optimset('MaxFunEvals',100000);
x = fsolve(@(x)fun(x(1),x(2),x(3),x(4)),x0,options)
fun(x(1),x(2),x(3),x(4))
Abderrahim. B
on 14 Jul 2022
Hi!
Make sure to recheck equations parentheses.
clear
% parameters
I_sc = 0.473;
V_oc = 2.6;
V_m = 2.32;
I_m = 0.455;
R_s = 0.001;
T = 313.5;
k = 1.38e-23;
e = 1.6e-19;
c = 1;
g = k*T;
% unknowns : a = I_in, b = I_diode, c = gamma, d = R_sh
syms a b c d
eq1 = a - b * exp((e*(R_s*I_sc)/(c*g))-1) - (1/d)*R_s*I_sc == I_sc;
eq2 = a - b * exp((e*(V_oc)/(c*g))-1) - (1/d)*V_oc == 0;
eq3 = a - b * exp((e*(V_m + R_s*I_m)/(c*g))-1) - (1/d)*(V_m + R_s*I_m) == I_m;
eq4 = I_m + V_m * ((-b * e* exp(e*(V_m + R_s * I_m)/(c*g))/(c * g) - (1/d))) == 0;
sol = vpasolve([eq1, eq2, eq3, eq4], [a, b, c,d]) ;
a = sol.a
b = sol.b
c = sol.c
d = sol.d
3 Comments
Abderrahim. B
on 14 Jul 2022
@Simon Kellen check @Torsten answer. In this case, you are like forcing you sys of eq to have more conditions than unknowns, you should expect that generically there are no solutions.
See Also
Categories
Find more on Simulation, Tuning, and Visualization 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!
