I am currently trying to numerically evaluate an expression which is the following. The expression IntD0
is being plotted, but the next line is not. I thought it might be because of zeros in IntD0
but even after removing them it shows an empty plot. I am not sure why this is happening.
The expression formally is the following : \begin{equation} \begin{aligned} &D_0 = \int_{-\left({w}+{T}\right)}^{\left({w}+{T}\right)}d{\epsilon}\frac{1}{\pi{w}}\left[1-\frac{{\epsilon}^2}{{w}^2}\right]\frac{\exp{\left(\frac{{\epsilon}-{\mu}}{{T}}\right)}}{\left(\exp{\left(\frac{{\epsilon}-{\mu}}{{T}}\right)}+1\right)^2}\frac{1}{T} \\ &E = \sqrt{\lambda - \frac{1}{D_{0}}}, \end{aligned} \end{equation} where $\lambda$, $w$, $T$, $\mu$ are parameters, and I am plotting $E$ as a function of $T$.
g[\[Epsilon]_, w_] := 1/(\[Pi] w) (1 - (\[Epsilon])^2/w^2)
f1[\[Epsilon]_, \[Mu]_,
T_] := E^((\[Epsilon] - \[Mu])/T)/((1 + E^((\[Epsilon] - \[Mu])/
T))^2 T)
(* Integrate*)
IntD0[(w_)?NumericQ, (\[Mu]_)?NumericQ, (T_)?NumericQ] :=
NIntegrate[
g[\[Epsilon], w] f1[\[Epsilon], \[Mu], T], {\[Epsilon], -w - T,
w + T}, MaxRecursion -> 100, AccuracyGoal -> Infinity,
Method -> "LocalAdaptive"]
Manipulate[
ListLinePlot[Table[{b, IntD0[t, e, b]}, {b, 0.001, 1, 0.05}]], {e, 0,
1}, {t, 0.001, 1}]
Manipulate[
ListLinePlot[
Table[{b, Sqrt[c - (1/IntD0[t, e, b]) ]}, {b, 0.1, 1}]], {e, 0.5, 1}, {t, 0.5, 1},{c, 0.5, 1}] (* empty plot*)
Edit: I had made an error in not specifying the increments for b. (thanks to @MarcoB for this)
g
that appears in yourNIntegrate
? $\endgroup$(1+E^((\[Epsilon]-\[Mu])/T))^2
and the denominator in the TeX-formula for $D_0$, the square is not in the same place. $\endgroup$Table[{b, Sqrt[c - (1/IntD0[t, e, b]) ]}, {b, 0.1, 1}]]
Evaluates to a{{0.1, 0. + 3.01091 I}}
, A single point to plot, but a complex andListLinePlot
expects real numbers, not complex. $\endgroup$