Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_01 FIXED_POINT_IM(II)
PROGRAM FIXED_POINT_IM IMPLICIT NONE REAL::F,X,G,X0,X1,TOL INTEGER::I,N PRINT*,"Enter the initial Value:" READ*,X0 PRINT*,"Enter the value of N:" READ*,N PRINT*,"Enter the value of Tolerance:" READ*,TOL PRINT*,X0 DO 10 I = 1,N X1 = G(X0); PRINT*,X1 IF(F(X1)==0) THEN PRINT*, "THE SOLUTION IS :",X1 STOP END IF IF(ABS(X0-X1)<TOL) THEN PRINT*,"THE REAL ROOT IS:",X1 PRINT*,'THE FORM CONVERGES' STOP END IF X0 = X1 10 CONTINUE PRINT*,"THE FORM DOESN'T CONVERGE" END PROGRAM FIXED_POINT_IM REAL FUNCTION F(X) REAL::X F = X**3.0- 2.0*X -5.0 RETURN END FUNCTION REAL FUNCTION G(X) REAL::X G = (2.0*X+5.0)**(1.0/3.0) RETURN END FUNCTION
run
|
edit
|
history
|
help
0
Question1(b)
A_04 FINITE DIFFERENCE METHOD
problem_2
Test
A_04 TRAPEZOIDAL RULE (3(I))
testcompiler.f90
Finite
Practice 4
4(ii)
Forward