answersLogoWhite

0


Best Answer

Here is the program for Gauss elimination method

#include<iostream.h>

#include<conio.h>

#include<math.h>

void main()

{float a[6][6],b[6],x[6],t,s;

int i,j,n,k;

clrscr();

cout<<"Enter the maximum no. of matrix"<<endl;

cin>>n;

cout<<"Enter th elements of matrix"<<endl;

for(i=0;i<n;i++)

{

for(j=0;j<n;j++)

{

cin>>a[i][j];

}

}

cout<<"enter the right constant"<<endl;

for(i=0;i<n;i++)

{

cin>>b[i];

}

for(k=0;k<n-1;k++)

{

for(i=k+1;i<n;i++)

{

t=a[i][k]/a[k][k];

a[i][k]=0;

for(j=k;j<n;j++)

{

a[i][j]=a[i][j]-(t*a[k][i]);

}

b[i]=b[i]-(t*b[k]);

}

}

x[n-1]=b[n-1]/a[n-1][n-1];

for(i=n-1;i>=0;i--)

{

s=0;

for(j=i+1;j<n;j++)

{s=s+(a[i][j]*x[j]);

}

x[i]=(b[i]-s)/a[i][i];

}

cout<<"the solution is"<<endl;

for(i=0;i<n;i++)

{

cout<<"x["<<i<<"]="<<x[i]<<endl;

}

getch();

}

C program for Gauss Jordan method:

#include<iostream.h>

#include<conio.h>

#include<math.h>

void main()

{float a[6][6],b[6],x[6],t,s;

int i,j,n,k;

clrscr();

cout<<"Enter the maximum no. of matrix"<<endl;

cin>>n;

cout<<"Enter th elements of matrix"<<endl;

for(i=0;i<n;i++)

{

for(j=0;j<n;j++)

{

cin>>a[i][j];

}

}

cout<<"enter the right constant"<<endl;

for(i=0;i<n;i++)

{

cin>>a[i][n];

}

for(k=0;k<n;k++)

{

for(i=0;i<n;i++)

if(i!=k)

{

for(j=k+1;j<n+1;j++)

{

a[i][j]=a[i][j]-(a[i][k]/a[k][k])*a[k][j]);

cout<<"the solution is"<<endl;

for(i=0;i<n;i++)

{

x[i]=(a[i][n]/a[i][i]);

cout<<"x["<<i<<"]="<<x[i]<<endl;

}

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the numerical method of gauss elimination and gauss Jordan method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

Solve the following systems of simultaneous linear equations using Gauss elimination method and Gauss-Seidel Method?

Solve the following systems of simultaneous linear equations using Gauss elimination method and Gauss-Seidel Method 2x1+3x2+7x3 = 12 -----(1) x1-4x2+5x3 = 2 -----(2) 4x1+5x2-12x3= -3 ----(3) Answer: I'm not here to answer your university/college assignment questions. Please refer to the related question below and use the algorithm, which you should have in your notes anyway, to do the work yourself.


Flow chart for gaussian elimination with partial pivoting?

gauss


How can you solve for the inverse of a 3 by 3 matrix?

Gauss Elimination


Why would you choose Gauss Jordan over Gauss seidel numeric methods?

It will solve the solution "exactly", but will take a very very long time for large matrices. Gauss Jordan method will require O(n^3) multiplication/divisions and O(n^3) additions and subtractions. Gauss seidel in reality you may not know when you have reached a solution. So, you may have to define the difference between succesive iterations as a tolerance for error. But, most of the time GS is much prefured in cases of large matrices.


Solve system of equation using Gauss Jordan form- When I try to solve these I find that the matrix is singular. Does that mean no solution x plus 2y-3z equals 1 y-2z equals 2 2y-4z equals 4?

The matrix is singular because the last equation is the same as the second equation (simply multiplying every term in an equation by the same number (in this case, 2) does not produce an equation with new information). for example 1) 3x=3y 2) 2x=2y has no useful solution beyond the information from 1) that x=y You would get a singular matrix for this. The Gauss-Jordan method will not solve equations which cannot be solved by the old "elimination method".

Related questions

What are the advantages of gauss elimination method?

There are no answer for that..


What is the difference between gauss elimination and gauss Jordan?

Gaussian elimination as well as Gauss Jordan elimination are used to solve systems of linear equations. If, using elementary row operations, the augmented matrix is reduced to row echelon form, then the process is called Gaussian elimination. If the matrix is reduced to reduced row echelon form, the process is called Gauss Jordan elimination. In the case of Gaussian elimination, assuming that the system is consistent, the solution set can be obtained by back substitution whereas, if the matrix is in reduced row echelon form, the solution set can usually be obtained directly from the final matrix or at most by a few additional simple steps.


Can we transform columns in gauss elimination method?

yes it is possible.not only columns but also rows can be transformed.


Write a c language program that solves linear equations using gauss-jordan elimination method?

Too complex to show here as a Wiki.Answer hoy pareha ta way i answer.......... pag sure uie.........


Solve the following systems of simultaneous linear equations using Gauss elimination method and Gauss-Seidel Method?

Solve the following systems of simultaneous linear equations using Gauss elimination method and Gauss-Seidel Method 2x1+3x2+7x3 = 12 -----(1) x1-4x2+5x3 = 2 -----(2) 4x1+5x2-12x3= -3 ----(3) Answer: I'm not here to answer your university/college assignment questions. Please refer to the related question below and use the algorithm, which you should have in your notes anyway, to do the work yourself.


Flow chart for gaussian elimination with partial pivoting?

gauss


How can you solve for the inverse of a 3 by 3 matrix?

Gauss Elimination


What are 3 methods to solving a system of linear equations?

u can use gauss jorden or gauss elimination method for solving linear equation u also use simple subtraction method for small linear equation also.. after that also there are many methods are available but above are most used


Why would you choose Gauss Jordan over Gauss seidel numeric methods?

It will solve the solution "exactly", but will take a very very long time for large matrices. Gauss Jordan method will require O(n^3) multiplication/divisions and O(n^3) additions and subtractions. Gauss seidel in reality you may not know when you have reached a solution. So, you may have to define the difference between succesive iterations as a tolerance for error. But, most of the time GS is much prefured in cases of large matrices.


Solve system of equation using Gauss Jordan form- When I try to solve these I find that the matrix is singular. Does that mean no solution x plus 2y-3z equals 1 y-2z equals 2 2y-4z equals 4?

The matrix is singular because the last equation is the same as the second equation (simply multiplying every term in an equation by the same number (in this case, 2) does not produce an equation with new information). for example 1) 3x=3y 2) 2x=2y has no useful solution beyond the information from 1) that x=y You would get a singular matrix for this. The Gauss-Jordan method will not solve equations which cannot be solved by the old "elimination method".


What is difference between doolittle and gauss elimenaton method?

kuta panchod ha ya method....................................sala


What did Carl Friedrich Gauss discover?

the method of adding all the numbers from 1~100