Math 22 Fall 2004
Linear Algebra with Applications
Vector and Matrix Equations
September 29, 2004
Load the package for doing Linear Algebra
> | with(Student[LinearAlgebra]): |
Warning, the protected name . has been redefined and unprotected
Example 1: Solve a vector equation
x1*a1 + x2*a2 = b
> | a1 := <-1, 3, -2>: a2 := <3, 2, -3>: b := <5, -4, 1>:
a1, a2, b; |
Define an (augmented) matrix of the equation
> | A := <a1 | a2 | b>; |
Reduce it to an echelon form
> | A := AddRow(A, 2, 1, 3):
A := AddRow(A, 3, 1, -2); |
> | A := MultiplyRow(A, 2, 1/11):
A := AddRow(A, 3, 2, 9); |
... and to the reduced echelon form
> | A := AddRow(A, 1, 2, -3); |
Solve the system now
> | x := LinearSolve(A); |
Test our solution
> | x[1] * a1 + x[2] * a2 = b; |
Example 2: Solve a matrix equation Ax=b
> | A := <<1, 3, -2> | <2, -1, 3> | <-2, -3, 1>>:
b := Vector(3, symbol = v): M := <A | b>: A, b, M; |
Solve this system
> | M := AddRow(M, 2, 1, -3):
M := AddRow(M, 3, 1, 2); |
> | M := AddRow(M, 3, 2, 1); |
Conclusion: this system is not consistent for every b
It is easy to find v1, v2, v3 such that v3-v1+v2 is nonzero
> |