Lower branch of Lambert W function in mathematica
Expanding my comment into an answer, ProductLog
can take two arguments, k
and z
, namely:
ProductLog[k, z]
There's some information to be found under the Details & Options of the documentation, but instead I turned to MathWorld, which has this to say on the matter:
The plot above shows the function along the real axis. The principal value of the Lambert W-function is implemented in Mathematica as
ProductLog[z]
. Different branches of the function are available in Mathematica asProductLog[k, z]
, wherek
is any integer andk = 0
corresponds to the principal value. Although undocumented,LambertW[k, z]
autoevaluates toProductLog[k, z]
in Mathematica.
Hence, if k = 0
gives the principal value, I think that using ProductLog[-1, z]
should be the solution you're after for $W_{-1}(z)$.
I'm not sure why the documentation isn't as clear on this.
Try this:
lst = Select[
Table[{z, (FindRoot[w + Log[w] == Log[z], {w, -1000, -1},
Method -> "Secant", AccuracyGoal -> 3, PrecisionGoal -> 3] //
Chop)[[1, 2]]}, {z, -0.5, -0.009, 0.002}], Im[#[[2]]] == 0 &];
which gives the list with the structure {z,W}
. This plots the list
ListPlot[Select[lst, Im[#[[2]]] == 0 &],
PlotRange -> {{-0.4, 0.1}, {-6, 1}}, AxesStyle -> Arrowheads[0.03],
AxesLabel -> {Style["z", 16, Italic], Style["W", 16, Italic]}]
It should look like follows:
There is a still more simple approach to this question. Just let us plot the function using the ParametricPlot
:
ParametricPlot[{W*Exp[W], W}, {W, -6, 0},
PlotRange -> {{-0.4, 0.1}, {-6, 1}}, AspectRatio -> 0.6,
AxesStyle -> Arrowheads[0.03],
AxesLabel -> {Style["z", 16, Italic], Style["W", 16, Italic]}]
Obviously, it should look very close to the first one:
If you need a table of the solution (e.g., z
versus W
you can make the list using the same idea:
lst2 = Table[{W*Exp[W], W} // N, {W, -6, 0, 0.3}]
yielding
(* {{-0.0148725, -6.}, {-0.019072, -5.7}, {-0.0243895, -5.4}, \
{-0.0310934, -5.1}, {-0.0395028, -4.8}, {-0.0499905, -4.5}, \
{-0.0629814, -4.2}, {-0.0789435, -3.9}, {-0.0983654, -3.6}, \
{-0.121714, -3.3}, {-0.149361, -3.}, {-0.181455, -2.7}, {-0.217723, \
-2.4}, {-0.257158, -2.1}, {-0.297538, -1.8}, {-0.334695, -1.5}, \
{-0.361433, -1.2}, {-0.365913, -0.9}, {-0.329287, -0.6}, {-0.222245, \
-0.3}, {0., 0.}} *)
I made a small step to have it short.
Have fun!