Darwinbots Forum
General => Off Topic => Topic started by: Botsareus on April 20, 2009, 12:59:32 PM
-
Note that the infinite series there has a radius of convergence of 1/e. That means it only gives the right answer if x < 1/e. If x > 1/e, you have to recenter the Taylor series, which isn't something I'll get into here. Also, it only gives one of the valid solutions. Just like sqrt(4) gives 2, which is one valid solution.
Yep, The reguler taylor series only works from -(1/e) to (1/e).
How do I "recenter" it?
-
Actually, there's probably a better way. It was probably a mistake showing you the Taylor series and not these methods right away:
clicky (http://en.wikipedia.org/wiki/Lambert_W#Numerical_evaluation).
Basically you compute a (wrong) answer, and then plug it back into the algorithm and it gives you a more correct answer. And you keep doing it until you get some arbitrary precision or you run out of time.
-
I know what you mean (although I don't understand "Python" at all, I was thinking of writing something like that in vb)
Basically It guesses x++ for every "x ^ x = c" where c is the value given (starting from x=0). If it goes over c, it goes back one, then it does x = x + 0.1 same thing. Then x = x + 0.01 etc.
But, what I want to understand is how to do it the long way, meaning the Taylor series way...
An interesting thing I notice is it can't go below ln(0.4~ ^ 0.4~)
-
Well the taylor series is constructed usually using derivatives. I dunno if you've had the calc background necessary to make it make sense. And LambertW is a peculiar enough function I can't even necessarily guarantee what would happen if you try and recenter it.
Anyway, the iterative method is a bit more complex than you're giving it credit for. It's derivation also lives in calc and derivatives, but basically it's using Newton's method to determine which direction to move in next, and by how much.
The only thing you might not understand looking at that python snippet is the ** operator, which means the same thing as the ^ operator in VB. Everything else should be reasonably understandable.
-
Looks like I will have to solve it the "Russian Way"
-
The only Russian method I know of involves ballet.