Post Reply 
LambertW function
11-07-2020, 08:41 AM (This post was last modified: 11-10-2020 08:26 AM by Stevetuc.)
Post: #2
RE: LambertW function
Simplified the code and change to fsolve:

Code:
#cas
fsolve(w*e^w=z,w)▶lmb(z);
#end
Result for lmb(-1.78) in home or cas:
8.92180498562ᴇ−2+1.62562367443*i

Code:
#cas
fsolve(w*e^w=z,w,0)▶lmb(z);
#end

Edit: add initial guess of 0 to avoid terminal screen in cas. This forces going direct to iterative solver rather than first trying and failing with bisection solver.
Edit: it doesn't fail with Bisectional solver. The cas terminal screen is just for information:
Quote:Solving by bisection with change of variable x=tan(t) and t=-1.57..1.57. Try fsolve(equation,x=guess) for iterative solver or fsolve(equation,x=xmin..xmax) for bisection.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
LambertW function - Stevetuc - 05-17-2020, 08:48 AM
RE: LambertW function - Stevetuc - 11-07-2020 08:41 AM
RE: LambertW function - Albert Chan - 11-07-2020, 11:57 AM
RE: LambertW function - Stevetuc - 11-07-2020, 01:50 PM



User(s) browsing this thread: 1 Guest(s)