Home
41Z module
Contents
1. DCEO L F F 212 ka PNC XQ gt 2BF7 108 SEIFB _ PNC AD z NC GO gt 22 Create buffer GGOC OU First free reg address fram EN select Chip number of Tree regs Must Be al least 12 ree regs header 5 complex stack leve Enough Memory NORMER First free reg address from EI select buffer header buffer address in A 5X Buffer idi Buffer id Bufer size Bufer size Store Header Reg 00 tell pir blink and set m MS5G105 HALT execution Remember that the buffer is created each time the calculator is turned on and that it gets reallocated when key assignments or other buffers like timer alarms are made yet it s possible that it gets unsynchronized or even lost altogether and therefore the assignment to the HP 41Z function as well 41Z User Manual Page 64 Appendix 2 Complex Keyboard keymaps The following table shows the detailed key map supported by the ZKBRD complex keyboard function launcher ae Free RDN SIN EEX Ke 0 9 RIS WE Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ml x lt gt mioj N be I m 12101015 le elel eaae aealg ZENTERA ZNEG ZA
2. IM RE a 1 ENTER R S IM RE b 1 CHS ENTER R S IM RE c 1 CHS ENTER 1 R S RUNNING followed by 1 300 j0 625 R S 0 300 10 625 We can see that both roots are NOT conjugate of each other as it occurs with real coefficients Program listing 412 User Manual Page 44 1 LBL ZQUAD 12 PROMPT 23 ZHALF 34 Za 2 aZ 2 bZ c 0 13 RUNNING 24 ZNEG 35 ZRDN 3 AVIEW 14 AVIEW 25 ZENTERA 36 178 4 PSE 26 ZENTERA 37 ZRUP 5 IM RE a 16 ZENTERA 27 742 38 SF 21 6 PROMPT 17 ZRUP 28 ZRUP 39 ZAVIEW 7 ZENTERA 18 Zi 29 17 40 Z lt gt W 8 IM RE b 19 LASTZ 30 ZSQRT 41 CFA 9 PROMPT 20 ZRUP 31 ZENTERA 42 ZAVIEW 10 ZENTERA 21 Z lt gt W 32 7 43 END 11 IM RE c 22 H 33 ZRUP Note that ZQUAD is just a driver for ZQRT which expects the three complex coefficients stored in levels V W and Z of the complex stack Note also that no memory registers are used and all calculations are performed using exclusively the complex stack The core of the program is from lines 16 to 37 or just 21 programming steps to resolve both roots The 412 complex function set and complex stack enables the programmer to treat complex calculations as though they used real numbers not worrying about the real or imaginary parts but working on the complex number as single entity In fact exercising some care you could alm
3. 9 CH L9 09 6S 89 LS 9S GS rS eS FAS LS 09 Hi LV 9y gy GOO wssy piaeq 1VO9Od JONA SHI Joung sdolq Gundwuoud Gundwuoud se35 ZIt un JO UONDAS pajedipap e JepunN Jeyng 0 p ldoo s lnq X Ul ssoippe AJOWSW wou Jang sieaI pu o 004 Olu p ldo ejep 9SJEJ ji sdiys S A e 8 Jepeou poj q linq VHd Tv ul Ja18169 1 s pp u peddoup s A 9 yogs 0 p ldo s Hqnq S19 SIbou o p ldo Gen 0 paldoo AX 01 01 p ldo AX 13447 0 p ldo AX uuy 01 00H U eyeq X ul zis ippi X UI DD Jejynqa X Ul PI Jejyna X Ul PI Jejnqa X Ul p X Ul PI UON UON UON UON UON XIJINS se HODY A ul Z uul X ul 2 A ul Z uul X ul 2 XIJINS SE A971 IZ p u p u p u p u Su Su e u 4 Hnq o s1918169 1 saidoo INVH ul J J nq seyeu ss ppe Jejnq spulj Jajjna S19 5169 o Jeynq soeidoo U16uaj Jang Gunsixe s1eynq e gie 1Six Jajnq seoq 4 DP H uon s 971 Jong Z SMOUS uo Jor Z SH OJUI JApe3H Hnqz uo Z sdoiq 15 Ba OJU Z1 8 1 801400 91 191 o Jang s idoo L1 OU AX Soo 01 Oju AX 301400 Olul AX 301402 AA3IA8Z 149Z 073 82 404082 1S lt dZ 87 L1 lt AX 01 lt AX AX SINPOW ONVTYIJ4NE o1 panou u q BARU suonou
4. The contents of complex and real stack levels are automatically synchronized before and after each complex operation is performed This may just involve real levels X Y and complex level Z if 41Z User Manual Page 5 it s a monadic or unary operation requiring a single complex argument or may also involve real levels Z T and complex level W if it s a dual operation requiring two complex arguments Monadic functions will assume that the real numbers in X Y are the most updated values for the real and imaginary parts of the complex argument They will overwrite the contents of complex level Z This allows quick editing and modification of the complex argument prior to executing the function Dual functions will assume that the second argument is stored in W that is level 2 of the complex stack and will thus ignore the values contained in real stack registers Z T Note that because the real stack overflows when trying to hold more than four different values it is not a reliable way to input two complex numbers at once The design objective has been to employ as much as possible the same rules and conventions as for the real number stack only for complex numbers instead This has been accomplished in all aspects of data entering with the exception of automated complex stack lift with a few exceptions entering two complex numbers into the complex stack requires pressing ZENTER to separate them Once again entering two complex numbe
5. 41Z User Manual Page 18 written by W Doug Wilder and it is even more convenient than the one used by the HEPAX module for its own multi function groups Similar to the real counterparts keys on the first two rows can be used as shortcut for indexes 1 9 Note that indirect addressing is also supported say ZRCL IND pressing the SHIFT key in RUN mode only i e not programmatically In program mode you can make use of the fact that the indirect addressing is nothing more that adding 128 to the address thus it can be handled by simply adding such factor to the index in the second program line Also note that despite being possible to invoke their logic doesn t support the use of the stack registers ZRCL ST and certainly neither the combination of both indirect and stack addressing ZRCL IND ST _ If you use these unpredicted and wrong results will occur The same be said if you press the arithmetic keys simply don t Lastly a NONEXISTENT message will be shown if the storage register is not available in main memory Registers can be made available using the SIZE function of the calculator ZRDN Rolls complex stack down 2577 Rolls complex stack up o NI Like their real stack counterparts these functions will roll the complex stack down or up respectively If executed in run mode it also displays the number in Z Real stack registers will be synchronized accordingly ZRUP ZRND b9 b7 b9 b3 b8 U
6. 49 LASTX k Note functions DECX and INCX 50 RCL 00 n can be replaced by standard 51 k n FOCAL seguences 52 HARMN H k n 53 H k H k n DECX 1 54 ZREAL INCX 1 55 Z 56 END 41Z User Manual Page 56 1 LBL ZYBS Integer Index 2 CF 00 3 GTO00 4 TBLZKBST 5 SF00 6 7 ZHALF 8 ZSTO 01 z 2 9 Z lt gt W 10 ZINT 11 GTO05 12 Zae W 13 XROM ZBS 14 FS 00 15 GTO00 16 ZHCL00 17 PI 18 STZ 19 20 ZCOS 21 Z 23 ZSTO 04 24 ZRCL 00 n 25 ZNEG n 26 ZRCL 01 2 2 27 XROM ZBS 28 ZRCLO4 29 Z lt gt W 30 Z 31 ZRCL 00 n 32 ZNEG n 33 PI 34 ST Z 35 36 ZSIN 37 Z 38 FC 00 39 40 41 42 43 44 45 46 integer orders negative 53 XROM ZB2 54 ZNEG SUM 1 4n 55 ZSTO03 56 XROM ZB1 to obtain both 57 ZRCL 03 58 Z lt gt W 59 Z 60 ZRCL 01 x 2 61 ZLN Ln x2 62 GEU g 63 g Ln x 2 64 ZRCLO2 J n x or l n x Z J n x 66 ZDBL 67 K n x Y n x 68 is it Yn 69 F NAL STEPS 70 n 71 n 1 72 K n x 1 n 1 73 74 GTO03 Exit 75 _ LBL 04_ lt n 76 PI 77 78 79 negative index 80 E Exit 81 n 82 83 84 ZSTO03 85 ZAVIEW 86 END The formulae used for integer orders are as follows X Ya x 2 y Ln 213 1 fi n x gin x 1 2 Kn x 2 y Ln x 2 In x Z f n x 1 Z 1 gk n x 2k n Qk n x x 2 n k 1 k
7. 60 2 aso oo a es KKK The figure above shovvs the unit circle and the relative position in the complex plane for the opposite z conlugate zc and opposite conjugate zc of a given number z 412 User Manual Page 31 Note that the Inverse of z 1 z will be located inside of the unit circle and over the direction defined by the negative of its argument Arg z Note that if z happens to be a cubic root of another number i e z then the other two roots Z and z3 will have the same module and be located at 120 degrees from each other on the red circle line ZNORM Normofz H Z l z 72 Doeslastz This function calculates the norm of a complex number also known as the square of its module all z thus Znorm x y When executed in run mode the display shows a meaningful representation for it like in the example below also for z 4 EH 5 Multiply by i Rotates z 90 deg ccw Divide by i Rotates z 90 deg cw The main role of these two functions is as subroutines for the trigonometric set and they are also provided for completion sake Their geometric interpretation is a 90 degrees rotation of the complex number either clockwise or counter clockwise respectively 6 2 Complex Comparisons The 41Z module includes a comprehensive set of comparison checks based on the complex numbers themselves and their modules for relative position in the complex plane Checks for p
8. O 7 ZSHK2 Spherical Hankel second kind 1 See the paper Besse functions on the 41 with the SandMath Module by the author for an extensive description of the real number Bessel Functions on the 41 system In fact following the do it as it s done with real numbers standard philosophy of the 412 module the complex versions of these programs are very similar to those real number counterparts described in said paper The formulae used are as follows J n z gt Uk k 1 2 z 2 T n 1 U k U k 1 z 2 k k n U 0 1 Val JA x cos na J x sin nzr Kn x 7 2 ln x 1 sin nz n 3 2 1 0 1 2 3 Like for the real case there are two auxiliary functions ZBS and ZBS2 to perform intermediate calculations used by the main programs ZJBS ZIBS first kind and ZYBS ZKBS second kind Other auxiliary functions are e GEUZ Euler s gamma constant and e HARM to obtain the harmonic number of a given integer H n SUM 1 k k 1 2 n The expressions used to calculate the results are different for integer orders remember the singularities of Gamma requiring special branches of the main routines For that reason two other functions have been added to the 41Z as follows e ZINT to determine integer condition and ZCHSX to simplify calculation of z 1 k Both the function order and the argument are complex numbers which are expected to
9. UOIJEND9 uol puiixoiddv AI1 18 12 UOH29 402 M Bulls enueu enueu s enueu s 9 0 M M Z dOHd uol puiixoidde Sozaue7 s 001 UOlleEn JIqn9 9 0 1402 9 Dej pfenuew 99s enuew s Z Z Z1 9 1 01 3981s e 1 saIdo3 Jajjna Z o s19 siGbel s idoo dn s youAs pue 17 ojui AX 301402 Jeun 7 Spul pue 07 olu AX s ldoo X q I A MaIA A IA 1Z out Z1 301400 1Z 0 fenb 21 51 9497 171 dems r19 L1 dems CIS L1 dems 218 11 dems 9497 L1 dems AX 0 Ienb LI SI Z s1e9j5 4 DEB H uon s UOHDUNJ e187 UUBWSIY uoun A I8ss g UOHDUNJ M Weque7 0 Z 4 10 S AlOS ZU I YUEH eousyds LU jayueH Ieou uds S100y bz one1penop xeajdwoy euwebig xoe dwoj sj erwouAjod xe dwoo Jo s100y Id Aq uolouni UOHDUNJ Y 959598 uoun r j ss g UOHDUNI l ss gi BWW JO eed et O Z 40 Z T x duioo S100y olqn xajduo3 putry pug ounnouqns assag puly ISL ounnouqns esseg M Yeque 7 10 82 19 azsou NOWLSd NOWA3Hd XMAIA1 Nd3IAT1 12 21 612 21 11 11 61 11 21 11 TEN AX L1 8212 V 13ZZ uSGAZ a IMZ FANTOSZ uCMHSZ EMHSZ 140Z ISdZ LOOddZ XIdZ ON L SAMZ 58 2 SEIZ qudd z VININVSZ 1432 0082 582 TAVZ CI YY LO ON O v9
10. UONDE NSAENS r IWNGLSOd 3 UOHDPDV IWNGLSOd 3 JOMOd G LA1140Hna V OTAX OTOLAX AX Ul E 2 x3 d MAIAVZ 1ZAX 241 Dou AN d Hd Jeng 2 x3 1Sod lqe1 UONDUNY JIGO G Xipuaddy NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd G NONLSd G NONLSd G NONLSd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd Sok Sok 591 s s s s s s s ou ou ou s s s s s s s s s s s s s s s s Sok s s sok Sok Sok Son s s s Sok Soh s s s s Sok Sok Son Son Sok s s Sok Sok Son 591 s s s s Sok s s Sok s s s s s s s s s s Sok Sok 591 s s s s s s s s Sok SOX Soh Sok Sok s s Sok s s s s s s Sok s s s s s s s Sok ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou NOW4dd NOW4dd NONddd NOW4dd NONddd NONddd NONddd NONddd NOW4dd NOW4dd NOW4dd NOW4dd NONddd NONddd NONddd NONddd NOW4dd NOW4dd NOW4d
11. they correspond to the standard functions on the HP 41 keyboard 41Z User Manual Page 13 Examples Pressing Z LN will execute ZLN pressing Z COS will execute ZCOS etc Pressing Z will execute Z pressing Z R S will execute ZAVIEW There are twenty 41Z functions directly accessible like these b Shifted functions Press Z followed by the SHIFT key These functions are either marked in blue when different from the standard SHIFTED ones or just marked in yellow as part of the standard HP 41 keyboard like x y which will execute Z W if the pressed key sequence is this Z SHIFT x y Examples pressing Z SHIFT LN will execute ZEXP pressing Z SHIFT SIN will execute ZASIN Pressing Z SHIFT R S will execute ZVIEW a prompting function itself There are thirty one 41Z functions accessible using this SHIFTED method c Dual alternate functions Press 2 twice as a double prefix to access the dual complex functions and many others These functions are marked in red on the right side of each available key Examples Pressing Z Z 7 will execute ZWDET pressing Z Z 5 will execute ZWCROSS and so on with all the red labeled keys Pressing Z Z ENTER will execute ZREPL pressing Z Z Z will execute Z lt gt U There are twenty five 41Z functions accessible using this Dual method d Multi value functions AS a particular case of the dual functions case above the ZNEXT function group is e
12. z ay 1e O Z 1010 Z indino 1004 UN IXON NT IXON O1SZ Td3uz NGHZ vOVINIZ 2 v ga INIZ 3NISVINI TOUZ v z ZISVT S lt gt Z q lt gt Z M lt gt Z 7 1SZ19 v4uz OVINIZ 210 MAIAVZ LHNLXN OOTLXN 28 98 98 v8 8 GH L8 08 62 92 LL IL GZ VL ol GL LA 02 69 89 LI
13. zise ung sdoig AX Z UI Z M AX Z UI Z M UIM Z M Z M uooesqns x jdwop Z 9 ZISE7 yng sdoiq AX Z u Z M AX Z UI Z M UDM ZA LA ZX X uolppEe x duuooO Z G Z1se7j s op AX Z ul zyx s l Z A ul Z l X ul x e U7 Z dx Zve XvA PUG H ZvX Jeyng sdoiq AX Z u ZyM AX Z 412 M UDM M U7 Z dxe ZyM XvA X ldulo2 ZvN Jeyng sdoiq AX Z UI z LA AX Z UI Z M UDM Z M u dx z LA X VVA 00 Z IVM NO Divo WO SAN wan z a Ven oe 4985 uond uos q Susuuco mao 8 du mme puo ie n qeudie ul SUONDUNI ZTE Ile ISI s Bed uno v ul s qqe UL p ns JOUBJIJAY y mn p x pu ddy 89 Z1Se7 s op AX Z Ul ZZ M u LZ S691 AX Z u z N1 f uM zZ u1 M Ixau z u 1X N NILXN Z Z1Se7 s op AX Z 4122 M u LZ AX Z 4102 Y QZ Z LZ enfeA NV LV 1X N 9 ZISE7 s op AX Z Ul ZZ M u LZ AX Z 4102 oz 0Z Z 1Z 9njeA NISY 1 NSVIXN S Zise s op AX Z U ZZ M u LZ AX Z 4102 yz 2 Z Z en BA SODY IX9N SIVIXN v Z1Se7 s op AX Z ul z dx AX Z UI Z UIS A S09 xv8 ZO dX3Z eaneuloje Zv l Z1sej s9op VHdTv pue s19 S1691 A X u Z AX Z UI Z Dre i dxa 1 1 JOdOL sosn ANIZ SAnguojje ZIL 2 Jeng SUIT Bundwuod Dal MOIS AX Z UI Z Z uul 40 n ZEM ulu4 e eq jeinjen WER ul Z SMOUS XIJINS se z
14. 1 ENTER ZGAMMA gt RUNNING followed by 0 498 j0 155 Example Verify that G 1 2 SOR n 0 ENTER 0 5 ZGAMMA gt 1 772 j0 PI SORT ZREALY Z gt 2 00E 9 jO Example Calculate G 1 5 i 1 ENTER 1 5 CHS ZGAMMA gt 0 191 j0 174 For cases when the real part of the argument is negative Re z lt 0 ZGAMMA uses a FOCAL program to compute the reflection formula all internal and transparent to the user 41Z User Manual Page 40 The graphic below also from the same web site shows Gamma for real arguments Notice the poles at x 0 and negative integers yceIx The following graphic showing the zzodule of the Complex Gamma function is taken from http en vvikipedia org vviki Gamma function Note the poles at the negative integers and zero Example Use ZLNG to calculate G 1 1 and compare it with the value obtained by 2 1 ENTER ZGAMMA LASTZ ZUNG ZEXP Z gt 2 400E 9 j3 000E 10 41Z User Manual Page 41 Program listings The two FOCAL programs listed below calculate the Digamma and the Gamma functions for complex arguments The first one is an example using the asymptotic approximation as described below whilst the second one is an extension of the MCODE function ZGAMMA using the reflection formula for arguments with Re z lt 1 programmed in turn as another MCODE function ZGNZG MO LBL ZPS 26 4 01 LB
15. 425 j1 etc Alternatively using the NXTASN function Note that here we start with the first value of the function i e 1 j 1 ENTER NXTASN gt 7 238 j1 Z lt gt W gt 2 142 j1 NXTASN gt 8 425 j1 NXTASN gt 14 708 j1 41Z User Manual Page 46 Program listing Note the use of flag 22 for numeric entry the catalog of functions will display continuously until one choice is made expected between 1 and 8 and all initial prompting will be skipped r 48 95 2 CF22 F 49 ZASIN 96 ZHACOS 3 50 ZSTO 97 GT007 5 A FCN 1 8 dib ZAVIEVV 98 5 AVIEW F 52 E F 99 2 6 PSE 53 STO 02 100 7 PSE 54 101 ZAVIEW dE FC 22 55 102 PSE 9 GTO 90 56 103 PI 10 INT 57 104 4 11 ABS 58 105 GTO06 12 90 r 59 106 13 60 107 ZLN 14 RDN 61 108 F15 SF25 F 62 ZAVIEW 109 ZAVIEW 16 GTOINDT 63 PSE 110 PSE F17 GTO20 F 64 E 111 NXTLN 18 1190 65 ST 02 112 GTO07 19 21 66 GTO03 113 20 1 2 5 67 114 CF00 21 AVIEV 68 ZACOS 115 N 22 PSE 69 ZSTO 116 PROMPT 23 2 ZACOSH 70 ZAVIEVV 117 ABS 24 AVIEV F 71 E 118 INT 25 PSE F 72 STO 02 119 X 0 zeroth Root 26 3 ZASIN 73 120 RTN F27 AVIEV F 74 121 STO00 28 PSE 75 122 E 29 4 ZASINH 76 123 N 1 30 AVIEW disi 124 STO01 31 PSE 78 125 X 0 3
16. CEA E CvZ Z e 2 dxa z ye z Buy vo u ubs z ubs P u u3g v9 u L vz M Ixou jJupe suo2 ewwehp saang Z 0 Ly jayuey jeoeyds 4 DP H uon o s M pue Z q p ul p uonenbe ou M pue Z 10 Jonpoud 100 M pue 7 99UBISIC M pue Z 10 jueuiuuo eq M pue Z jonpoud SS019 M pue Z u Ml q ajbuy N91S Xejdwog uonejou JE NBUR D9H o SISAUOJ uonejou JEJOS O 51 npolN a1enbs ol Z JO UJON Z 10 9 NpoW xajdwoy 7 10 juaunGiy Dep 06 Aq s lidnlniy UO poul Odd SIBS UO poul HV Od 4199 si quinu JIUOUJEH 4 DP H UOIDOS wuleBoj M aseg DIAIQ OLS Aldnln N OLS UONDJENANS OLS uoHppy OLS 2 Z AMEN suonounj xejdwoy en eA niniN Jeyounej pseoghey xejdwo9 sjuewubissy Ady Y20 g Jequnu ue SI Z JI SYO UD AeuiGeuu z ayel x Ag abueyg ubis Jamod Jiqn9 XvA PUG H 1040 sosn LHOS 100 x ldulo X N ZNA 21 213 vy p HLYNZ 1 27 2 1182 LSZ LSZ 1SZ v4uz ALINZ 082 NAGMZ LNIZ OVINIZ XSH Z vZ Z LvX ZIYOS NLHLXN YOLOJAZ v Ec GG lo 02 61 81 11 91 GI Pl el ol LI 01 6 8 Gundwuoud Gundwuoug Gundwuoudj 1VOOd 17 043 17 043 1730 17 043 17 043 17303 17303 17303 VDO 184 2 17303 17303 17303 1730 7181 seop 02 Z ay 1oJ s sn WOOd 1VO
17. M MAIA Xa du103 m 79 S691 AIInb suoo ul Z SEJO IS 9 se HODY OLS Xe dwo9 CO yoe1s dn SIIOH SI A 1 MDB S dn WO M9e1S Z 29 SI9A8 p JE U Z AX Z U z SI A 2 u Z sejeoijdey L9 A ul 0O18Z X ul Z ay X UI z u Z ul Jequinu jedy Jeju3 09 YOE1S UMOQ SIJOY SI A JORIS UMOQ IIOH 19 7 6G YIBIS 911 A X UI Z xijjns se TOY x duioo 89 A ul Z Wy X Ul O19Z X ul Gu Jequnu AeuiGeuul 191u3 ZS AX 8 HUM LZ Z1ul Z AX Z UI Z M UI A 21 M pue 2 99 A ul Z ay X Ul z uu AX Z UI Z Z wW pue z ay sebugyoxj GG AX 8 L7 U F1 FT Ul z 1duuoid ul I A AX UI Z 7 pue Z sebueyoxj oL vS S u91U09 Shel UJIM Z 2 XIJINS se HODY obueuox3 xejdwoy 9G dn 9A9 z SOUSNJ AX Z UI Z 1 1SIB 1 M v ojui Z s idoo 29 VHdT1V ul z SMOUS AX Z UI z Z 0 SMOUS LS SDai A X UI Z 1587 X1SV1 X9jdwog 05 9 19 7 19 7 SILA I 67 AX 949 Z 2 SI891I 8 4 pP H uon s ee J sds 9 is SI 9 9119 h n OU uo 2 si LINNZ Ob Z1se7 seop AX Z ul z ue1 AX Z ul 2 zi yue 2 ue NYL 0 NV LZ Sr Z1Se7 s op AX Z Ul Z 1vZ 10 anfen UEL AX Z UI Z U ibs z ibs pad LHOS x ldulo2 LHOSZ tr ZISE7 s op AX Z ul z uis AX Z ulz 21 UUIS Z UIS NIS x lduloo NISZ Z1Se7 s op AX Z ul wi dy pepunoy AX Z UI Z Aejdsip o senjeA pepunou sBulyjes Aejdsip o Z spunoy aNYZ
18. User Manual Page 14 Pressing Z XEQ calls the function IM AG for the Natural Data entry This is obviously not shown on the keyboard which has no changes to the key legends for un shifted functions Note that there are three different ways to invoke IM AG as follows SEO ALPHA SHIFT N I M A G ALPHA gt the standard HP 41 method or Z SHIFT ENTER gt shown in blue in the overlay or Z XEO gt not shown Other keystrokes The 41Z module takes control of the calculator keyboard when ZKBRD is executed Available keys are determined by the partial key seguence entered as defined on the 41Z Keys overlay and as explained above Pressing USER or ALPHA will have no effect and pressing ON at any time will shut the calculator off The back arrow key plays its usual important role during data entering and also undoes the last key pressed during a multi shifted key seguence Try it by yourself and you ll see it s actually easier than giving examples on how it works here In summary a complete new keyboard that is accessed by the Z blue prefix key This being the only requisite it s a near perfect compromise once you get used to it but if you dont like it you can use the User Assignments the choice is yours The 41Z overlay can be downloaded from the HP 41 archive website at http www hp41 org LibView cfm Command ViewG6ltemID 893 To use it with V41 emulator replace the original file arge bmp in t
19. be on complex stack levels W order and Z argument prior to the execution of the function The result is placed on the Z level complex stack Below are the program listings for each particular case 41Z User Manual Page 54 a Bessel Functions of the first kind a Z n 2 CF00 49 ZRCL 00 n 3 GTO00 50 RCL M k 4 51 n k 5 52 LASTX k 8 53 ST Z k n k 8 CF01 54 8 Ze W 55 7 9 TZN isninteger 56 ZSTO 02 U k 10 XEQ05 57 ZRCL 03 SUM k 1 11 ZW 1 58 Z SUM k 12 ZHALF z 2 59 ZENTERA 13 XROM ZBS 60 Z lt gt 03 SUMk 1 14 Pin 61 Z W 15 RCL01 62 GTO 01 16 3201 63 E 17 uZCHSX J n z 1 n Jn z 64 ST M k k 1 18 LBLO4 lt 65 GTO 02 19 ZAVIEW 66 20 RTN 67 n 21 ILBLO5 68 n 1 22 0 n lt 0 69 1 23 SFO1 70 24 ABS 71 25 RTN oOOOOO 72 26 LBL ZBS 73 Z 27 _ Z 0 74 2 28 GTO00 75 29 Z W 76 30 E 77 Z 31 04 78 32 79 33 ZSTACK running 80 34 ZSTO 01 z 2 81 b Z lt gt W n 82 36 ZSTO00 n 83 ZRCL 01 z 2 37 E 1 84 ZRCL 00 n 38 ZREAL 1 JO 85 WAZ z 2 n 39 ZSTO02 1 JO 86 z 40 ZSTO03 1 J0 87 END 41 STOM k 1 42 CR00 n 43 ZRCL 01 CRO1 Z 2 44 212 z 2 2 CR02 Uk 45 ZRCL 02 Uk 1 CR03 SUM 46 FC 00 CR04 result 47 ZNEG Examples Calculate JBS I i 1 i and IBS 0 5 i 1 0 5i 1 ENTER ZENTER ZNEG ZJBS gt 1 ENTER 0 5 CHS ZENTERA ENTER 1 2185 gt 8 889
20. direct data entry Angle first then modulus Arg z ENTER z ZREC gt Re z J Im z 3 2 Complex Natural Data Entry This function belongs to its own category as an automated way to input a complex number using the Natural data entry convention Real part first Imaginary part next Its major advantage besides allowing the natural data entry sequence is that it performs a complex stack lift upon completion of the data entry thus there s no need to use ZENTER to input the complex number into the complex stack That alone justifies its inclusion on the 41Z module Inputs Im z Arg z Part Does Stack Lift The function will prompt for the imaginary part or the argument if in POLAR mode of the complex number being entered The design mimics that on the HP 35S calculator and it s used as a way to separate the two complex parts during the complex number data entering A few important considerations are 41Z User Manual Page 9 e The real part or module must be introduced right before calling it so it s in X during the data entry e The keyboard is redefined to allow for numeric digits RADIX CHS and EEX as only alid keys The radix symbol used comma or dot is controlled by the user flag 28 Only one RADIX character will be allowed in the mantissa and none in the exponent Only nine digits will be used for the mantissa and two in the exponent IM AG will not check for that during the input pro
21. functions 3 2 Complex Natural Data entry 3 3 The Complex User Assignments 3 4 The Complex Keyboard 4 Stack and Memory functions 4 1 Stack functions group 4 2 ZSTO Math function group 5 GOMPIEX Mall av eu vu s id s uw a ww de ENNEN E l ac n EN A 5 1 Simple Arithmetic 5 2 Exponentials and Powers that be 5 3 Complex Logarithm 0 Complex Geometry La s azda a ddd ba AE nan 7 Complex Trigonometry 8 2D vectors or complex numbers 9 It s a Gamma world out there 10 Application programs 10 1 Solution to quadratic equation 10 2 Lambert W function 10 3 Multi valued functions 10 4 Polynomial rOOtS 10 5 Solutions to ffz F0 10 6 Bessel Functions Appendix 1 Complex Buffer functions Appendix 2 Complex Keyboard key maps Appendix 3 Formula compendium Appendix 4 Quick Reference Guide Appendix 5 C
22. hold up to four levels We didn t need to use ZENTER to push the complex numbers into the complex stack because the stack lift was performed by IM AG With regard to the data entry sequence one could have used ZREC instead of IM AG albeit in that case it would have been in direct mode as opposed to the more intuitive natural Convention It also requires pressing ZENTER to push each number into the complex stack This is the keystroke sequence and partial results assuming we re in POLAR mode 62 ENTER 185 ZREC ZENTER gt 185 lt 62 143 ENTER 170 ZREC ZENTER gt 170 143 261 ENTER 100 ZREC 100 99 Z Z 178 9372 111 1489 One last remark about data displaying vs data entry As it was explained before ZPOL will convert the complex number into Polar coordinates and it will be displayed in POLAR form even if RECT mode is selected This is the single one exception all throughout the 41z module and it will only work immediately after pressing ZPOL but not for subsequent executions of ZAVIEW which always expects the number is stored in rectangular form and therefore will show an incorrect expression 41Z User Manual Page 11 3 3 The Complex User Assignments The 41Z module provides a convenient way to do user key assignments n masse Given the parallelisms between the real and complex number functions the natural choice for many of the functions is predeterm
23. i Are they equal La The first two functions compare the contents of the Z and W stack levels checking for equal values of both the real and imaginary parts z w iff Re z Re w and Im z Im w The third function Z WR will establish the comparison on the rounded values of the four real numbers according to the current display settings on the calculator i e number of decimal places Shown This is useful when programming iterative calculations involving conditional decisions Rnd z Rnd w iff rnd Re z rnd Re w and rnd lm z mdllmiv l The remaining three functions on the table are particular applications of the general cases checking whether the Z complex stack level contains zero or the imaginary unit z 0 iff Re z 0 and Im z 0 z iff Re z 0 and Im z 1 Some of the inverse comparisons can be made by using standard functions as follows use X0 to check for Z 0 condition Use X0 to check for Z 1 Condition ZUNIT Checks if z is on the unit circle ZIN G Checks if z lt 1 Checks if z gt 1 These three functions base the comparison on the actual location of the complex number referred to the unit circle inside of it on it or outside of it The comparison is done using the number s modulus as a measure of the distance between the number and the origin 41Z User Manual Page 33 Unit Circle 05 0 i 511 0 Vau HM AN E ai J cos isin
24. j 2 295 3 421 j 1 178 41Z User Manual Page 55 b Bessel functions of the second kind LT T51 Z51 sumin T TEL ZB2 laurent 2 CLZ 2 CLZ 3 ZSTO02 Jn In 3 28STO03 reset partial SUM 4 _ ZSTOO4 SUM 4 RCL00 ABS n 5 STO01 k 0 5 0 n 0 6 6 RTN skip it 7 summing term 7 DECX 8 x 0 8 E3 9 GTO01 ignore term 9 0 00 n 1 10 ZRCL 04 S k 1 10 STO08 11 Z S k 11 12 2 12 ZRCLO1 x 2 13 Z lt gt 04 13 RCLO8 k 00 n 1 14 Z W are they equal 14 INT 15 RTN Final result s 15 STO01 k 16 16 ST X 2k 17 increase index 17 RCLOO n 18 k k 1 18 2k n 19 19 ZAX x 2 2k n 20 Function to Sum 20 RCLOO n 21 2801 01 2 21 BCL oi k 22 BCL oi k 22 n k 23 ST X 2k 23 DECX n k 1 24 RCLOO n 24 n k 1 25 2k n 25 101 k 26 ZAX x 2 2k n 26 FACT k 27 2 Paz 1 1 1 28 BCL oi k 28 STZ 29 k 29 Pre 30 LASTX k 30 is it Yn 31 RCLOO n 31 32 k n 32 k 33 k n 33 1 4k term 34 kl k n 34 LBL00 lt 35 ZREAL 35 ZRCLOS3 36 Z k th Term 36 Z 37 FS 00 is it Kn 37 ZSTOO3 38 GTO00 38 1ISG08 39 1 01 k 39 GTO05 k 1 00 n 1 40 ZCHSX term 1 4k 40 ZRCL 03 41 FC 00 is it Yn 42 Z lt 02 ZST 02 42 R N 43 ZRCL 02 A3 RCLO00 n 44 Z f k SUM k 1 44 ZCHSX SUM 1 4n 45 Z B o MAN 0 0 7 745 END 46 2 47 RCL 01 k 48 HARMN H k
25. mode back and forth depending on whether it s a complex or a real native function to be executed Besides that the Complex Assignments consume a relative large number of memory registers that can be needed for other purposes Lastly there are numerous 41Z functions not included on the user assignments map and no more logical keys are available without compromising the usability of the calculator To solve these guibbles the 41Z module provides an alternative method to access the majority of the complex functions plus some unique additional functionality It s called the Complex Keyboard accessed by the function ZKBRD a single key assignment unleashes the complete potential of the module used as a complex prefix or in different combinations with the SHIFT key and with itself Figure 3 4 Complex Keyboard overlay with ZKBRD assigned to Sigmar On the left the version for V41 On the right for i41CX 10 uz eX ez LOG D cos TAM H SIN COS TAM x H d SN 2k LELSGN GIO LZ BST STO RCL SST K L M lt gt CAT IMG ISG CHAJ RTN xZ C ENTER CHS N L SL 113 1 2000220202 ALPHA SPACE HP 412 KEYS 2009 M Lujan Garcia Here s how to access all the functions using ZKBRD a Direct functions Simply press Z as a prefix to denote that the next function will operate on a complex argument and not on a real one These functions don t have any special marks as
26. one the program above changes to this very simplified way 01 LBL ZASIN2 04 ZAVTEVV 07 END 02 ZASIN 05 NXTASN 03 LBL 00 06 GTO 00 Using the general expressions vve can obtain the multiple values of a given function from its principal value Z of a given function as follovvs Ln k Ln 2kr J asin k 1 4k asin kr Z 2 j acos k acos 2kr atan k atan Ri Z z 2n Z 3n 2 4 Z On A A AA 22 Z 2x j m nl 2 Z 2n Z 4n L Z 6n aia gi eg ee e 0 7 Ou Z T Z An Z 5n Z n r Z 61 J Z3 i SC the multiple values for ASIN Z in green squares are placed on the two straight lines parallel to the x axis y Im ASIN Z and y Im ASIN z and are separated at intervals of 2x length on each line the multiple values for ACOS z in yellow circles are placed on the same two straight lines and are separated at intervals of 2x length on each line the multiple values for ATAN z in brown triangles are placed on the upper of those straight lines separated at intervals of x length on it 41Z User Manual Page 37 the multiple values for Ln z in blue squares are placed on the vertical straight line x Re LN z and separated at intervals of 2x length on it the three different values for z 1 3 are placed in the circle r z 1 3 and are separated at 120 degrees from each other angular interval NXTASN Next Complex ASIN 1 Does LastZ NXTACS Next Co
27. the first function in the module HP 41Z either by using XEQ or the Complex Keyboard sequence Z SHIFT Z This requires at least 12 memory registers to be available or the error message NO ROOM will be shown Because the buffer can be dynamically re allocated by the 41 OS upon certain circumstances it s not possible to store its address to be reused by the functions Every 41Z function woula first seek out the buffer address prior to proceeding with its calculation Fortunately this takes very little overhead time Buffer synchronization with the appropriate real stack levels is also performed automatically by the 41Z functions as follows Inthe input phase pre execution monadic functions will copy the XY contents into level LI prior to executing their code Dual functions will do the same for the second argument Z and will use the current contents of the L2 level as first argument W In the output phase post execution the results will be placed in the complex buffer levels and then copied to the real stack registers as appropriate XY for monadic functions and XZYT for dual functions That s the reason why the real stack should just be considered as a scratch pad to prepare the data like doing math on the real values as only levels X Y will be used You must use ZENTER to push the W argument into the complex level L2 In other words real stack registers T Z will be ignored The same consideration applies
28. when performing chain calculations because there s no automated complex stack lift the result of a monadic function would be overwritten by the subsequent input unless it is first pushed into the complex stack using ZENTER or another 41Z function that does stack lift Example Calculate Ln I i 2 1 The following sequence use the direct data entry entering m z first 1 ENTER ZLN ZENTER 1 CHS ENTER 2 Z gt 2 347 j0 215 Some functions perform stack lift by default and thus ZENTER is not required before them They are as follows LASTZ ZRCL ZREAL also when using the complex real keypad Z plus digit key 41Z User Manual Page 60 ZIMAGA also when using the complex imaginary keypad Z radix plus digit key AIM AG The following sequence uses natural data entry entering Re z first as an alternative method for the previous example Note that because IMG does stack lift it s not necessary to use ZENTERA 1 IMG 1 R S ZLN 2 IMG 1 CHS R S Z gt 2 347 j0 215 Buffer synchronization with the real stack registers can be tested and forced using the following functions in this group L1 XY Tests for the first buffer level and XY registers XY gt L1 Copies X Y into level L1 L2 ZT Tests for second buffer level and Z T registers L2 gt ZT Copies L2 into registers Z T ST gt ZB Copies real stack XYZT to buffer levels L1 8 L2 ZB gt ST Copies Li 8 L2
29. 0 2 n 1 fk nx NDT H k H n k ki n k k 0 1 2 417 User Manual Page 57 Example Calculate KBS 0 5 1 1 0 51 1 ENTER 0 5 CHS ZENTERA ENTER 1 ZKBS gt 0 348 j 0 104 Example Calculate YBS 1 1 0 ENTER 1 CHS ZENTERA ZYBS gt 0 781 j 0 880 This last example shows how even real arguments can yield complex results Example Calculate JBS and IBS for 1 2i 1 3i 2 ENTER 1 ZENTER 3 CHS ENTER 1 CHS ZIBS gt 35 813 j 191 737 2 ENTER 1 ZENTERA 3 ENTER 1 ZNEG 2185 gt 257 355 j 12 633 Note Using the Complex Keyboard shortcuts the Bessel function group can be accessed pressing SHIFT when the NEXT indicator is shown as per the following sequence Z Z SHIFT SHIFT gt then l J for ZJBS and ZJBS or D E for ZKBS and ZYBS The same group can be used to access ZWL Complex Lambert and EIZ IZ the Spherical Hankel function of first kind and order zero then SHIFT E 41Z User Manual Page 58 Appendix 1 Complex Buffer functions This appendix lists the buffer handling functions included in the 41Z and thus are not related to the Complex Number treatment per se This set is only useful to diagnose problems or to bypass the normal execution of the module s standard functions therefore its use is not recommended to the casual user i e do it at your own risk Function Description input Output
30. 136 RTN 8 2N 11 51 GTO01 94 GTO 137 9 X Y 52 SIGN 95 TONE5 138 ZENTERA 10 PSIZE 53 STOM 96 RCL 01 139 BCL 04 11 RCLZ 54 97 INT 140 RCL 03 12 STO 00 N 55 BCL 00 98 1 141 7 13 STO 03 N 56 570 08 9Z 142 RCL IND 05 14 9 008 57 SEO 100 E3 143 FS 01 15 58 11 101 144 RCL 08 16 5TOM N 9 008 59 RP 102 ST 05 145 FS 01 17 STO05 N 9 008 60 WX 103 FIX3 146 18 Xe Y 2N 11 61 STOOT 104 SF 24 147 19 E 62 X gt Y 105 148 FS 00 20 2N 10 63 CHS 106 156 00 149 STO IND 05 21 STO02 2N 10 64 STO 08 107 NOP 150 Xe Y 22 STO 06 65 CEO 108 RCL IND 06 151 RCL IND 06 23 FIXO 66 XEQ11 109 RCL IND 05 152 FS 01 24 29 67 ZENTER 110 ZAVIEW 153 BCL 08 25 68 BCL 08 111 DSE 06 154 FS 01 26 IMARE 69 BCL 07 112 DSE05 155 27 ARCL 03 T PR 113 GTO 10 156 28 71 114 CF21 157 F5 00 29 PROMPT 72 ST 03 115 SF29 158 STO IND 06 30 STO IND 05 73 Xe Y 116 RIN 159 Xe Y 31 X lt gt Y 74 5 04 117 160 FS 01 32 STOINDOG Ni 75 ZRND 118 RCL 1 161 DSE 08 33 DSE 03 76 2740 119 5 05 162 LBLO2 4 34 Xe Y 77 GTOM 120 BCL 02 163 DSE 06 35 SE 06 78 FIXO 121 STO 06 164 DSE 05 36 DSE 05 79 FOUND ROOT 122 FC 01 165 GTO 00 37 GTO 05 80 ARCL 00 123 167013 166 END 38 BCL 03 81 AVIEW 124 3 82 5 00 125 40 SOLVING 83 XEQ 11 126 41 AVIEW 84 E 127 BCL IND 06 42 SF 25 85 ST 05 128 RCL IND 05 43 5 99 86 5T 06 129 FC 01 41Z
31. 2 5 ZATAN 79 STO 03 126 SF00 unit root 33 AVIEW 80 127 E 34 PSE F 81 ZAVIEW 128 N 35 6 2 F 82 PSE 129 1 X 1 N 36 AVIEW 83 ZRCL 130 ZAX main value 37 PSE F 84 ZNEG 131 SF21 38 7 ZLN 85 RCL 03 132 ZAVIEW 39 AVIEW 86 133 FS C00 40 PSE 87 ZAVIEW 134 GTO08 F 41 8 ZA1 N F 88 PSE 135 42 AVIEV F 89 E 136 RCLOO F43 PSE 90 ST 02 137 NXTNRT A4 GTO20 91 GTO 01 138 ZAVIEW ras r 92 139 DSEO1 46 ZATAN F 93 ZHASIN 140 GTO05 47 GTO06 94 GTO 07 141 142 21 143 END 412 User Manual Page 47 10 4 Roots of Complex Polynomials ZPROOT Roots of Polynomials By Valentin Albillo This program calculates all the roots of a polynomial of degree n and with complex coefficients It is therefore the most general case of polynomial root finders that can possibly be used as it also will work when the coefficients are real This program is a wonderful example of FOCAL capabilities and very well showcases the versatility of the HP 41C even without the 41Z module It was first published on PPC Technical Notes PPCTN 1 181 ZPROOT 44 00 87 3 130 GTO 02 2 SIZE 45 CHS 88 5T 01 131 BCL 08 3 DEGREE 46 STO 04 89 BCL 03 132 ST Z 4 PROMPT AT FIX 90 STO IND 05 133 5 TOZ 48 RND 91 RCL 04 134 DSE 08 6 ST X 2N 49 FIX 6 92 STOIND 06 135 GTO 02 7 11 50 X80 93 DSE 00
32. 6 21 ZSTO 00 40 Z 3 GTO06 22 NEO IND 06 41 ZNEG 5 F NAME 43 6 PROMPT T 7 AOFF 45 ZENTERA 8 ASTO 06 46 9 PREC 47 10 PROMPT 48 Z WR 11 FIXINDX 4 GT002 12 721 Y X 50 GTO 01 13 PROMPT 51 14 ZENTERA 52 FC 06 15 22 Y X 53 EIX3 54 FC 06 55 ZAVIEW 56 END 41Z User Manual Page 50 User flag 06 is for subroutine usage when set the data input will be skipped In that case the relevant data is expected to be in the appropriate registers as follows CRO Initial estimation 21 Cr1 Initial estimation z2 R06 Function s name FIX set manually to reguired precision Example Calculate one root of the equation SINH z z22 pi 0 Which we easily program using 41Z functions as follows LBL ZT ZSINH LASTZ Z42 Z PI END Using the initial estimations as z0 0 and z1 1 i we obtain Root 0 27818986 j 1 81288037 Example Calculate two roots of the equation eX z z programmed as follows LBL ZE ZEXP LASTZ Z END using the estimations 120 1 8 z1 I j note that both roots are conjugated Rooti 0 3181315 j 1 3372357 Root2 0 3181315 j 1 3372357 Example Calculate the roots of the polynomials from section 10 1 and 10 3 P2 1 i z 1 1 z 1 1 re written as z 1 i z 1 1 1 1 P3 z z2 z 1 re written as z l z l z 1 P4 1 2i z 1 2i z 3 3i z z 1 re written as
33. 9Od 1VOOd 71881 seop Jejunq o p ldo yoe1s S19 SIbou Wouj p ldoo ejep UON uou j9nJeA posodsueu i nlPA pasodsue 12 0 p ldo 21 ase JI dIMS N A pebueyoxe s A pebueyoxe s A pebueyoxe S A pebueyoxe S I A pebueyoxe S A ase JI dIYS N A poaea o Jong AX Z ul Ins 1 AX Z u Z WA AX Z ul Z M Z 40 1001 uo Sajejnaje3 AX Z ul insa1 AX Z ul Ns uonenb jo 51001 sojejnojeo VHdTv puy 56 A X ul Z ISd SI A 9 AX Z pue M U S1001 AX Z ul lIns 1 AX Z ul lIns 1 AX Z ul Z M M AX Z ul Z M T AX Z u Z M I AX Z ul ilns AX Z ul z SI A 9 AX Z pUe M A ul S 001 WNS 2 1219 WNS 2 1219 AX Z Ul lins UON 9 se HODY A ul z uuj X u z ay A ul Z uul X ul z ay X UI XIJINS SE 4 3A97 OUON OUON X UI f A UON UON UON XIJINS SE ZH A UON UON AX Z UI Z AX Z ul Z M Ul A AX Z UI Z 904 ul OQWEU Xu Z ul z DIS M U M Jap10 Z ul z DIS M U M 197 U Dav AX Z UI Z U AIID 1duioid AX Z ulz AX Z UI Z AX Z 412 M UDM AX Z Ul Z M UDM AX Z UI Z M UDM AX Z UI Z AX Z UI Z 19 7 U Aa J g v LOYI ul Z Z 0049 UI A Z UI Z Z M UI M AX Z UI z OL p u p u e u e u Su Su Su Su Su Su Su Su p u wy objy UIBAUOg enueu s enueu s pou 8ui S UOJMaN ZM U 2 0 9100
34. EPS Ch i oli T L 4 zi 0 ENTER 1 ZTRP gt 0 j1 i ZA2 gt 1 j0 i 1 ZA2 gt 1 J0 Tas 1 41Z User Manual Page 25 Whilst this will take care of the rest and also in general 0 ENTER 1 ZTRP gt 0 jl i 3 Z X gt 0 j1 LASTZ gt 0 jl 5 Z X gt 0 jl Note in this example that for enhanced usability ZAX stores the original argument in the LastZ register even though it wasn t strictly located in the Z level of the complex stack The same behavior is implemented in XA Z Alternatively using WAZ and ZREPL 1 ENTER 0 ZREPL gt 0 jl 0 ENTER 2 WAZ gt 1 j0 H 1 ZRND gt 0 jl 0 ENTER 3 WAZ gt 0 jl i ZRND gt 0 jl 0 ENTER 4 WAZ gt 1 j0 1 ZRND gt 0 jl 0 ENTER 5 WAZ gt 0 jl bzi Examples Calculate the value of z 271 1 1 and z 1 i 1 2 These two have a very similar key sequence but they have different meaning Solution 1 ENTER ENTER 2 XA1 Z Solution 1 ENTER ENTER 2 Z 1 X 1 330 10 480 gt 1 099 j0 455 NXTNRT Next value of Nth Root Z z0 e j 2 z0 is the principal value In its general form the solution to the Nth root in the complex plane admits multiple solutions This is because of its logarithmic nature since the logarithm is a multi valued function see discussion in next section Z 1 N e Ln z N e Ln z i a 21 N e Ln z ia N e j 2n N Fr
35. ER 2 CHS ZENTER gt 2 j1 3 CHS ENTER 4 Z gt 2 1 j Z gt 2 500 j9 Note that 41Z automatically takes common factor when appropriate and that integer numbers are displayed without decimal zeroes to simplify the visuals display of the complex numbers Non integers are displayed using the current decimal settings but of course full precision that is 9 decimal places is always used for the calculations except in the rounding functions ZRND Rounds Complex number Z Rounded z Does LastZ ZINT Takes integer parts Z int Re 2z jint lm z Does LastZ IZFRC Fractional parts Z Frc Re z jFrc lm z Does Last These functions will round take integer part or fractional part both the real and imaginary parts of the complex number in Z The rounding is done according to the current decimal places specified by the display settings ZPIX MuM ltiplies by pi Does LastZ Simple multiplication by pi used as a shortcut in the Bessel FOCAL programs Has better accuracy than the FOCAL method as it used internal 13 digit math 41Z User Manual Page 22 5 2 Exponential and powers that be Table 5 2 Exponential group Index Function Formula Description _ O O O Z O Z o la 1ZEXP Z REC e x y Complex exponential method one Complex Exponential method two 1b 2 1212 ZeREC r 2 2a Complex square ZSQRT Algebraic Formula Principal value of complex square root SQ
36. HP 41Z Initializes Z Buffer Buffer created CLZB Clears Z buffer Buffler cleared L1 XY Is L1 equal to XY Y N skip if false Li lt gt L _ Swap L1 amp Level levels exchanged L1 lt gt LX Swap L1 amp Level levels exchanged L2 ZT Is L2 equal to ZT Y N skip if false L2 gt ZT Copies L2 into ZT L2 copied to ZT LVIEW _ Level as suffix Transposed value LVIEWX level in X Transposed value PREMON Copies XY into LO and finds Zbuffer Re z in X lm z in Y none PSTMON Copies XY into L1 and synch s up Re z in X Im z in Y RG ZB _ _ Copies registers to Z buffer data copied from registers ST gt ZB Copies real stack to L1 8 L2 stack copied to buffer XY gt L Copies XY into Level Level as suffix XY copied to LEVEL XY gt LO Copies XY into LO Re z in X Im z in Y XY copied to LO XY gt L1 Copies XY into L1 XY copied to L1 ZB gt RG _ _ copies buffer to registers data copied to registers ZB gt ST Copies L1 8 L2 into real stack buffer copied to Stack ZBDROP Drops Z buffer one level levels dropped ZBHEAD Z buffer Header info header register in ALPHA ZBLIFT Lifis Z buffer one level buffer lifted ZBSHOW Shows Z Buffer shows header all levels Items highlighted in yellow indicate prompting functions Buffer layout he complex buffer has 5 levels labelled LO to L4 that s 10 memory registers plus the header and footer registers for a total of 12 registers The function names in this group use the Level number LO to L4 to identify each
37. HP 41Z Module Complex Number Module for the HP 41 PRGM ALPHA 1 d L a SIN COs TAN 2 IMC ENTER CHS N User s Manual and Quick Reference Guide Written and developed by ngel M Martin October 2011 41Z User Manual Page 1 This compilation revision A 3 5 Copyright 2005 2011 ngel M Martin Published under the GNU software licence agreement The author wishes to thank the contributors to this project in various ways as follows W Doug Wilder who wrote the code for the non merged functions in program mode Hakan Th rngren for his assistance and advices on the Memory Buffer implementation Valentin Albillo who wrote the original ZPROOT FOCAL program M Lujan Garcia who prepared the 41Z Keys overlay bitmap file Some graphics taken from http www clarku edu djoyce complex copyright 1999 by David E Joyce Some graphics taken from http www wikipedia org Screen captures taken from V41 Windows based emulator developed by Warren Furlow See http www hp41 orq Original authors retain all copyrights and should be mentioned in writing by any party utilizing this material No commercial usage of any kind is allowed 41Z User Manual Page 2 di e eco s itp saf fe a a kt dp pan an a fk BE a ia fe al dae 2 Complex Stack number entering and displaying 3 User interface enhancements 3 1 Display and Conversion
38. I cr ji sdiys ON S3A AX Z UI Z 0 z ti SI 40 Z ay SI IVAHZ ji SAS ON S3A AX Z UI z tsizi si g v z JUN y pisino Z si 61 2 Z1Se7 s op AX Z ul z AX Z U z Al x Z SHO Xajdwog SANZ 6 Z1se7 s op A X Z ul z 5o7 AX Z UI Z 0 ul Z u 2 507 x duioo 2 82 ZISE7 s op AX Z ul z u7 AX Z ulz Bay 4 uj Z u NI 0 NIZ Z Z1Se7 s op VHdTv pue AX Z ul Z L AX Z UI Z ZVA ZVX 1 ZV UOISJBAU x ldulo2 ANIZ 9 Z1Se7 s op AX Z ul Wy pue ay Jebayuj AX Z UI Z Z WI LLNI 8 z 4 LNI Z 9 INIZ S AGING SUIT Zi1set s op x duuo2 se jue suoo AX Z ul Usel UOU AX Z UI Z LIZZ U post meng KU ZISE7 saying sdoig Z1SP1 Jang sdoig Z1SP1 4aying sdoig Z1SP1 Jang sdoig Z1SP1 Jang sdoig Z1SP1 Jaying sdoig ZIsE7 s op ZISET A S9019z ZISET A S9019z ZIsE7 s op ZISET A S9019z Zise s op SOU SS g Ul p sn Z1sSE7 ung saoig Gundwoud Gundwoud Gundwoud Gundwoud Z1se7j s op 1720 Jeyoune Gundwo d DNIMOVd Kew SOU jessog UI pasn Z1SE7 s op Z1sP7 s op XvZ UPU 9 P1NIDR GOU Z1SE7 s op Z1SE7 s op Z1sP7 s op X ule A Ul Q VHd TV ul G XB PIOA A X U M z 1op PIOA A X U X Z 1sip pioa A X UI M z jep PIOA A X U A X Z PIOA A X u M z Gue A X Ul z DOW Z A ul z uu X u z H A ul Zz Bay X
39. L ZG 02 ZREPL 27 21 02 ZENTERA 03 E 28 1X 03 X lt gt Y 04 29 ZREALA 04 X 0 05 30 Z 05 GTO 00 06 31 Z 06 X lt gt 07 32 0 1 07 X gt 0 08 33 08 GTO 00 gt 09 34 Z 09 INT 10 35 1 10 LASTX 11 36 11 XEY 12 371 Z 12 GTO 00 13 38 12 13 0 14 39 ZREAL 14 1X 15 40 A 15 16 41 ZRCL 00 16 ZRDN 17 42 ZLN 17 CF 00 18 43 LASTZ 18 X lt 0 19 ZHALF 19 SF 00 20 ZINV 45 Za 20 FS 00 21 ZSTO 00 46 7 21 ZNEG 22 782 AT ZRCL 22 23 ZREPL 43 1 23 24 20 49 Z 24 25 ZREAL 50 ZAVIEW 25 51 END 26 27 for x 20 Psi x In x 1 2x 1 12x 1 120 1 252x 1 240x 29 together with the relationship Psii x 1 Psifx 1 30 31 Approximation for Digamma when x gt 8 kola 2 a ma er O zs programmed as u 2 u 2 20 1 21 u 2 1 10 u22 13 12 Ln u u 2 where u 1 x and using the following precision correction factor Viz 1 V z d The next expression shows Stirling s approximation for Gamma 41Z User Manual Page 42 The following two programs calculate the Logarithm of the Gamma function for complex arguments The first one uses the Stirling approximation with a correction factor to increase the precision of the calculation This takes advantage of the ZGPRD function also used in the Lanczos approximation 1 1 2InT z In 27 2 1 h 2 2 In 27 az 2 nz n z sin muz correction factor LnG z L
40. Mos b5 T b3 Se Y b4 b4 b4 Gr b3 b3 z JEL b3 ZREPL simply fills the complex stack with the values in the real registers X Y This is convenient in chained calculations like the Horner method for polynomial evaluation If executed in run mode it also displays the number in Z This is in fact a common characteristic of all the functions in the 41Z module built so to provide visual feedback of the action performed Enters X in Z as x j0 Does Stack Lift Enters X in Z as 0 jX Does Stack Lift These functions enter the value in X either as a purely real or purely imaginary number in complex form in the Z stack level and perform stack lift If executed in run mode it also displays the number in Z upon completion Exchanges Z and Stack Level 0 1 2 3 4 Prompting function NOS Exchanges Z and V Exchanges Z and W 2 1 Fully programmable see note in previous page 412 User Manual Page 17 Use these functions to swap the contents of the Z and U V W levels of the complex stack respectively As always the execution ends with ZAVIEW in run mode displaying the new contents of the Z register which is also copied into the XY registers ZRCL _ _ Recall from Complex Register Does Stack lift Prompting function Store in Complex Register Prompting function Like their real counterparts these functions are used to Recall or store the complex number in Z from or into the complex register which number is s
41. RTZ Z su a 2 Principal value of complex square root Power WA1 Z 2 27 a Complex to reciprocal complex Power ein T Rea to complex power 0 7 XAI Z Zee z ln x Real to reciprocal complex power 8 ZX Zee x ln z Complex to real Power S 9 ZA1 X 7 e 1 x Complex to reciprocal real Power 10 ZALOG Z eiziini Complex decimal power NXTRTN Z z e j 2 Next value of complex nth Root Looking at the above formula table it s easy to realize the importance of the exponential and logarithmic functions as they are used to derive many of the other functions in the 41Z module It is therefore important to define them properly and implement them in an efficient way The 41Z module includes two different ways to calculate the complex exponential function The first one is based on the trigonometric expressions and the second one uses the built in polar to rectangular routines which have enough precision in the majority of practical cases The first method is slightly more precise but takes longer computation time ZEXP Complex Exponential Z REC e x y Does LastZ eAZ Complex Exponential Does LastZ One could have used the rectangular expressions to calculate the result as follows e z e x cosy i sin y thus Re z e x cosy and Im z e x sin y and this is how the function e Z has been programmed It is however more efficien
42. User Manual Page 48 Example Calculate the three roots of xX x x 1 ZPROOT gt DEGREE 3 R S gt MARE 3 0 ENTER 1 R S gt MARE 2 0 ENTER 1 R S gt MARE 1 0 ENTER 1 R S gt MARE 0 0 ENTER 1 R S gt SOLVING gt FOUND ROOT 3 gt SOLVING gt FOUND ROOT 2 gt SOLVING gt FOUND ROOT 1 gt 5 850E 14 j1 that is i gt 5 850 144 1 that is i gt 14j1 170E 13 that is 1 Example Calculate the four roots of 1 2i z 1 2i z 3 3i z z 1 ZPROOT gt DEGREE 4 R S gt M RE 4 2 ENTER 1 R S gt IM RE 3 2 CHS ENTER 1 CHS R S gt IM RE 2 3 CHS ENTER CHS R S gt IM RE 1 0 ENTER 1 R S gt IM RE 0 0 ENTER 1 CHS R S gt SOLVING gt FOUND ROOT 4 gt SOLVING gt FOUND ROOT 3 gt SOLVING gt FOUND ROOT 2 gt SOLVING gt FOUND ROOT 1 gt 1 698 J0 802 R S gt 0 400 0 859 R S gt 0 358410 130 R S gt 0 656 0 073 The four solutions are 1 698 0 802 j or 1 878 lt 25 27 21 Z2 0 400 0 859 or 0 948 lt 114 976 73 0 358 0 130 or 0 381 lt 9 941 74 0 656 0 073 or 0 660 lt 173 676 Using V41 s turbo mode or another equivalent HP 41 emulator functiona
43. X Z Z 7 2 WA1 Z ZPSI ZLNG 2 Z lt gt V ZORT ZIMAGA ZREALA 2 CLSTZ ZRPL ZA1 X ZHW ZWDET ZWDIST ZWANG ZREAL ZIN ZWCROSS ZIMAG ZUNIT ZW LINE 280 2 ZWDOT Z lt gt U Hee Trunctn l IV V Name Z HP 41Z Z w z Z X 2 Z 2 Z ZALOG Z e X ZEXP Z ZTRP Z RDN ZRUP Z ASIN ZASIN Z ZACOS Z ATAN ZATAN Z ASN ZK YN Z ZSIGN Z 21 2 AIMG _ Z ISG ZCONJ 2 X Z Z CLZ Z X Y Z W Z SF ZNORM Z ZMOD Z ZARG Z X Y Z V R Z BEEP ZTONE Z P R ZREC Z RP ZPOL Z gt Y Z Z ZRND Z SCI ZINT Z ZFRC Z X 0 Z 0 Z PO ZGAMMA Z LASTZ 54 2 Z ZSINH 2 ZCOSH z ZTANH Z SIN ZASINH Z COS ZACOSH Z TAN 2 z Z SORT ZNXTNRT Z Z ZNXTLN Z Z SIN ZNXTASN Z Z ZNXTACS z Z TAN ZNXTATN Z Z LOG ZKBS j Zn Zz LN ZYBS z Z COS ZIBS Z Z TAN ZJBS z Z SIN ZVVL z Z SQRT 62 2 417 User Manual Page 65 Appendix 3 Formula Compendium Elementary complex numbers and functions By W Doug Wilder j e 1200 12180 1 j j Rei Z ilmiZ yc x fy re Z rcaM irsirb r Z e ry fan y x Z f x jy re r Z F RAZ Z Z j imZ ZZ 22 ZZ SS L 2 Z Z Z Z Z Z 4 Z y Z Z 22 2 2 212 2 lz 25 ZZ
44. ZWCROSS 41Z User Manual Page 39 9 It s a Gamma Zeta world out there This section describes the different functions and programs included on the 41Z that deal with the calculation of the Gamma and Zeta functions in the complex plane A group of five functions in total two completely written in machine code and three as FOCAL programs plus a couple of example application programs to complement it Table 9 1 Gamma function group ZGAMMA Complex Gamma function for z k k integer Does LastZ ZGPRD_ Auxiliary Product 0 PROD z n n 1 6 ZPSI Complex Digamma Psi ZLNG Gamma Logarithm see below FOCAL program ZGAMMA uses the Lanczos approximation to compute the value of Gamma An excellent reference source is found under http www rskey org gamma htm written by Viktor T Toth Remark that ZGAMMA is implemented completely in machine code even for Re z lt 0 using the reflection formula for analytical continuation For complex numbers on the positive semi plane Re z 0 the formula used is as follows q 75122 6331530 q 80916 6278952 ee 4 36308 2951477 Toi z 5 595 4853 4 8687 24529705 Jl g 1168 92649479 q 83 8676043424 q 2 5066282 And the following identity reflection formula is used for numbers in the negative semi plane Re z lt 0 which can be re written as G z G z n z Sin x z sin Example Calculate G 1 i
45. adds 4 to it b5 7 C C A Sax b11 addr b4 Y RAM SELECT non zero the last buffer reg b3 x WRIT DATA this should do it b2 2F3ET 13 Exit if PRG Running bi L CRIN b PORT DEP Show X Y 08c GO x INITIALIZE INITIALIZE A9DO ACOO EAVIEW OZ OOOO Notice how we finish with ZAVIEW to show the current complex number in the stack upon buffer creation CHKBUF does not create the buffer but reads its address into register A and the content of the header into register C The following section shows the actual buffer creation snippets 41Z User Manual Page 63 m a I CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE CREATE NORME C E E E m HO 7 j ALL C 0 ALL RAM SLCT M C LDI S8X CON 12 AC SEX JC 11d C M ALL RAM SLCT A C S amp X PT 13 LD PT 8 LD PT 8 LD PT 0 LD PT 12 WRIT DATA JNC 33d NC XQ 060 _ ZC _ NC XQ POTE Gei JNC 16d NOBU NOBUFE NOBUFE NOBUF NOBU NOBU NOBU NOBU NOB NOB NOB NOB NOB NOB NOB NOB NOB NOB NOB NOB NOB AAA LAZA A AI A C Land Led Led Lal Led Land Led Led Lol Led Lem mld monn IT TT ffl ono IT IT mm DI
46. alculated and placed in complex levels Z and W You can use Z lt gt W to see them both 41Z User Manual Page 29 6 Complex geometry The next set of functions admits a geometrical interpretation for their results Perhaps one of the earliest ways to approach the complex numbers was with the analogy where the real and imaginary parts are equivalent to the two coordinates in a geometric plane Table 6 1 Complex geometric group NE T BE Fan 2 2 m ne EE ANE 116 Bees 3b 2 5 Ze 1 x 2160 Opposite by X of a complex number ZCONJ Z 5 zstoN Ten San of a complex mumbe 2 6 ZNORM_ Z iz 2 S Norm of a complex number _ 8 2 1 Zezli S Rotates z 90 degrees clockwise o In fact various complex operations admit a geometrical interpretation An excellent reference source for this can be found at the following URL http www clarku edu djoyce complex Let s see the functions in detail Module of z z SQR x 2 y 2 Does LastZ Argument of z a ATAN y x Does LastZ This pair of functions calculates the module or magnitude and the argument or angle of a complex number given by the well known expressions z SQR x y a ATAN y x Since they use the internal TOPOL routine like R P does the argument will always be given between 180 and 180 degrees or equivalent in the selected angular mode The result is saved in the complex Z register and the r
47. cess but exceeding entries will simply be ignored Only one EEX can exist in the imaginary part IM AG will check for that Only one CHS can be used for the mantissa sign IM AG will check for that Multiple CHS can be used for the exponent sign but IM AG will apply the arithmetic rules to determine the final sign as follows odd number is negative even number is positive e Pressing Back Arrow will remove the last entry be that a number Radix EEX or CHS If the entry is the first one it will cancel the process and will discard the real part as well The seguence must be ended by pressing ENTER or R S The display cue is different depending on the actual complex mode RECT or POLAR and it s controlled automatically Upon completion the complex number is pushed into the Z complex stack level and placed on the X Y real stack registers as well following the same 41Z convention real part in X and imaginary part in Y The complex stack is lifted and the real stack is synchronized accordingly The screens below show usage examples in RECT and POLAR modes i until finally 725 575 ending as ee Note To extract the numeric value from the input string IM AG executes the same code as the X function ANUM All conversion conventions will follow the same ANUM logic Suffice it to say that the implementation of IM AG is not absolute perfect and you can trip it up If that s what you really want but it should p
48. d NOW4dd NONddd NONddd NONddd NONddd NOW4dd NOW4dd NOW4dd NOW4dd NONddd NONddd NONddd NONddd NOW4dd NOW4dd NOW4dd NOW4dd ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou L ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou s SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA SoA NV LV DO SOOV DO NISV 1X N UORE101 UOHE101 Jamod puqAu uonounj dX3Z leul le UONBION 4 Je NBUP D9H viZ H piez W lt gt 3H HNV L NYL 100 aienbs HNIS NIS z ubis Z p puno 7 z 6o1 z u1 71 ZIZ Zv4 7 2 9 SOD HNVLV NVLV HNISV NIVIXN SOVIXN NSV LXN VZ L 2 ZI ZIF Zv 10dZ o3uz WHONZ GONZ DHVZ du1Z HNV1Z NV1Z IYOSZ HNISZ NISZ NDISZ 99 99 v9 9 c9 L9 09 6S 89 28 9G GG Pi EG Ch S 09 87 LV 9y gy vv
49. e 43 42 ZAVIEW EMD 10 Application programs The following functions in the 41Z are in reality FOCAL programs included as application examples because of their applicability and as a way to illustrate actual programming of the complex number functions of the module Index Function Description Author 0060606060 6 zWL Lambert Wfunction JM Ballard 8 AM 8 7 ZAWL Inverse ofLamberttW AN 1 Note Most of these functions appear on CAT 2 as M Code entries instead of as FOCAL programs This is achieved by using a clever technigue shown by William E Wilder author of the BLDROM which allows cleaner and convenient program listings no ugly XROM description before the program title These programs can still be copied into main memory using COPY as usual but won t have the global label The drawback is that they can t be looked up using GTO global LBL since there s no global LBL for them 10 1 Solution of guadratic and cubic eguations ZCRT Roots of cubic equation Main routine C 7522 7 ZORT Roots of quadratic equation routine Z Z ZORT Solves the roots of a quadratic equation with complex coefficients as follows Ci zZ C z 0 where Ci C C3 and z are complex numbers By applying the general formula Z12 C2 SOR Cz 4C1 C3 2 Example find out the roots of 1 i z 1 i z 1 i ZOUAD aZ 2 bZ c O0 followed by
50. e a few techniques applied together combining the capabilities of the 41Z in a convenient way The solution is a direct application of the definition requiring very simple extra programming albeit with the logical slow performance The Lambert W function is given by the following functional equation 2 W z e for every complex number z Which cannot be expressed in terms of elementary functions but can be properly written with the following short program 1 LBL ZVVL The complex value is expected to be in the Z complex stack level 2 and X Y registers upon initialization Set the FIX manually for the 3 4 required precision 4 ZUN 3 Lu Because ZSOLVE uses all the complex stack levels and registers 0 E to 6 the argument is saved in the complex register 4 E06 corresponding to real registers 8 and 9 thus a SIZE 10 or higher is reguired see register correspondence map below Sr We solve for W z z using as the function initial estimations the 12 ZAVIEVY logarithm of the same argument and the same point plus one 13 R N perhaps not a refined choice but sufficient to ensure convergence 14 in the majority of cases Some calculated values are 15 ZEKP 16 LASIZ W 0 0 17 7 W 1 Q 0 56714329 18 ZRCL W e 1 19 4 W 1 0 31813 1 33723 20 i 21 END This example is not meant to compete with a dedicated program using an iterative algorithm yet it showcases the versatilit
51. eal X Y stack levels as a complex number with zero imaginary part The original complex number is stored in the LastZ register The other complex stack levels W V U aren t disturbed These functions display a meaningful description when used in run mode as can be seen in the pictures below for z 5 4 j and RAD mode _ Opposite of z Does Last Opposite of z by X Z 1 x z Does LastZ Conjugate of z Does LastZ 41Z User Manual Page 30 This pair of functions calculate the opposite or the multiple opposite by 1 x and the conjugate of a complex number z x y I as follows z x yl and z x yl See the figure below for the geometric interpretation of ZNEG and multiplication by real numbers Peat multiples ot a complex number kri Z W ed Module of z Does LastZ This function calculates the sign of a complex number As an extension to the SIGN function for the real domain it is a complex number with magnitude of one i e located on the unit circle that indicates the direction of the given original number Thus obviously Zsign z z PR axi ha qayalar 2 ggf TT aa Tree D D D D D D Ze 2 x Ret z KA 2 P 4 m Z y Im z Ba i K j x H 277 102777777 7 5 8l15
52. ed on the LastZ register The result is placed on the complex Z level Levels W V U are preserved in all cases including the more involved calculations with ZTAN and ZATAN those with the devilish names for which extensive use of scratch and temporary internal registers is made The formulas used in the 41Z are sin z i sinh iz sinh z 1 2 le e cos z cosh iz cosh z 1 2 e e tan z i tanh iz tanh z e e e e asin z i asinh iz asinh z Ln z SQ Z 1 acos z 1 2 asin z acosh z Ln z SQ z 1 atan 2 i atanh iz atanh z 1 2 Ln 1 z 1 z So we see that interestingly enough the hyperbolic functions are used as the primary ones also when the standard trigonometric functions are required This could have also been done the other way around with no particular reason why the actual implementation was chosen Example Because of their logarithmic nature also the inverse trigonometric and hyperbolic functions will be multi valued Write a routine to calculate all the multiple values of ASIN z 01 LBL ZASIN 08 ZRCL 15 ZAVIEW 02 ZASIN 09 ZNEG 16 PSE 03 ZSTO 10 ZSTO 17 E 04 ZAVIEW 11 RCL 02 18 ST 02 05 E 12 PI 19 GTO 00 06 STO 02 13 20 END 07 LBL 00 14 41Z User Manual Page 36 The 41Z module now also includes new functions to calculate next values for complex ASIN ACOS and ATAN as follows NXTASN NXTACS and NXTATN Using the first
53. er in level Z 13 ZREPL Complex Stack Fill Fills complex stack with value s inXY 4 7 ZRDN Complex Roll Down Rolls complex stack down 5 28 Complex Roll Up Rolls complex stack up 6 28 InputsrealZ Enters value in X as real part only complex number 8 Z lt gt W ComplexZ lt gt W Swaps complex levels Zand W o o EEN Complex Exchange Exchanges number in level Z and memory a taz Cleats tevel 2 Deletes complexlevel 20 M 16 ZREAL Extradsreal part Clearsim z 628 17 ZIMAG _ Extractslmag part ClearsRe 2 n Note These functions are fully programmable When used in a program their argument is taken from the next program line see below for details 4 1 Stack and memory functions group Let s start with the individual description of these functions in more detail beginning with the simplest ZTRP ZTranspose S DoesRe lt gt Im 1 This function s very modest goal is to exchange the real and imaginary parts of the complex number stored in the Z level of the complex stack Hardly a worthwhile scope you d say considering that the standard function X lt gt Y does the same thing Indeed it is quite similar and as such it s logically assigned to the shifted X lt gt Y key But it s not quite the same as in run mode ZTRP also shows on the display the complex number after transposing their real and imaginary parts Besides as it was mentioned in the introduction
54. ex to real power Z e x Ln z Does LastZ Z 1 X Complex to reciprocal real Z e Ln z x Does LastZ Real to complex power Z e z Ln x Does LastZ X41 Z Real to reciprocal complex Z e 11 z Ln x Does LastZ ZALOG 10 to complex power Z e z Ln 10 Does LastZ These five functions are calculated as particular examples of the generic case WZ Their advantage is a faster data entry not requiring inputting the zero value and a better accuracy in the results ZA1 X is identical to 1 X Z X X4 1 Z is identical to RDN ZINV R X Z Data entry is different for hybrid functions with mixed complex and real arguments As a rule the second argument is stored into its corresponding stack register as follows X into the real stack register X for ZAX and 2 1 Zinto the complex stack register Z for XAZ and XA1 Z The first argument needs to be input first since this is an RPN implementation Because ZALOG is a monadic function it expects z in the stack level Z and thus it doesn t disturb the complex stack Example Calculate 1 2i 3 and 3 1 21i 2 ENTER 1 ZENTERA 3 ZAX results 1 2i 3 11 2 j 2 ENTER 1 ZENTER 3 XA Z results 37 1 21 1 0 j Example Verify the powers of the imaginary unit as per the picture below You can use either ZAX with z O i and x 1 2 3 4 5 or alternatively WAZ with w O i and z 1 0i 2 0i 3 0i etc 24 M u lipl ication a 1 a by 1 Do W
55. fferent expressions for the formulas Like it occurs with any built in comparison function there s no action taken on the original number which will remain unchanged 41Z User Manual Page 35 7 Complex Trigonometry Table 7 1 Complex trigonometry function group Index Function Formula Description n 1 ZSIN sinz ixsinh iz 2 ZCOS cosz cosh i Lompen Cosine 3 ZTAN tanz i tanh iz Complex Tangent 4 ZHSIN sinh z 1 2 le z e z Complex Hyperbolic Sine ZHCOS coshz 1 2 ez e z Complex Hyperbolic Cosine 6 ZHTAN tanh 2 e z e z e z e z Complex Hyperbolic Tangent And their inverses 7 ZASIN asin z i asinh iz 8 ZACOS 52 z 2 asin 10 ComplexinverseCosine 9 2 atanz i atanh iz 10 ZHASIN asinh z Ln z 50 272 1 Complex Inverse Hyperbolic Sine 11 ZHACOS acosh z Ln z SQ z72 1 Complex Inverse Hyperbolic Cosine ZHATAN atanh z 1 2 Ln 1 z 1 z Complex Inverse Hyperbolic Tangent This section covers all the trigonometric and hyperbolic functions providing the 41Z with a complete function set In fact their formulas would suggest that despite their distinct grouping they are nothing more than particular examples of logarithm and exponential functions kind of logarithms in disguise Their usage is simple the argument is taken from the complex Z level and a ways sav
56. g A d j lt i Pai j 2 d ji e M T cos ising Example For z 4 5j calculate its sign and verify that it s located on the unit circle 5 ENTER 4 ZSIGN gt result ZSign 0 62 0 78 ZUNIT gt result YES DEG POLAR gt result 1 00 lt 51 34 in degrees In program mode the behavior is ruled by the do if true rule skipping the next line if false W N x SS Reciprocal a rid Co n uga fe 41Z User Manual Page 34 ZREAL Checks if z is purely real Checks if z is purely imaginary ZINT Checks if z is an integer The first two functions check whether the complex number is purely a real or imaginary number Do not mistake these comparison functions with the other pair ZREAL and ZIMAG which cause the number to change to become either real or imaginary nor with ZREALA and ZIMAGA which are used to input complex numbers of the selected type based on the value stored in the real stack level X The third one extends the scope of ZREAL adding the condition of being a true integer number ZINT True means ZREAL True and FRC Re z 0 Do not mistake it with ZINT which causes the complex number to have no decimal figures in BOTH its real and imaginary parts therefore it s result not a Real number ZINT is used in the FOCAL programs to calculate Bessel Function as a quick an effective way to determine if the order is integer which triggers di
57. garithm as follows Ln z Ln z ia Ln z i a 2nn Or in general LN z Ln z i a 2x n where n is a natural number To deal with this multi valued nature of the function mathematicians define the different branches of the complex logarithm logy as the single one and only logarithm which argument is comprised between and y z thus within the open interval 1 y x y z Its domain isnt the whole complex plane but it excludes a semi straight line centered at the origin that forms an angle amp with the real axis as shown in the picture Such set is called the torn or cut complex plane at Torn plane Dg C H angle y Thus the principal value of d the logarithm really should be called m amp Logo as It tears or cuts the complex amp P1 4 plane by the real negative semi axis 2 or otherwise y 0 This means it is a x NOT defined for any negative numbers and when those need to be subject of its application a different cut should be chosen Therefore all arguments should be comprised between 180 and 180 degrees as it would correspond to this definition of Logo Branch In practicality the values calculated by ZLN always lie within this interval 41Z User Manual Page 28 since they use the internal routines of the calculator TOPOL and TOREC The angle y should not be confused with the base of the logarithm which is alwa
58. he V41 directory with the 412 bitmap file after renaming it to the same file name The figure below shows the main different modes of the ZKBRD function the real cornerstone of the 41Z module ME 7 na SHIFT PRE SHIFT PP cae Press the Back arrow key to bring the command chain back to the starting point ZKBRD Pressing it twice shows NULL and cancels out the sequence Pressing non relevant keys i e those not supposed to be included in the corresponding mode causes the display to blink and maintain the same prompt no action taken 41Z User Manual Page 15 4 Stack and Memory functions Let Z and W be the lower two levels of the complex stack and z and w two complex numbers stored in 2 and W respectively 2 Re z jIm z W Re w j Im w Note the use of j to express the imaginary unit instead of i This isn t done to favor those EE s in the audience you know who we are but rather due R the displaying limitations of the 41 display no lower case letters for either or j and better looking for the last one in caps d Note also that despite their being used interchangeably the complex stack register Z in bold font and the real stack register Z in regular font are not the same at all Table 4 1 Stack and memory function group Index Function Name Description O Z O Z S Exchanges transposes Re and Im for numb
59. ial functionality in the 41Z module can be used as shortcuts to input purely real or imaginary numbers more efficiently For instance to enter the imaginary unit one need only press 1 ZIMAGA which is also equivalent to executing the IMAGINE function or simply ZKBRD Radix 1 using the complex keypad And to enter 4 as a complex number just press 4 ZREALA or simply ZKBRD 4 using the complex keypad Incidentally the 425 implementation fails short from delivering a true 4 level stack due to the COMPLEX function and the fact that it requires two stack levels to be available to combine the complex number In this regard the 41Z solution is a better one Two opposite alternatives to data entry COMPLEX key on the 42S and 1 key on the 35S 41Z User Manual Page 7 3 User interface enhancements Table 3 1 Functions to enhance the user interface index m Tan U abili Kere deactivates the Complex Assignments 2 ZKBRD Usabilit Accesses most of the 41Z functions plus special features ZAVIEW Display Views complex number in X Y POLAR Displays complex numbers in Polar form RECT Displays complex numbers in Rectangular form 6 AIM AG Usabilit Inputs Imaginary Part or Argument of complex number These functions facilitate the showing of the complex number on the display and the conversion between the polar and rectangular forms They enhance the usability by supplying a system to hand
60. implementation of ZSQRT only offers one of the two existing values for the square root of a given complex number The other value is easily obtained as its opposite thus the sum of both square roots is always zero Such isn t exclusive to complex arguments for the same occurs in the real domain where there are always 2 values x1 and x1 that satisfy the equation SQRT x1 2 As with other multi valued functions the returned value is called the principal value of the function See section 6 ahead for a more extensive treatment of this problem Complex to complex Power Z e z Ln w Does LastZ WA1 Z Complex to reciprocal Power Z e Ln w z Does LastZ The most generic form of all power functions calculated using the expressions wz exp z Ln w and w 1 z exp Ln w z The second function is a more convenient way to handle the reciprocal power but it s obviously identical to the combination ZINV WAZ Example calculate the inverse of the complex number 1 2i using WAZ Then obtain its reciprocal using ZINV to verify the calculations 2 ENTER 1 ZENTER number stored in level W also as 1 ENTER 2 ZTRP 0 ENTER 1 exponent 1 stored in level Z also as 1 ENTER 0 ZTRP WAZ result 0 200 j0 400 ZINV result 1 000 j2 41Z User Manual Page 24 Note that the final result isn t exact as the decimal zeroes in the real part indicate there s a loss of precision in the calculations Compl
61. ined to be that of their real counterparts A single function is used for the mass assignment or de assignment action ZK YN Complex User Assignments function ZK YN automates the assignment and de assignment of 37 functions It prompts for a Yes No answer as follows Answering Y will assign the complex functions to their target keys Answering N will de assign them and Pressing Back Arrow will cancel the function Any other key input including ON will be ignored The assignment action will be indicated by the message Z KEYS ON or Z KEYS OFF in the display during the time it takes to perform followed by PACKING and possibly TRY AGAIN should the enough number of memory registers not exist Note that ZK YN is selective any other key assignment not part of the complex functions set will not be modified Keycode 11 12 13 14 15 21 22 23 24 25 33 34 41 R 42 CHS ISG ZHEG 44 x CLx CLZ Ji xey W 51 xe y Z WR fi xey Z 81 0 2 0 83 LASTX LAST 84 VIEW FVIEW Table 3 3 Complex key assignments done by ZK YN 41Z User Manual Page 12 3 4 The Complex Keyboard AS good as the user assignments are to effectively map out many of the 41Z functions this method is not free from inconveniences Perhaps the biggest disadvantage of the Complex Assignments is that it s freguently reguired to toggle the user
62. ion for a few functions notably the logarithms and some analogies will be made to their geometric eguivalences but it is assumed throughout this manual that the user has a good understanding of complex numbers and their properties 5 1 Arithmetic and Simple Math Table 5 1 Arithmetic functions Formula T Description 0U2 Index Function 2 Z Z w z Complex subtraction 6 12 12 222 Doubles the complex number Z o Z o 7 ZHALF 2 2 2 Halves the complex number 1 __ZRND_Zzroundedizi Rounds 2 to display settings prog gr ZINT Z m Takes Integer part for Re z W Im z EE Takes fractional part for Regj and im 11 L pp 2 2 2 9 simple multiplication by d Here s a description of the individual functions within this group Z Complex subtraction 1 Z v z DoslastZ Z 8 Complex multiplication 1 Z w z 93 DoesLastzZ Complex arithmetic using the RPN scheme with the first number stored in the W stack level and the second in the Z stack level The result is stored in the Z level the complex stack drops duplicating U into V and the previous contents of Z is saved in the LastZ register ZINV Direct Complex inversion Does LastZ Uses POLAR conversion Z 1 r e iArg Does LastZ Calculates the reciprocal of the complex number stored in Z The result is saved in Z and the original argument saved in the LastZ register Of these two the direct method is faster and of c
63. le the lack of native complex number treatment capabilities of the calculator 3 1 Display mode and conversion functions Complex number AVIEW Uses ALPHA registers Shows the contents of the complex stack level Z in the display using the current complex display mode POLAR or RECT RECT Re z 5 imi where 2 is stored in register X and Im 2 in register Y POLAR Mod z lt Arg z shown but not stored in the X Y stack registers 1 Note that ZAVIEW uses the ALPHA register thus the previous contents of the M N and O registers will be lost The displaying will respect the current DEG RAD or GRAD angular mode in POLAR form the current FIX SCI or ENG settings as well as the number of decimal places selected on the calculator Note that J precedes the imaginary part as this improves legibility with real life complex numbers with decimal imaginary parts For a simplified visualization ZAVIEW won t show decimal zeroes if the number is an integer This is done automatically regardless of the number of decimal places selected in the calculator so one can immediately tell whether the real or imaginary parts are true integers as Opposed to having some decimal content hidden in the least significant places not shown m Versus KSE ZAVIEW will extract common factor if both the real and imaginary parts are equal 5157 or also Executing the functions POLAR and RECT will also display the complex n
64. level and not the U V W and Z notation employed In previous sections of the manual Buffer Layout Buffer Details b11 non zero The bufer has 12 memory registers b10 Buffer registers are labeled B to 11 b9 Header is located at the boltom ba A non zero register is at the top b Each Level uses wo buffer registers bb Levels are labeled L fo 14 b5 b4 b3 b2 b1 b Header The buffer header b0 register is placed at the lowest memory address It contains the buffer id its size and its initial address when it was first created no updates if it s re allocated later on 41Z User Manual Page 59 Buffer creation is done automatically by the 41Z module upon power on when the 41 awakes from deep sleep using the corresponding poll point in the module The contents of the real stack registers XYZT is copied into the buffer levels LI 6 L2 upon initialization The buffer is maintained by the 41 OS which handles it when modifying the layout of main memory either changing the SIZE settings or modifying the user key assignments The buffer Id is 8 and thus should be compatible with any other memory buffer that uses a different id an example of which are the TIMER alarms Should for any reason the buffer is damaged or erased like when using the function CLZB the message NO Z BUFFER would appear when trying to execute any of the 41Z module functions To manually re create the complex buffer simply execute
65. lity the execution time is largely reduced to almost instantaneous response 41Z User Manual Page 49 10 5 Solution to f z 0 The final example uses the Secant Method to obtain roots of a complex eguation given two estimations of the solution A general discussion on root finding algorithms and is beyond the scope of this manual this example is intended to show the capabilities of the 41Z module in particular how programming with complex numbers becomes as simple as doing it for real numbers using the native function set See the following link for further reference on this subject albeit just for real variable http en wikipedia org wiki Secant method The secant method is defined by the recurrence relation Ly ty 1 Fen fa 7 Endi dn which will be calculated until there s no significant contribution to the new value as determined by the function Z WR Program listing As it s the case with this type of programs the accuracy of the solution depends of the display settings and the convergence i e The first two iterations of the secant method The red likelihood to find a root will depend on the curve shows the function F and the blue lines are the initial estimations secants The program works with 8 digit precision therefore will largely benefit from the turbo mode settings on V41 to dramatically reduce the execution time 1 LBL ZSOLVE 20 Z lt gt W 39 IZ 2 FS 0
66. mplex ACOS e Does LastZ NXTATN Next Complex ATAN e Does Last Let z0 be the principal value of the corresponding inverse trigonometric function Each of these three functions returns two values 21 and 21 placed in complex stack levels Z and W Z1 will be shown if the function is executed in RUN mode You can use Z lt gt W to see the value stored in W that is z1 The NEXT values z and z1 are and given by the following recursion formulas gt lt Next ZASIN Z1 ZO 2 pi Z1 Z0 pi Next ZACOS Z1 Z0 2 pi Z1 Z0 2 pi Next ZATAN Z1 Z0 pi Z1 Z0 pi The figure on the right plots the multi valued imaginary part of the complex logarithm function which shows the branches As a complex number Z goes around the origin the imaginary part of the logarithm goes up or down For further information on multi valued complex functions see the following excellent reference http en wikipedia org wiki Branch point See section 9 ahead for further details on multi valued functions with the FOCAL driver program ZMTV ZMulTiValue that calculates all the consecutive results of the eight multi value functions 41Z User Manual Page 38 8 2D vectors or complex numbers One of the common applications for complex numbers is their treatment as 2D vectors This section covers the functions in 41Z that deal with vector operations between 2 complex numbers Table 6 1 2D vectors function group I
67. n x Go Ye d lo 02 61 81 11 CL NOWLSOd sak sak Sei ou NON3Hd ou ou ou eat eat NISY HIERZ o NOWLSOd sok sok sak ou NOW3Hd ou ou ou SIK eat ZVOL 501VZ 62 NOWLSOd s Sai sai ou NON3Hd ou ou ou Sai Sai Hsoov HSO VZ 82 NOWLSOd s s 5891 ou NON3Hd ou ou ou s Sak 502 SODWZ Jz NOWLSOd Sei sa ou NOW3Hd ou ou ou sok sok XvZ XVZ 92 NOWLSOd sof 591 sof ou NOWaud ou ou ou s s ZvZ ZZ G NOWLSOd sa sak sah ou NOW3Hd ou ou DUO L ZX vz G NOWJFYId G NOWJFYId G NOWJYId G NOWJFJYId 2 G NOWJFYId G NOWJYId G NOWJFYId INGa34d INGa34d INGa34d t IZI tsizI 2111 pew 7 s G R Z S I Z Sl O18Z JOU Z SI 40197 Z SI M 0U Z SI puno M Z SI M Z SI LINNZ 61 02 NIZ SVNWIZ TVIUZ I Z 0 Z 0 Z EM Z HA Z N Z z Tvna sd I 1 SAA ou ou SoA sok uonenb3 au 3NITAZ 21 Z T1VNGLSd ou sok sok sah Tvnda3tid sof ou Ou SoA sa 100 LOGMZ C 1vnalSd ou s s Soh 1VNa 34d sa OU ou SoA SoA 9DUBISICI ISIOMZ OL Z 1VNGLSd ou sok sok sa Tvna3ud s ou i ou Sal Sak jeu use LJAGMZ 6 Z 1VNGLSd ou sok sok Sah Tvnd3ud sah ou Ou SoA SoA jonpoug 5500 SSOHOMZ 8 Z T1VNGLSd ou sok sok sah Tvnd3tud s 4 ou Ou SoA SoA obuv ONVMZ Z TWNGLSOd Tvnd3ud SPA Z 9 1VNaLSOd Tvnd3ud Adnny q IWNGLSOd 43
68. nG z 7 Ln PROD z k k 1 2 6 The second one applies the direct definition by calculating the summation until there s no additional contribution to the partial result when adding more terms In addition to being much Slower than the Stirling method this is also dependent of the display precision settings and thus not the recommended approach It is not included on the 41Z but nevertheless is an interesting example of the utilization of some of its functions like Z WR and the memory storage registers ZSTO and ZRCL Pt M n I z yz ln z F ln 1 2 kai 02 1 ZREGZ Size ST 03 STO02 n a 04 ZSTO 00 04 RDN R 05 Text NOP 05 2510 00 3 06 6 06 05 1 07 CHS 07 LBL 2 08 ZAX 08 ZENTERA 3 09 810 09 05 i 10 IST Z 10 Z 3 111 11 27 VVR 2 12 IZRCL 00 12 GTO02 4 13 ZINV 13 GTO00 H H 14 ZS NH 14 5 15 IZRCL 00 15 IZRCL 00 16 Z 16 LN 6 17 Ze 17 Z 18 118 18 IZRCL 00 7 19 IZRCL 00 19 0 5772156649 20 ZLN 20 STZ 8 21 2081 211 22 Z 22 9 231 12 23 A T 24 An 25 ZRCL 00 25 P 26 Z 26 27 ZRCL 00 27 28 LN 28 Su The table on the right shows the 31 ST X 31 correspondence between the 32 LN 32 complex register number CRnn 33 Le 23 and required SIZE in the 34 ZHALE 34 calculator Note that a minimum of 36 ZRCL 00 35 SIZE 003 is required for CROO to 36 Text NOP 36 exist 37 Z 37 38 38 39 ZGPRD 41 r Pag
69. nabled by pressing Z twice and then SHIFT This group is encircled on the keyboard overlay and sets the five multi value functions as follows NXTASN NXTACS NXTATN NXTLN and NXTNRT this one will also prompt for the root order as an integer number 0 9 Notice that pressing SHIFT while in the NEXT section toggles the display to ZBSL Use it asa shortcut to access the different Bessel functions of first and second kind provided in the 41 as follows ZJBS ZIBS ZKBS and ZYBS as well as EIZ IZ a particular case of Spherical Hankel h1 0 2 e Hyperbolic functions Press Z followed by SHIFT twice to access the three direct hyperbolics Pressing SHIFT a third time will add the letter A to the function name and will enable the inverse functions This action toggles with each subsequent pressing of SHIFT Watch the 41Z building up the function name in the display as you press the keys Example Pressing Z SHIFT SHIFT SHIFT SIN will execute ZASINH f Complex Keypads Press Z followed by a numeric key 0 to 9 to enter the corresponding digit as a complex number in the complex stack Pressing Z followed by the Radix key and then the numeric key will input the digit as an imaginary number as opposed to as a real number into the complex stack This is a very useful shortcut to quickly input integer real or imaginary values for complex arithmetic or other operations like multiplying by 2 etc 41Z
70. ndex Function Formula D or 1 ZWANG Arg ZW Arg Z Angle between 2 vectors 2 _ ZWDIST W Z SQR VVx Zx 2 Wy Zy 2 3 ZWDOT Z W Zx Wx Zy Wy 2D vector Dot product ZWCROSS Z x W z w Sin Angle 120 vector Cross product 5 51 ZVVDET ZW Wx Zy Wy Zx 2D determinant a Y1 Y2 X1 X2 Equation of line through two points b Y2 a X2 These functions use W and Z levels of the complex stack leaving the result in level Z after performing complex stack drop The original contents of Z is saved in the LastZ register The following screen captures from V41 show the different displays for these functions Let z 4 45 degrees and w 3 75 degrees 45 ENTER 4 ZREC gt 2 828 1 ZREPL don t forget or Z will be overwritten 75 ENTER 3 ZREC 0 776 2 898 1 ZWANG angle defined between both vectors in degrees in this case 2 ZRDN LASTZ ZWDIST distance between both complex numbers 275586 1 257 The angle vvill be expressed in the selected angular unit 3 ZRDN LASTZ ZWDOT dot product of both vectors 4 ZRDN LASTZ ZVVCROSS magnitude of the cross product of both vectors KE ES 5 ZRDN LASTZ ZWDET magnitude of the determinant of both vectors 6 ZRDN LASTZ ZWLINE eguation of the straight line linking both points Note that despite having a simpler formula ZWDET shows less precision than
71. nh Z 1 2Xe7 e i sini iZ sinh 2 in 2 fZ7 4 j cashZ 1 2We Ae coal iZ cash Z Inf Z Z 1 F R e ge I l Z tanh Z itan jZ tank z Jul e Ae e Ai d 2 1 2 cosZ cos x coshp isinx sinh y sin Z sin x cashy jcasx sinh y 41Z User Manual Page 66 L9 esfey J SdIYS ON S3A AX Z UI z gt Z si 69 0119 lun y pisul Z SI NIZ t J SdIYS ON S3A AX Z U z 0 Z wW SI 0 Z wW SI 6 2 22 ZISE7 s op AX Z ul z uue AX Z ul z Z v FZ Z V Z 2 yuel NV L d H xajdu09 2 28 Z1se7j s op AX Z ul z uuis AX Z UI Z z v9 z l Z L 2 UUIS NIS d H Xejdwo9 NISHZ L Z1se7 s op AX Z u z usoo AX Z U z 2 z l 2 2 ysoo 902 d H xejdwog SOOHZ 06 ZISE7 s op AX Z ul z uueje AX Z ul z Z 1 Z 1 u1 2 1 z yuge NV LV d H x duuoo NYLVHZ 62 Z1Se7 s op AX Z ul z uulse AX Z UI Z L ZvZ OS 2101 2 yulse NISY GAH Xejdwo9 NISVHZ 82 ZISE7 s op AX Z Ul Z SOAJEH AX Z UI Z Z Al Z X 2 2 SOAJEU Z Z saMe JIVHZ 12 Z1se7 s op AX Z u z ysooe AX Z 412 L zvz os 217 z ysooe SOOV GAH Xe dwo9 SOOVHZ 92 ZISE7 s op AX Z ul ilns AX Z ul z z uloug z eoy loua Sued BUONDJEJ4 OHAZ SZ ZISE7 s op VHdTV pue AX Z ul z AX Z UI z I V Xv Xv9 0 dxaz v Z1set s op AX Z ul Z Z AX Z UI Z AZ XZ ZZ sargnog Z
72. ns that deal with complex arguments like ZSTO ZSTO Math ZRCL Z lt gt and ZVIEW all of them fully programmable as well 2 Complex Stack number entering and displaying A four level complex stack is available to the user to perform all complex calculations The complex stack levels are called U V W and Z from top to bottom Each level holds two real numbers the imaginary and real parts of the corresponding complex number Besides them a LastZ complex register S temporarily stores the argument of the last executed function 417 Complex Stack b11 The complex stack uses a dedicated buffer in main memory It is b10 created and maintained by the 41Z module and its operation b3 should be transparent to the user This buffer is independent b from the real stack X Y Z and T registers but it s important De however to understand how they interact with each other A Se complex number uses two real stack levels like X and Y but a single complex stack level like Zor MW The figure on the left b4 l i b3 shovvs the relationship betvveen the complex and real stacks b which is automatically maintained upon function execution as b we ll see later on b The real stack is used to enter the complex number values real and imaginary parts The input sequence varies depending on the method used but all functions will expect the imaginary part in the Y register and the real part in the X register More about this later
73. oV ov Ly OV 6E 8E LE 9E GE ve GE LE E NOWLSd E NOWLSd E NOWLSd NOW LSOd NOWLSOd E NOWLSd NOWLSOd NOWLSOd E NOWLSd E NOWLSd E NOWLSd E NOWLSd E NOWLSd NOWLSOd E NOWLSd NOWLSOd NOWLSOd NOWLSOd NOWLSOd NOWLSOd Sok Sok sah Sok Sok sah Soh Sok sah 591 sa sah sah 591 sah s s s s SoA Sok 591 Sok sah Sok 591 sah s s sah Sok sah sah sah Sok sah s s s ou SoA s ou ou ou s s ou s s ou ou ou ou ou s ou s s Sok ou SoA Sok Ou Ou s ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou 2 2 4 2 4 NOW4dd NOW4dd G NOWJYId G NOWJFJYId G NOWJYId G NOWJFJYI G NOWJYId G NOWJYId G NOWJFJYId G NOWJYId NONddd NOW4dd NOW4dd ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou ou VL ou ou ou sof sah 591 591 591 sah sah Ou Ou Ou Ou Ou Ou Ou Ou Ou Ou Ou mm x em m wem mm mm em em mm em em em emm wm emm mm mmm mmm mmm mm ng s w w Soh sof s 4 ou ou s sa s s s 4 sah s s ou ou ou ou ou ou ou ou 7 S9101S Z So1e0i doy 192 UMOG IO Jequnu ndu Jequnu ndu 191U3 z uuj sindui Z 91 2900 yoe18Z dn 1108 jJu uunBue 198 yoe1s oDuPuDxI yoe1s oDuPuDxI yoe1s oGbueyoxJ oeGuByYIXI YIBISZ 129 9 z u 12810
74. om this we derive the general expression Next z 1 N z 1 N e4 j 27 N thus there are N different Nth roots all separated by 2x over N See the geometric interpretation on section 7 ahead for further discussion on this When executed in a program or RUN mode data entry for this function expects N in the X register and Z in the Z complex stack level However when the Complex Keyboard shortcut is used the index N is prompted as part of the entry sequence a much more convenient way 1 Shortcut Z Z SHIFT SORT 41Z User Manual Page 26 Example Calculate the two square roots of 1 0 ENTER 1 ZENTERA 2 2 1 gt 1 j0 2 NXTNRT plus ZRND gt 1 j0 Note that the previous root is temporarily stored in the LastZ register LASTZ gt 1 j0 previous root See section 9 for a general application program to calculate the n different Nth Roots of a complex number Example Calculate the three cubic roots of 8 Using direct data entering Im z ENTER Re z 0 ENTER 8 ZENTERA 3 ZA1 X gt 2 j0 3 NXTNRT gt 1 000 j1 732 3 NXTNRT gt 1 000 j1 732 Note for this example use the Complex Keyboard ZKBRD to execute NXTNRT as follows Z Z SHIFT SORT and then input 3 at the last prompt Example Calculate both quadratic roots of 1 2i 2 ENTER 1 ZSQRT gives the first root z 1 2724 0 786 2 NXTNRT gives the second root z 1 272 0 786 2 NXTNRT reverts to the firs
75. omparable accuracy thus it s the preferred one as well as the one used as subroutine for other functions This function would be equivalent to a particular case of Z where w 1 0j and not using the stack level W Note however that Z implementation is not based on the ZINV algorithm that is making use of the fact that w z w 1 z but based directly on the real and imaginary parts of both arguments 41Z User Manual Page 21 Example Calculate z z using ZINV for z i We ll use the direct data entry starting w the imaginary part 1 ENTER 0 ZINV gt 0 j1 LASTZ O j1 Z gt 1 j0 Note that nteger numbers are displayed without decimal zeroes simplifying the visual display of the complex numbers ZDBL Doubles Z Does LastZ ZHALF HalvesZ 17 2 6 Dosslasiz These two functions are provided to save stack level usage and programming efficiency The same result can also be accomplished using their generic forms like Z and Z with w 2 0j but the shortcuts are faster and simpler to use Example Taken from the HP 41 Advantage manual page 97 Calculate z1 z gt z3 for zi 23 131 5 2 i and 23 4 3i If the complex stack were limited to 2 levels deep we would need to calculate the inverse of the denominator and multiply it by the numerator but using the 4 level deep complex stack there s no need to resort to that workaround We can do as follows 13 ENTER 23 ZENTER A gt 23 j13 1 ENT
76. omplex functions logic LA N 417 User Manual 41Z User Manual Page 4 41Z Complex Number Module for the HP 41 1 Introduction Complex Number handling is perhaps one of the very few areas where the HP 41 didnt have a comprehensive set of native functions written in machine mode and so taking advantage of the speed and programming enhancements derived from it While both the Math Pack and the Advantage Rom provide FOCAL programs for complex number treatment neither of them could be properly consider as a full function set to the effect of for instance the powerful Matrix handling functions contained in the Advantage Rom in turn an evolution of those implemented in the CCD Module The 41Z module provides a significant number of functions that should address the vast majority of complex number problems in a user friendly context and with full consistency To that goal this manual should also contribute to get you familiar with their usage and applications hopefully learning a couple of new things and having some fun during the process The implementation provided in this 8k module is a second generation code building on the initial 41Z ROM released by the author in April 2005 Numerous improvements have been added to the initial function set notably the addition of a 4 eve complex stack a POLAR mode and a fully featured complex mode keyboard Memory management is facilitated by prompting functio
77. ost translate one to one many FOCAL programs by replacing the standard functions with the eguivalent complex ones That s why it s important that the function set be as complete as possible and that the same RPN conventions are followed by the complex stack 10 2 Lambert W function ZWL Lambert W z FOCAL program ZAWL Inverse of Lambert W Does LastZ These two functions provide a dedicated way to compute the Lambert W function and its inverse The FOCAL program uses an iterative method to compute W z using 1 Ln z as initial guess for Re z gt 0 and simply 1 i elsewhere This program is based on a real mode version written by JM Baillard just applying the seamless transposition method provided by the 41Z module In the vast majority of cases convergence Is provided for all complex arguments with 8 decimal digits accuracy It uses the Z WR Function on FIX 8 mode to determine that two consecutive iterations are equal Another version using SOLVE is listed in section 10 5 1 with slightly more accurate results but significantly slower execution 10 3 Multi value Functions Multi valued functions KE This program calculates all possible values for the multi valued functions including the n different N roots of a complex number all the inverse trigonometric and hyperbolic plus the logarithm itself source of all the multi valued scenarios 412 User Manual Page 45 Due to the 64 function limit of the 41 ROM FAT struc
78. ote that all complex level contents will be shown transposed that is Im z j Re z 41Z User Manual Page 61 Finally the other two functions are auxiliary mainly used to perform action between the two lower and upper 4k pages within the 41Z module PREMON Finds Z Buffer address Copies XY into LO and checks X Y for ALPHA DATA PSTMON Copies the Z complex level into X Y Note FAT entries for these two functions were removed in newer versions of the module Because of its relevance and importance within the 41Z module the following section lists the buffer creation and interrogation routines pretty much the heart of the implementation Consider that they are called at least twice every time a function is executed and you ll appreciate their crucial role in the whole scheme 41Z User Manual Page 62 CHKBUF CHKB A998 04E C OALL H CHKBUF CHKB 999 130 10158 CHKBUF CHE 1008 CON 8 Buffer id in C 14 CHKBUF CHKB 23C RCR2 ID to C 12 CHKBUF CHKE 35C PT 12 CHKBUF CHKB 130 LDIS amp X CHKBUF CHKB OBF CON 191 Fisrt possible reg 1 CHKBUF CHK 10E A CALL CHEBUF Bil 166 A A 1 SEX Increase address CHKBUF BZ 046 0 SEX selecHChip 0 CHKBUF CHKBUF A9A2 270 BAM SLCT CHKBUF CHKBUF A9A3 378 READ 130 c END CHKBUF CHKBUF AQA4A 306 A C SEX did we reach the END Chainhe CHKBUF CHKBUF ASA5 3A0 NCRTN ye
79. pecified as the function s argument In fact two real storage registers are used one for the imaginary part and another for the real part This means that CRnn corresponds to the real storage registers Rnn and R nn 1 ZSTO ZRCL Y ba bd Y ZRCL will perform complex stack lift upon recalling the contents of the memory registers to the Z stack level Also note that following the 41Z convention ZSTO will overwrite the Z level with the contents of X Y if these were not the same This allows walk up complex data entering Displays Complex Register value Prompting function Exchanges Z and complex register S 5 Prompting function Like its real counterparts these functions view or exchange the content of the complex stack level Z with that of the complex storage register given as its argument Two standard storage registers are used as per the above description These four functions are fully programmable When in program mode either running or SST execution the index input is ignored and their argument is taken from the following program line after the function For this reason they are sometimes called non merge functions In fact the number denoting the argument can have any combination of leading zeroes like 001 01 1 all resulting in the same Moreover when the argument is zero then such index following line can be omitted if any non numeric line follows the function This saves bytes This implementation was
80. r Z Z Z 422 HEY 2273 ZE AZI AB Z ZP 2RaZT A Z x x PR d Kg Z ZZ xx ay ay y r Z 0 ne 9 Re 1 27 2 2 2 Gu y Kis MOS yl 100 28 9 23 iy x yi ech ir 22 xx y J x y yx rr Z 8 8 Z Z j Z X Z Z Z 2 D vectors Z sr y jiy re Z p ef principai m 3 14159 26535 8979323846 264 g mz e 2 7182818284 59045 23536 ZE e see ze sy e may je siny g ya u zy ze lt sr e fe s Z ef cas Z Z e cash Z Y sinh Z onsi iZ j sini iZ n nr A y jtag y x Den g N IZ sinZ Joost Z hz Z Z n 2 n 22 in Z In Z n 2 Z n co ne Z X in Log Z hZ na n z fei n n ci c g7 d Z ayi z az L a a Ina inZ fe dz EE z z z z a dl A z z P 2 2 1 2 Z 1Y 2 Z 1Y ei 4 4 4 inZ E 22 Re Z z0 TE 31 1241 3241 SUZ i sinZ 1 22 7 zF Me 1 e sin jin jz 41 2 2 1 e e 1 De 1 27 as Z j Z 42 j e d iz nzr r fi fan j tan Z n je og 4 Z jln PSEM el A ef ef 1 3 11 Z Hr asZ inZ sin Z EE eas 242 sin 2 sind az cazs Z Z Z Z Z Z Z sin cos Z l A 3 7 zal di l si
81. registers F z Ln z SQR z 2 1 for z 20 201 Solution 20 ENTER ZRPL gt puts 20420 in all 4 levels of the complex stack 2 2 1 ZREALA Z gt could have used 1 as a more direct method ZSORT Z ZLN gt 4 035 J0 785 Congratulations You just calculated the hyperbolic arcsine of 20 201 4 2 ZSTO Math function group Recall from Complex Register prompting function Store in Complex Register e Prompting function Recall from Complex Register 7 Prompting function Store in Complex Register e Prompting function The newest addition to the 41Z function set allow storage math in a concise format saving bytes and programming steps in FOCAL programs Their equivalence with standard functions would have to be done using four steps and disturbing the Complex Stack as follows 1 ZENTER 2 Z lt gt nn 3 MATH 3 Z lt gt nn Functions are fully programmable using the non merged technique These functions can be accessed using the Z keyboard from its own dedicated launcher pressing Z twice and then STO 41Z User Manual Page 20 5 Complex Math Complex numbers are much more than a Simple extension of the real numbers into two dimensions The Complex Plane is a mathematical domain with well defined own properties and singularities and it isn t in the scope of this manual to treat all its fundamental properties On occasions there will be a short discuss
82. registers or Complex stack level Z 41Z User Manual Page 6 2 2 Data Entry Conventions And how about complex number entering Here the world divides in two camps depending on whether the sequence is Re z ENTER Im 2 like on the HP 42S or its reverse Im 2 ENTER Re 2 like on the HP 32 33S and other FOCAL programs With the 412 module you can do it either way but it s important to remember that regardless of how you introduce the numbers all functions expect the imaginary part in the Y real stack register and the real part in the X real stack register Fast data entry will typically use the sequence Im z ENTER Re z followed by the complex function This is called the Direct data entry as opposed to the Natural data entry which would first input the real part The 41Z module includes the function AIM AG that can be used to input the number using the Natural convention reversed from the Direct one Its usage is the same as the i function on the HP 35s to separate the real and the imaginary parts The seguence is completed by pressing ENTER or R S after which the imaginary part will be left in the Y register and the real part in the X register as explained before Incidentally the 425 implementation of the complex stack isn t suitable for a true 4 level since the COMPLEX function requires two levels prior to making the conversion Other functions and spec
83. revent likely errors that could yield incorrect results It s a very convenient way to meet this need solving the diverse issues associated with its generic character If the input string doesn t yield any sensible numeric result the message SYNTAX ERROR is briefly shown in the display and the stack is restored to its status prior to executing IM AG ECH will trigger onsi Some apparently incorrect syntax constructions will however be properly interpreted by AIM AG returning a valid imaginary part This is for instance the case with multiple negative Signs in the exponent or decimal values after negative sign in the mantissa Such is the flexibility of the ANUM function 41Z User Manual Page 10 Example Vector Load addition taken from the 35s User Guide We start by setting POLAR and DEG y modes then using the IM AG function three times will set the La 185 lb 62 three complex numbers on the complex stack and finally simply 170 Ib 143 Li execute the complex addition function Z twice POLAR DEG L3 185 IM AG 62 ENTER 170 IM AG 143 R S 100 IM AG 261 R S 100 lb 261 Z Z Result gt 178 9372 lt 111 1489 Or in Rectangular mode as it s saved in XY RECT gt 64 559 J166 885 Note the following points e We used indistinctly ENTER and R S to terminate the complex number entry No need to store intermediate results as the complex buffer can
84. rs into the complex stack is accomplished by executing ZENTER to separate the first and second complex number Exceptions to this rule are the other complex stack lifting functions such as GEUZ ZRCL ZRPL IMAGINE 21 ZREAL AIM AG and the Complex Keypad Here the left side symbol SHIFT N represents an input action 2 1 Rectangular vs Polar forms The HP 41 sorely lacks a polar vs Rectangular mode This limitation is also overcome on the 41Z module with the functions POLAR and RECT to switch back and forth between these modes It uses an internal flag in the complex buffer not part of the 41 system flags The operation is simplified in that complex numbers are always stored in their rectanqular or Cartesian form z x yi So while all functions expect the argument s in rectangular form yet the results are shown in the appropriate format as defined by the POLAR or RECT mode The notable exception is ZPOL which always returns the value in Polar form Note also that the POLAR mode is directly affected by the angular mode as well as it occurs with real argument values Note The POLAR display of the complex number reguires an additional R P conversion after the result is calculated in Cartesian form The Polar form is temporarily stored in the Real stack registers T Z which have no active role in the Complex Stack and therefore can always be used as scratch Once again no changes are made to either X Y
85. s gt Not Found CHKBUF CHKBUF DAB 58 CHKBUF CHKBUF 270 RAM SLCT ate address CHKBUF CHKBUF As C SEX CHKBUF CHKBUF 1038 READ DATA Candidate Value CHKBUF CHKBUF 2 C O ALL Carry if not empty register CHKBUF CHKBUF 3A NCRTN Zero reg Not Found CHEBLUF 232 CC M5 not zero keep searching CHKBUF CHKBUF ASAD 39F JC 13 CHKBUF CHKBUF ASAE 362 A C APT IS this O Buffer CHKBUF CHKBUF ASAF 037 06 CHKBUF CHKBUF A9BO 1B POPADR CHKBUF CHKBUF A9B1 23A 41 Return to P 2 CHKBUF CHKBUF A9B2 170 PUSHADR CHKBUF CHKBUF A9B3 1038 READ DATA Return with Header in C CHKBUF SU KBUF A9B4 3EO RTN uffAdr in A CHKBUF CB30 AQB5 OFC RCR10 CHKBUF GC F ASBG 056 0 5 CHKBUF CHKBUF A9B7 146 AzA C SEX CHKBUF CHKBUF A988 34 JNG 23d GB 0i INITIALIZE Header A9B9 0 INITIALIZE Header A9BA INITIALIZE Header INITIALIZE Header ABC I INITIALIZE Header ABB Programmable INITIALIZE Header INITIALIZE Header BBE 02D eee O O INITIALIZE INITIALIZE ASC 379 PORT DEP Check for buffer INITIALIZE INITIALIZE A9C1 10 xQ Get its address if exists 130 A998 000 EEHKBU 511 non zero ASC3 073 NC 144 NotFound Create it oo b10 0 write 2 into b3 b6 b9 a to initialize L1 amp L 2 b8 ISYNCH U U b7 A holds b7 address b6 T
86. t albeit slightly less precise to work in polar form as follows since z xtiy then e z e xtiy e x e iy and to calculate the final result we only need to convert the above number to rectangular form Example Calculate 22 for z 1 i 1 ENTER ZENTERA gt 1 1 j 2 CHS ZAX gt 0 j0 500 ZEXP gt 0 878 j0 479 Another method using WAZ and the complex keypad function ZREALA 1 ENTER ZENTERA gt 1 1 j 2 CHS ZREALA gt 2 j0 WAZ ZEXP gt 0 878 j0 479 41Z User Manual Page 23 or alternatively this shorter and more efficient way leaves W undisturbed 1 ENTER ZA2 ZINV ZEXP gt 0 878 j0 479 Note how this last method doesn t require using ZENTER to terminate the data input sequence as the execution of monadic functions will automatically synchronize the complex stack level Z with the contents of the real X Y registers Complex sguare Z REC r 2 2a Does LastZ ZSORT Complex sguare root Algebraic Formula Does LastZ SORTZ Complex sguare root Z REC r 1 2 a 2 Does LastZ Two particular cases also where working in polar form yields more effective handling Consider that Z72 z 2 e 2ia and Sqrt z z 1 2 Sart z e ia where a Arg z It is then simpler first converting the complex number to its polar form and then apply the individual operations upon its constituents followed by a final conversion back to the rectangular form Note that this
87. t principal value of the root This verifies that both roots are in fact on the same straight line separated 180 degrees from each other and with the same module Example Calculate the three cubic roots of 1 2i 2 ENTER 1 ZENTERA inputs z in the complex stack level Z 3 1 X ZAX gives the main root z 1 220 0 472 j 3 NXTNRT gives the second root z 1 018 0 82 j 3 NXTNRT give the third and last z 0 201 1 292 j In the next section we ll discuss the logarithm in the complex plane a very insightful and indeed interesting case study of the multi valued functions 41Z User Manual Page 27 5 3 Complex Logarithm Table x Logarithm group Index Function Formula Description 1 ZEN Z hnizi Hia Principal value of natural logarithm 2 ZLOG Z Ln z Ln10 Principal value of decimal logarithm 3 ZWLOG Z Ln z Ln w Base w logarithm of z NXTLN Next value of natural logarithm The first thing to say is that a rigorous definition of the logarithm in the complex plane requires that its domain be restricted for if we defined it valid in all the plane such function wouldn t be continuous and thus neither holomorfic or expressible as series of power functions This can be seen intuitively if we consider that Since 2 zl e io then Ln z Ln z Ln e ia Ln z ia But since z z e i a 2n z e i a 4n z e i a 2xn Then we d equally have multiple values of its lo
88. this 41Z User Manual Page 16 function may play an important role during data entry it is the one to use when entering the real part first as per the following sequence Re z ENTER Im 2 ZTRP Thus its use is analogous to the COMPLEX function on the HP 425 also required to enter the complex number in the stack from its two real components Note that the other alternative data entering sequence doesn t reguire using ZTRP although the order of the real and imaginary parts IS reversed and arguably less intuitive Im 2 ENTER Reiz Either one of these two is entirely adequate once you become familiar with it and get used to using it it s your choice ZENTER Enters X Y into levels Z W Does Stack lift ZRPLA Fills complex stack p n ZENTER enters the values in X Y as a complex number in the Z stack level and performs stack lift thus duplicates Z into W as well and U is lost due to the complex stack spill over As said in the introduction always use ZENTER to perform stack lift when entering two or more complex numbers into the complex stack This is required for the correct operation of dual complex functions like Z or when doing chain calculations using the complex stack which unlike the real XYZT real stack it does NOT have an automated stack lift triggered by the introduction of a new real number ZENTER ZREPL wiet l l V b9 b7 b3 Uv AM b7 b b3 sp
89. to the real stack XYZT To dump the complete contents of the complex buffer into memory registers and back you can use these two complementary functions ZB gt RG Copies complex buffer to memory registers RG gt ZB _ Copies memory registers to complex buffer Note that RG gt ZB won t check for valid header data thus it expects the contents to be correct like with a previously execution of ZB gt RG Remember that the header register is a non normalized number NNN thus do not recall it using RCL Other functions to manipulate the contents of the buffer levels are L1 lt gt L swaps buffer level L1 and level given by prompt L1 lt gt LX swaps buffer level L1 and level input in X XY LO copies registers X Y into buffer level LO used to save arguments into LastZ XY gt L copies registers X Y into buffer level given by prompt ZBDROP drops contents of complex buffer one level used during ZRDN ZBLIFT lifts contents of complex buffer one level used ZRUP ZENTER and others All these functions act on the complex buffer but will not display the resulting complex number i e will not trigger ZAVIEW upon completion To see view the contents of the buffer levels without altering their position you can use the following functions LVIEW prompts for level number 0 4 LVIEWX expects level number in X ZBSHOW lists the contents of all buffer levels ZBHEAD shows in Alpha the decoded buffer header N
90. ture these routines are all part of a common entry into the module catalog The program prompts for a number from zero to eight where Zero lists the catalog of all possible choices as follows Index Function Description Equivalence 8 1 ZACOS Inverse Complex Cosine Same asNXTACS 2 ZACOSH Inverse Complex Hyperbolic Cosine 2 3 ZASIN Inverse Complex Sine 7 3 Sameas 4 ZASINH Inverse Complex Hyperbolic Sine a 6 ZATANH _ Inverse Complex Hyperbolic Tangent ua 7 ZzLN Complex togarihm ame an NXTIN O 8 7Z 1 N Roots of Complex number Same as NXTNRT Each case will briefly display the title of the sub function and will calculate the principal value followed by all the other values with each subseguent pressing of R S The first 7 routines expect z into the Z level of the complex stack Data entry is the same for all of them except the last one which expects N in the real stack register X and zin Z Only the first N values will be different running into cyclical repetition if continued This is a simple program mostly written to document an example for the 41Z functions Use it to get familiar with these concepts and to understand fully the NXT function set as well Example Obtain all values of ASIN Sin 1 j 1 ENTER ZSIN gt 1 298 j0 635 ZMTV gt FNC 0 8 3 R S gt 1 000 j1 R S gt 2 142 j1 R S gt 7 283 j1 R S gt 8
91. u z poN A X ul gv z pouu pioa Gou A X ul Z PO z uu JO UBIS SUSAU pioa Gou A X u Zz buy AX 8 7 ULL Z Bue gt 1 SMOUS z uuj p Z oy smous X1Se7 UI X X UI u H z Aq 191 Xo dwoo S9PIAG 19 1SI69 4 xajduuo9 o z s lidilniy 1 1S D 1 x duuoo WO Z ognqns 1 1SI D 1 Xo dwoo z sppy A Ul 018Z X U 2 USAUP NU3W uonoun seyoune7 sijuouubisse Soup sle ji sdbis ON S3A A Ul Z Wy X Ul Ol z AX Z ul z Xv L i AX Z ul ilns AX Z u z x AX Z Ul Z vZ 10 anjen urew AX Z ul P U EZ V x Z AX Z Ul Z M ULM AX AX A X zu AX AX AX Z ul z U AIID 1duioid X u ay A Ul Z u Z X u ay A Ul Z u Z 969 z A ul z X Ul x X Ul ay A Ul uu Z u Z sB 1 Z A ul z B 1 X ul x AX Z UI Z Se AZ ul U L yz Gou X ulu 69 999912 9 0 210 U 5 Z z dx cx 1X ZA LA e LA ZX X M Z Gv 1x ZX MOS Z M LX A mz l5uy uls M z A x 2 Abay 2 mz Bie IZ z ubis Izv 1A zA Izisllzil 2vA z X 1bs lz Ai x uoo x UeJe Z OY Z WI d ng ui Bey rejog 24 sip r Jeyng ul DEU rejog ou 5195 US L y DUU BU Z ul Que M Ul A SEQ Z yo Z H 2 Z Yo o z uu enuew e u e u 4o z sg oug pue 0 z uul 0 2
92. umber currently stored in X Y 41Z User Manual Page 8 Sets POLAR mode on Displays number Shows in SET mode Sets RECT mode on Shows in SET mode F O _ Convert to Polar Converts X Y to POLAR A ways shows in POLAR ZREC Convert to Rectangular Converts X Y to RECT Shows in SET mode ZPOL Converts the complex number in the Z stack level from rectangular to polar mode If executed in run mode the display shows the value of its magnitude its module and its argument as follows Mod lt Arg where Mod z and Arg a z z e ia The argument value will be expressed in the angular settings currently selected DEG RAD or GRAD rz be m m or also EEL ZREC is the reciprocal function and will convert the complex number in Z assumed to be in polar form to rectangular form showing it on the display in run mode in identical manner as ZAVIEW In fact if it weren t because of the displaying capabilities these two functions will be identical to the pair R P and P R standard on the calculator Recognizing this they re assigned to the very same position as their real counterparts on the Complex User keyboard Notice that contrary to the POLAR and RECT functions which only display the values ZPOL and ZREC perform the actual conversion of the values and store them in the stack registers complex and real This is also very useful to enter complex numbers directly in polar form simply using the seguence
93. urely real or imaginary cases are also provided The main utilization for these functions is in program mode as conditional decisions under program control based on the different values Table 6 2 Complex comparisons function group TN n 1 12 09 ISZ 0 Checksifziszero n 2 12807 ISZ 0 Checksifzismotzero n 3 Z I sz Checks if z is the imaginary unit U o 4 Z W iszw Checksifzandwarethesame o 8 5 Z WR Isz wrounded Checks if rounded z and rounded w are the same 6 z w isz w Checks if zand w are different 9 ZOUT 15 212177 Checks whether z is outside the unit circle Checks whether imi E ZMAG tue imaginary Checks whether E 41Z User Manual Page 32 It s well know that contrary to real numbers the complex plane isn t an ordered domain Thus we can t establish ordered relationships between two complex numbers like they are done with real ones like x gt y x y etc There are however a few important cases that can also be used with complex numbers as defined by the following functions As it is standard they respond to the do if true logic skipping the next program line when false Compares z with w Are they equal Compares z with w Are they different Compares z with w rounded Are they equal 14 9D L U U LDT TU7 Compares z vvith zero Are they equal lL Compares z with zero Are they different Compares z with
94. van b ba b10 b7 b5 b4 b5 b3 bb b b3 T ba b3 Be aware that although ZRDN and ZRUP do not perform stack lift they update the Z complex register with the values present in X Y upon the function execution This behavior is common across all 41Z functions Clears complex stack level Z Clears complete complex stack ZREAL Extracts Real part from Z p Extracts Imaginary part from Z Use these four functions to partially or completely clear delete the contents of the complex stack Z level or the complete complex stack No frills no caveats The real stack will also be cleared appropriately 41Z User Manual Page 19 LASTZ Recalls last number used to Z Does Stack Lift Similar to the LASTX function LASTZ recalls the number used in the immediate preceding operation back to the Z level of the complex stack A complex stack lift is performed pushing the contents of Z up to the level W and losing the previous content of U b10 b8 b9 b7 b8 b6 b7 T b5 b6 b4 b4 b2 ZA m b3 b1 x lt ball b2 b1 bi The majority of functions on the 41Z module perform an automated storage of their argument into the LastZ register enabling the subsequent using of LASTZ This will be notated in this manual when appropriate under each function description Example to calculate z z 2 simply press ZSQRT LASTZ Z ZHALF Example Calculate the following expression without using any data
95. y of the approach The obvious speed shortcomings are diminished when ran on modern emulators like V41 The Taylor series of W around 0 Is given by lei 20 l Wo x yn p 1 L 0 5 Another technique somehow a brute force 521 approach would employ this definition to calculate successive terms of the summation until 4 5 their contribution to the sum is negligible This method would only be applicable within the M convergence region See the following links for further references on the Lambert W function http en vvikipedia org vviki Lambert W function http mathworld wolfram com LambertW Function htmi 41Z User Manual Page 53 10 6 Bessel functions This last section represents an interesting tour de force within the 41Z module taking the humble 41 system to the realm of true high level math Use it or leave it it s all a matter of choice but programming technigues and valid algorithms are always interesting despite its obvious speed shortcomings Index Function Description ti 1 ZJBS_ Complex Bessel J function firstkind U 2 2185 Complex Bessel I function firstkind n 3 1285 Subroutine for First SecondKind 8 4 Second kind ZKBS Complex Bessel K function Second kind 6 2852 Subroutine for KandY Second Kind 7 e z Z Spherical Hankel fst ind ordervero 10000 8 ZSHK1 Spherical Hankelfirstkind
96. ys the number e that is there are natural logarithms See http en wikipedia org wiki Branch point for a more rigorous description of this subject After this theoretical discussion let s see the functions from the 41Z module ZIN Naturallogarithm Zelnizlri c DoeslatZ 8 Calculates the principal value of the natural logarithm using the expression Ln z Ln Z ic where a Arg z Example check that z Ln e z for z 1 1 and 2 2 41 1 ENTER ZEXP ZLN gt 1 000 j1 000 4 ENTER 2 ZEXP ZLN gt 2 j2 283 How do you explain the last result Is it correct Try executing NXTLN see below on it NXTLN gt 2 j4 000 that s more like it ZLOG Decimal logarithm Z Ln z Ln10 Calculates the principal value of the decimal logarithm using the expression Log z Ln z Ln 10 Example check that z Log 10 z for z 1 i and z 2 4 1 ENTER ZALOG ZLOG gt 1 1 j 4 ENTER 2 ZALOG ZLOG gt 241 271 How do you explain the last result Is it correct Have you found a bug on the 412 Base VV Logarithm Z Ln z Ln w Does LastZ General case of ZLOG which has w 10 This is a dual function Log z Ln z Ln w Calculates the next value of the natural logarithm using the expression Next Ln z Ln z 27 J So the different logarithms are separated 2x in their imaginary parts This works both going up as well as going down thus each time NXTLN is executed two values are c
97. z 1 z 3 3i z 1 2i z 1 2i 1 Use the following estimations for the P4 example 4z0 1 j z1 I j for root 1 4z0 1 j z1 2 2j for root 2 4z0 2j zl 2j for root 3 z0 4j zl 5j for root 4 And programmed as follows 41Z User Manual Page 51 1 i z 1 i z 1 i 2 ZREPL 2 ZREPL 3 1 3 2 a 4 4 EMTER 4 ENTER 4 fax 5 Fig 5 1 5 ZENTER B ZENTER ZC 2 F 1 H LASTZ ENTER ENTER a L a 1 Z g Z z Fij 10 L 10 ZENTER 10 Z lt gt W 11 ZENTER 11 3 11 3 12 1 12 ENTER 12 ad 13 ENTER 13 CH5 13 ZENTER 14 CH5 14 it 14 2 15 Z 15 z 15 ENTER 15 END 15 1 15 1 17 17 Fij 23 22 2 1 18 Z 18 24 uu 19 1 19 Z lt gt W 2 ZREPL 20 20 2 2 3 1 21 END 21 ZENTER 4 ES 3 5 Note the usage of stack Ntind 23 ENTER z 1 functions to separate entries 24 CHS LASIZ and ZENTER 25 L a 26 it 2 1 27 it 10 20 1 11 29 30 Lastly a few other excellent programs written by Jean Marc Baillard address the general solution to the eguation f z 0 They dont use functions from the 41Z module but are mentioned here for their obviously close related content The programs can be found at the following link http www hpmuseum org software 41 41cmpxf htm Logarytmiczna pochodna funkcji Gamma w x Funkcja dzeta Riemanna x 4 1 2 2 4 Page 52 10 5 1 Application example Using ZSOLVE to calculate the Lambert W function In this example we se
98. z sejejnoje3 1802 Ce Z1se7j s op AX Z ul z soo AX Z UI z 21 USO9 Z S09 SOO x lduuoo SOOZ 22 ZISE7 s op AX Z ul z ueje AX Z UI Z zi UUETE Z uee NV LV Xx ldulo02 NYLVZ L Z1se7j s op AX Z ul z uise AX Z UI Z zi UUISE I Z ulse NISY Xejdwo9 NISVZ 02 ZISE7 s op VHdTv pue AX Z ul ZVOL AX Z ul z OL Ul Z ve 0 x ldulo2 2 61 Z1Se7 s op AX Z ul z sooe AX Z UI z 2 UISE Z Id 2 5098 SODY Xejdwoj SOOVZ 81 JI SdIYS ON SAA AX Z UI Z M UDM M Z SI M 0 fenb 2 s EM Z LI 9s ej J SdIYS ON S3A AX Z UI Z OHZ SI O18Z 0 fenb 2 s 6082 91 ji SdIYS ON S3A AX Z ul Z M UDM M PUY Z PUY SI p punoi yi fenb m z ae UHM Z SI ji SdIYS ON S3A AX Z UI Z M UDM M Z SI M Z S M Z vi 9s ej J SdIYS ON S3A AX Z UI Z 41 2 SI Z SI I Z EL 9s ej J SdIYS ON S3A AX Z UI Z 0 Z SI 0 Z SI 60 2 21 Z1set s op AX Z ul xvz sSD5 1l1Z A ul z X ul x B1y Uu 1 dxo Uys UyZ XvA PUG H 2 LI Z1set s op AX Z u zvz AX Z UI Z Zvi ZvZ vX X ldulo2 ZvZ Ol ZISE7 s op AX Z ul x yz 9601 Z A ul z Ba X Ul X U v4 U L yZ XvA PUG H 2 6 ZISE7 19yng sdoiq AX Z UI Z M AX Z 412 M UDM 2 2 UOISIAIP Xe dwoj z 8 ZISE7 19yng soi AX Z UI Z M AX Z ul Z M l M 2x 14 Z x 1 ZA LA ZX gt uoneoijdninu xejdwog Z Z
Download Pdf Manuals
Related Search
Related Contents
P - Bernissart NCCCS Business Intelligence Training Manual 取扱説明書 充電式 4 モード インパクトドライバ TP130D TP140D MM1 MANUAL DE INSTRUCCIONES FIBERMESH® 300 Lenovo ThinkPad X220 「滑らんゾー」取扱説明書 Anwendung: A Instructions for use: Modo de empleo: Mode d`emploi Guía de usuario del Nokia 3200 Copyright © All rights reserved.
Failed to retrieve file