Question: Program c...... Newton-Raphson program.......................... implicit none integer*4 i, nit real*8 fl,fr,f,fp,x,dx,eps x = 0 eps = 0.00000001 nit = 10 i=0 100 CONTINUE i =

Program
c...... Newton-Raphson program..........................
implicit none
integer*4 i, nit
real*8 fl,fr,f,fp,x,dx,eps x = 0
eps = 0.00000001
nit = 10
i=0 100 CONTINUE
i = i+1
call ffunction (fl,x-eps)
call ffunction (fr,x+eps)
f = 0.5*(fr+fl)
fp= (fr-fl)/(2*eps)
dx = -f/fp
x = x+dx
if(abs(dx).gt.eps) GOTO 100
write (6,*) STOPPED
write(6,*)Numer of iterations: , i, and x = , x
END c...... subroutine to assign value of f for given x.....
subroutine ffunction(f,x)
implicit none
real*8 pi
parameter (pi = 3.141592653589793)
real*8 f, x c...... you can define your function f(x) ..............
f = EXP(x)-x*x RETURN
END
Problem 10.1. Use the Newton-Raphson program provided in this chapter to find the solution of e" sin x - x2 = 1 (Hint: you only need to modify the 'ffunction' subroutine). Submit the printout of the source code and output. Problem 10.2. Modify the Newton-Raphson program provided in this chapter to solve the following system of equations. " sin r1 + = 6 +e-12 sin 22 = 1 2 Submit the print out the source code and output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
