Jump to content

Lambert W function

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by NellieBly (talk | contribs) at 20:31, 29 October 2009 (Reverted edits by 71.121.242.66 to last revision by Sligocki (HG)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The graph of W0(x) for −1/e ≤ x ≤ 4

In mathematics, the Lambert W function, named after Johann Heinrich Lambert, also called the Omega function or product log, is the inverse function of f(w) = wew where ew is the natural exponential function and w is any complex number. The function is denoted here by W. For every complex number z:

Since the function ƒ is not injective, the function W is multivalued (except at 0). If we restrict to real arguments x and demand w real, then the function is defined only for x ≥ −1/e, and is double-valued on (−1/e, 0); the additional constraint w ≥ −1 defines a single-valued function W0(x), whose graph is shown. We have W0(0) = 0 and W0(−1/e) = −1. The alternate branch on [−1/e, 0) with w ≤ −1 is denoted W−1(x) and decreases from W−1(−1/e) = −1 to W−1(0) = −∞.

The Lambert W function cannot be expressed in terms of elementary functions. It is useful in combinatorics, for instance in the enumeration of trees. It can be used to solve various equations involving exponentials and also occurs in the solution of delay differential equations, such as y'(t) = a y(t − 1).

Lambert W function in the complex plane. Note the branch cut running along the negative real axis, ending at −1/e

The canonical reference is by Corless, Gonnet, Hare, Jeffrey and Knuth.[1]

History

Lambert first considered the related Lambert's Transcendental Equation in 1758[2] which led to a paper by Leonhard Euler in 1783[3] that discussed the special case of wew. However the inverse of wew was first described by Pólya and Szegö in 1925[citation needed].

Differentiation and integration

By implicit differentiation, one can show that W satisfies the differential equation

and hence:

The function W(x), and many expressions involving W(x), can be integrated using the substitution w = W(x), i.e. x = w ew:

Taylor series

The Taylor series of W0 around 0 can be found using the Lagrange inversion theorem and is given by

The radius of convergence is 1/e, as may be seen by the ratio test. The function defined by this series can be extended to a holomorphic function defined on all complex numbers with a branch cut along the interval (−∞, −1/e]; this holomorphic function defines the principal branch of the Lambert W function.

Special values

(the Omega constant)

Applications

The Lambert function has been applied to solve problems in the analysis of algorithms, the spread of disease, quantum physics, ideal diodes and transistors, black holes, the kinetics of pigment regeneration in the human eye, dynamical systems containing delays, and in many other areas.[4]

Many equations involving exponentials can be solved using the W function. The general strategy is to move all instances of the unknown to one side of the equation and make it look like Y = XeX at which point the W function provides the solution.

In other words :

Examples

Example 1

More generally, the equation

where

can be transformed via the substitution

into

giving

which yields the final solution

Example 2

Similar techniques show that

has solution

or, equivalently,

Example 3

Whenever the complex infinite exponential tetration

converges, the Lambert W function provides the actual limit value as

where ln(z) denotes the principal branch of the complex log function.

Example 4

Solutions for

have the form

Example 5

The solution for the current in a series diode/resistor circuit can also be written in terms of the Lambert W. See diode modeling.

Example 6

The delay differential equation

has characteristic equation , leading to and , where is the branch index. If is real, only need be considered.

Generalizations

The standard Lambert W function expresses exact solutions to transcendental algebraic equations (in x) of the form:

where a0, c and r are real constants. The solution is . Generalizations of the Lambert W function[5] include:

and where r1 and r2 are real distinct constants, the roots of the quadratic polynomial. Here, the solution is a function has a single argument x but the terms like ri and ao are parameters of that function. In this respect, the generalization resembles the hypergeometric function and the Meijer G-function but it belongs to a different class of functions. When r1 = r2, both sides of (2) can be factored and reduced to (1) and thus the solution reduces to that of the standard W function. Eq. (2) expresses the equation governing the dilaton field, from which is derived the metric of the lineal two-body gravity problem in 1+1 dimensions (one spatial dimension and one time dimension) for the case of unequal (rest) masses, as well as, the eigenenergies of the quantum-mechanical double-well Dirac delta function model for unequal charges in one dimension.
  • Analytical solutions of the eigenenergies of a special case of the quantum mechanical three-body problem, namely the (three-dimensional) hydrogen molecule-ion.[7] Here the right-hand-side of (1) (or (2)) is now a ratio of infinite order polynomials in x:
where ri and si are distinct real constants and x is a function of the eigenenergy and the internuclear distance R. Eq. (3) with its specialized cases expressed in (1) and (2) is related to a large class of delay differential equations.

Applications of the Lambert "W" function in fundamental physical problems are not exhausted even for the standard case expressed in (1) as seen recently in the area of atomic, molecular, and optical physics.[8]

Plots

Numerical evaluation

Iterative algorithm

The W function may be approximated using Newton's method, with successive approximations to (so ) being

The W function may also be approximated using Halley's method,

given in Corless et al. to compute W. Together with the evaluation error estimate given in Chapeau-Blondeau and Monir, the following Python code, which computes the principal branch for , implements this. Note: the success of this code is closely dependent on the initial estimates (e.g., w = 0).

from math import e
 
def lambertW(x, prec=1E-12, maxiters=100):
    w = 0    

    for i in range(maxiters):
        we = w * e**w
        w1e = (w + 1) * e**w

        if prec > abs((x - we) / w1e):
            return w

        w -= (we - x) / (w1e - (w + 2) * (we - x) / (2*w + 2))
        
    raise ValueError("W doesn't converge fast enough for abs(z) = %f" % abs(x))

Approximation

The following closed form approximation for values of x greater than or equal to zero may be used by itself when less accuracy is needed, or to give an excellent initial estimate to the above code, which then may need only a few iterations:

double
desy_lambert_W(double x) {
      double  lx1;
      if (x <= 500.0) {
              lx1 = ln(x + 1.0);
              return 0.665 * (1 + 0.0195 * lx1) * lx1 + 0.04;
      }
      return ln(x - 4.0) - (1.0 - 1.0/ln(x)) * ln(ln(x));
}

(from http://www.desy.de/~t00fri/qcdins/texhtml/lambertw/)

See also

Notes

  1. ^ Corless, R. M.; Gonnet, G. H.; Hare, D. E. G.; Jeffrey, D. J.; Knuth, D. E. (1996). "On the Lambert W function" (PDF). Advances in Computational Mathematics. 5: 329–359.
  2. ^ Lambert JH, "Observationes variae in mathesin puram", Acta Helveticae physico-mathematico-anatomico-botanico-medica, Band III, 128-168, 1758 (facsimile)
  3. ^ Euler, L. "De serie Lambertina Plurimisque eius insignibus proprietatibus." Acta Acad. Scient. Petropol. 2, 29-51, 1783. Reprinted in Euler, L. Opera Omnia, Series Prima, Vol. 6: Commentationes Algebraicae. Leipzig, Germany: Teubner, pp. 350-369, 1921. (facsimile)
  4. ^ http://www.orcca.on.ca/LambertW/posters/LambertW_UWO_Poster.pdf
  5. ^ T.C. Scott and R.B. Mann (April 2006). General Relativity and Quantum Mechanics: Towards a Generalization of the Lambert W Function, AAECC (Applicable Algebra in Engineering, Communication and Computing), 17: no. 1,  41–47, [1]; Arxiv article [2]
  6. ^ P.S. Farrugia, R.B. Mann, and T.C. Scott (2007). N-body Gravity and the Schrödinger Equation, Class. Quantum Grav. 24: 4647–4659, [3]; Arxiv article [4]
  7. ^ T.C. Scott, M. Aubert-Frécon and J. Grotendorst (2006). New Approach for the Electronic Energies of the Hydrogen Molecular Ion, Chem. Phys. 324: 323–338, [5]; Arxiv article [6]
  8. ^ T.C. Scott, A. Lüchow, D. Bressanini and J.D. Morgan III (2007). The Nodal Surfaces of Helium Atom Eigenfunctions, Phys. Rev. A 75: 060101, [7]