does any body know how to write an iteration to compute y in y-log(y)=x ?

thank's,

dan

Results 1 to 15 of 15

- Jul 10th 2006, 07:28 AM #1

- Jul 10th 2006, 08:08 AM #2

- Joined
- Nov 2005
- From
- someplace
- Posts
- 14,972
- Thanks
- 5

- Jul 10th 2006, 09:09 AM #3

- Joined
- Nov 2005
- From
- New York City
- Posts
- 10,616
- Thanks
- 10

(I assume your question is on Newton's Method cuz that is what you asked the other time).

You want to solve,

$\displaystyle y-\ln y =x$

Which is equivalent to,

$\displaystyle y-\ln y-x=0$

The iteration sequence is,

$\displaystyle

a_{n+1}=a_n-\frac{f(a_n)}{f'(a_n)}

$

Where,

$\displaystyle f=y-\ln y-x$

Thus,

$\displaystyle f'=1-1/y$

Thus,

$\displaystyle f(a_n)=a_n-\ln a_n-x$

$\displaystyle f'(a_n)=1-1/a_n$

Thus,

$\displaystyle a_{n+1}=a_n-\frac{a_n-\ln a_n-x}{1-1/a_n}$

Simplfy,

$\displaystyle a_{n+1}=a_n-\frac{a_n-\ln a_n-x}{\left(\frac{a_n-1}{a_n} \right)}$

More simplfying,

$\displaystyle a_{n+1}=a_n-\frac{a_n^2-a_n\ln a_n-xa_n}{a_n-1}$

And yet one more time, (watch those signs )

$\displaystyle a_{n+1}=\frac{a_n^2-a_n-a_n^2+a_n\ln a_n -xa_n}{a_n-1}$

Finally we have,

$\displaystyle a_{n+1}=\frac{a_n(\ln a_n-x-1)}{a_n-1}$

- Jul 10th 2006, 10:00 AM #4

- Jul 10th 2006, 10:14 AM #5

- Joined
- Nov 2005
- From
- someplace
- Posts
- 14,972
- Thanks
- 5

Originally Posted by**dan**

$\displaystyle a_{n+1}$ in terms of $\displaystyle a_n$, so you get a sequence:

$\displaystyle a_0,\ a_1,\ .. \ a_n,\ ..$,

which with luck will converge to the required solution.

RonL

- Jul 10th 2006, 12:47 PM #6

- Jul 10th 2006, 01:02 PM #7

- Joined
- Nov 2005
- From
- New York City
- Posts
- 10,616
- Thanks
- 10

- Jul 10th 2006, 01:12 PM #8

- Jul 10th 2006, 01:30 PM #9

- Joined
- Nov 2005
- From
- someplace
- Posts
- 14,972
- Thanks
- 5

Originally Posted by**dan**

iteration as given by PH it appears to diverge with $\displaystyle x=10$, $\displaystyle a_0=10$ or $\displaystyle 14$!

It must be a mistake in PH's algebra as the iteration (which is what PH had before he tried simplifying it):

$\displaystyle

a_{n+1}=a_n-\frac{a_n^2-a_n\ln(a_n)-xa_n}{a-1}

$

does converge with $\displaystyle x=10, a_0=10$, to $\displaystyle \approx 12.528$ after two iterations.

RonL

- Jul 10th 2006, 02:15 PM #10

- Joined
- Oct 2005
- From
- Earth
- Posts
- 1,599

PH: Some slight errors in your algebra.

Starting from here: $\displaystyle

a_{n+1}=a_n-\frac{a_n^2-a_n\ln a_n-xa_n}{a_n-1}

$

For the next step you wrote:Originally Posted by**ThePerfectHacker**

$\displaystyle a_{n+1}=\frac{a^2_{n}-a_{n}}{a_{n}-1}-\frac{(a_n^2-a_n\ln a_n-xa_n)}{a_{n}-1}$

$\displaystyle a_{n+1}=\frac{a^2_{n}-a_{n}-a^2_{n}+a_{n}\ln(a_{n})+xa_{n}}{a_{n}-1}$

And factoring: $\displaystyle a_{n+1}=\frac{a_n(\ln(a_n)+x-1)}{a_n-1}$

- Jul 10th 2006, 02:33 PM #11

- Joined
- Nov 2005
- From
- New York City
- Posts
- 10,616
- Thanks
- 10

- Jul 10th 2006, 06:09 PM #12Originally Posted by
**dan**

You are given x

Guess any value of a(a is iterating variable, should be greater than x)

Find $\displaystyle \frac{a + loga + x}{2}$

You will get some value

this is your next value of a

Substitute it again in the above expression.

After some steps it will give the answer(when you the same value of a for two times)

Note: I am not sure about this idea, please someone check it.

Keep Smiling

Malay

- Jul 10th 2006, 07:36 PM #13

- Joined
- Nov 2005
- From
- someplace
- Posts
- 14,972
- Thanks
- 5

- Jul 11th 2006, 04:22 AM #14

- Jul 11th 2006, 04:39 AM #15

- Joined
- Nov 2005
- From
- someplace
- Posts
- 14,972
- Thanks
- 5