How do I find the zero of this function:
Ef=5.53;
e=1.6*10^-19;
qc[w1_?NumericQ] :=
w1 (1/(2 a[w1]) (1 + Sqrt[1 - 4/(27 a[w1])])^(1/3) +
1/(2 a[w1]) (1 - Sqrt[1 - 4/(27 a[w1])])^(1/3));
a[w1_?NumericQ] :=
Piecewise[{{2/3,
w1 < 0.62}, {0.9069 + 0.3577 w1^(-2/3) - 1.0565 w1^(-1) +
1.478 w1^(-4/3) - 0.4524 w1^(-5/3), w1 > 0.62}}];
wmax2[w1_?NumericQ, T_?NumericQ] := Min[T - Ef, T/2];
s4[w1_?NumericQ, T_?NumericQ] := (Pi e^4)/
T (Log[wmax2[w1, T]/qc[w1]] + T/(T - wmax2[w1, T]) - T/(
T - qc[w1]) + 2 Log[(T - wmax2[w1, T])/(T - qc[w1])]);
If I plot it it crosses the x axis, so there is a zero, but NSolve[s4[100,T]==0,T]
gives a complex number as a solution and says to use Refine
, and Refine
can't find the zero.
FindRoot
perhaps? You haven't definedqc
for us, so we can't investigate more. $\endgroup$ – John Doty Jul 4 '18 at 14:50FindRoot
. Can't say more, because you didn't give full definitions of your symbols (e.g. wmax2, qc). You have asked 48 questions on this site so far, you should know how to ask a good question by now. $\endgroup$ – MarcoB Jul 4 '18 at 14:50a
is still undefined. The best way to check for these things is to copy back your posted code in a clean MMA session (see this Q) and try to execute it. It has to work under those conditions, because that's what we will be trying on our own computers. $\endgroup$ – MarcoB Jul 4 '18 at 15:26a
$\endgroup$ – mattiav27 Jul 4 '18 at 16:53