Algorithm
Regula Falsi Method Algorithm
Regula Falsi Method |
STEP 1: Start
STEP 2: Read values of x0, x1 and
e.
(Here
x0 and x1 are the two initial guesses e is the degree of accuracy or
the
absolute error i.e. the stopping criteria)
STEP 3: Computer function values
f(x0) and f(x1)
STEP 4: Check whether the product
of f(x0) and f(x1) is negative or not.
If
it is positive take another initial guesses. If it is negative then
goto
STEP 5.
STEP 5: Determine: x2 = [x0*f(x1) –
x1*f(x0)] / (f(x1) – f(x0))
STEP 6: Check whether the product
of f(x1) and f(x0) is negative or not. If it is negative, then assign x0 = x2;
If it is positive, assign x1 = x2;
STEP 7: Check whether the value of
f(x0) is greater than 0.00001 or not. If yes, goto STEP 5. If no, goto STEP 8.
(Here
the value 0.00001 is the desired degree of accuracy, and hence the
stopping
criteria.)
STEP 8: Display the root as x.
STEP 9: Stop.
Post a Comment
0 Comments