72 CHAPTER 3. FUNCTIONAL DESCRIPTION OF Xµ
3.2.1 Dynamic Systems
Xmath has a dynamic system data object which specifies a dynamic system in terms of
A,B,Cand Dmatrices. The dynamic equations of the system are,
˙x(t)=Ax(t)+Bu(t),
y(t)=Cx(t)+Du(t),
in the continuouscase, and
x(kT +T)=Ax(kT)+Bu(kT),
y(kT)=Cx(kT)+Du(kT),
in the discrete time case. The discrete time sample period, T, is stored as part of the
data object. The user can label the system inputs, u(t), outputs, y(t), and states,x(t).
Also residing within the Xmath state-space object is the initial state, x(0). Thisis used
primarily for time response calculations. It is debatable whether or not the initial state
is an intrinsic attribute of the system as one frequently changes it for simulation. It has
the advantage of reducing the time response calculation to a simple multiplication and it
can easily be changed without accessing all of the other system variables.
The Xmath core functionssystem and abcd are used to createstate-space systems. The
system function is also used to specify the initial state (and, as discussed in the next
section, any other system attributes). The following example puts together a simple
two-statesystem.
# Specify the A, B,C&Dmatrices
a = [-.15,.5;-.5,-.15]
b = [.2,4;-.4,0]
c = [5,5]
d = [.1,-.1]
sys = system(a,b,c,d)
[a,b,c,d] = abcd(sys)
Simple systems are easily generated as transfer functions. To achieve this we simply
define the numerator and denominator polynomials and then divide one by the other.