

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


We will learn writing matlab scripts and using symbolics. Answer or do questions with ∗.
∂ f ∂ y =^
∂ ∂ y
∂ f ∂ x true?
Last week, we have computed eigenvalues and eigenvectors of the two matrices A =
, and B =
The matrix A has eigenvalues { 1 , 1 , 2 }, where 1 is the eigenvalue with multiplicity 2 that has two linearly independent eigenvectors. In contrast, B has eigenvalues { 3 , 3 , 6 }, where 3 is the eigenvalue with multiplicity 2, but it has only one linearly independent eigenvector.
Note that A has three linearly independent eigenvectors: two associated with 1 and another associated with 2. There- fore, we can construct an invertible eigenvector matrix V A and the diagonal eigenvalue matrix D A so that AV A = V A D A. Since V A is invertible, we can right multiply V − A^1 to obtain an eigenvalue decomposition A = V A D A V − A^1. Since D A is diagonal, we say A is diagonalizable.
However, even though we can construct an eigenvector matrix V B and the diagonal eigenvalue matrix D B so that BV B = V B D B , the eigenvector matrix V B is not invertible. There are only two eigenvectors: one associated with 3 and
another associated with 6. We cannot construct a full rank, and therefore invertible, matrix V B. Therefore, we cannot have the eigenvalue decomposition B = V B D B V − B^1 , with a diagonal matrix D B. We say that B is not diagonalizable.
In fact, if allow an off-diagonal term in D B , we can make B = V B D B V − B^1. We can compute this by using the Matlab command jordan. Using this command, compute V B and D B and submit the matrix. Also verify that B = V B D B V − B^1. Note that D B is not a diagonal matrix anymore. This is called the Jordan decomposition.
Using Matlab, we can plot graphs of nonlinear surfaces. Try help meshgrid , and read some. Try [X,Y] = meshgrid(-3:0.2:3, -3:0.2:3);. This will create an array X that varies along rows and Y that varies through columns.
Now, construct a function f ( x , y ) = x^2 + y^2 / 4 + 3 xy + 2, by f = X.X + Y.Y/4 + 3X.Y + 2. You can plot the surface by surf(X,Y,f); xlabel(’x’); ylabel(’y’); zlabel(’f’);. Submit a hand-drawn sketch (or printed copy) of this graph.
The contour can be plotted by contour(X,Y,f,-40:4:40). Submit a hand-drawn sketch (or a printed copy) of this contour graph. What each curves in this contour plot stands for?
The gradient of f ( x , y ) is ∇ f = [ 2 x + 3 y y / 2 + 3 x ] T^. Compute the gradient by fx = 2X + 3Y; fy = Y/2 + 3*X;. The gradient vector can be drawn by quiver(X,Y,fx,fy);
You can draw the contour and the gradient vectors together by using the ’hold’ command. Try contour(X,Y,f,-40:4:40); axis equal; xlabel(’x’); ylabel(’y’); hold on; quiver(X,Y,fx,fy); hold off; What is the angle between the gradient vector and the contour line?
Critical point is the point where ∇ f = 0. Compute the critical point. Indicate the critical point in your contour graph.