Post Reply 
(35S) Complex Roots Of Any Equation Using Newton's Method
03-12-2018, 03:06 AM (This post was last modified: 03-13-2018 03:20 AM by gerry_in_polo.)
Post: #1
(35S) Complex Roots Of Any Equation Using Newton's Method
HP 35s program to compute the complex roots of any equation (as long as the functions used support complex numbers on the 35s) using Newton's Method utilizing the forward difference method to approximate the derivative. The 35s' built-in equation solver can compute Y given a complex value of X, but it cannot solve for complex values of X when Y is set to zero.

Program N - Newton's Method program proper
Program Y - Equation in terms of X whose roots are to be solved.

Upon typing XEQ N, enter an initial estimate of the root. Press R/S to update the root estimate until the value no longer changes indicating convergence. To find other root values, change the initial root estimate inputted.

HP-35s Program - Complex Root Newton's Method (Gerardo V. Lozada, M.S., P.E.E., 2018-03-10)

Newton Routine
N001 LBL N
N002 INPUT X
N003 0.01i0.01
N004 STO D
N005 XEQ Y001
N006 STO A
N007 RCL X
N008 RCL D
N009 +
N010 STO X
N011 XEQ Y001
N012 RCL A
N013 -
N014 RCL D
N015 ÷
N016 RCL A
N017 x<>y
N018 ÷
N019 RCL X
N020 RCL D
N021 -
N022 x<>y
N023 -
N024 STO X
N025 VIEW X
N026 GTO N005

Sample Equation Whose Roots Are To Be Solved For (Y = e^X + X^2)
Y001 LBL Y
Y002 RCL X
Y003 e^x
Y004 RCL X
Y005 2
Y006 y^x
Y007 +
Y008 RTN
Find all posts by this user
Quote this message in a reply
10-23-2021, 02:57 AM
Post: #2
RE: (35S) Complex Roots Of Any Equation Using Newton's Method
I was wondering what line N003 means -- is it something that I have not
rtm'd or is it a typo.

Thanks.
Find all posts by this user
Quote this message in a reply
10-23-2021, 11:50 AM
Post: #3
RE: (35S) Complex Roots Of Any Equation Using Newton's Method
Hello. Can you please provide a numeric example of this equation.
I also have doubts about step N003 symbols. Thank you in advance. Pedro
Find all posts by this user
Quote this message in a reply
10-23-2021, 12:51 PM
Post: #4
RE: (35S) Complex Roots Of Any Equation Using Newton's Method
I believe its simply a complex number with the value of 0.01 for both the real and imaginary parts (note the "i"), but looks odd due to the variable pitch font used in the code listing.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
10-23-2021, 06:44 PM
Post: #5
RE: (35S) Complex Roots Of Any Equation Using Newton's Method
Agree with the above about line N003. Here is what it would look like on the actual HP 35s.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)