Solving a symbolic array
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
Im trying to solve an equation that has an array of different values. In the following code, I want to solve for x at different values of T where T=[50:1:1000]. The code works when T is a single element, but not when it is a matrix. I get this error:
Error using mupadengine/feval (line 163) The number of equations exceeds the number of indeterminates. This is allowed only for polynomial systems.
Error in sym/vpasolve (line 172) sol = eng.feval('symobj::vpasolve',eqns,vars,X0);
Error in HW5 (line 27) Efv=vpasolve(LHS==(ni.^2),x);
--------------------------------------------------------------------------------------------------------------- Here is the code:
close all
clear all
syms x
Econv=1.60218*10^-19; %%J/eV
Eg=1.11; %%Bandgap energy in eV
k=(1.38064852*10^-23)/Econv; %%Bolzmann Constant in eV/K
m0=9.109*10^-31; %%Mass of electron
mn=1.1*m0; %%Mass of e carrier
mp=0.58*m0; %%Mass of e hole
Eion=0.045;
hbar=1.054571800*10^-34; %Planck's constant in Js
Nd=((10^15)*(100)^3); %%#Donors/m^3
T=[50:1:1000];
Nc=2.*(mn*Econv*k.*T./(2*pi*hbar^2)).^(3/2);
Nv=2.*(mp*Econv*k.*T./(2*pi*hbar^2)).^(3/2);
Eiv=Eg/2+(3/4)*k.*T.*log(mp/mn);
ni=((Nc.*Nv).^(1/2)).*exp(-Eg./(2*k.*T));
p=ni.*exp(-x./(k.*T)).*(exp(Eiv./(k.*T)));
Ndion=Nd./(1+exp(x./(k.*T)).*exp((Eion-Eg)./(k.*T)));
LHS=p.*(p+Ndion);
Efv=vpasolve(LHS==(ni.^2),x);
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!