This exercise will familiarize you with the symbolic capabilities of MATLAB.
Through an interface with "maple", MATLAB allows symbolic manipulations. The symbolic variables are distinct from the regular, numerical variables and they will not be accessible to normal Matlab functions. Rather, they should be manipulated with special symbolic functions. Therefore, it helps to keep track of which variables are "symbolic" by, for example, giving all symbolic variables a prefix of "sym."
Some useful commands: help more; more on; help script; help symbolic; sym; numeric; maple; solve; ls, who, save, echo, diary, conv.
The answers to all questions must be given by using Matlab.
We will begin with the transfer function representation of a system: 1/(s 2+4)
num = 1; den = [ 1 0 4];
SYMBOLIC MANIPULATIONS
In Questions 2-14 use exclusively symbolic commands
Question-2: Define variables syma, symb, symc, symd to be the symbolic versions of a, b, c, and d respectively.
Question-3: Form symbolic matrix s*I, where I is an identity matrix with the same dimension as the system, and s is a symbolic (Laplace) variable. Call this matrix symsI.
Question-4: Define symbolic matrix symM to be s*I - syma
Question-5: Get symbolic characteristic polynomial = determinant(s*I-symA). Call this polynomial symcharpoly.
Question-6: Find the roots of symbolic characteristic polynomial and convert to numerical form.
Question-7: Compare with eigenvalues of A as obtained above.
Question-8: compute symMI,
symMI := ( s*I - A )-1 = symM-1
Question-9: Compute the transfer function using the following formula:
C * (s*I - A)-1 * B.
Designate the transfer function by symtf.
Question-10: Compute the state transition matrix (call it symphi) which is the inverse laplace transform of symMI.
Note 1: invlaplace(symMI) would not work because invlaplace does not accept matrix inputs.
Note 2: For some reason, invlaplace sometimes does not work. It seems that for it to work, one must first type "maple('readlib(laplace)')".
Question-12: Now, we put the transfer function -4/(s+2) in series with the previous system. Find the state transition matrix for the resulting system. Follow a procedure similar to the above, but do no more work than is required to get the state transition matrix.
Question-13: Get impulse and unit step response of the new system.
Question-14: Get impulse and unit step response of the closed-loop system.