0
$\begingroup$

I'd like to fit a branch of the Lambert function :

-ProductLog[-1, x]

in the interval $[-0.35,0]$ with a function of the form $-a\log(-bx)+c+d x$ or $-a\log(-x)+c+d x$ or something like that. I saw that the functions

-Log[-x] + 1.5 + 3 x
-1.5*Log[-x]

were not so bad but I'd like to fit better...

The command $Fit$ is not good for that kind of fitting, and Fitting one function to another doesn't look appropriate either.

How could I proceed plz ?

$\endgroup$
1
$\begingroup$

Try

int[a_?NumericQ, c_?NumericQ, d_?NumericQ] :=NIntegrate[( \[Minus]a Log[\[Minus]x] + c + d x -ProductLog[-1, x])^2, {x, -.35, 0}]
opt = NMinimize[int[a, c, d], {a, c, d}]
(*{0.000222356, {a -> -1.13033, c -> -1.27779, d -> -2.88088}}*)

check result

Plot[{ \[Minus]a Log[\[Minus]x] + c + d x,ProductLog[-1, x]} /. opt[[2]] // Evaluate, {x, -.35, 0}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.