Using your knowledge of matlab and linear algebra solve the follow Consider the
ID: 3886646 • Letter: U
Question
Using your knowledge of matlab and linear algebra solve the follow
Consider the following matrices T, D, A, and B. T = [t_11 0 0 t_12 t_22 0 t_13 t_23 t_33], D = [d_11 0 0 0 d_22 0 0 0 d_33], A = [a_11 a_21 a_12 a_22], B = [b_11 b_21 b_12 b_22] Compute the determinant of T. Based on this solution, what do you expect the determinant of a general, n times n, triangular matrix (upper or lower) to be? Explain. Does the determinant of D conform to this expectation? Compute the eigenvalues of D. Based on this solution, what do you expect the eigenvalues of a general, n times n, diagonal matrix to be? Explain. Compute the eigenvalues of AB. What are the eigenvalues if B = A? You are encouraged to use MATLAB's symbolic math toolbox to assist with algebraic manipulations.Explanation / Answer
1.
syms t11 t12 t13 t21 t22 t23 t31 t32 t33
T =[t11 t12 t13; 0 t22 t23; 0 0 t33]
det(T)
Output of the above script is as follows:
T = [ t11, 0, 0]
[ t21, t22, 0]
[ t31, t32, t33]
ans = t11*t22*t33
Since, the determinant value of upper triangular Matrix contains diagonal elements only, so it can be expected that lower triangular matrix will have the same determinant value.
If the Matrix is lower:
T = [ t11, t12, t13]
[ 0, t22, t23]
[ 0, 0, t33]
ans = t11*t22*t33
Therefore, in both triangular matrix determinant value is same, so the expectation is correct.
Matlab script for Matrix D is as follows:
syms d11 d22 d33
D =[d11 0 0; 0 d22 0; 0 0 d33]
det(D)
Output is as follows:
D = [ d11, 0, 0]
[ 0, d22, 0]
[ 0, 0, d33]
ans =d11*d22*d33
Since, the determinant value contains diagonal elements only, so Matrix D conforms the expectation.
-------------------------------------------------------------------------------
syms d11 d22 d33
D =[d11 0 0; 0 d22 0; 0 0 d33];
eig(D)
Following is the output:
ans = d11
d22
d33
So, the eigen values of the normal n x n Matrix can be expected as the main diagonal elements. Since it is a diagonal matrix, so it contains these eigen values, if the matrix has other elements, these values will change accordingly.
-----------------------------------------------------------------------------------
Matlab script is as follows:
syms a11 a12 a21 a22
A =[a11 a12; a21 a22]
syms b11 b12 b21 b22
B = [b11 b12; b21 b22]
eig(A*B)
Output of above script is as follows:
A = [ a11, a12]
[ a21, a22]
B = [ b11, b12]
[ b21, b22]
ans =
(a11*b11)/2 + (a12*b21)/2 + (a21*b12)/2 + (a22*b22)/2 - (a11^2*b11^2 + 2*a11*a12*b11*b21 + 2*a11*a21*b11*b12 - 2*a11*a22*b11*b22 + 4*a11*a22*b12*b21 + a12^2*b21^2 + 4*a12*a21*b11*b22 - 2*a12*a21*b12*b21 + 2*a12*a22*b21*b22 + a21^2*b12^2 + 2*a21*a22*b12*b22 + a22^2*b22^2)^(1/2)/2
(a11*b11)/2 + (a12*b21)/2 + (a21*b12)/2 + (a22*b22)/2 + (a11^2*b11^2 + 2*a11*a12*b11*b21 + 2*a11*a21*b11*b12 - 2*a11*a22*b11*b22 + 4*a11*a22*b12*b21 + a12^2*b21^2 + 4*a12*a21*b11*b22 - 2*a12*a21*b12*b21 + 2*a12*a22*b21*b22 + a21^2*b12^2 + 2*a21*a22*b12*b22 + a22^2*b22^2)^(1/2)/2
If both matrix are equal , B= A
Eigen Values will be :
a12*a21 - (a11*(a11^2 - 2*a11*a22 + a22^2 + 4*a12*a21)^(1/2))/2 - (a22*(a11^2 - 2*a11*a22 + a22^2 + 4*a12*a21)^(1/2))/2 + a11^2/2 + a22^2/2
a12*a21 + (a11*(a11^2 - 2*a11*a22 + a22^2 + 4*a12*a21)^(1/2))/2 + (a22*(a11^2 - 2*a11*a22 + a22^2 + 4*a12*a21)^(1/2))/2 + a11^2/2 + a22^2/2
-------------------------------------------------------------------------------------------------------------------------
2.
If Matrix A=
2 2 -2
2 -4 -2
0 2 0
A =[2 2 -2; 2 -4 -2; 0 2 0];
eig(A)
det(A)
Eigen Values are : -4, 2, and 0
And the determinant is 0.
In the following script, Vector will be having eigen vectors , and Values will have eigen values
A =[2 2 -2; 2 -4 -2; 0 2 0];
[Vectors,Values] = eig(A)
Output of the above script is as follows:
Vectors =0.4082 0.9428 0.7071
-0.8165 0.2357 -0.0000
0.4082 0.2357 0.7071
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.