LambertW

101 views
Skip to first unread message

Henryk Trappmann

unread,
Aug 28, 2009, 12:23:50 PM8/28/09
to sage-devel
has Sage the Lambert W function implemented?
I can not find it.

William Stein

unread,
Aug 28, 2009, 5:35:44 PM8/28/09
to sage-devel, Fredrik Johansson
2009/8/28 Henryk Trappmann <bo19...@googlemail.com>:

>
> has Sage the Lambert W function implemented?
> I can not find it.

It does, but via mpmath:

sage: mpmath.lambertw(10)
mpf('1.7455280027406994')
sage: import mpmath
sage: mpmath.lambertw(complex(2,3))
mpc(real='1.0900765344857908', imag='0.53013972077483884')
sage: mpmath.lambertw?
pages and pages of examples and docs!

William

William Stein

unread,
Aug 28, 2009, 5:36:19 PM8/28/09
to sage-devel, Fredrik Johansson
2009/8/28 William Stein <wst...@gmail.com>:

> 2009/8/28 Henryk Trappmann <bo19...@googlemail.com>:
>>
>> has Sage the Lambert W function implemented?
>> I can not find it.
>
> It does, but via mpmath:

By the way, do

sage: import mpmath

first.


>
> sage: mpmath.lambertw(10)
> mpf('1.7455280027406994')
> sage: import mpmath
> sage: mpmath.lambertw(complex(2,3))
> mpc(real='1.0900765344857908', imag='0.53013972077483884')
> sage: mpmath.lambertw?
> pages and pages of examples and docs!
>
> William
>

--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

Ondrej Certik

unread,
Aug 28, 2009, 11:55:15 PM8/28/09
to sage-...@googlegroups.com, Fredrik Johansson

or through sympy:

sage: import sympy
sage: sympy.LambertW(x)
LambertW(x)
sage: sympy.integrate(sympy.LambertW(x))
-x + x*LambertW(x) + x/LambertW(x)


Ondrej

Henryk Trappmann

unread,
Aug 30, 2009, 10:44:24 AM8/30/09
to sage-devel
oh thanks. The mpmath is even capable of the complex branches.

Reply all
Reply to author
Forward
0 new messages