Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fhhjhh
! Gauss elimination(forward substitution) Real a(10,10),b(10),x(10),pivot,sum Integer i,j,k,n WRITE(*,*)'enter the dimension of the matrix' Read(*,*)n Write(*,*)'enter the coefficients of the equations in matrix form ,input values row wise' Do i=1,n Read(*,*)(a(i,j),j=1,n),b(i) !read the matrix End do Write(*,*)'the matrix form by coefficient of the equations is' ! Entered matrix and vector Do i=1,n WRITE(*,*) (a(i,j),j=1,n) End do Write(*,*)'and the vector B is' Do i=1,n Write(*,*)b(i) End do Do i=n,1,-1 ! lower triangle matrix Do j=i-1,1,-1 pivot=a(j,i)/a(i,i) Do k=1,n a(j,k)=a(j,k)-pivot*a(i,k) End do b(j)=b(j)-pivot*b(i) End do End do Write(*,*)'lower triangular matrix after gauss elimination' Do i=1,n Write(*,*)(a(i,j),j=1,n) End do Write(*,*)'Corresponding B vector:' Do I=1,n WRITE(*,*) b(i) End do Do i=1,n ! Forward substitution sum=0 Do j=1,n-1 sum=sum+a(i,j)*x(j) End do x(i)=(b(i)-sum)/a(i,i) End do Write(*,*)'###THE SOLUTIONS ARE :' Do i=1,n WRITE(*,10)i,x(i) End do 10 format('X(',I3,')=',f10.5) Stop End
run
|
edit
|
history
|
help
0
Find HM
ascending sorting
New3
4(ii)
Fixed point for several variables
problem_2
2
Taylors method of three order
A_02 JACOBIAN NEWTON'S METHOD
A_02 JACOBI METHOD