필터 지우기
필터 지우기

Solving a symbolic array

조회 수: 2 (최근 30일)
mattyice
mattyice 2016년 5월 19일
편집: mattyice 2016년 5월 19일
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개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by