Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fixed point for several variables
!gfortran, gcc version 7.4.0 program fixedpoint Implicit none Real,external::f1,f2,d1f1,d1f2,d2f1,d2f2 Integer::k Real::x0=4.4,y0=1.0,x1,y1,a,b,c,d,tol=0.001 A=abs(d1f1(x0,y0)) B=abs(d1f2(x0,y0)) C=abs(d2f1(x0,y0)) D=abs(d2f2(x0,y0)) If((a<1.0).and.(b<1.0).and.(c<1.0).and.(d<1.0))then K=1 do while(k<=5) X1=f1(x0,y0) Y1=f2(x0,y0) X0=x1 Y0=y1 If(((x0-4.0)<0.0).or.((7.0-y0)<0.0))then Print*,"does not converge" Print*,"show iteration no. K=",k Print*,"values of kth iteration",x0,y0 Stop End if K=k+1 End do Else Print*,"does not converge" End if Print*,x1,y1 End program Real function f1(x,y) Real::x,y F1=sqrt(7.0-y) End function Real function f2(x,y) Real::x,y F2=sqrt(x-4.0) End function Real function d1f1(x,y) Real::x,y D1f1=0 End function Real function d1f2(x,y) Real::x,y D1f2=1.0/(2.0*sqrt(x-4.0)) End function Real function d2f1(x,y) Real::x,y D2f1=(-1.0)/(2.0*sqrt(7.0-y)) End function Real function d2f2(x,y) Real::x,y D2f2=0 End function
run
|
edit
|
history
|
help
0
Matrix problem
stochastic matrix
Sudoku
A_03 ADAMS BASHFORTH S4
LU gauss
Pivot 2
A_04 SIMPSON'S RULE (3(II))
2
Dynamical Memory Allocation fortran
finitos