Why some output show 0-by-1

1 次查看(过去 30 天)
Sarah
Sarah 2025-3-20
回答: Thorsten 2025-3-20
I am confused about some output has numerical answer, but some show empty system. I did use the same function and the input are similar.
ro = 5;
q = 1.6*10^(-19)
Si_emin = 68.5
Si_emax = 1414
Si_eref = 9.2*10^16
Si_ea = 0.711
Si_n = dp(ro,q,Si_emin,Si_emax,Si_eref,Si_ea)
ro = 5;
q = 1.6*10^(-19)
Si_hmin = 44.9
Si_hmax = 470.5
Si_href = 2.23*10^17
Si_ha = 0.719
Si_p = dp(ro,q,Si_hmin,Si_hmax,Si_href,Si_ha)
ro = 5;
q = 1.6*10^(-19)
GaAs_emin = 500
GaAs_emax = 9400
GaAs_eref = 6*10^16
GaAs_ea = 0.394
GaAs_n = dp(ro,q,GaAs_emin,GaAs_emax,GaAs_eref,GaAs_ea)
ro = 5;
q = 1.6*10^(-19)
GaAs_hmin = 20
GaAs_hmax = 491.5
GaAs_href = 1.48*10^17
GaAs_ha = 0.38
GaAs_p = dp(ro,q,GaAs_hmin,GaAs_hmax,GaAs_href,GaAs_ha)
ro = 5;
q = 1.6*10^(-19)
InP_emin = 0
InP_emax = 5000
InP_eref = 4*10^17
InP_ea = 0.45
InP_n = dp(ro,q,InP_emin,InP_emax,InP_eref,InP_ea)
ro = 5;
q = 1.6*10^(-19)
InP_hmin = 10
InP_hmax = 170
InP_href = 4.87*10^18
InP_ha = 0.62
InP_p = dp(ro,q,InP_hmin,InP_hmax,InP_href,InP_ha)
function x = dp(ro,q,min,max,ref,a)
syms x
eqn = 1/(ro*q*(min+(max-min)/(1+(x/ref)^a)))-x == 0
x = vpasolve(eqn,x)
end
Output:
q = 1.6000e-19
Si_emin = 68.5000
Si_emax = 1414
Si_eref = 9.2000e+16
Si_ea = 0.7110
eqn =
x =
915687197686292.77386563464132068
Si_n =
915687197686292.77386563464132068
q = 1.6000e-19
Si_hmin = 44.9000
Si_hmax = 470.5000
Si_href = 2.2300e+17
Si_ha = 0.7190
eqn =
x =
2758477083642648.6175367991525707
Si_p =
2758477083642648.6175367991525707
q = 1.6000e-19
GaAs_emin = 500
GaAs_emax = 9400
GaAs_eref = 6.0000e+16
GaAs_ea = 0.3940
eqn =
x =
Empty sym: 0-by-1
GaAs_n =
Empty sym: 0-by-1
q = 1.6000e-19
GaAs_hmin = 20
GaAs_hmax = 491.5000
GaAs_href = 1.4800e+17
GaAs_ha = 0.3800
eqn =
x =
Empty sym: 0-by-1
GaAs_p =
Empty sym: 0-by-1
q = 1.6000e-19
InP_emin = 0
InP_emax = 5000
InP_eref = 4.0000e+17
InP_ea = 0.4500
eqn =
x =
Empty sym: 0-by-1
InP_n =
Empty sym: 0-by-1
q = 1.6000e-19
InP_hmin = 10
InP_hmax = 170
InP_href = 4.8700e+18
InP_ha = 0.6200
eqn =
x =
7477430144904512.3068191021258371
InP_p =
7477430144904512.3068191021258371

回答(1 个)

Thorsten
Thorsten 2025-3-20
It seems that vpasolve cannot solve the equation with the given input to it returns an empty symbol.

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by