0
$\begingroup$

I am trying to solve an equation involving polylog using FindRoot, I am not sure how to give the initial guess as I want to solve the equation for a variety of parameters. Here is my code:

q := 1.6*10^-19; (* Electron charge in Coulomb *)
me := 9.1*10^-31; (* Free electron rest mass in kg *)
h := 6.63/(2*\[Pi])*10^-34;  (* Reduced Planck's constant in J.s *)
kb := 1.38*10^-23; (* Boltzmann constant in J/K *)

FD[d_, \[Eta]_] := -PolyLog[d + 1, -E^\[Eta]];(* Defining the Fermi-Dirac integrals *)

Nc[d_, gs_, gv_, meff_, T_] := gs*gv*((2*\[Pi]*meff*me*kb*T)/h^2)^(d/2);  (* Effective band-edge DOS in d dimensions *)

n[d_, gs_, gv_, meff_, T_, \[Eta]F_] := Nc[d, gs, gv, meff, T]*FD[(d - 2)/2, \[Eta]F]; 

\[Eta]S[d_, gs_, gv_, meff_, T_, v_, nd_] := 
 Quiet[Chop[
     FindRoot[
      1/2*(n[d, gs, gv, meff, T, \[Eta]] + 
          n[d, gs, gv, meff, T, \[Eta] - (q*v)/(kb*T)]) == 
       nd, {\[Eta], 
       1}]][[1]][[2]]]; 

Lkcore[d_, gs_, gv_, meff_, T_, v_, nd_] := 
 1/2*((FD[d/2, \[Eta]S[d, gs, gv, meff, T, v, nd]] + 
      FD[d/2, \[Eta]S[d, gs, gv, meff, T, v, nd] - (q*v)/(kb*T)] - 
      2*FD[d/2, \[Eta]S[d, gs, gv, meff, T, 0, nd]])/(FD[(d - 1)/
       2, \[Eta]S[d, gs, gv, meff, T, v, nd]] - 
      FD[(d - 1)/
       2, \[Eta]S[d, gs, gv, meff, T, v, nd] - (q*v)/(kb*T)])^2); 


Lk0[d_, gs_, gv_, meff_, T_] := (2*\[Pi]*meff*me)/(
  q^2*Nc[d, gs, gv, meff, T]);
Lkall[d_, gs_, gv_, meff_, T_, v_, nd_] := 
  Lk0[d, gs, gv, meff, T]*Lkcore[d, gs, gv, meff, T, v, nd];

Now there is a line in the code

\[Eta]S[d_, gs_, gv_, meff_, T_, v_, nd_] := 
 Quiet[Chop[
     FindRoot[
      1/2*(n[d, gs, gv, meff, T, \[Eta]] + 
          n[d, gs, gv, meff, T, \[Eta] - (q*v)/(kb*T)]) == 
       nd, {\[Eta], 
       1}]][[1]][[2]]]; 

I have approximately given the estimate of Eta = 1, but suppose I want to evaluate Lkall for d=1, gs=2,gv=1, meff=1, and T between 10 and 300, nd between 10^6 and 10^8, I am getting vastly wrong results since I am guessing my initial guess for Eta is not right for all the different values of T and nd. How should I automate this process of choosing the right estimate of eta for each value of T and nd and I don't have to draw a graph and estimate. I am getting vastly wrong results since I am guessing my initial guess for Eta is not right for all the different values of T and nd. How should I automate this process of choosing the right estimate of eta for each value of T and nd and I don't have to draw a graph and estimate.

$\endgroup$
  • $\begingroup$ What is the value of v? $\endgroup$ – Bob Hanlon May 15 at 18:06
  • $\begingroup$ value of v=0 to 1 $\endgroup$ – Indeterminate May 16 at 2:40

Your Answer

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

Browse other questions tagged or ask your own question.