# Fortran ~ Newton Raphson Method - Ishwaranand

## Fortran ~ Newton Raphson Method

• Let Xo be an approximate value of the root of the equation f(X)=0 either algebraic or transcendental and let h be a real number sufficiently small.
• F(X)=2*X**3-5.0*X-2.15
• This is known as the Newton - Raphson formula or Newton's iteration formula. Image Source ~ Crafted With ©Ishwaranand - 2020 ~ Image by ©Ishwaranand

### Write a program to demonstrate the application of the Newton-Raphson method to find the root of the equation.?

PROGRAM RAPHSN
C
C      PROGRAM TO LOCATE A ROOT OF EQUATION USING NEWTON RAPHSON METHOD
C
C      GIVEN EQUATION
F(X)=2*X**3-5.0*X-2.15
C      DERIVATIVE OF GIVEN EQUATION
FD(X)=6.0*X**2-5.0
C
WRITE(*,*)'ENTER YOUR ESTIMATE OF ROOT...'
I=0
300    I=I+1
C       FIND ROOT POSITION
X=X-F(X)/FD(X)
CHK=ABS(F(X))
C        EXIT LOOP IF ROOT FOUND
IF(CHK.LE.0.0001)GOTO 100
C        EXIT LOOP IF UNABLE TO FIND ROOT EVEN AFTER 100+CYCLES
IF(I.GT.100)GOTO 200
C        START NEXT CYCLE
GOTO 300
100     WRITE(*,*)'ROOT FOUND AT', X
STOP