2
$\begingroup$

I'm new to Mathematica, and I'm trying to solve for corresponding Ef values for a range of T values in the transcendental equation: p = n + Nd.

hbar = 6.5821*10^-16

m0 = 9.109*10^(-31);

mn = 1.1;

mp = 0.5;

ionizeE = 45 *0.001;

Eg = 1.11

Ed = Eg - ionizeE

nd = 10^15*0.01

kb = 8.6173*10^-5;

p[T] = 2*((mp*kb*T)/(2*\[Pi]*hbar^2))^(3/2)*Exp[Ef/(kb*T)]

n[T] = 2*((mn*kb*T)/(2*\[Pi]*hbar^2))^(3/2)*Exp[(Eg - Ef)/(kb*T)]

Nd[T] = nd*(1 + Exp[(Ef - Ed)/(kb*T)])

I attempted to do the following but this clearly doesn't work. Any help in the right direction is much appreciated! Thank you so much.

f[T_] := Ef /. FindRoot[p[T] /. {T -> {50, 1000}} == n[T] /. {T -> {50, 1000}} + Nd[T] /. {T -> {50, 1000}}, {Ef, T}]

$\endgroup$
5
  • $\begingroup$ To numerically solve for Ef and T you need to provide numeric values for \[HBar] and kb $\endgroup$
    – Bob Hanlon
    May 20 at 5:56
  • $\begingroup$ @BobHanlon Thanks for pointing that out, I just tried putting the values for them, but it still gives me the same error. FindRoot::srect: Value T in search specification {Ef,T} is not a number or array of numbers. ReplaceAll::reps: {FindRoot[p[T]/. {Rule[<<2>>]}==n[T]/. {T->{<<2>>}}+Nd[T]/. {T->{50,1000}},{Ef,T}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. $\endgroup$
    – schiko
    May 20 at 6:32
  • $\begingroup$ Edit your question to include the values. $\endgroup$
    – Bob Hanlon
    May 20 at 6:34
  • $\begingroup$ @BobHanlon Just did. $\endgroup$
    – schiko
    May 20 at 6:38
  • $\begingroup$ Note that the exact value for hbar is QuantityMagnitude@ UnitConvert[Quantity[1, "ReducedPlanckConstant"], "SI"] $\endgroup$
    – Bob Hanlon
    May 20 at 17:21

1 Answer 1

5
$\begingroup$
Clear["Global`*"]

ℏ = 65821*10^-20;
m0 = 9109*10^(-34);
mn = 11/10;
mp = 1/2;
ionizeE = 45/1000;
Eg = 111/100;
Ed = Eg - ionizeE;
nd = 10^13;
kb = 86173*10^-9;

p[T_] = 2*((mp*kb*T)/(2*π*ℏ^2))^(3/2)*Exp[Ef/(kb*T)];

n[T_] = 2*((mn*kb*T)/(2*π*ℏ^2))^(3/2)*Exp[(Eg - Ef)/(kb*T)];

Nd[T_] = nd*(1 + Exp[(Ef - Ed)/(kb*T)]);

eqn = p[T] == n[T] + Nd[T] // Simplify;

sol[T_?NumericQ] := 
 Ef /. FindRoot[eqn, {Ef, 29/50}, WorkingPrecision -> 20]

Plot[sol[T], {T, 5, 1000},
  WorkingPrecision -> 20] // Quiet

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you so much! $\endgroup$
    – schiko
    May 20 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.