System of 4 non-linear equations yields Empty sym: 0-by-1
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Torsten
2022 年 7 月 14 日
%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
2022 年 7 月 14 日
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 件のコメント
Abderrahim. B
2022 年 7 月 14 日
@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.
参考
カテゴリ
Help Center および File Exchange で Simulation, Tuning, and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

