Newtons Method

Routine Summary

Newton's Method - calculates the value of an equation


Variant 1: Str1, A
Variant 2: Str1, Str2

Str1 and Str2 - The equation(s) are stored to the string variables.
Y1 and Y2 - The equation(s) are stored to the Y-variables from the string variables, then used for operations.
A - To store the seed value, and then the final value of the equation.


A - The answer is stored to A

Variables Used

A, Y1, Y2

Calculator Compatibility



Variant 1:Myles_Zadok
Variant 2: Xeda Elnara


Newton's Method is a routine for math that calculates the value of the zeroes of an equation, or the intersection point of two equations.

Variant 1

:Input "Y1=",Str1
:Input "SEED VALUE=",A

The program asks the user for an equation and the seed value. The seed value is the point from which the calculator approximates the zero of the function, so the seed value needs to be close to the desired zero. The calculator then begins the For( loop, which is run 10 times, each time getting a closer approximation of the zero. The loop draws a tangent line and runs the formula for the zero of the function. The answer, depending on the seed value, should be really close to the zero of the function.

In case you're wondering, you can remove the Tangent( command altogether and make the program run faster. However, you will have no clue as to whether you chose a good seed value or not. The Tangent( command slows down the program, but it lets you see if your chosen seed value will be accurate or not.

Variant 2

Variant 2
:Input "Y1 ",Str1
:Input "Y2 ",Str2
:Repeat I=10 or K<20
:While K<20 and E-10<abs(A-Ans
:Disp Ans

The program asks for two equations and runs Repeat and While loops followed by the formula for the X-coordinate of the intersection of the two equations. The answer should be the value of the X-coordinate of the intersection.

Related Routines


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.