Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Jacobi
!gfortran, gcc version 7.4.0 program hello implicit none real::mat(3,4),temp integer::i,j,k mat(1,1)=6 mat(1,2)=5 mat(1,3)=3 mat(1,4)=14 mat(2,1)=8 mat(2,2)=-3 mat(2,3)=2 mat(2,4)=11 mat(3,1)=10 mat(3,2)=-7 mat(3,3)=-8 mat(3,4)=21 call pm(mat) call cdd(mat) call gs(mat) call jac(mat) end program hello subroutine cdd(mat) implicit none real::mat(3,4),temp integer::i,j do i=1,4 temp=mat(1,i) mat(1,i)=mat(3,i) mat(3,i)=temp end do do i=1,4 mat(2,i)=mat(2,i)-mat(3,i) end do do i=1,4 mat(3,i)=mat(3,i)-mat(1,i)+mat(2,i) end do write(*,*)'cddm :' call pm(mat) end subroutine subroutine gs(mat) implicit none real::mat(3,4),x(3) integer::i,j x(1)=1.5 x(2)=1.5 x(3)=-0.5 do i=1,50 x(1)=(mat(1,4)+(-1.0*mat(1,2)*x(2))+(-1.0*mat(1,3)*x(3)))/mat(1,1) x(2)=(mat(2,4)+(-1.0*mat(2,1)*x(1))+(-1.0*mat(2,3)*x(3)))/mat(2,2) x(3)=(mat(3,4)+(-1.0*mat(3,1)*x(1))+(-1.0*mat(3,2)*x(2)))/mat(3,3) write(*,*)x end do end subroutine subroutine jac(mat) implicit none real::mat(3,4),x(3),x0(3) integer::i,j x0(1)=1.5 x0(2)=1.5 x0(3)=-0.5 do i=1,50 x(1)=(mat(1,4)+(-1.0*mat(1,2)*x0(2))+(-1.0*mat(1,3)*x0(3)))/mat(1,1) x(2)=(mat(2,4)+(-1.0*mat(2,1)*x0(1))+(-1.0*mat(2,3)*x0(3)))/mat(2,2) x(3)=(mat(3,4)+(-1.0*mat(3,1)*x0(1))+(-1.0*mat(3,2)*x0(2)))/mat(3,3) write(*,*)x x0=x end do end subroutine subroutine pm(mat) implicit none real,intent(in)::mat(3,4) integer::i,j do i=1,3 write(*,*)mat(i,1),mat(i,2),mat(i,3),mat(i,4) end do end subroutine
run
|
edit
|
history
|
help
0
New
first
Sum of series
euler-cromer
evaluation
SIUM(3.7)
A_01 NEWTON_RM(B(I))
finitos
Bissection Method
False position