qraal
- 787
- 3
Hi All
Is there a solution to the following?
y = x/ln(2x)
...solving for x.
Is there a solution to the following?
y = x/ln(2x)
...solving for x.
qraal said:Hi All
Is there a solution to the following?
y = x/ln(2x)
...solving for x.
rock.freak667 said:as in x/ln(2x) = 3, find x?
coomast said:Hello qraal,
Using the method of Newton-Raphson will give you a fast approximate solution if you have a "good" starting value in the neighbourhood of the solution. The method can be found here:
http://en.wikipedia.org/wiki/Newton's_method
and is for your equation:
x_{n+1}=x_{n}+\frac{ln(2x_{n})[yln(2x_n)-x_n]}{ln(2x_n)-1}
The problem is that the function
\frac{x}{ln(2x)}
is diverging for x=0.5. For values smaller than 0.5 it is negative and for values larger than 0.5 it is positive. However for the positive values it has a minimum and thus two solutions if a y-value is given. So the initial value is best to be determined by plotting it.
As an example use rock.freak667 value of 3. This has two solutions, one in the neighbourhood of x=0.6 and one in the neighboorhood of x=8. These serve as starting values in the iterative scheme and give you very quickly the solutions. I have the following values: x=0.613444 and x=8.499444. I added also a graph of the function to clearify things. If you have any questions please post.
best regards,
coomast
coomast said:Hello qraal,
@CRGreathouse: I can't get to your expression with the function of Lambert. I get by rewritting this expression back to the original form the following:
x-ln(2x)=y
I might be making a silly mistake, it's getting late over here and I'm a bit tired:-) Anyway to find the solution even with Lambert you will need an iterative scheme and Newton-Raphson seems the easiest here. Presumably it will give a similar formula as the one I gave. Or is there another one which is faster?
best regards,
coomast
uart said:I think there is a mistake in that derivation of the Lambert-W solution. Here's how I would do it.
\ln(2x) = x/y
2x = e^{x/y}
2x e^{-x/y} = 1
Now let z = -x/y.
-2y\,z\,e^{z} = 1
z e^{z} = \frac{-1}{2y}
So from the definition of the Lambert W function :
z = W \left( \frac{-1}{2y} \right)
and
x = -y \, W \left( \frac{-1}{2y} \right)
coomast said:This is the same result I had. Now the initial remark raised by CRGreathouse was:
"This can be solved fairly quickly compared to a general Newton's method based solution."
What is this other method? Using Newton-Raphson on the Lambert function gives in the end the same interative scheme as the one I proposed. I think the formula obtained is easy and fast enough to get to the solution. If another method is available I would like to learn it, it will be interesting.
best regards,
coomast
coomast said:"This can be solved fairly quickly compared to a general Newton's method based solution."
What is this other method? Using Newton-Raphson on the Lambert function gives in the end the same interative scheme as the one I proposed. I think the formula obtained is easy and fast enough to get to the solution. If another method is available I would like to learn it, it will be interesting.
CRGreathouse said:What are your numbers?
qraal said:My target y value is 210713.2394 and my starting x value is 3303361. I used Newton's Method, as per my Maths text and Wikipedia, i.e.
x1 = x0 - f(x0)/f '(x0)
...but it converged somewhere else.
Дьявол said:y=\frac{x}{ln(2x)}
...
2=e^k
...
x^y=z
...
x=k*y*ln(z)
k is constant ≈ 0.693147
z can be any number
This is what I came up with...
Kittel Knight said:Of course not.