Cramer's rule is a method used to solve a system of linear equations by using determinants. It is named after the Swiss mathematician Gabriel Cramer, who first published the rule in 1750.
Suppose we have a system of linear equations with n unknowns:
a11x1 + a12x2 + ... + a1nxn = b1 a21x1 + a22x2 + ... + a2nxn = b2 ... an1x1 + an2x2 + ... + annxn = bn
where aij and bi are constants. We can represent this system of equations in matrix form as:
Ax = b
where A is an n x n matrix of coefficients, x is a column vector of the unknowns, and b is a column vector of constants.
Cramer's rule states that the solution to this system of equations is given by:
xi = Det(Ai) / Det(A)
where xi is the solution to the ith unknown, Det(A) is the determinant of the matrix A, and Ai is the matrix obtained by replacing the ith column of A with the column vector b.
In other words, to find the solution to the ith unknown, we calculate the determinant of the matrix obtained by replacing the ith column of A with the column vector b, and divide it by the determinant of A.
Note that Cramer's rule only works for systems of linear equations that have a unique solution and where the determinant of A is not equal to zero. If the determinant of A is zero, the system may have no solution or an infinite number of solutions.
Let summarize it as:
Let us apply Matlab: Here is the source code for solving equations.
=================================================
The Matlab solver for the above code gives the following result.
==========================================================
detA =
0.0538
detA1 =
0.0328
detA2 =
-0.8719
detA3 =
0.4692
x1 = 0.609294
x2 = -16.206320
x3 = 8.721933
No comments:
Post a Comment