% Fall'06 - Spring'07 16.01-16.04 MATLAB Tutorials: Linear Systems % Instructor: Violeta Ivanova, violeta@mit.edu % Faculty: Mark Drela, Stephen Hall, Wes Harris, Ian Waitz % Example 1: Linear Systems: Eigenvalues and Eigenvectors % This exercise is based on S. Hall's Signals and Systems lectures. % C1. State space linear equations: x' = Ax % If x = (v; i), create the matrix A for the following system: % dv/dt = -1/2*v - 2*i % di/dt = 1/2*v - 3*i % C2. Define vector x0 for initial conditions: v(0) = 2 and i(0) = 1 % C3. Compute eigenvalues and eigenvectors of the matrix A % Hint: use function EIG with option 'nobalance' for non-symmetric A % Compute a column vector lambda including the two eigenvalues: % Compute two column eigvectors eigvec1 and eigvec2: % C4. Compute v(t) and i(t) for 0 < t < 5s % Hint: the solution has exponential form - see handout for formula % Compute the coefficients' vector a from the initial conditions x0 % Hint: Use operator \ to solve equation x0 = eigenvectors * a % C5. Plot v(t) and i(t) vs. time t