The state space representation of a system is one way in which the mathematical model of the system can be expressed. It is a time-domain description of the system, just as the impulse response and the classical nth-order differential equation are. This is in contrast to the transfer function, which is a complex frequency domain description of the system. This example shows the state space model for a particular system and compares it with other forms of system representation.
We will define the number of inputs to the system to be m, the number of outputs to be p, and the number of independent energy storage elements to be n. The state space model for an nth-order system is a set of n 1st-order differential equations, called the state equations, and a set of p algebraic equations, called the output equations. The set of equations are written in a compact matrix-vector notation in the following manner:
where x is the n-dimensional "state" vector, u is the m-dimensional input vector, and y is the p-dimensional output vector. A is the n-by-n system matrix, B is the n-by-m input matrix, C is the p-by-n output matrix, and D is the p-by-m direct feedthrough matrix.
There are several advantages to using the state space representation compared with other methods. Some of there are:
the system model includes the internal state variables as well as the output variable;
the model directly provides a time-domain solution, which ultimately is the thing of interest;
the form of the solution is the same as for a single 1st-order differential equation;
the effect of initial conditions can be easily incorporated in the solution;
the matrix/vector modeling is very efficient from a computational standpoint for computer implementation.
The system for this example can be represented by one 4th-order differential equation, which would model a system having 4 energy storage elements in it. The specific model is
By taking the Laplace Transform of each term in the equation, under the assumption of zero initial conditions, and using the linearity property of Laplace Transforms, the transfer function can be written down immediately by inspection of the differential equation. The transfer function is
You can see from the second form of the transfer function that there is a zero with the same value of a pole. Therefore, there is a cancellation between those two terms in the transfer function. It is important to note that the physical mechanisms which created the pole and the zero are still there in the system, but from the standpoint of the transfer function (which assumes zero initial conditions), the cancellation is complete, and the transfer function can be represented by the lower-order model, given in the next equation.
To illustrate the fact that the systems modeled by the original full-order
transfer function and by the reduced-order model are equivalent from an
input-to-output standpoint with zero initial conditions, Bode plots and
time-domain responses are shown below. Note that the magnitude and phase
plots and the time response plots are identical for the two models.
Bode Plots
Zero Initial Condition Time Responses
For a given real system, there is only one transfer function which has the fewest number of poles. It is unique. There is only one to exactly model the input-to-output behavior using the least number of poles. In this example, that number is 3, and the unique transfer function is the 3rd-order model given above. No transfer function with fewer poles would be correct, and transfer functions with additional poles and zeros which cancel would not be of minimum order. Unlike the transfer function, however, a state space description is not unique, even when it is of minimum order (3 in this example). There are an infinite number of state space descriptions, each of minimum order, which exactly model the same system from an input-to-output perspective. We will look at one way of creating a state space model from the transfer function. This is the technique used in the MATLAB function "tf2ss.m" (transfer function to state space). For systems with one input and one output, so they are modeled by a single transfer function, the state space matrices A, B, C, D can be written down by inspection of the transfer function or nth-order differential equation.
For this example, the four matrices are given by
For this strictly proper, single-input/single-output system, the elements in the various matrices are either 1 or 0 or coefficients from the numerator or denominator polynomials. The ordering of the terms will always be the same. All the elements of the A matrix will be 0 except the first row and the elements on the first diagonal below the main diagonal. The first row will be the negatives of the terms in the denominator polynomial except the highest power term. The order that the terms appear in the first row is the same as they appear in the polynomial. The elements on the first diagonal below the main diagonal will each be 1.
The B matrix will have 1 in the first row and 0 in each of the other rows. The C matrix will have the coefficients of the numerator polynomial, in the same order that they appear in the polynomial. The coefficients are "right justified". The C matrix has n rows. If there are less than n coefficients in the numerator polynomial, the leading columns of the C matrix contain 0. For any strictly proper transfer function, the D matrix is 0. A strictly proper transfer function is characterized by a higher order denominator polynomial than numerator polynomial. In terms of an nth order differential equation, a strictly proper system has higher derivatives of the output variable than of the input variable.
If the system has the same degree for the numerator and denominator polynomials (biproper system), the A and B matrices are formed in the same way. The C and D matrices are modified from what was described above. They are obtained through synthetic division of the numerator polynomial by the denominator polynomial. Assuming that the leading coefficient of the denominator polynomial is 1, the D matrix will be the leading coefficient of the numerator polynomial. The C matrix will be the coefficients of the numerator polynomial in the strictly proper transfer function which results from the synthetic division. The MATLAB function "tf2ss" can be used for either strictly proper or biproper systems, with the syntax
[A,B,C,D] = tf2ss(NUM, DEN);
Although the full-order and reduced-order transfer functions provide the same input-to-output characteristics when the initial conditions are 0, they do not do so when initial conditions are included. First of all, they do not have the same number of internal state variables, so the number of initial conditions which are required are not the same. The full-order model has 4 states and requires 4 initial conditions, one for each state variable. The reduced-order model has 3 states and requires 3 initial conditions.
The total solution to the differential equation which includes the effects of the input and of the initial conditions is given by
where x(0) is the initial condition on the state variables. The equation
shows the output signal being composed of a term which is only a function of
the initial conditions and terms which are only a function of the input u(t).
As an example of how the initial conditions cause different outputs for the
two models, each model was given an initial state vector consisting of 1 for
each element (4 of them for the full-order model, 3 for the reduced-order
model). As the next figure shows, the resulting outputs variables are not the
same for the two models. If the real system was actually modeled by the
4th-order differential equation shown in the first equation, the curve
representing the full-order system would be the correct response for the
given initial conditions. The reduced-order model would not be able to
completely model all the dynamics of the system.
Nonzero Initial Condition Responses
To compare the state space model with the impulse response representation, we can let the input u(t) be the unit impulse function, and substitute that into the solution to the differential equation shown above. The sifting property of the impulse function is used to derive the impulse response, which is
This clearly shows the relationship between the various matrices in the state space representation and the impulse response h(t). If the system is strictly proper, D=0, and the impulse function does not appear in the output. If the system is biproper, there is direct feedthrough from the input to the output, so the impulse at the input produces an impulse at the output. If the system is strictly proper, the value of h(t) at t=0 will be 0; for a biproper system, h(t) will be non-zero at t=0 due to the impulse.
One of the most popular system representations is the transfer function. We have seen how a state space model can be obtained in a particularly easy way from the transfer function in the case of single-input/single-output systems. Now we will look at obtaining the transfer function from the state space model. This is done by assuming zero initial conditions and then taking the Laplace Transform of the state and output equations. Using the differentiation property of Laplace Transforms, the transform of the state x(t) can be obtained. Substituting this X(s) into the output equation yields the transfer function
Applying the Laplace Transform to the matrices and vectors of the state equation takes the same form as if the matrices were just real numbers. The second form of the transfer function makes use of the fact that the inverse of a matrix can be written as the adjoint of the matrix divided by the determinant of the matrix.
The determinant of (sI-A) is an nth-degree polynomial. If this is set equal to zero, the eigenvalues (characteristic values) of the A matrix are obtained. However, since the transfer function is unique, except for pole/zero cancellations, the determinant of (sI-A) is equal to the denominator polynomial in the usual transfer function model. The eigenvalues of A are called the modes of the system. They determine the major characteristics of both the input-output and initial condition responses of the system. The poles of the transfer function are the same as the modes of the system if there are no pole/zero cancellations. Thus, the modes of the system provide a more complete characterization than do the poles. For this example, the modes and poles (after cancellation) are:
Modes: [-1 -2 -3+j2 -3-j2] Poles: [-1 -3+j2 -3-j2]
Obviously, the mode that is missing from the poles of the transfer function is the one which was cancelled by a zero in the original form of the transfer function.
If the equations for the impulse response and the transfer function given above are compared, it can be seen that the matrix exponential exp(At) is the inverse Laplace Transform of the matrix (sI-A).
Click the icon to return to the Dr. Beale's home page
Latest revision on
Thursday, May 18, 2006 11:09 PM