Matrix Methods for Linear Equations Uniqueness and ...
Transcript of Matrix Methods for Linear Equations Uniqueness and ...
Chapter 8: Linear Algebraic Equations
β’ Matrix Methods for Linear Equations
β’ Uniqueness and Existence of Solutions
β’ Under-Determined Systems
β’ Over-Determined Systems
Linear Algebraic EquationsFor 2 Equations and 2 Unknowns, the solution is the intersection of the
two lines. For 3 Equations and 3 Unknowns, the solution is the
intersection of three planes.
Matrix Methods for Linear Systems of
Equations The simplest system of linear equations is:
ππ₯ + ππ¦ = πππ₯ + ππ¦ = π
Two equations and two unknowns (all coefficients are known). Can be
solved by substitution, row reduction, Kramerβs Rule. Cast the system in
Vector Form:
π ππ π
βπ₯π¦ =
ππ
Matrix*Column Vector = Column Vector
π΄ β π§ = π΅
Matrix Methods for Linear Systems of
Equations
π΄ β π§ = π΅
Solve for solution vector π§ by multiplying both sides by π΄β1 (π΄ Inverse
[Matrix]):
π΄β1 β π΄ β π§ = π΄β1 β (π΅)
LHS: π΄β1 β π΄ β π§ = π΄β1 β π΄ β π§ = πΌ β π§ = π§
π΄β1 β π΄ = πΌ Identity Matrix : πΌ =1 00 1
π§ = π΄β1 β π΅where
π΄β1 =1
ππ β ππβ
π βπβπ π
Matrix Methods for Linear Systems of
Equations π΄β1 Exists if the Determinant of Matrix π΄ is both Square and
Nonsingular:
π΄ = det π΄ = ππ β ππ β 0
For a given linear system of equations, there may be:
β’ One Unique Solution
β’ An Infinite Number of Solutions
β’ No Solution
Use the Rank of Matrix π΄ and the Rank of the Augmented Matrix [π΄ π΅]
to Establish the Uniqueness and Existence of the Solution.
Rank_A = rank(A)
Rank_AB = rank([A B])
Uniqueness and Existence of the
SolutionIf Rank_A β Rank_AB, a Unique Solution Does Not Exist
If Rank_A = Rank_AB = Number of Unknowns, a Unique Solution
Exists
If Rank_A = Rank_AB but Rank_A β Number of Unknowns, an Infinite
Number of Solutions Exist
Uniqueness and Existence of the
Solution% One Unique Solution: % x-y = -1, 3x+y = 9A = [1 -1; 3 1]B = [-1; 9]AB = [A B]rank_A = rank(A)rank_AB = rank(AB)Det_A = det(A)Inv_A = inv(A)z = Inv_A*B
Matrix Methods for Linear Systems of
Equations MATLAB has Several Methods of Solving Systems of Linear Equations:
β’ Matrix Inverse: z = inv(A)*B (Calculates the Inverse of π΄.)
β’ Left Division: z = A\B (Uses Gauss Elimination to Solve for π§ for
Over-Determined Systems.)
β’ Pseudo-Inverse: z = pinv(A)*B (Used When There are More
Unknowns than Equations: Under-Determined Systems. This Method
Provides One Solution, but Not All Solutions.)
β’ Row-Reduced Echelon Form: rref([A B]) (Also Used for
Under-Determined Systems. This Method Provides a Set of Equations
That Can be Used to Find All Solutions.)
Under-Determined Systems Not Enough Information to Determine all of the Unknowns (Infinite
Number of Solutions)
Case 1: Fewer Equations than Unknowns:
π₯ + 3π¦ β 5π§ = 7β8π₯ β 10π¦ + 4π§ = 28
Case 2: Two Equations are Not Independent:
π₯ + 3π¦ β 5π§ = 7β8π₯ β 10π¦ + 4π§ = 28β16π₯ β 20π¦ + 8π§ = 56
(Equation 3) = 2*(Equation 2)
Solve Under-Determined Systems using Pseudo-Inverse pinv, which
finds one solution by minimizing the Euclidean Norm, or find all
possible solutions by using the rref method (Row-Reduced Echelon
Form).
Under-Determined Systems % Under-Determined System: % Inverse Method% x+3y-5z = 7, -8x-10y+4z = 28A = [1 3 -5; -8 -10 4]B = [7; 28]AB = [A B]rank_A = rank(A)rank_AB = rank(AB)Det_A = det(A)Inv_A = inv(A)z = Inv_A*B
Under-Determined Systems % Under-Determined System: % Pseudo-Inverse Method% x+3y-5z = 7, -8x-10y+4z = 28A = [1 3 -5; -8 -10 4]B = [7; 28]AB = [A B]rank_A = rank(A)rank_AB = rank(AB)z = pinv(A)*B
Row-Reduced Echelon Formπ₯ + 3π¦ β 5π§ = 7
β8π₯ β 10π¦ + 4π§ = 28Replace (Equation 2) by 8*(Equation 1) + (Equation 2):
π₯ + 3π¦ β 5π§ = 70π₯ + 14π¦ β 36π§ = 84
Divide (Equation 2) by 14:
π₯ + 3π¦ β 5π§ = 7
0π₯ + π¦ β36
14π§ = 6
Replace (Equation 1) by β3*(Equation 2) + (Equation 1):
π₯ + 0π¦ + 2.714π§ = β11
0π₯ + π¦ β36
14π§ = 6
Infinite Number of Solutions because π§ can be any number:
π₯ + 2.714π§ = β11
π¦ β36
14π§ = 6
Under-Determined Systems % Under-Determined System:% Row-Reduced Echelon Method% x+3y-5z = 7, -8x-10y+4z = 28A = [1 3 -5; -8 -10 4]B = [7; 28]AB = [A B]rank_A = rank(A)rank_AB = rank(AB)z = rref([A,B])
Over-Determined Systems
More Independent Equations
than Unknowns.
If Rank_A = Rank_AB, A
Unique Solution Exists: Use
Left Division Method to find
the Solution: z = A\B
If Rank_A β Rank_AB, No
Solution Exists: The Left
Division Method gives a Least-
Squares Solution, NOT an
Exact Solution.
Over-Determined Systems % Over-Determined System:% 4x+3y = 7; x-2y = -1; 3x+5y = 8A = [4 3; 1 -2; 3 5]B = [7; -1; 8]AB = [A B]rank_A = rank(A)rank_AB = rank(AB)z = A\B
Over-Determined Systems % Over-Determined System:% 4x+3y = 6; x-2y = -1; 3x+5y = 8A = [4 3; 1 -2; 3 5]B = [6; -1; 8]AB = [A B]rank_A = rank(A)rank_AB = rank(AB)z = A\B
Problem 8.2:
π΄ π΅πΆ + π΄ = π΅π΄β1π΄ π΅πΆ + π΄ = π΄β1π΅
π΅πΆ + π΄ = π΄β1π΅π΅πΆ = π΄β1π΅ β π΄
π΅β1π΅πΆ = π΅β1 π΄β1π΅ β π΄πΆ = π΅β1 π΄β1π΅ β π΄
Problem 8.4:
a) Write a MATLAB script file that uses given values of the applied voltage π£and the values of the five resistances and solves for the six currents.
b) Use the program developed in part a) to find the currents for the case where
π 1 = 1 kΞ©, π 2 = 5 kΞ©, π 3 = 2 kΞ©, π 4 = 10 kΞ©, π 5= 5 kΞ©, and π£ =100 π (1 kΞ© = 1000 Ξ©).
Problem 8.4:
Unknowns: π1, π2, π3, π4, π5, π6
π£ β π 2π2 β π 4π4 = 0
βπ 1π1 β π 3π3 + π 2π2 = 0
βπ 5π5 + π 4π4 + π 3π3 = 0
π1 = π3 + π5
π2 + π3 = π4
π4 + π5 = π6
π6 = π1 + π2
Problem 8.4:
Unknowns: π1, π2, π3, π4, π5, π6
(0)π1+ βπ 2 π2 + 0 π3 + βπ 4 π4 + 0 π5 + (0)π6 = (βπ£)
βπ 1 π1 + π 2 π2 + (βπ 3)π3 + 0 π4 + 0 π5 + 0 π6 = (0)
0 π1 + 0 π2 + (π 3)π3 + π 4 π4 + βπ 5 π5 + 0 π6 = (0)
1 π1 + 0 π2 + (β1)π3 + 0 π4 + β1 π5 + 0 π6 = (0)
0 π1 + 1 π2 + (1)π3 + β1 π4 + 0 π5 + 0 π6 = (0)
0 π1 + 0 π2 + (0)π3 + 1 π4 + 1 π5 + β1 π6 = (0)
β1 π1 + β1 π2 + (0)π3 + 0 π4 + 0 π5 + 1 π6 = (0)
Problem 8.11:
The resulting equations are:
(1)π₯ + 0 π¦ β 1.3846π§ = 4.92310 π₯ + (1)π¦ + 0.0769π§ = β1.3846
These equations can be solved in terms of π§:
π₯ = 1.3846π§ + 4.9231π¦ = β0.0769π§ β 1.3846