Finding values of Lambert's W function for x>0
Show older comments

I have been struggling with this question and I think I have found an answer but I am not %100 sure. Can you check it please? First, I tried to define a Lambert function
function W = myLambert(a)
syms x;
f (x) = x*exp(x);
g = finverse(f);
double(g(a))
end
In the second part, it gives output for values greater than 0
clc;
clear all;
prompt = 'Enter the x value that is greater than 0 ';
q=input(prompt);
myLambert(q)
1 Comment
Torsten
on 12 Jun 2018
finverse(f) will be MATLAB'S Lambert's W function, not yours ...
Answers (1)
Star Strider
on 12 Jun 2018
Solve this the same way you solved the Bessel function, this time without the loop.
Think of it this way: You want to find:
x = y.*exp(y)
for any ‘x’. Define ‘x’ and solve for ‘y’, using fzero.
4 Comments
Koray Kocak
on 12 Jun 2018
Star Strider
on 12 Jun 2018
You did.
That was the same result I got with this:
x = 12;
LW = lambertw(x);
f = @(y) y.*exp(y) - x;
y = fzero(f, 10);
for both ‘LW’ and ‘y’.
Koray Kocak
on 12 Jun 2018
Star Strider
on 12 Jun 2018
My pleasure!
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!