Lambert W / Product log function? I would like

Devin Dougherty

Devin Dougherty

Answered question

2022-04-14

Lambert W / Product log function?
I would like to solve this equation:
n2n=15000
And according to WolframAlpha
n=W(15000log(2))log(2),  where  log  is ln
Which shows that I need to use the product log function W which I tried looking up on wikipedia. I don't need the complex numbers, just real numbers.
Additionally, are there ways of solving the original equation without the W functions?
Can someone explain the rules and how to do this please?
I would eventually like to implement a way to find n programmaticly (if possible-in python).

Answer & Explanation

gsmckibbenx7ga

gsmckibbenx7ga

Beginner2022-04-15Added 17 answers

You can use Newton's method for finding the root of
f(n)=n2n15000=0
ni+1=nif(ni)f(ni)=nini2ni150002ni(1+nilog(2))
and start with a suitable guess (look up the Wikipedia page on that). Here n0=1 1 should do.You keep repeating the process for i1 until you reach a proper accuracy, i.e., you terminate at iteration t when ntnt1<ϵ for some tiny ϵ you define.
Questions on exact implementation are more suitable question for SO; also scicomp.SE in case you're interested in details on appropriate numerical methods, and robust libraries

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?