0
$\begingroup$

I need to plot this implicit equation $$\omega-k=\frac{1}{k}\left[1+\left(1-\frac{\omega}{k}\right) \frac{1}{2} \ln \left(\frac{\omega+k}{\omega-k}\right)\right]\,,$$

for $(k,\omega)\in[0,5]\times[0,5]$. Theoretically, the result is finite at $k=0$ (in fact, the limit is $\omega=1$) and WolframAlpha confirms it.

I tried the following piece of code,

w[k_, \[Omega]_] := 
  1/k (1 + (1 - \[Omega]/k) 1/2 Log[(\[Omega] + k)/(\[Omega] - k)]);
ContourPlot[{\[Omega] - k == w[k, \[Omega]]}, {k, 0, 
  5}, {\[Omega], 0, 5}]

but I get the following error messages:

enter image description here

and an empty plot. What can I do to overcome this issue?

$\endgroup$
2
  • $\begingroup$ It is not the limit that cause the issue. Check that for $k=\omega=x$ you have $\log\left(\frac{x+x}{x-x}\right)$ $\endgroup$
    – bmf
    Commented Apr 11, 2022 at 19:39
  • $\begingroup$ Thanks, @bmf, but as far as I understand, $k=\omega$ is not a solution to the implicit equation. I might be wrong, though. $\endgroup$ Commented Apr 11, 2022 at 19:42

1 Answer 1

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

w[k_, ω_] := 1/k (1 + (1 - ω/k) 1/2 Log[(ω + k)/(ω - k)]);

Limit[w[k, ω], #] & /@ {ω -> k, k -> 0, ω -> 0}

(* {1/k, 1/ω, (2 + I π)/(2 k)} *)

w[k_, k_] := 1/k;

w[_?(# == 0 &), ω_] := 1/ω;

w[k_, _?(# == 0 &)] := (2 + I*Pi)/(2 k)

ContourPlot[{ω - k == w[k, ω]}, {k, 0, 5}, {ω, 0, 5},
 Exclusions -> {ω == k},
 FrameLabel -> (Style[#, 16] & /@ {k, ω})]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks! Now I understand what I was missing. $\endgroup$ Commented Apr 11, 2022 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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