Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to 32SII / DM32
|
12-23-2023, 05:07 PM
(This post was last modified: 12-23-2023 10:14 PM by Vincent Weber.)
Post: #1
|
|||
|
|||
Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to 32SII / DM32
Hi all,
Reading again Valentin's excellent article, featuring an efficient 35S program to find complex roots of an arbitrary equation (the build-in solver being unable to do so), I was thinking that it was a pity that my beloved DM32 could not do that, having no provision for complex registers or equations. Or... was it really so ? I tried to adapt the program to the 32SII/DM32 limitations, and... I succeded ! Of course, the program uses many more steps, many more registers (you need to use 2 registers instead of one for each complex number, let alone the fact that you need to store intermediate results sometimes, since the stack is only 2-level depth and not 4, when dealing with complex numbers), more labels, and, the ugliest of all, you need to convert equations to RPN (32SII/DM32 equations are useless when dealing with complex numbers). It is a real pain, but it works, and it runs very fast on my DM32, much faster than on the 35S ! The program has also one slight improvement: since the 32SII can deal with indirect branching, unlike the 35S, I remplaced the XEQ F statements by XEQ(i). Juste store the equation routine number in i (e.g. 6 for F, 7 for G, 8 for H), and you can try many equations without erasing them or relabeling them. When writing equations, use X for the real part of the unknown, and A for the imaginary part. When supplying initial guesses, enter the imaginary part then the real part on the stack. For the most part my program gives the same results than Valentin's, altough in some cases initial guesses leads to a different root - I have yet to figure out why. Here is the program listing. Forgive the horrible formatting, it is coming straight out DM32 state file, which I can supply on request to DM32 users. As supplied examples, LBL H holds example 4 (Leonardo di Pisa's equation), LBL F holds example 2 (polynom with complex coefficients) and LBL G holds example 3 (x^3-6x-2=0). Long live the DM32 ! feedback welcome Code: LBL A |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to 32SII / DM32 - Vincent Weber - 12-23-2023 05:07 PM
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to... - Thomas Klemm - 12-23-2023, 05:35 PM
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to... - Vincent Weber - 12-23-2023, 08:07 PM
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to... - Valentin Albillo - 12-23-2023, 10:09 PM
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to... - Vincent Weber - 12-23-2023, 10:15 PM
|
User(s) browsing this thread: 1 Guest(s)