% IAP2007 Introduction to MATLAB: Calculus, Linear Algebra, Differential Equations % Instructor: Violeta Ivanova, violeta@mit.edu % Example 1: Linear Systems, Eigenvalues & Eigenvectors: RCL Circuit % This exercise is based on Prof. Stephen Hall's Signals and Systems lectures % for 16.01-16.04 Unified Engineering. % NOTE: consult this session's handout for illustrations (slides 21-13). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % A. STATE EQUATION % A1. For state equation x' = Ax, and (column) state vector 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 % A2. Define a (column) vector x0 for initial conditions: v(0) = 2 and i(0) = 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % B. EIGENVALUES & EIGENVECTORS % B1. Compute eigenvalues and eigenvectors of the matrix A % Hint: use function EIG with option 'nobalance' for non-symmetric A % B2. Compute a column vector lambda including the two eigenvalues % Hint: use function DIAG. % B3. Define the two column eigvectors eigvec1 and eigvec2: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % C. SOLUTION: v(t) and i(t) % C1. Compute the coefficients' vector A from the initial conditions x0 % Hint: Use operator \ to solve equation x0 = eigenvectors * A for A. % C2. Compute v(t) and i(t) for 0 < t < 5s % Hint: the solution has an exponential form - see handout for formula. % C3. Plot v(t) and i(t) vs. time t on the same plot.