0
$\begingroup$

I want to plot this equation.

enter image description here

mu, Eb, gamma, Eg are constant parameters and x is independent parameter.

\[Mu] := 1;
Eb := 0.040;
\[CapitalGamma] := 1;(*Fitting parameter*)
Eg := 2.354
Ebj := Eg - Eb/j^2
c := 1.4 (*fitting parameter*)
A[x_?NumericQ] := \[Mu]^2/x (Sum[(2 Eb /j^3 Sech[(x - Ebj)/\[CapitalGamma]]), {j, 1, 10}] + 
Integrate[Sech[(x - e)/\[CapitalGamma]] 1/(1 - c (e - Eg))(*1/(1-
 E[-2 Pi Sqrt[Eb/(e-Eg)]])*) , {e, Eg, 2.355}])

Plot[A[x], {x, 2.0, 3.5}]

There are two problem.

  1. Above the equation, I omit (1/(1-E[-2 Pi Sqrt[Eb/(e-Eg)]])) part because of NIntegrate : non-numerical values error. (maybe divergence issue)
  2. Although I omit some part, It takes too long time to Plot.

How remove that error and save calculation time?

Thank you

$\endgroup$
1
$\begingroup$

The Integral has no closed form solution, so use NIntegrate instead of Integrate:

\[Mu] := 1;
Eb := 0.040;
\[CapitalGamma] := 1;(*Fitting parameter*)Eg := 2.354
Ebj := Eg - Eb/j^2
c := 1.4 (*fitting parameter*)

and

A[x_?NumericQ] := \[Mu]^2/
   x (Sum[(2 Eb/j^3 Sech[(x - Ebj)/\[CapitalGamma]]), {j, 1, 10}] + 
    NIntegrate[Sech[(x - e)/\[CapitalGamma]] 1/(1 - c (e - Eg))(*1/(1-
     E[-2 Pi Sqrt[Eb/(e-Eg)]])*), {e, Eg, 2.355}])

then

Plot[A[x], {x, 2.0, 3.5}]

delivers:

enter image description here

$\endgroup$
  • $\begingroup$ Thank you very much. but when I input 1/(1 - E[-2 Pi Sqrt[Eb/(e - Eg)]]) part, the errors exist yet. (non-numerical values). Is there any solution?? $\endgroup$ – hongsun Ryu Aug 29 at 6:31
  • $\begingroup$ Could not try at the moment, but in the picture of your formula is no "-" before "2Pi..." product? Maybe a typo? $\endgroup$ – mgamer Aug 29 at 6:51
  • $\begingroup$ Oh... that image is wrong... and I found typo not E but Exp[...] thank you $\endgroup$ – hongsun Ryu Aug 29 at 7:10

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.