Posts

Showing posts with the label matrix determinant

mathajax

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 ...

Matrix Determinant, Matrix Adjoint and Matrix Inverse

The Java program implements following three important matrix operation in this code. and these operation is applied on a square matrix size of 3x3. They are, Matrix Determinant Matrix singular or not Adjoint matrix Matrix Inversion AA -1 = I (A -1 ) -1 = A Matrix Determinant - algorithm matrix A - a matrix size of 3x3 A-cofactor(0,c) - read cofactor matrix of 0 th row and c th column of the matrix A set M[] =0 set D=0 Read matrix A For c=0 : A-column matrix cf = A-cofactor(0,c) M[c]=cf[[0][0]*cf[[1][1] - cf[[0][1]*cf[[1][0] End For c=1 : A-column D = D + pow(-1,c+0) *M[c] End print "determinant" D Matrix Inverse - algorithm matrix A - a matrix si...