This action might not be possible to undo. Are you sure you want to continue?

The State Space Equations and Their Time Domain Solution Introduction This section of notes concentrates on three areas: 1. A general notation for the state variable treatment of dynamic systems (the so-called standard state space form). 2. Techniques for putting general systems into standard form. 3. Methods for the time domain solution of the state equations, including both analytical methods and numerical methods. Several examples are used to illustrate these techniques and a final numerical example in Matlab contrasts three different solution methods. This information is organized into the following subsections:

●

**The State Space Representation
**

○

**Example 3.1 Nth Order Linear Differential Equations
**

■ ■

●

**Conversion to State Form
**

○

Example 3.2 Example 3.3 Example 3.4 Example 3.5

○

**Mixed Algebraic and Differential Equations
**

■

○ ●

**Linearization of Nonlinear Systems
**

■

**Analytic Solution to Linear Stationary Systems
**

○ ○ ○

Homogeneous Systems Non-Homogeneous Systems Time-Varying Systems

● ● ●

Discretization of Linear Stationary Systems Numerical Integration of the State Equations An Example Illustrating Various Solution Schemes The State Space Representation (Continuous Systems)

The general state variable form for continuous dynamic systems can be written as (3.1) and (3.2) where contains all the variable coefficient and nonlinear terms. To complete this description, we note that the input, output, and state vectors do not generally contain the same number of elements. To treat this, one can write as

and allow the , , and matrix operators to be rectangular matrices (i.e. non-square). The system matrix, , is required to be square. A particular element of eqn. (3.1) can be written as (3.3) and for eqn. (3.2), we have (3.4) where we have an Nth order system with M inputs and a maximum of K nonlinear terms for any one equation. Example 3.1 illustrates the use of eqns. (3.1 and 3.2) for a simple second order system. The most general form of eqn. (3.1) can be written as (3.5) where the vector function f(x,u,t) contains the full inter-relationship among all the state variables and inputs. The use of this form usually implies that only numerical simulation techniques will be used to study the system's dynamic behavior. Example 3.1 Standard State Space Form Problem Statement: Put the following 2nd order system into standard state form:

and Problem Solution: Putting this 2nd order system into standard state space form, gives

and

where

and

8). Treatment of mixed algebraic and differential equations.6): . Linearization of nonlinear systems. and 3. (3.Conversion to State Form The goal here is to present a recipe for the conversion of certain classes of problems into state form. Conversion of nth Order Linear Differential Equations (with derivatives) Given the following nth order system. let or. for the jth state variable or In these expressions. one gets the following SISO matrix representation of eqn. (3. State space representation of nth order systems. Three specific areas to be addressed are: 1. 2. is defined as Using eqns.7) and (3.

e. However. Putting these expressions into matrix form gives Thus. consider the following 2nd order system. (3. we simply multiply by . giving . Conversion of Mixed Algebraic and Differential Equations The general formulation in eqn. For example. Note that for the special case where the derivatives of the forcing function are not present (i. a more general form for the state equations for linear stationary systems is Now to put this into standard form.1) has only one derivative term in each equation. and it is much easier to visualize and implement the conversion algorithm (since all the are zero except ). but very common case. a linear system can have more than one derivative per equation. We will focus further on the properties of the state matrix in later subsections. Example 3. we have and d = 0.with and Example 3.2 illustrates the use of the above general conversion algorithm.3 illustrates this less general. It also highlights the importance of the state matrix in determining the solutions to linear stationary systems. for RHS = u(t) only). This is the standard form. This latter situation is actually the usual situation.

Step 4. Expand the matrix expression in Step 2. giving where vector containing elements that have derivative terms vector containing elements that appear without derivatives Step 3. systems with embedded statics can be reduced in order (by the number of algebraic equations) via a series of algebraic manipulations. In general. Such a system is said to have embedded statics since the algebraic equations represent relationships that do not change with time. Order the equations so that n1 equations contain derivative terms and the next n2 equations only have algebraic relationships Step 2. Solve the algebraic expressions for differential equation in terms of and substitute into the and Step 5. Write the original equations using partitioned matrices (with ).where now becomes the system matrix. The new system written in standard form is with . A general procedure for doing this is as follows: Step 1. Another common situation that occurs is to have a complex dynamic system that is described by a set of mixed algebraic and differential equations.

However.Example 3. A general nonlinear nonstationary system can be written as where all the nonlinear and variable coefficient terms are included within . This is done because most of the analytical techniques are applicable only for linear stationary systems. Expressing the dependent state variables and independent forcing function as deviations from some normal operating state. (3. For the ith component of the vector. The variable coefficient terms in the original equations are also often treated in a similar manner as the nonlinear terms. (3. demonstration for dealing with systems with embedded statics. written out in detail is given as . the first-order approximation gives The last two summations simply represent matrix multiplication operations.18) as follows: The nonlinear nonstationary terms can be written in a first-order Taylor series expansion about the operating point.16) gives eqn.20). The goal here is to develop a method for linearizing the general nonlinear state variable equations.4 gives a simple. (3. but illustrative. (3. Thus. eqn. . These matrices can be represented symbolically as For example. all systems are nonlinear. gives Substituting these expressions into eqn. linear analysis methods can usually be used for systems analysis in some limited range around some reference state. or where are referred to as Jacobian matrices (evaluated at the reference operating point). Linearization of Nonlinear Systems In general.19) written in matrix notation gives eqn.

are zero.Note also that at the reference operating point. . (3. we have with . The new system matrix for the linearized system becomes matrix operator becomes and the new input . (3. (3. Example 3.23) is often useful even if the original system is linear and stationary. This is true since we have linearized about this condition. one has Now.18) gives This latter expression represents a linearization of the original nonlinear nonstationary system. Note that these matrices are functions of the initial reference operating point.5 illustrates the use of the above expressions. by definition.2 Conversion of 3rd Order System to State Form (General Case) Problem Statement: Given convert this 3rd order linear stationary system to state form. Note also that the perturbation form given in eqn. the initial conditions for the new state vector.20) and (3. Example 3. Problem Solution: Using the recipe given previously. since. . substitution of eqns.22) into eqn.

let's make the following substitutions: .and with Therefore and Example 3.3 Conversion of 3rd Order System to State Form (Usual Case) Problem Statement: Given convert this system to state form. Also show that the eigenvalues of the resultant system matrix are identical to the roots of the characteristic equation associated with the homogeneous solution to the given 3rd-order equation. noting that the RHS does not contain derivatives of u(t). Problem Solution: For this case.

Thus. the vector can be written as . The eigenvalues of the state matrix for a linear stationary system are identical to the roots of the characteristic equation of the original linear constant coefficient ODE.2. we have Therefore. in general. with Now. giving Also. the eigenvalues of the state matrix are given by and expanding along row 1 gives This is exactly the same result as above. 3. except now. the general expression for the output equation reduces to This case is very similar to that given in Ex. since the solution of interest is y(t) (a single output). is also referred to as the characteristic equation. with only u(t) on the RHS of the defining ODE. recall from Section II that the characteristic equation associated with the homogeneous form of the given equation can be written as Now.or. In addressing the second part of the problem. the three equations for can be put into matrix form. . from the defining equation with .

let or. Linearization of nonlinear systems. 2. (3. Conversion of nth Order Linear Differential Equations (with derivatives) Given the following nth order system. one gets the following SISO matrix representation of eqn.7) and (3. (3.6): . Three specific areas to be addressed are: 1.Conversion to State Form The goal here is to present a recipe for the conversion of certain classes of problems into state form.8). and 3. is defined as Using eqns. State space representation of nth order systems. for the jth state variable or In these expressions. Treatment of mixed algebraic and differential equations.

Putting these expressions into matrix form gives Thus. for RHS = u(t) only).with and Example 3.2 illustrates the use of the above general conversion algorithm. However.3 illustrates this less general. For example. It also highlights the importance of the state matrix in determining the solutions to linear stationary systems. (3. we have and d = 0. Conversion of Mixed Algebraic and Differential Equations The general formulation in eqn. consider the following 2nd order system. This is the standard form. This latter situation is actually the usual situation.e. a linear system can have more than one derivative per equation. giving .1) has only one derivative term in each equation. and it is much easier to visualize and implement the conversion algorithm (since all the are zero except ). a more general form for the state equations for linear stationary systems is Now to put this into standard form. Note that for the special case where the derivatives of the forcing function are not present (i. we simply multiply by . We will focus further on the properties of the state matrix in later subsections. but very common case. Example 3.

A general procedure for doing this is as follows: Step 1. Expand the matrix expression in Step 2. Step 4. In general. Such a system is said to have embedded statics since the algebraic equations represent relationships that do not change with time. The new system written in standard form is with .where now becomes the system matrix. Solve the algebraic expressions for differential equation in terms of and substitute into the and Step 5. Order the equations so that n1 equations contain derivative terms and the next n2 equations only have algebraic relationships Step 2. Write the original equations using partitioned matrices (with ). giving where vector containing elements that have derivative terms vector containing elements that appear without derivatives Step 3. systems with embedded statics can be reduced in order (by the number of algebraic equations) via a series of algebraic manipulations. Another common situation that occurs is to have a complex dynamic system that is described by a set of mixed algebraic and differential equations.

19) written in matrix notation gives eqn. (3. Linearization of Nonlinear Systems In general. all systems are nonlinear. This is done because most of the analytical techniques are applicable only for linear stationary systems. but illustrative. (3. A general nonlinear nonstationary system can be written as where all the nonlinear and variable coefficient terms are included within .18) as follows: The nonlinear nonstationary terms can be written in a first-order Taylor series expansion about the operating point.20). The variable coefficient terms in the original equations are also often treated in a similar manner as the nonlinear terms. However.16) gives eqn. written out in detail is given as . . (3. demonstration for dealing with systems with embedded statics. For the ith component of the vector. The goal here is to develop a method for linearizing the general nonlinear state variable equations.Example 3. the first-order approximation gives The last two summations simply represent matrix multiplication operations.4 gives a simple. These matrices can be represented symbolically as For example. or where are referred to as Jacobian matrices (evaluated at the reference operating point). gives Substituting these expressions into eqn. Thus. linear analysis methods can usually be used for systems analysis in some limited range around some reference state. (3. eqn. Expressing the dependent state variables and independent forcing function as deviations from some normal operating state.

Note that these matrices are functions of the initial reference operating point. .Note also that at the reference operating point. the initial conditions for the new state vector. one has Now.4 Treating Mixed Algebraic and Differential Equations Problem Statement: Put the following system in standard state form: Problem Solution: Let's write these equations in matrix form and partition them accordingly.22) into eqn.23) is often useful even if the original system is linear and stationary. Example 3.20) and (3. The new system matrix for the linearized system becomes matrix operator becomes and the new input . Note also that the perturbation form given in eqn. are zero. since. (3. (3. This is true since we have linearized about this condition. (3.18) gives This latter expression represents a linearization of the original nonlinear nonstationary system. substitution of eqns. . by definition.5 illustrates the use of the above expressions. . Example 3.

Expressing the dependent state variables and independent forcing function as deviations from some normal operating state. linear analysis methods can usually be used for systems analysis in some limited range around some reference state. the first-order approximation gives . For the ith component of the vector. The goal here is to develop a method for linearizing the general nonlinear state variable equations. all systems are nonlinear.18) as follows: The nonlinear nonstationary terms can be written in a first-order Taylor series expansion about the operating point. The variable coefficient terms in the original equations are also often treated in a similar manner as the nonlinear terms. This is done because most of the analytical techniques are applicable only for linear stationary systems. . gives Substituting these expressions into eqn. (3. (3.This is now in the form which has solution where and Linearization of Nonlinear Systems In general. A general nonlinear nonstationary system can be written as where all the nonlinear and variable coefficient terms are included within . However.16) gives eqn.

eqn. .20). (3. Thus.23) is often useful even if the original system is linear and stationary. by definition. one has Now. Note also that the perturbation form given in eqn. substitution of eqns. (3. Note that these matrices are functions of the initial reference operating point. since.5 Linearization of a 2nd Order Nonlinear System Problem Statement: Write a linear approximation for the system described by . (3. The new system matrix for the linearized system becomes matrix operator becomes and the new input . . or where are referred to as Jacobian matrices (evaluated at the reference operating point).22) into eqn.19) written in matrix notation gives eqn.5 illustrates the use of the above expressions.18) gives This latter expression represents a linearization of the original nonlinear nonstationary system.The last two summations simply represent matrix multiplication operations. Example 3. (3. This is true since we have linearized about this condition. are zero. written out in detail is given as Note also that at the reference operating point. (3. These matrices can be represented symbolically as For example. the initial conditions for the new state vector. Example 3.20) and (3.

we first must identify the reference state. one has ) with . the linearized system is .e. In or and Rearranging these expressions gives and or Therefore. the two equilibrium states are and The Jacobian matrix associated with the state vector can be expressed as (note that this case) for For the reference state with . Problem Solution: Since we must expand the system around this case.Take the reference state as the equilibrium point (i. .

where it is implied that the To derive the discrete form.and for . given convert the continuous system into a difference equation of the form where T is the sampling period and (3. the only assumption in our development is that piecewise constant function of time. one has . Discretization of Linear Stationary Systems As just discussed. These include the discretization of the analytic solution scheme for linear stationary systems and general numerical integration techniques that can be adapted to any system of interest (i. the linearized system is given as These linear stationary systems represent linear approximations to the original system (about different initial states). eqn. nonstationary and non-linear).44) is often written simply as and are constant matrices. The basic goal of the discretization process is to convert the standard continuous linear stationary state equations to discrete form. In general there are two good approaches used in computer simulations of high order dynamic systems. Our goal here is to derive explicit To accomplish this transformation. can be written as a . forcing function is constant over the kth interval. In fact. matrices are known. That is. These expressions represent a discrete recurrence relationship that can be evaluated quite easily on the computer if the and expressions for these matrices. recall that the solution to the continuous linear stationary problem is Letting t = (k+1)T and t0 = kT.e. the computer implementation of any potential solution scheme is usually a prerequisite for the analysis and simulation of realistic systems. Therefore. For convenience. we must make an assumption concerning the behavior of .

. Thus.45). one has with Note that is similar to and they both can be generated within the same routine with little can be found via eqns. additional effort. (3.Introducing a new variable and one has such that or with Since our final result is By comparison with eqn.49). Recall that If is expanded in a similar manner. explicit expressions for the and matrices are and Another form for may be more appropriate if one plans to use the infinite series expansion for generating a numerical result for the matrix exponential. (3.48) or (3.

A possible solution is to use the Euler method to get a first guess for xk+1 and fk+1 and then use this guess to get a better estimate of xk+1.46) . (3. Our goal will be to give a simple illustration that introduces the proper terminology and describes the basic concept behind all one-point numerical integration methods. the numerical simulation of the system can proceed using the recursion relation given in eqn. Note that this method gives an exact solution assuming is indeed constant within the sampling interval T. This is a relatively crude approximation but. (3. one assumes that the right hand side of eqn. The algorithm implied by eqns. (3. this simple scheme can give reasonable results. The advantage of numerical integration methods is that they can easily handle time-varying systems and relatively complicated nonlinear problems.51) gives or Thus. Numerical Integration of the State Equations An alternate solution technique to using the matrix exponential approach is to simply integrate the defining state equations. This gives the following recurrence relation.51) is constant over some small time interval . integrating eqn. This crude Predictor-Corrector scheme can be summarized as follows: . The methods presented here are intended only as an illustration of the basic methodology. Euler Method (Scalar Case) As a starting point. The problem with eqn. and these techniques are not normally implemented as derived. the Euler and Modified Euler methods. if is chosen sufficiently small. they are quite inefficient relative to some of the more advanced techniques. Modified Euler Method (Scalar Case) A somewhat better estimate for integrating the defining equation over some specified is to assume that f(x.(3. consider the general first-order differential equation In the Euler method. With this condition.53) is that we need xk+1 to calculate fk+1.45). we will look at the two simplest methods available.50) is relatively straightforward to implement on the computer.u. the problem has been converted to a recurrence relation for xk+1 in terms of xk and the function evaluated with the solution at time tk. Matlab's implementation of the discrete solution for LTI systems is roughly similar to this algorithm.t) varies linearly over the given step. (3. Although these methods present the basic concepts. (3. As a brief introduction to numerical integration.In either case. once the matrices and have been generated.

For the solution of several state equations. the choice of becomes even more . one only inputs a desired tolerance level and a variable integration step is computed that will satisfy the specified error criterion. In most current algorithms. .Predictor Step Corrector Step where with x'k+1 representing a first estimate (prediction) of the value for the dependent variable at tk+1 and xk+1 being the best estimate (correction) for this time point. but illustrative example of a predictor-corrector numerical integration scheme. . one has the following expressions: Euler Method (Matrix Case) where Modified Euler Method (Matrix Case) Predictor Step Corrector Step where The most important part of the above simple schemes is the choice of an appropriate time interval. By analogy to the scalar problem. Other refinements such as adaptive control/updating of the integration step. can be done by addressing the error in the predictor and corrector steps. In this case we desire the solution of a general system of first order equations. The above schemes for the scalar problem can be easily generalized for solution of large systems of equations. The modified Euler method is a simple.

As a specific example. where x1(0) and x2(0) represent the initial conditions for the system. Example 3. From Kirchoff’s voltage law.important and difficult. The more advanced schemes usually address this concern by automatically adjusting as needed to meet user specified accuracy requirements. 3. one has where Also. Substituting these relationships into the balance equation gives . consider the simple series RLC circuit shown in Fig. we have where ea(t) is the applied voltage and the voltage drops across the individual components are given by where i(t) is the current in the loop. "Adaptive Predictor-Corrector" methods are the norm for performing realistic time domain simulations.1.6 An Example Illustrating Various Solution Schemes A general 2nd order linear stationary system can be given as Using the general recipe for converting nth order systems into state form. since some state variables may vary rapidly while others are slowly varying functions of time. Thus.

The sensitivity of i(t) to changes in these parameters can also be addressed. Let ea(t) be a step input of 10 volts. To illustrate the various solution techniques. and C = 0. u(t) = 10 volts for all t > 0.This combined differential and integral balance equation is put into standard differential form by differentiating each term. i(t). 2. ea(t). A brief overview of each method is given below. R = 100 ohms. Solution Method A For a step input. or Comparing this system to the general representation for a 2nd order LTI system. versus time. L = 0. and y(t) is the resultant current. Thus. Continuous analytical solution using the closed form representation of Discretization of the LTI system Numerical integration of the state equations All three solution schemes were implemented in Matlab within files LTIDEMO1.M. let’s assume the following: 1.1 henry. the analytical solution for a LTI system can be written as This expression can be simplified as follows: . the standard state space representation for this specific system is where and and u(t) is the input voltage. 4. let’s perform a time domain simulation for this system using three different methods: A. 3.M and SSEQN1. For specificity in the numerical solutions. C. we have Thus.001 farad. For the reference case. B.

T) where Y and X contain the output and state vector time domain responses in a 3-D array format. Solution Method B The discrete solution of the LTI state equations is incorporated as part of Matlab’s Control Toolbox. respectively.D) This creates an LTI object named sys that can be manipulated within several other Matlab functions. In the second form. This toolbox has a whole series of functions for the analysis of linear stationary systems using the same terminology developed in these notes. the T vector is specified by the user and passed into Matlab’s step function. Finally.B. In the first form given above. In Matlab 5. for example. For this situation the ss command is used as follows (see Matlab’s help file for function ss): sys = ss(A. the number of pages (the length of the 3rd dimension) is equal to the number of inputs to the system.3.2 and 3.C. there is a 2-D matrix for each system input. The time domain solutions for the nominal set of parameters given above and for the case where R = 10 ohms are plotted in Figs.or where. For the case of a unit step input.T. in the last manipulation. . impulse . one has [Y.X] = step(sys. Note that R = 100 ohms gives and overdamped response and an underdamped solution is obtained for R = 10 ohms. The Y array has as many columns as outputs and X has as many columns as states (i. This behavior can be explained simply by computing the eigenvalues for the two cases.0 and higher a new object-oriented approach to working with systems was implemented. 3.X] = step(sys) or [Y. the order of the system). we used that fact that and commute. Note that Matlab has similar functions. Matlab defines an LTI state-space object via knowledge of the matrices from the standard state-space representation. This To implement this last expression we used Sylvester’s Theorem to evaluate required that the eigenvalues be computed from All other matrix manipulations were completed directly within Matlab. Thus. the sample period and the number of time points in the T vector is determined automatically by Matlab.e. The number of rows in Y and X is determined by the number of time points in the equally-spaced time vector T. In particular.T.

For the current RLC series circuit simulation with a step input.47) and (3. Note there that the time vector is determined automatically within ode23 and it is usually not evenly spaced because of the adaptive step control algorithm that is used. the call to ode23 should resemble the following. The student is referred to the second part of LTIDEMO1. and it can be specialized for any particular case of interest. is clearly the easiest to use since the problem fits exactly into the LTI class of problems. . (3. if the time domain input function is a unit impulse or a general input vector. sseqn1. This can be seen by comparing the results in Figs. as expected. c2d.2 and 3. impulse and lsim routines were designed to easily treat LTI systems.T). [T.T. which simply implements the recursive expression given in eqn. The results from Method C.tf].10*B.M). (3. Solution Method C The last method to be highlighted in this example is the numerical integration technique implemented with Matlab’s ode23 routine. the solutions using Method B are identical with those from Method A.X] = ode23(‘sseqn1’. It then calls ltitr (Linear Time Invariant Time Response). except for possible control of the user-specified error tolerance. converts the continuous state space system into a discrete state space representation by computing the and matrices given in eqns. The outputs from ode23 includes a time vector containing the discrete time points where the state is evaluated. [Y. since there is only a single input quantity and its strength is 10 units (and the default is for a unit step input). In the current case. For nonlinear or variable coefficient systems. this function is quite straightforward as seen in SSEQN1. As expected. and options is an ODE options structure within Matlab that allows the user to control several options within the ODE numerical integration routine (see function odeset for the various options that can be adjusted).[to. 3. This routine applies an adaptive step control algorithm by obtaining error estimates using two Runge Kutta (RK) predictions of different order.45). 3.C.and lsim.X] = step(sys. and Matlab’s ss. Method B. the discrete solution method. An overview of how to use the ode23 routine in Matlab can be obtained by simply typing help ode23 at the Matlab prompt (this procedure is the best way to learn how to use any Matlab function).48) using Matlab’s built-in matrix exponential routine.M.3. expm. respectively. and the state vector in a matrix whose columns are the various elements of the state versus time. step. The ode23 function uses a 2nd and 3rd order RK set for medium accuracy. points to the function routine that evaluates that right hand side of the state balance equation at each time point.2 and 3. In the current example. where to and tf are the initial and final integration times. The first one. and to Figs. the appropriate calling sequence is sys = ss(A. xo represents the initial condition of the state vector. The Matlab m-file that implements the step function actually call two other m-files.xo. with a sampling time determined by the constant interval width in vector T.options).M for the details of the Matlab implementation. The default options are satisfactory for many cases. are identical to those from the other techniques. The function name. For the specific RLC circuit of interest in this example. This routine is supplied by the user. the numerical integration technique with the ode23 routine would be used (with some modification to SSEQN1.3 for displays of the output responses using Method B.D).

Sign up to vote on this title

UsefulNot useful- Ball&Beam 01
- Introduction Simulation Techniques
- 2013_2014_report1_copy (1)
- Fcla Draft Solutions
- motor drive with flexible shaft control system
- 9 Some Mathematical Tools for Spreadsheet Calculations
- 0810.1821v2
- VTU Syllabus for Computer Science
- m054_B+DiP_exs.ps !
- Mol. Phys (ginoza)
- TUTORIAL PROBLEMS IN NUMERICAL METHODS
- State-Space System Identification-Toward MIMO
- Finite Mathematics
- 2011 Mathematical Studies Examination Paper
- Condensed Matter I chapter8
- Matlab Essentials
- Modern Matrix Algebra
- Numerical Solution of Two Point Boundary Value Problems_Herbert
- Multivariate Laboratory Exercise II
- Linear Algebra
- mathematical modelling lecture
- DELT V1
- L10_IntroToMatrices
- Nonlinear and Adapative Control
- Doc Annexe
- Yearly Lesson Plan Mathematics Form 5
- port optimisation
- 00535671
- Mechanical Engineering - Me Syllabi --> Mechanical
- Parameters Identification of non linear DC motor
- System Dynamics Ch3 the State Space Equations and Their Time Domain Solution