Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
I'm trying to use a floating point evaluation of the LambertW function, within the assignment of a numerically evaluated function, but once the argument to the LambertW function becomes dynamic (i.e. the numerical wrapper function's arguments passed into the symbolic LambertW function), the LambertW function turns red and shows the error "This variable is undefined." I've been searching the archives of this forum and I see a few posts with similar questions, specificallly pertaining to the polylog symbolic function, but frankly I don't understand the discrepancy yet. If anybody has time to check out the attached worksheet and give me some pointers, I'd appreciate the help. Thanks!
Update...
Been working on this... I still don't really understand the disconnect between the symbolic and numerical solver, but after searching this forum more, I found a few worksheets and posts that provided some insight into numerical evaluation of the LambertW function. Specifically, this post:
http://communities.ptc.com/message/58209#58209
Using examples in the worksheets attached to the above post, and with a little tweaking of the initial value for the root function, I came up with a solution to my function that appears to be working well (attached).
Thanks to everyone who's posted about this in the past - I learned a lot from browsing old posts!
If you still would like to use the symbolic LambertW in your function f you can get it to work with a little trick using a local assignment:
You have to type the highlighted expression somewhere in you worksheet and copy it from there in your "program".
WE
Just played around and found, that you do not need the local assignement and the dummy variable.
A normal bracket around the highlighted expression is all that is needed. You still have to copy and paste the expression with the symbolic evaluation
My oft repeated warning:
The float keyword does not just change the precision of the displayed result. It changes the precision of the calculations. It should be used very sparingly!
Thanks to everybody for the followup comments. Very insightful and interesting.