(28/48/50) Lambert W Function
|
01-29-2024, 02:47 PM
(This post was last modified: 01-29-2024 02:58 PM by Gil.)
Post: #30
|
|||
|
|||
RE: (28/48/50) Lambert W Function
I tried to translate your code in post 17, Albert.
{ "« x -.1 <= IF THEN .367879441171 'R' STO 4.42321595524E-13 'R2' STO 'sqrt(2.*R*(x+R+R2))*(k+k+1.)' —>NUM 'Y' STO 'R+Y*sqrt (1.+Y/(3.*R))' —) NUM 'Y' STO DO Y 'Y+x' '(Y-R-R2)/R' —>NUM DUP TYPE 1. == IF THEN 1. + LN ELSE LNP1 END / - —>NUM 'H' STO 'Y-H' —>NUM 'Y' STO Y 'Y+H*.0001' —>NUM == UNTIL END ELSE 'k+k+1.' '(k+k+1.)*x/4.' + —>NUM 'Y' STO DO 'Y-(Y+x)/(LN(Y)+1.)' —>NUM 'H' STO 'Y-H' —>NUM 'Y' STO UNTIL Y 'Y+H*.0001' —>NUM == END END x Y / »-x =-.36787944118 W(k=->; (-.999999999985,-6.87304618656E-6) Result ± ok for imaginary part. Your translated code for more accuracy, post 19, same input values « x -.1 IF THEN .367879441171 'R' STO 4.42321595524E-13 'R2' STO '(x+R+R2)/R' —>NUM 'H' STO 'sqrt(2.*H)*(2.*k+1.)' —>NUM 'X' STO 'X*sqrt(1.+X/3.)' —>NUM 'X' STO 'R+R*X' —>NUM 'Y' STO DO X DUP TYPE 1. == IF THEN 1. + LN ELSE LNP1 END 'Z' STO 'X-(X-Z+H)/Z', —>NUM 'Z' STO X Z - 'X' STO X 'X+Z*.000001' —>NUM == UNTIL END X DUP TYPE 1. == IF THEN 1. + LN ELSE LNP1 END 1. - ELSE 'k+k+1.' '(k+k+1.)*x/4.' + —>NUM 'Y' STO DO 'Y-(Y+x)/(LN(Y)+1.)' —>NUM 'H' STO 'Y-H' —>NUM 'Y' STO UNTIL Y 'Y+H*.0001' —>NUM == END x Y / END » No solution is found: X is never equal to 'X+Z*.000001'. Why this difference of "behaviour"? And why, in code post 29, did you define Y=R+R*X, that seems never to be used again? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 13 Guest(s)