Posts

Showing posts with the label system of linear equation

mathajax

Solving Linear equations by Lower Triangular & Forward Substitution

Image
The Java program that wrote down, finds a solution vector for a system of linear equations which has N equations and N variables by Lower Triangular matrix and Forward Substitution method. A system linear equations has a system matrix (coefficient matrix ), A and a non-homogeneous vector, b thereby, Augmented matrix A|b is formed to find solution vector for unknown variables of the system using lower triangular and forward substitution method. Example for Lower Triangular & Forward substitution The example shown below explains how to solve solution of linear system having 3 equations and 3 variables by lower triangular and forward substitution method. Given System of Linear Equation \[\begin{array}{c} 2.0x+4.0y+6.0z=18 \\ 4.0x+5.0y+6.0z=24 \\ 3.0x+1y-2.0z=4 \end{array} \] Augmented matrix A|b \[ \left[\begin{array}{rrr|r} 2.0 & 4.0 & 6.0 & 18.0 \\ 4.0 & 5.0 & 6.0 & 24.0 \\ 3.0 & 1.0 & -2.0 & 4.0 ...

Solving System of Linear Equation by Gaussian Elimination

Image
Solving linear equation by matrix inverse method is difficult when a system has more than 3 equations and 3 unknown variables. hence, Gaussian elimination is preferred for solving system of linear equations, which has N linear equations and N unknown variables. Gaussian elimination is performed by two steps. they, upper triangular matrix back substitution System of Linear Equation by Gaussian Elimination - algorithm Given - system of Linear equations represents it in matrix form -: A - coefficient matrix X - unknown vector b - non-homogeneous vector form augmented matrix, A|b convert augmented matrix, A|b into upper triangular matrix, U by row operation U = A|b ...

Solving System of Linear Equation by Matrix Inverse

The two or more algebraic equation are called system of equations. The Java program finds solution vector X to a system of three linear equations by matrix inverse method. a 11 x 1 + a 12 x 2 + a 13 x 3 = b 1 a 21 x 1 + a 22 x 2 + a 23 x 3 = b 2 a 31 x 1 + a 32 x 2 + a 33 x 3 = b 3 The three linear equation is represented by matrix format by separating coefficients and unknown variables | a 11 a 12 a 13 | Coefficients matrix A = | a 21 a 22 a 23 | | a 31 a 32 a 33 | unknown variable X = [ x 1 x 2 x 3 ]' non-homogeneous b = [ b 1 b 2 b 3 ]' solve given matrix A and vector b (non-homogeneous vector) find value of vector X Matrix representation A X = b ...

Solve Linear Equation 2x2 matrix

Image
System of Linear Equation The two are more linear equations are called system of linear equation. ax 1 + bx 2 = b 1 cx 1 + dx 2 = b 2 System of Linear Equation in matrix representation solution of system of Linear Equation - Algorithm The following steps are carried out for solving system linear equations by inverse method. Read Matrix A 2x2 D = determinant (Matrix A) D==0, then print matrix A is singular return no solution cA = cofactor_matrix (A) Adjoint-Matrix Adj = transpose (Matrix cA) A -1 = Adj / D solution S = A -1 b print solution S Java program Solve Linear Equation The Java program LinearEquation has one constructor function and following four member functions in order t...