Student[LinearAlgebra] Examples
|
Eigenvalues and Eigenvectors
|
|
|
Example 1: Diagonalize a Matrix
|
|
Diagonalize by finding and applying an appropriate transition matrix .
|
|
|
Data entry
|
•
|
Control-drag the matrix.
Context Panel: Assign to a Name≻
|
|
|
Obtain the transition matrix , whose columns are the eigenvectors of
|
•
|
Write the name .
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Eigenvectors
|
•
|
Context Panel: Select Element≻2
|
•
|
Context Panel: Assign to a Name≻
|
|
=
|
Diagonalize by applying
|
•
|
Write the appropriate product of matrices. Use dot (period) for matrix multiplication.
Context Panel: Evaluate and Display Inline
|
|
=
|
|
|
|
|
Example 2: Singular Values of a Matrix
|
|
Obtain the singular values of , and verify the results from first principles
|
|
|
Data entry
|
•
|
Control-drag the matrix.
Context Panel: Assign to a Name≻
|
|
|
Obtain the singular values
|
•
|
Write the name .
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Singular Values
|
|
=
|
From first principles
|
•
|
Enter the product of the transpose of with .
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Eigenvalues
|
•
|
Context Panel: Assign to a Name≻V
|
|
=
|
•
|
Expression palette: square-root operator
Apply to each component of the vector V, whose components are the eigenvalues of
|
|
=
|
=
|
|
|
|
|
Example 3: Jordan Form
|
|
Obtain a transition matrix that puts into Jordan form.
|
|
|
Maple can return the required transition matrix. The calculations below proceed from first principles.
•
|
Context Panel: Assign to a Name≻
|
|
|
•
|
Context Panel: Student Linear Algebra≻
Solvers and Forms≻Jordan Form
|
(Consequently, there is one chain of length 3 corresponding to the eigenvalue 2.)
|
|
Obtain the null spaces of and
|
•
|
Context Panel: Assign to a Name≻
|
(Note that Maple tolerates as a short form of , where is the identity matrix.)
|
=
|
•
|
Context Panel: Evaluate and Display Inline
Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space
|
|
=
|
=
|
Select a vector in that is not in the null space of and verify this choice
|
•
|
Context Panel: Assign to a Name≻b[3]
|
|
|
•
|
Context Panel: Student Linear Algebra≻
Standard Operations≻Determinant
|
(Non-vanishing of the determinant shows is not a member of the null space of )
|
|
Construct the remaining members of the one chain of linearly independent generalized eigenvectors
|
•
|
Context Panel: Evaluate and Display Inline
Context Panel: Assign to a Name≻b[2]
|
|
=
|
•
|
Context Panel: Evaluate and Display Inline
Context Panel: Assign to a Name≻b[1]
|
(Note that is an eigenvector.)
|
=
|
Construct the transition matrix whose columns are the vectors
|
•
|
Context Panel: Evaluate and Display inline
|
•
|
Context Panel: Select Elements≻Combine into Matrix
|
•
|
Context Panel: Assign to a Name≻
|
|
=
|
Verify that puts into Jordan form
|
•
|
Context Panel: Evaluate and Display Inline
|
|
=
|
|
|
|
|
|
Solution of Linear Systems
|
|
|
Example 1: Solve a Completely Determined Linear System
|
|
Solve the completely determined system consisting of the equations
|
|
|
Simply solve the equations
|
•
|
Control-drag the equations.
Context Panel: Solve≻Solve
|
|
|
Convert to a linear system
|
•
|
Control-drag the equations.
|
•
|
Context Panel: Student Linear Algebra≻
Constructions≻Generate Matrix≻Augmented
(Complete dialog as per Figure 1.)
|
•
|
Context Panel: Student Linear Algebra≻
Solvers and Forms≻Linear Solve
|
|
|
Figure 1
|
|
|
|
|
|
|
|
|
|
|
|
Example 2: Least-Squares Solution of an Overdetermined System
|
|
Obtain a least-squares solution to the overdetermined system consisting of the equations
|
|
|
•
|
Control-drag the equations and press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Constructions≻Generate Matrix≻Matrix-Vector pair
(Complete dialog as per Figure 1, in Example 1.)
|
•
|
Context Panel: Student Linear Algebra≻Solvers and Forms≻Least Squares
|
|
|
|
|
|
|
Example 3: Minimum-Norm Least-Squares
|
|
Obtain the minimum-norm least-squares solution of the system .
|
|
|
Obtain the minimum-norm least-squares solution
|
•
|
Control-drag the system, editing it to a sequence of matrix and vector.
|
•
|
Context Panel: Student Linear Algebra≻Solvers and Forms≻Least Squares
Check the "Optimized" box in the "Specify options for Least Squares" dialog
|
|
|
|
|
Work from first principles: obtain the general solution and minimize its norm:
Obtain the general solution
|
•
|
Control-drag the system, editing it to a sequence of matrix and vector.
|
•
|
Context Panel: Student Linear Algebra≻Solvers and Forms≻Least Squares
Free-Variable Name≻
|
•
|
Context Panel: Evaluate at a Point≻
|
•
|
Context Panel: Assign to a Name≻X
|
|
|
Obtain the norm and minimize it
|
•
|
Write the name X and press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
|
•
|
Context Panel: Differentiate≻With Respect To≻
|
•
|
Context Panel: Conversions≻Equate to 0 (This step is optional.)
|
•
|
Context Panel: Solve≻Solve
|
•
|
Context Panel: Assign to a Name≻
|
|
|
•
|
Expression palette: Evaluation template
Evaluate X at the solution in S
|
•
|
Context Panel: Evaluate and Display Inline
|
|
=
|
|
|
|
|
|
|
|
Example 4: Stepwise Row Reduction and Back-Substitution
|
|
If the linear system is expressed by the augmented matrix , row-reduce to upper triangular form and solve for x.
|
|
|
•
|
Control-drag the matrix.
Context Panel: Student Linear Algebra≻
Standard Operations≻Row-Reduced Form
|
•
|
Context Panel: Select Elements≻Restrict Columns
(Complete dialog as per Figure 2. The return is then a vector and not a one-column matrix.)
|
|
|
Figure 2
|
|
|
|
|
|
|
Stepwise row reduction can be done via the Context Panel system, as per Figure 3.
|
Figure 3 Elementary row operations via the Context Panel system
|
|
|
The elementary row operations are also available in two tutors that can be accessed from the Context Panel (Student Linear Algebra > Tutors) . These are the Gaussian Elimination and Gauss-Jordan Elimination tutors..
|
|
|
Matrix Factorizations
|
|
|
Example 1: LU Decomposition
|
|
Obtain the LU decomposition of the matrix .
|
|
|
•
|
Control-drag the given matrix.
Context Panel: Student Linear Algebra≻Solvers and Forms≻LU Decomposition
|
|
|
|
|
The returned matrices are , with being the matrix that tracks permutations of the rows; being the unit lower triangular factor; and being the upper triangular factor. By default, Maple returns the Doolittle, not the Crout, factorization.
|
|
Example 2: QR Decomposition
|
|
Obtain the QR decomposition of the matrix .
|
|
|
•
|
Control-drag the given matrix.
Context Panel: Student Linear Algebra≻Solvers and Forms≻QR Decomposition
|
|
|
|
|
|
|
Example 3: Singular-Value Decomposition
|
|
Obtain the singular-value decomposition of the matrix .
|
|
|
•
|
Control-drag the given matrix.
Context Panel: Student Linear Algebra≻Solvers and Forms≻Singular Value Decomposition≻Singular Value Decomposition (U,S,Vt)
|
|
|
|
|
The return consists of the factor , the vector of singular values, and the transpose of the factor . If is a diagonal matrix whose diagonal elements are the singular values, then .
|
|
|
Queries
|
|
|
Example 1: Positive Definite Matrix
|
|
Is the symmetric matrix positive definite?
|
|
|
•
|
Control-drag the given matrix.
Context Panel: Student Linear Algebra≻Queries≻
Is Definite?≻Positive Definite?
|
|
|
|
|
Typically, definiteness is assigned to bilinear forms derived from the symmetric matrix . If is not symmetric, the associated bilinear form can be represented by , where , the "symmetric part of " is symmetric. Hence, Maple assigns definiteness to the symmetric part of a nonsymmetric matrix on the grounds that the matrix represents a bilinear form.
|
|
Example 2: Similar Matrices
|
|
Show that the matrices and are similar by finding a matrix for which .
|
|
|
•
|
Write the sequence of matrices A and B
Context Panel: Student Linear Algebra≻Queries≻Similar?
|
•
|
Context Panel: Select Element≻2
|
•
|
Context Panel: Assign to a Name≻C
|
|
|
|
|
Data entry
|
•
|
Control-drag each matrix.
Context Panel: Assign to a Name≻ (or , as appropriate)
|
|
|
|
Test for similarity and find
|
•
|
Write a sequence of the names and , then press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Queries≻Is Similar?
|
•
|
Context Panel: Select Element≻2
|
•
|
Context Panel: Assign to a Name≻
|
|
|
Verify similarity
|
•
|
Context Panel: Evaluate and Display Inline
|
|
=
|
=
|
|
|
|
|
Example 3: Orthogonal Matrix
|
|
Construct a (nontrivial) 3×3 orthogonal matrix.
|
|
|
•
|
Enter a list of three linearly independent vectors and press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Gram-Schmidt≻normalized
|
•
|
Context Panel: Select Elements≻Combine into Matrix
|
•
|
Context Panel: Assign to a Name≻
|
|
|
Verify that is an orthogonal matrix
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Queries≻Orthogonal?
|
|
=
|
|
|
An alternative verification consists in showing that , thereby confirming that the rows (and columns) of are sets of orthonormal vectors.
=
|
=
|
|
|
|
|
|
Vector Spaces
|
|
|
Example 1: Four Fundamental Subspaces of a 5×3
|
|
Find the row space, column space, null space, and null space of the transpose for the matrix
(Gilbert Strang of MIT calls these the four fundamental subspaces of .)
|
|
|
The 5×3 matrix maps to . Maple provides bases for each of the four fundamental subspaces.
The row and null spaces of are orthogonal subspaces of ; the column space of and the null space of are orthogonal subspaces in . Figure 4 illustrates the relationships between these four subspaces.
|
Figure 4 The four fundamental subspaces of
|
|
|
Data entry
|
•
|
Control-drag (or copy/paste) the given matrix.
Context Panel: Assign to a Name≻
|
|
|
Row space of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Row Space
|
|
=
|
Column space of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Column Space
|
|
=
|
Null space of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space
|
|
=
|
Null space of
|
•
|
Write the notation for the transpose of
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space
|
|
=
|
|
|
|
|
Example 2: Four Fundamental Subspaces of a 4×5
|
|
Find the row space, column space, null space, and null space of the transpose for the matrix
(Gilbert Strang of MIT calls these the four fundamental subspaces of .)
|
|
|
The 4×5 matrix maps to . Maple provides bases for each of the four fundamental subspaces.
The row and null spaces of are orthogonal subspaces of ; the column space of and the null space of are orthogonal subspaces in . Figure 5 illustrates the relationships between these four subspaces.
|
Figure 5 The four fundamental subspaces of
|
|
|
Data entry
|
•
|
Control-drag (or copy/paste) the given matrix.
Context Panel: Assign to a Name≻
|
|
|
Row space of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Row Space
|
|
=
|
Column space of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Column Space
|
|
=
|
Null space of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space
|
|
=
|
Null space of
|
•
|
Write the notation for the transpose of
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space
|
|
=
|
|
|
|
|
|
Special Matrices
|
|
|
Example 1: Inverse by Adjoint
|
|
Divide the adjoint of by the determinant of , and show that the resulting matrix is , the multiplicative inverse of .
|
|
|
Data entry
|
•
|
Control-drag the matrix .
Context Panel: Assign to a Name≻
|
|
|
Obtain the determinant of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻
Standard Operations≻Determinant
|
|
=
|
Obtain the adjoint of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Standard Operations≻Adjoint
|
•
|
Context Panel: Assign to a Name≻adjA
|
|
=
|
Divide the adjoint by the determinant
|
•
|
Context Panel: Evaluate and Display Inline
|
|
=
|
Obtain , the multiplicative inverse of
|
•
|
Write the name
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻
Standard Operations≻Inverse
|
|
=
|
|
|
|
|
Example 2: Reflection Matrix (across a Line)
|
|
Obtain a matrix that reflects vectors in across the line .
|
|
|
•
|
The red dashed line line in Figure 6 is the graph of . The green vector, , is along this line.
|
•
|
The gold vector, , is orthogonal to the line .
|
•
|
The black vector, , is an arbitrary vector in . Its reflection across the line is the red vector.
|
•
|
The reflection matrix is constructed from the gold vector, that is, from a vector orthogonal to the "mirror" across which reflection is to take place.
|
|
|
|
|
Construct the rotation matrix
|
•
|
On a vector orthogonal to the line of reflection:
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Constructions≻Reflection Matrix
|
•
|
Context Panel: Assign to a Name≻
|
|
=
|
Test the rotation matrix
|
•
|
Write sequences of two vectors (black & green, red & green, in Figure 6); press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Standard Operations≻Vector Angle
|
|
|
|
|
|
|
|
Example 3: Reflection Matrix (across a Plane)
|
|
Obtain a matrix that reflects vectors in across the plane .
|
|
|
•
|
Figure 7 shows the plane across which reflections are to take place. In addition, N, the black vector in the figure, is a normal to the plane.
|
•
|
The red vector, , is an arbitrary vector in .
|
•
|
The green vector is , the reflection of V across the given plane, where is the requisite reflection matrix.
|
•
|
The angles between V and N and RV and -N should be equal if RV is the reflection of V across the plane.
|
|
>
|
use plots, Student:-VectorCalculus, Student:-LinearAlgebra in
module()
local p1,p2,p3,R,N,V;
N:=<1,2,3>/2;
V:=<1,1,1>;
R:=ReflectionMatrix(N);
p1:=implicitplot3d(x+2*y+2*z=0,x=-1..1,y=-1..1,z=-2..2,style=wireframe);
p2:=PlotVector([N,V,R.V],color=[black,red,green],width=.2);
p3:=display(p1,p2,scaling=constrained,labels=[x,y,z],axes=frame,orientation=[-5,80,0],tickmarks=[3,4,6],lightmodel=none);
print(p3);
end module:
end use:
|
|
Figure 7
|
|
|
|
|
|
Construct the rotation matrix
|
•
|
On a vector orthogonal to the plane:
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Constructions≻Reflection Matrix
|
•
|
Context Panel: Assign to a Name≻
|
|
=
|
Test the rotation matrix
|
•
|
Write sequences of two vectors (V and N, RV and -N, in Figure 7); press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Standard Operations≻Vector Angle
|
|
|
|
|
|
|
|
Example 4: Rotation Matrix
|
|
Rotate the vector through an angle of radians about the line .
|
|
|
•
|
In Figure 8, the black vector, , is along the axis of rotation, shown as the dashed red line.
|
•
|
In Figure 8, the red vector is ; its rotation about the axis of rotation, is the green vector.
|
|
>
|
use plots, Student:-VectorCalculus, Student:-LinearAlgebra in
module()
local p1,p2,p3,V,N,R;
R:=RotationMatrix(Pi/6,<1,2,3>);
V:=<1,-1,2>;
N:=<1,2,3>;
p1:=spacecurve([t,2*t,3*t],t=-1/5..1.2,color=red,linestyle=dash);
p2:=PlotVector([V,R.V,N],color=[red,green,black],width=.2);
p3:=display(p1,p2,scaling=constrained,labels=[x,y,z],tickmarks=[3,3,5],orientation=[-65,85,0]);
print(p3);
end module:
end use:
|
|
Figure 8
|
|
|
|
|
|
Construct the requisite rotation matrix
|
•
|
Write a sequence of the rotation angle and a vector along the axis of rotation; press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Constructions≻Rotation Matrix
|
|
|
|
|
|
|
|
Matrix Operators
|
|
|
Example 1: Matrix Norm Subordinate to Vector Norm
|
|
Obtain the Euclidean norm of the matrix and show that it is the maximum value of the Euclidean norm of the vector , where v is a unit vector.
|
|
|
Obtain the Euclidean norm of
|
•
|
Control-drag the matrix
Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
|
•
|
Context Panel: Simplify≻Simplify
|
|
|
Obtain the norm of , where x is a unit vector
|
•
|
Write times a unit vector and press the Enter key.
|
•
|
Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
|
•
|
Context Panel: Simplify≻Simplify
|
•
|
Context Panel: Assign to a Name≻
|
|
|
Maximize the norm of
|
•
|
Write and press the Enter key.
|
•
|
Context Panel: Differentiate≻With Respect To≻
|
•
|
Context Panel: Conversions≻Equate to 0 (This step is optional.)
|
•
|
Context Panel: Solve≻Solve
|
•
|
Context Panel: Assign to a Name≻
|
|
|
Evaluate at each critical value of
|
•
|
Expression palette: Evaluation template
Evaluate at each of the two critical values.
|
•
|
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Simplify≻Simplify
|
|
=
|
=
|
|
|
|
|
Example 2: Matrix Norm and Singular Values
|
|
Show that the Euclidean norm of the matrix is the largest singular value of , and the square root of the largest eigenvalue of .
|
|
|
From Example 1:
Obtain the Euclidean norm of
|
•
|
Control-drag the matrix
Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
|
•
|
Context Panel: Simplify≻Simplify
|
|
|
|
|
Obtain the singular values of
|
•
|
Control-drag the matrix
Context Panel: Student Linear Algebra≻
Eigenvalues, etc≻Singular Values
|
|
|
Obtain the eigenvalues of
|
•
|
Write the product .
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Eigenvalues
|
|
=
|
•
|
Control-drag the larger of the two eigenvalues.
|
•
|
Select, and click in the Expression palette
|
•
|
Context Panel: Evaluate and Display Inline
|
|
=
|
|
|
|
|
|
Vectors and Vector Operators
|
|
|
Example 1: Vector Angle, Dot and Cross Products
|
|
Determine the angle between the vectors and , then obtain their dot and cross products.
|
|
|
Data entry
|
•
|
Context Panel: Assign to a Name≻ and , as appropriate
|
|
|
|
Determine the angle between u and v
|
•
|
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Standard Operations≻Vector Angle
|
|
=
|
Dot product
|
Cross product
|
•
|
Common Symbols palette: Dot product operator
|
•
|
Context Panel: Evaluate and Display Inline
|
|
Common Symbols palette: Cross product operator
Context Panel: Evaluate and Display Inline
|
=
|
=
|
•
|
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Linear Algebra≻Standard Operations≻Dot Product (or Cross Product)
|
|
=
|
=
|
|
|
|
|
Example 2: Orthonormalization
|
|
Orthonormalize the columns of the matrix , then form , a matrix with these orthonormalized vectors, and show that is an orthogonal matrix.
|
|
|
•
|
Control-drag the matrix and press the Enter key.
|
•
|
Context Panel: Select Elements≻Split into Columns
|
•
|
Context Panel: Student Linear Algebra≻Vector Spaces≻Gram-Schmidt≻normalized
|
•
|
Context Panel: Assign to a Name≻
|
|
|
Verify that is an orthogonal matrix
|
•
|
Context Panel: Evaluate and Display Inline
|
|
=
|
=
|
|
|
|
|
|
Visualizing a Linear Transform
|
|
|
Example 1: Linear Transform Induced by a 2×2 Matrix
|
|
Visualize the effect of applying to unit vectors, the linear transformation determined by the matrix .
|
|
|
Access the Linear Transform Plot tutor through the Context Panel applied to the matrix . The result is Figure 9.
Context Panel: Student Linear Algebra≻Tutors≻Linear Transform Plot
|
Figure 9
|
|
|
|
|
Return to Index for Example Worksheets
|