lambertw, all branches
|
01-23-2024, 11:00 PM
(This post was last modified: 01-24-2024 03:23 PM by Gil.)
Post: #43
|
|||
|
|||
RE: lambertw, all branches
Again, W(k=-1,a=+PI/2 )
seems impossible to give — at least with my HP50G program —the nice answer (0-i×PI), returning "tiny real - i×PI" And also W(k=-1, a=-4×PI/2 ) HP output is "tiny - i×2PI" And also W(k=-2,a=i×6PI/2) HP output is "tiny - i×3PI" LambertW (k=-3,0+10*i*pi/2) HP output is "tiny - i×5PI" LambertW (k=-1000,i*3998 *pi/2) Output Wolfram Alpha i × 6280.04371452599668368682412317572626551014162935083653612891424= Output HP: :W-1000('i*3998*(pi/2)'=(0.,6280.04371455)): (3.6616915941E-12,-6280.04371452) And LambertW (-5, -20*i*pi/2) =-i*10*pi/2 =-i*20*pi/2 = a Pattern W(k=n, n<0, a=i×(-n×4-2)) = a —> complex with no real part W(k=n, n>0, a=i×(n×4)) = a —> complex with no real part All the results are quite OK, though unsatisfactory, as already said. Rule of thumb: IF {imaginary (result) = integer≠0 × PI and abs (real (result) < 1E-10} THEN result = i × imaginary (result) END And more generally With W0(-pi/2)=0+i×Pi/2 With W-1(-pi/2)=0-i×Pi/2 IF {imaginary (result) = integer≠0 × PI/2 and abs (real (result) < 1E-10} THEN result = i × imaginary (result) END Is that deduction or assumption correct? Of course, because of the roundings and the fact that we never have the real value of pi, we might never — or rather will never — have a real integer multiple of pi/2. Final program steps/test M0=abs(Imaginary part of the final result) /(pi/2) M1= round (M0, 0) —> to get the nearest integer to M0 M2= real part of the final result IF {abs (M0-M1)<0.0001 and abs (M2) < 1E-11} THEN M0 is considered as a multiple of (pi/2) & real part of the result, found to be "tiny", is to be set to exactly = zero: M2=0 final result = M2+i×(Imaginary part of the final result) (ELSE The found result is OK and is not to be "tampered": final result = final result) END Check a=real, multiple of pi/2, with no imaginary part Tests with Wolfram Conclusion W(k, k<0 or k>0, a= real =(-4k-1)×pi/2=-i×a (and zero for the real part) Overall conclusion Too many tests about the input on k & a=±i × multiple of pi/2. Easier to test the final result and correct the real part of that final result (tiny into exactly zero), as described above in Final program steps/test, if necessary or wished, ie if & only if when both conditions abs (M0-M1)<0.0001 and abs (M2) < 1e-11 are fulfilled. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: