fx5800p: Bisection Method
The program BISECT finds a root for f(X) given an initial open interval of (A, B). I have the tolerance set to 10^9. To prevent calculations from going "forever", I set the maximum number of iterations to 150. You can adjust these factors in the program as desired.
The first point to be tested is (A+B)/2. If this is a root, the program stops and it will return this root as a result.
The program BISECT calls on a subroutine program FX. The function f(X) is stored in FX.
While programming, use the Prog to call subroutines. The syntax is:
Prog "name of subroutine in quotes"
Press [SHIFT] [FILE].
Remember for the fx5800p, all variables (AZ, and Z[#]s) are global, meaning they will carry over from programs and subroutines.
Anything following the double slash (//) is a comment.
Program FX
insert function of X here → Y
//store result in Y
// A Return command is implied.
Program BISECT
1 → I // I = iteration count
"A"? → A
"B"? → B
A → X
Prog "FX"
Y → C
B → X
Prog "FX"
Y → D
While Abs(AB) > 10^(9) // tolerance setting
(A + B) ÷ 2 → X
Prog "FX"
If Y = 0
Then
Break
IfEnd
If Y*C > 0
Then
X → A
Y → C
Else
X → B
Y → D
IfEnd
I + 1 → I
If I > 150 // iteration limit
"ITER. EXCEEDED" ◢
Stop
IfEnd
WhileEnd // finish the loop
"ITERATIONS:" ◢ // optional
I ◢ // optional
"ROOT=" ◢ // result
X
Example:
f(X) = X^(3)2X+1, for the intervals (2,0), (0,2), and (0,1).
Program FX would look like this:
Program FX
X^3  2*X + 1 → Y
Run BISECT.
For (2,0), results are:
ITERATIONS: 32
ROOT = 1.618033989
For (0,2), results are:
ITERATIONS: 1
ROOT = 1
For (0,1), results are:
ITERATIONS: 31
ROOT = 0.6180339893
This blog is property of Edward Shore. 2015
A blog is that is all about mathematics and calculators, two of my passions in life.
Sunday, January 4, 2015
fx5800p: Bisection Method
Subscribe to:
Post Comments (Atom)
Curve Fitting: Fitting to the Curve y = a*e^(b*x^2)
Curve Fitting: Fitting to the Curve y = a*e^(b*x^2) Introduction This blog is to fit data to the equation y = a*e^(b*x^2). A f...

Casio fx991EX Classwiz Review Casio FX991EX The next incarnation of the fx991 line of Casio calculators is the fx991 EX. ...

One of the missing features of the TI82/83/84 family is the ability to convert between bases. Here are two programs in TIBasic to help...

TI36X Pro Review This is a review of the TI36X Pro Calculator by Texas Instruments. History Originally, this was the TI30X Pro that w...
Dear Edward , I tried to type like you ,but it doesn't work for me ,I don't know why (0,2) interval work fine but another didn't work ,my calculator said SYNTAX ERROR and I trying to check what I miss but nothing I left my code as you did, please advise thanks anyway
ReplyDeleteZheng,
DeleteDo you know what interval caused the Syntax Error?