• Rainy Season
• World
Wednesday - June 7, 2023

# This is the oldest method for finding the real root of the equation f(x)=0. This method is similar to the bisection method.

 Image Source ~ Crafted With Â©Ishwaranand – 2020 ~ Image by Â©Ishwaranand

### Write a program to demonstrate the calculation of root of an equation using Regula-Falsi Method.?

PROGRAM RFALSI
C        PROGRAM TO LOCATE A ROOT OF EQUATION USING METHOD OF FALSE
C        POSITION(Regula Falsi)
C
C        GIVEN EQUATION
F(X)=2.0*X**3-5.0*X-2.15
C
100    WRITE(*,*)’ENTER YOUR ESTIMATE OF ROOT(LOWER LIMIT, UPPER LIMIT)’
C        FIND IF ESTIMATES ARE CORRECT
CHK=F(XL)*F(XR)
C        ENTER DATA AGAIN IF ESTIMATES DO NOT BRACKET THE ROOT
IF(CHK.GT.0.0)GOTO 100
I=0
400     I=I+1
C        FIND ROOT POSITION USING GEOMETRIC MEAN
XM=(XR*F(XL)-XL*F(XR))/(F(XL)-F(XR))
CHK=ABS(F(XM))
C        EXIT LOOP IF ROOT FOUND
IF(CHK.LE.0.0001)GOTO 200
C        EXIT LOOP IF UNABLE TO FIND ROOT EVEN AFTER 100+ CYCLES
IF(I.GT.100)GOTO 300
C        GET NEW LOWER AND UPPER LIMITS FOR NEXT CYCLE
CHK=F(XL)*F(XM)
IF(CHK.LT.0.0)THEN
XR=XM
ELSE
XL=XM
ENDIF
C         START NEXT CYCLE
GOTO 400
200     WRITE (*,*)’ROOT FOUND AT X=’, XM
STOP
STOP
END

ENTER YOUR ESTIMATE OF ROOT(LOWER LIMIT, UPPER LIMIT)
1 2
ROOT FOUND AT X = 1.4141974

Crafted by ISHWARANAND | Distributed by ISHWARANAND

.