You are on page 1of 8

System Dynamics III. The State Space Equations and Their Time Domain Solution Example 3.

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, one has

where

Also,

where x1(0) and x2(0) represent the initial conditions for the system. As a specific example, consider the simple series !" circ#it shown in $ig. %.1.

21&

$rom 'irchoff(s voltage law, we have

where ea(t) is the applied voltage and the voltage drops across the individ#al components are given by

where i(t) is the c#rrent in the loop. )#bstit#ting these relationships into the balance e*#ation gives

+his combined differential and integral balance e*#ation is p#t into standard differential form by differentiating each term, or

"omparing this system to the general representation for a 2nd order !+, system, we have

+h#s, the standard state space representation for this specific system is

21-

where

and

and #(t) is the inp#t voltage, ea(t), and y(t) is the res#ltant c#rrent, i(t), vers#s time. $or specificity in the n#merical sol#tions, let(s ass#me the following. 1. $or the reference case, 0.001 farad. / 100 ohms, ! / 0.1 henry, and " /

2. !et ea(t) be a step inp#t of 10 volts. +h#s, #(t) / 10 volts for all t 0 0. %. +he sensitivity of i(t) to changes in these parameters can also be addressed. 1. +o ill#strate the vario#s sol#tion techni*#es, let(s perform a time domain sim#lation for this system #sing three different methods. A. "ontin#o#s analytical sol#tion #sing the closed form representation of 2. 3iscreti4ation of the !+, system ". 5#merical integration of the state e*#ations

216

All three sol#tion schemes were implemented in 7atlab within files !+,38791.7 and ))8:51.7. A brief overview of each method is given below. )ol#tion 7ethod A $or a step inp#t, the analytical sol#tion for a !+, system can be written as

+his expression can be simplified as follows.

or

where, in the last manip#lation, we #sed that fact that comm#te.

and

+o implement this last expression we #sed )ylvester(s +heorem to eval#ate . +his re*#ired that the eigenval#es be comp#ted from

All other matrix manip#lations were completed directly within 7atlab. +he time domain sol#tions for the nominal set of parameters given above and for the case where / 10 ohms are plotted in $igs. %.2 and %.%, respectively. 5ote that / 100 ohms gives and over;damped response and an #nder;damped sol#tion is obtained for / 10 ohms. +his behavior can be
220

explained simply by comp#ting the eigenval#es for the two cases. )ol#tion 7ethod 2 +he discrete sol#tion of the !+, state e*#ations is incorporated as part of 7atlab(s "ontrol +oolbox. +his toolbox has a whole series of f#nctions for the analysis of linear stationary systems #sing the same terminology developed in these notes. ,n 7atlab <.0 and higher a new ob=ect;oriented approach to wor>ing with systems was implemented. ,n partic#lar, 7atlab defines an !+, state;space ob=ect via >nowledge of the matrices from the standard state;space representation. $or this sit#ation the ss command is #sed as follows (see 7atlab(s help file for f#nction ss). sys = ss A!"!#!D$ +his creates an !+, ob=ect named sys that can be manip#lated within several other 7atlab f#nctions. $or the case of a #nit step inp#t, for example, one has %&!T!'( = step sys$ or %&!T!'( = step sys!T$ where & and ' contain the o#tp#t and state vector time domain responses in a %;3 array format. +he n#mber of rows in & and ' is determined by the n#mber of time points in the e*#ally; spaced time vector T. +he & array has as many col#mns as o#tp#ts and ' has as many col#mns as states (i.e. the order of the system). $inally, the n#mber of pages (the length of the %rd dimension) is e*#al to the n#mber of inp#ts to the system. +h#s, there is a 2;3 matrix for each system inp#t. ,n the first form given above, the sample period and the n#mber of time points in the T vector is determined a#tomatically by
221

7atlab. ,n the second form, the T vector is specified by the #ser and passed into 7atlab(s step f#nction. 5ote that 7atlab has similar f#nctions, impulse and lsim, respectively, if the time domain inp#t f#nction is a #nit imp#lse or a general inp#t vector. $or the specific !" circ#it of interest in this example, the appropriate calling se*#ence is sys = ss A!)*+"!#!D$, %&!T!'( = step sys!T$, since there is only a single inp#t *#antity and its strength is 10 #nits (and the defa#lt is for a #nit step inp#t). +he 7atlab m;file that implements the step f#nction act#ally call two other m;files. +he first one, c-d, converts the contin#o#s state space system into a discrete state space representation by comp#ting the and matrices given in e*ns. (%.1&) and (%.1-) #sing 7atlab(s b#ilt; in matrix exponential ro#tine, expm, with a sampling time determined by the constant interval width in vector T. ,t then calls ltitr (!inear +ime ,nvariant +ime esponse), which simply implements the rec#rsive expression given in e*n. (%.1<). As expected, the sol#tions #sing 7ethod 2 are identical with those from 7ethod A. +he st#dent is referred to the second part of !+,38791.7 for the details of the 7atlab implementation, and to $igs. %.2 and %.% for displays of the o#tp#t responses #sing 7ethod 2. )ol#tion 7ethod " +he last method to be highlighted in this example is the n#merical integration techni*#e implemented with 7atlab(s ode-3 ro#tine. +his ro#tine applies an adaptive step control algorithm by obtaining error estimates #sing two #nge '#tta ( ') predictions of different order. +he ode-3 f#nction #ses a 2nd and %rd order ' set for medi#m acc#racy. An overview of how to #se the ode-3 ro#tine in 7atlab can be obtained by
222

simply typing help ode-3 at the 7atlab prompt (this proced#re is the best way to learn how to #se any 7atlab f#nction). ,n the c#rrent case, the call to ode-3 sho#ld resemble the following, %T!'( = ode-3 .sseqn)/!%to!t0(!xo!options$, where to and t0 are the initial and final integration times, xo represents the initial condition of the state vector, and options is an 938 options str#ct#re within 7atlab that allows the #ser to control several options within the 938 n#merical integration ro#tine (see f#nction odeset for the vario#s options that can be ad=#sted). +he defa#lt options are satisfactory for many cases, except for possible control of the #ser;specified error tolerance. +he o#tp#ts from ode-3 incl#des a time vector containing the discrete time points where the state is eval#ated, and the state vector in a matrix whose col#mns are the vario#s elements of the state vers#s time. 5ote there that the time vector is determined a#tomatically within ode-3 and it is #s#ally not evenly spaced beca#se of the adaptive step control algorithm that is #sed. +he f#nction name, sseqn), points to the f#nction ro#tine that eval#ates that right hand side of the state balance e*#ation at each time point. +his ro#tine is s#pplied by the #ser, and it can be speciali4ed for any partic#lar case of interest. $or the c#rrent !" series circ#it sim#lation with a step inp#t, this f#nction is *#ite straightforward as seen in ))8:51.7. +he res#lts from 7ethod ", as expected, are identical to those from the other techni*#es. +his can be seen by comparing the res#lts in $igs. %.2 and %.%. ,n the c#rrent example, 7ethod 2, the discrete sol#tion method, is clearly the easiest to #se since the problem fits exactly into the !+, class of problems, and 7atlab(s ss, step, impulse and lsim ro#tines were designed to easily treat !+, systems. $or nonlinear or variable coefficient systems, the n#merical integration techni*#e with the ode-3 ro#tine wo#ld be #sed (with some modification to ))8:51.7).

22%

221

You might also like