Re: How to solve this natural log problem?




"David W. Cantrell" <DWCantrell@xxxxxxxxxxx> wrote in message news:20070129122419.199$HL@xxxxxxxxxxxxxxxxx
"Dirk Van de moortel" <dirkvandemoortel@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
<amy_burton2007@xxxxxxxxx> wrote in message
news:1170055954.369782.189430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> How to solve for x?
>
> 4000x = -6.9 - ln x

Take excel and write a number in cell A1.
In cell A2 enter the formula
= A1 - ( 4000*A1 + 6.9 + LN(A1) ) / ( 4000 + 1/A1 )
and copy this down to about A20.

This is Newton's method with f(x) = 4000 x + 6.9 + ln(x)

You're going to need a very small number to start with in A1
Try putting 1, 0.1, 0.01, 0.001 etc... in A1 and see what happens.

If you don't have excel, just take a high precision calculator
and you'll find the result in a few minutes.

My first preference would be to use the Lambert W function, as Rob did.

Yes, although excel doesn't have the Lambert W function (and
I have *never* seen a home/garden/kitchen calculator offer it),
there is, at least on this group, a strange tendency to mention
Lambert W whenever someone is looking for a solution to this
kind of equations.
Strange :-)



My second preference would be to use some analysis to get an approximate
solution. Then, if that's not sufficiently accurate, it at least gives a
good value for A1 in Newton's (or some other iterative) method.

Knowing that x must be a small positive number, the equation

a x = -b - ln(x)

has the approximate solution

x = (2a + 3c - Sqrt(-2a^2 + 24ac + 9c^2)) / (a(a - 2c)) where c = e^b.

Using a = 4000 and b = 6.9 in the above, we get the approximate solution

x = 0.000308... For comparison, the solution, as mentioned by Rob, is

x = 0.0003016...

Yes, that's what Excel gives me after a mere 5 iterations
with a seed of 0.001.

Dirk Vdm
.



Relevant Pages

  • Re: Using Array Formulas
    ... > Rob wrote: ... > so in earlier versions of Excel, and I remember having used it, but it is no ... By using an array formula and names in my example, clicking on any cell ...
    (microsoft.public.mac.office.excel)
  • Re: Weird DISPLAY Glitch? Everything divided by 100! [updated]
    ... robbyg4307 or Rob - ... Decision Analysis Add-ins for Excel ... display glitch today on both my MacBook Pro and Mac Pro computers. ... Similarly, if I enter 1234 into ANY cell, Excel displays 12.34. ...
    (microsoft.public.mac.office.excel)
  • Re: How to solve this natural log problem?
    ... Take excel and write a number in cell A1. ... My first preference would be to use the Lambert W function, as Rob did. ... has the approximate solution ...
    (sci.math)
  • Re: Changing the Colour of a comment
    ... You can change the color of cell comments, individually or the tool tip default, ... My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm ... > Rob, I don't think this is possible ... >> flagged with a red indicator in the top right hand corner. ...
    (microsoft.public.excel.misc)
  • Re: Output form to excel with range ????
    ... here is a long post with lots of useful code for exporting to excel. ... Dim varGetFileName As Variant 'File Name with Full Path ... Set objXLws = objXLWkb.ActiveSheet ... For Each cell In objXLws.Range ...
    (microsoft.public.access.formscoding)

Loading