Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Practice
PROGRAM NR IMPLICIT NONE REAL::F,DF,X,Y(30),TOL=.000001,M=23,K, TF INTEGER::N=30,I CALL MU(Y,K) END PROGRAM NR SUBROUTINE MU(Y,K) IMPLICIT NONE REAL::F,DF,X,Y(30),TOL=.0000001,M=23,K,TF INTEGER::N=30,I Y(0)=-5 PRINT*,'positive number is =',M PRINT*,' ','I',' ','Y(I)' DO I=1,N,1 Y(I)=Y(I-1)-F(Y(I-1))/DF(Y(I-1))-(1.0/2.0)*((DF(I-1))**2.0)*TF(I-1)/((DF(I-1))**3.0) PRINT*,I,' ',Y(I) IF(ABS(Y(I)-Y(I-1))<TOL)THEN WRITE(*,25)Y(I) 25 FORMAT('Square_root of M is =',F10.8) !PRINT*,'SOLUTION IS',Y(I) STOP END IF END DO END SUBROUTINE MU REAL FUNCTION F(X) IMPLICIT NONE REAL::X F=X**3.0-2.0*x-5.0 END FUNCTION F REAL FUNCTION DF(X) IMPLICIT NONE REAL::X DF=3.0*X**2.0-2.0 END FUNCTION DF REAL FUNCTION TF(X) IMPLICIT NONE REAL::X TF=6.0*X END FUNCTION TF
run
|
edit
|
history
|
help
0
fortran-genetic-algo
G b
NEWTON FORWARD DIFFERENT INTERPOLATION
exercise
Hello / fortran
A_02 Newton's practice
নাজমুন নাহার
A_02 JACOBIAN NEWTON'S METHOD
A_04 GUASSIAN QUADRATURE METHOD
Factorial problem