Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_02 Newton's practice
PROGRAM N_I_M IMPLICIT NONE REAL::X,Y,F1,F2,DXF1,DYF1,DXF2,DYF2,M(3,2),TOL INTEGER::I X=2 Y=2 DO I=1,100 M(1,1)=DXF1(X,Y) M(2,1)=DYF1(X,Y) M(3,1)=-1*F1(X,Y) M(1,2)=DXF2(X,Y) M(2,2)=DYF2(X,Y) M(3,2)=-1*F2(X,Y) CALL NEW(M) X=X+M(3,1) Y=Y+M(3,2) PRINT*,X,Y IF((ABS(M(3,1))<=TOL).OR.(ABS(M(3,2))<=TOL)) EXIT END DO PRINT*,M STOP END PROGRAM N_I_M REAL FUNCTION F1(X,Y) IMPLICIT NONE REAL::X,Y,PI=3.1415926 F1=LOG(ABS(X-Y**2))-SIN(X*Y)-SIN(PI) RETURN END FUNCTION F1 REAL FUNCTION DXF1(X,Y) IMPLICIT NONE REAL::X,Y DXF1=(1/(X-Y**2))-Y*COS(X*Y) RETURN END FUNCTION DXF1 REAL FUNCTION DYF1(X,Y) IMPLICIT NONE REAL::X,Y DYF1=(1/(X-Y**2))*(-2*Y)-X*COS(X*Y) RETURN END FUNCTION DYF1 REAL FUNCTION F2(X,Y) IMPLICIT NONE REAL::X,Y,e=2.718281 F2=e**(X*Y)+COS(X-Y)+2 RETURN END FUNCTION F2 REAL FUNCTION DXF2(X,Y) IMPLICIT NONE REAL::X,Y DXF2=Y*e**(X*Y)-SIN(X-Y) RETURN END FUNCTION DXF2 REAL FUNCTION DYF2(X,Y) IMPLICIT NONE REAL::X,Y DYF2=X*e**(X*Y)+SIN(X-Y) RETURN END FUNCTION DYF2 SUBROUTINE NEW(MAT) REAL::MAT(3,2),D INTEGER::I,J,K
run
|
edit
|
history
|
help
0
Blasius Euler Code
y
A_01 NEWTON_RM(B(III))
ANIRUDDHA
A_01 NEWTON_R_M(B(I))
Shooting P1
4(ii)
Practice secant
A_01 FIXED_POINT_IM(I)
spl