Systems Described by Differential/Difference Equations

1.3 Systems Described by Differential/Difference Equations

1.3.1 Differential/Difference Equation and System Function

The time-domain input-output relationships of continuous-time/discrete-time sys- tems are often described by linear constant-coefficient differential/difference equa- tions that are set up based on underlying physical laws or design specifications to make it perform desired operations:

d i y (t )

d j x (t )

[n − j] with the initial conditions

with the initial conditions

y [n 0 ], y[n 0 − 1], · · · , y[n 0 − N + 1] With zero initial conditions, this can be transformed to make the system or transfer

y (t 0 ), y ′ (t 0 ), · · · , y (N −1) (t 0 )

function as

A (s)Y (s) = B(s)X(s);

A [z]Y [z] = B[z]X[z]; Y (s)

X [z] (1.3.1a) = A [z] (1.3.1b)

Note the following: - The poles/zeros of the system function G(s) or G[z] are the values of s or z at which its denominator/numerator becomes zero.

32 1 Signals and Systems - The degree N of the denominator A(s)/ A[z] of the system function G(s)/G[z] is

sense that its output depends on not only the input but also the previous output; otherwise, it is said to be non-recursive or memoryless and its output depends only on the input.

- Especially, discrete-time recursive and non-recursive systems are called IIR (i nfinite-duration i mpulse r esponse) and FIR ( f inite-duration i mpulse r esponse) systems, respectively since the duration of the impulse response of recursive/non- recursive system is infinite/finite, respectively.

1.3.2 Block Diagrams and Signal Flow Graphs

Systems are often described by graphical means such as block diagrams or sig- nal flow graphs. As an example, let us consider an RC circuit or its equivalent depicted in Fig. 1.16(a). We can apply Kirchhoff’s current law to write the node equation, take its Laplace transform with zero initial conditions, and find the system function as

R Input voltage

– (a) An RC circuit and its equivalent with the voltage-to-current source transformation V i (s)

v i –v o R i [n] C (1–z ) v o [n] (b1) Block diagram representation

(b2) Block diagram representation Tz –1

I [z] C (1–z –1 ) V o [z] v i (t)

V i (s) adder 1/R I (s) 1/Cs

V o (s)

V i [z] adder 1/R

–1 (c1) Signal flow graph representation

(c2) Signal flow graph representation V i (s) adder 1/R I (s) 1/C

V i [z] adder T/RC z –1 V o [z] –1

s –1 V o (s)

–1 (d1) State diagram

(d2) State diagram Fig. 1.16 Block diagram, signal flow graph, and state diagram representations of a system

1.3 Systems Described by Differential/Difference Equations 33 dv o (t )

v o (t ) v i (t )

C dt + R =

(1.3.2a) R

Laplace transform

R (s) → G(s) = V i = (s) RCs + 1 (1.3.3a)

B.7(5)

We may replace the derivative dv o (t )/dt with its difference approximation dv o (t )

v o ((n + 1)T ) − v o (nT ) v o [n + 1] − v o [n] = dt ∼

T with sampling interval T to discretize the differential equation into a difference

equation, take its z -transform with zero initial conditions, and find the system function as

z−transform

V i [z] = RC (z − 1)/T + 1 Fig. 1.16(b1)/(b2) show the block diagram representing the continuous-time/

→ G[z] =

(1.3.3b)

discrete-time system whose input-output relationship is described by Eqs. (1.3.2a)/ (1.3.2b) in the time domain and (1.3.3a)/(1.3.3b) in the s- / z -domain. Figure 1.16(c1)/(c2) and (d1)/(d2) show their signal flow graph representations where a branch from node j to node i denotes the causal relationship that the signal j is multiplied by the branch gain and contributes to the signal i . Espe- cially, Fig. 1.16(d1) is called a continuous-time state diagram since all branch gains are constants or s −1 (denoting an integrator). Likewise, Fig. 1.16(d2) is called a discrete -time state diagram since all branch gains are constants or z −1 (denoting a delay T ).

Since signal flow graphs are simpler to deal with than block diagrams, we will rather use signal flow graphs than block diagrams. A signal flow graph was origi- nally introduced by S.J. Mason as a graphical means of describing the cause-effect relationship among the variables in a set of linear algebraic equations. It consists of nodes connected by line segments called branches. Each node represents a signal (variable), whose value is the sum of signals coming along all the branches from other nodes and being multiplied by the branch gain. Every branch has the gain and direction that determine or are determined by the cause-effect relationship among the variables denoted by its nodes. Note that a branch with no gain indicated is supposed to have unity gain.

34 1 Signals and Systems For example, we consider the following set of linear equations:

y 2 =a 12 y 1 +a 32 y 3 ,

y 3 =a 23 y 2 +a 43 y 4 , y 4 =a 34 y 3 +a 44 y 4 +a 54 y 5 , y 5 =a 25 y 2 +a 35 y 3 +a 45 y 4

which describes the cause-effect relationship among the variables y 1 , y 2 , y 3 , y 4 , and y 5 with the causes/effects in the right/left-hand side, respectively. Figure 1.17 shows a signal flow graph representing the relationships described by this set of equations.

a 35 a 32 a 43 a 54

Input 1 Output node y 1 a 12 y 2 a 23 y 3 a 34 y 4 a 45 y 5 y 5 node

a 44 a 25

Fig. 1.17 A signal flow graph

1.3.3 General Gain Formula – Mason’s Formula

In this section we introduce Mason’s gain formula, which is applied to signal flow graphs to yield the overall gain from an input node to an output node. To understand how to use the formula, we need to know the following terms:

- Input Node (Source) : A node having only outgoing branches. - Output Node (Sink) : A node having only incoming branches.

(cf.) Note that, in contrast with the input node, the output node may not be clearly seen. Suppose we don’t have the dotted branch in the signal flow graph depicted in Fig. 1.17. In that case, if we regard y 5 as an output, we may draw a branch with unity gain from the node for y 5 so that the node appears to be an output node.

- Path: A continuous connection of branches traversed in the same direction. - Forward Path: A path connecting an input node to an output node along which

no node is encountered more than once. - Loop: A closed path that originates and terminates at the same node and encoun- ters no other node more than once. - Path Gain: The product of all the branch gains along a path. - Loop Gain: The path gain of a loop. - Non-touching: Having no nodes in common.

The gain formula states that the overall gain is

1.3 Systems Described by Differential/Difference Equations 35

m P m 3 +··· (1.3.5) where

with Δ = 1 −

N : Total number of forward paths from node y in to node y out M k : Path gain of the k th forward path

P mr : Gain product of the m th combination of r nontouching loops Δ k : Δ (Eq. (1.3.5)) for the part of the signal flow graph not touching the k th

forward path It may seem to be formidable to use at first glance, but is not so complicated in

practice since most systems have not so many non-touching loops. For example, we can apply Mason’s gain formula to the signal flow graph depicted in Fig. 1.18 as follows:

Input 1 Output node y 1 a 12 y 2 a 23 y 3 a 34 y 4 a 45 y 5 y 5 node

a 44

a 25

Fig. 1.18 A signal flow graph with its loops denoted by closed curves

N = 3 (the total number of forward paths from node y 1 to node y 5 ) M 1 =a 12 a 23 a 34 a 45 ,Δ 1 = 1 for the forward path y 1 −y 2 −y 3 −y 4 −y 5

M 2 =a 12 a 23 a 35 ,Δ 2 =1−a 44 for the forward path y 1 −y 2 −y 3 −y 5 M 3 =a 12 a 25 ,Δ 3 = 1 − (a 34 a 43 +a 44 ) for the forward path y 1 −y 2 −y 5 Δ = 1 − (a 23 a 32 +a 34 a 43 +a 44 +a 45 a 54 +a 35 a 54 a 43 +a 25 a 54 a 43 a 32 )

+ (a 23 a 32 a 44 +a 23 a 32 a 45 a 54 )

1.3.4 State Diagrams

Now we introduce a special class of signal flow graphs, called the state diagram or state transition signal flow graph , in which every branch has a gain of constant

36 1 Signals and Systems or s −1 (integrator)/z −1 (delay). This is very useful for the purposes of system

analysis, design, realization, and implementation. Systems represented by the state diagram need the following three basic software operations or hardware elements for implementation:

- addition(adder)

- addition

- multiplication(amplifier) - multiplication - integration(integrator) s −1

- delay (z −1 )/advance (z) It is good enough to take a look at the following examples. Example 1.4a Differential Equation and Continuous-Time State Diagram

Figure 1.19(a) and (b) show the controllable and observable form of state dia- grams, respectively, both of which represent the following differential equation or its Laplace transform (see Problem 1.9):

y ′′ (t ) + a 1 y ′ (t ) + a 0 y (t ) = b 1 u ′ (t ) + b 0 u (t ) with zero initial conditions (E1.4a.1)

(E1.4a.2) Example 1.4b Difference Equation and Discrete-Time State Diagram

(s 2 +a

1 s+a 0 )Y (s) = (b 1 s+b 0 )U (s)

Figure 1.20(a)/(b)/(c)/(d) show the direct I/transposed direct I/direct II/transposed direct II form of state diagrams, respectively, all of which represent the following difference equation or its z -transform (see Problems 1.8 and/or 8.4):

y [n + 2] + a 1 y [n + 1] + a 0 y [n] = b 1 u [n + 1] + b 0 u [n] with zero initial conditions (E1.4b.1)

(z 2 +a 1 z+a 0 )Y [z] = (b 1 z+b 0 )U [z]

(E1.4b.2)

x 1 b 0 Y (s) –a 1 : Signal distribution point

–a 0 : Adder(addition) s –1 : Integrator (a) Controllable canonical form of state diagram

: Amplifier (multiplication) b

(b) Observable canonical form of state diagram Fig. 1.19 State diagrams for a given differential equation y ′′ (t)+a 1 y ′ (t)+a 0 y (t) = b 1 u ′ (t)+b 0 u (t)

1.3 Systems Described by Differential/Difference Equations 37 u [n]

y [n] U [z]

x 4 [n+1]

x 2 [n+1]

x 3 [n+1]

x 1 [n+1]

x 2 [n+1]

x 4 [n+1]

x [n+1] 0 b 3 0 (a) Direct I form

–a

x 1 [n]

b 1 0 [n+1] 0 –a

(b) Transposed direct I form u [n]

x 2 [n] y [n] U [z]

x 2 [n+1]

z –1 –a 1 b 1 x 2 [n+1]

x 1 [n+1] b 1 –a z

z –1 1 [n] x 1 [n]

–a 0 x 1 [n] b 0 b 0 x 1 [n+1] –a 0 (c) Direct II form

(d) Transposed direct II form

: Signal distribution point : Adder(addition)

z –1 : Delay b b : Amplifier (multiplication) : Amplifier (multiplication)

Fig. 1.20 State diagrams for a given difference equation y[n + 2] + a 1 y [n + 1] + a 0 y [n] = b 1 u [n + 1] + b 0

For example, we can write the state and output equations for the state diagram of Fig. 1.20(c) as

1 [n + 1] 0 1 1 [n]

[n] (E1.4b.3) x [n + 1]

−a 0 −a 1 x 2 [n]

y [n] = b 1 x 2 [n] + b 0 x 1 [n]

(E1.4b.4)

We can apply Eq. (8.3.2b) with Eqs. (1.4b.3,4) or Mason’s gain formula for Fig. 1.20(c) to obtain the transfer function G[z] = Y [z]/U [z] or equivalently, the

input-output relationship (E1.4b.2). The digital filter or controller may be realized either by using a general-purpose computer or a special digital hardware designed to perform the required computa- tions. In the first case, the filter structure represented by the state diagram may be thought of as specifying a computational algorithm where the number of z or z −1 is proportional to the required memory size. In the latter case, it may be regarded as specifying a hardware configuration where z −1 denotes a delay element like a flip- flop. Note that, as shown in the above examples, the structure to solve or implement

a given differential/difference equation is not unique and it can be rearranged or modified in a variety of ways without changing the overall input-output relationship or system function.

38 1 Signals and Systems