Python: Complex Number Arithmetic and Lambert Function +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Python: Complex Number Arithmetic and Lambert Function (/thread-17247.html) |
Python: Complex Number Arithmetic and Lambert Function - Eddie W. Shore - 07-14-2021 09:42 AM Complex Number Arithmetic The HP Prime App "Python-Complex Arithmetic" performs the four arithmetic functions on two complex numbers. Code: from cmath import * Lambert W Function The HP Prime App "Python-Lambert W Function" approximates the Lambert W function. The Python script estimates w given complex number z using Newtons Method: w * e^w = z Code: from cmath import * Example: Input: -1.57079362679 (about π/2) Result: approx -1.223152769062088e-06+1.57079554811127j Input: 2+3j Result: approx 1.090076534485791+0.5301397207748389j Source: Wikipedia. "Lambert W Function" Last updated June 13, 2021. https://en.wikipedia.org/wiki/Lambert_W_function Retrieved July 9, 2021 Download both apps here (zip file): https://drive.google.com/file/d/1MX5G-1MJidb2ZmoBVe57GpiUnYvY5BqD/view?usp=sharing |