Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology...

31
Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Transcript of Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology...

Page 1: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Radu Grosu Vienna University of Technology

Hybrid Systems Modeling, Analysis and Control

Lecture 3

Page 2: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Solution for Systems with Input

Differential equations: !x = Ax +Bu, y = Cx, x(0)=x0

Output y

Integrator

Next State x

x(t) = x(τ )dτ

0

t

∫ , x0

!x(t) x(t)

y(t)

A x(t)+Bu(t)

C x(t)

u(t)

x(t)

Page 3: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Solution for Systems with Input

!x = Ax +Bu, x(0) = x0

y = Cx

Differential equations:

The solution is: x(t) = eAtx0 + eA(t−τ)

0

t

∫ B u(τ) dτ

Proof:

1) !x = d( eAtx0 + eAt e-Aτ

0

t

∫ B u(τ) dτ ) / dt

2) x(0) = eA0x0 = e0x0 = Ix0 = x0

Fundamental theorem

of calculus

= AeAtx0 + AeAt ( e-Aτ

0

t

∫ B u(τ) dτ ) + eAte-AtB u(t) = Ax +Bu

Derivative Of a product

Page 4: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

A =

2 11 2⎡

⎣⎢

⎦⎥ , B =

11⎡

⎣⎢⎤

⎦⎥ , x0 =

10⎡

⎣⎢

⎦⎥ , !x = Ax+B, x(0) = x0

Example: Fixpoint Computation

1. Homog. sol.: x(t) = eAtx0 = BeΛtB-1x0 =

et e3t

-et e3t

⎣⎢

⎦⎥B-1x0

2. General solution:

x(t) =

et e3t

-et e3t

⎣⎢

⎦⎥

10⎡

⎣⎢

⎦⎥

B

+ et−τ e3( t−τ)

-et−τ e3( t−τ)

⎣⎢

⎦⎥

0

t

∫11⎡

⎣⎢⎤

⎦⎥

B

x(t) = 1

2 et +e3t

-et +e3t

⎣⎢

⎦⎥ −

13

e3( t−τ)

e3( t−τ)

⎣⎢

⎦⎥

0

t

= 1

6 3et +5e3t - 2-3et +5e3t - 2

⎣⎢

⎦⎥

Page 5: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Solution for Systems with Input

Difference equations: x(n+1) = Ax(n) +Bu(n), y(n) = Cx(n), x(0)=x0

Output y

Register

Next State x

x(n +1) = x(n), x0

x(n +1) x(n)

y(n)

A x(n)+Bu(n)

C x(n)

u(n)

x(n)

Page 6: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Solution for Systems with Input

x(n +1) = Ax(n) +Bu(n), x(0) = x0

y = Cx(n)

Difference equations:

The solution is: x(n) = Anx0 + An-1-τ

τ=0

n-1

∑ B u(τ)

Proof:

1) x(n +1) = A ( Anx0 + An-1-τ

B u(τ)

τ=0

n-1

∑ ) +B u(n)

2) x(0) = A0x0 = Ix0 = x0

= Ax(n) +Bu(n)

Matrix: Anx0 = B diag(λ1n,...,λn

n) B−1 x0 = B diag(λ1

n,...,λnn) (x0)

B

Page 7: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

A =

2 11 2⎡

⎣⎢

⎦⎥ , B =

11⎡

⎣⎢⎤

⎦⎥ , x0 =

10⎡

⎣⎢

⎦⎥ , x(n +1) = Ax(n)+B, x(0) = x0

Example: Fixpoint Computation

1. Homog. sol.:

2. General solution:

x(n) =

1 3n

-1 3n

⎣⎢

⎦⎥

10⎡

⎣⎢

⎦⎥

B

+ 1 3n-1-τ

-1 3n-1-τ

⎣⎢

⎦⎥

11⎡

⎣⎢⎤

⎦⎥

τ=0

n-1

∑B

x(n) = 1

2 1+3n

-1 +3n

⎣⎢

⎦⎥ + 3n-1 3-τ

3-τ

⎣⎢

⎦⎥

τ=0

n-1

∑ =

3n

3n -1

⎣⎢

⎦⎥

x(t) = Anx0 = BΛnB-1x0 =

1 3n

-1 3n

⎣⎢

⎦⎥B-1x0

Page 8: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Impulse and Delay

Unit-delay function: D(x) (n) ! x(n-1)

Impulse function: δ(n) ! (n = 0) ? 1 : 0

Consequence: x = x(τ)

τ=0

∑ Dτ (δ)

Signal representation: x(n) = x(τ)

τ=0

∑ δ(n-τ)

x(τ) δ(n-τ)

n = τ

x

Page 9: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Time Invariance

Definition: A system f is called time invariant if ∀k,x:

Signal delayed by k

Response delayed by k

f(Dk (x)) = Dk (f(x)) or alternatively (f !Dk )(x) = (Dk ! f)(x)

Theorem: The delay Dk is linear and time invariant:

Dk (ax + by) = aDk (x) + bDk (y) (linearity)Dk (Dn(x)) = Dk+n(x) = Dn(Dk (x)) (time invariance)

Page 10: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

The Z-Transform (my definition)

(2) Z{δ}xx = 1-1Z{x} (impulse transform)

where z is a complex variable. Z{x} is the Z-transform of x.

Consequences of this definition:

Z{x} = x(n) Z{Dn(δ)} = x(n) z−n

n=0

∑n=0

∑ standard definition of Z

Definition: A linear, continuous function Z satisfying:

(1) Z{D(x)} = z-1Z{x} (delay transform)

Z{x} = F(z)xxxxx is a function of the complex variable z

Z{x} = Xxxxxx Z{x} is also written simply as X

Page 11: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Convergence

Theorem: Assume that |x(n)| ≤ kσn for n = 0,1,2,..., for some real constants k > 0 and σ ≥ 0. Then F(z) exists for all σ < |z|.

= k 1

1− (σ / |z|)

Z{x} = x(n) z−n

n=0

∑ ≤ k (σ / |z|)n

n=0

Proof:

= k(σ / | z |)*

Page 12: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Z-Transform Properties

PowerMult: Z{ax(n) + by(n)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

Linearity: Z{ax(n) + by(n)} = aZ{x(n)} + bZ{y(n)}

PowerMult: Z{x(n)an} = F(z / a)

LeftShift: Z{x(n +k)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

RightShift: Z{x(n - k)} = z-kF(z)

Convolution: Z{x(n)∗y(n)} = Z{x(n)} ⋅ Z{y(n)}

Page 13: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Z-Transform Properties

PowerMult: Z{ax(n) + by(n)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

Linearity: Z{ax(n) + by(n)} = aZ{x(n)} + bZ{y(n)}

PowerMult: Z{x(n)an} = F(z / a)

LeftShift: Z{x(n +k)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

RightShift: Z{x(n - k)} = z-kF(z)

Convolution: Z{x(n)∗y(n)} = Z{x(n)} ⋅ Z{y(n)}

Page 14: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Z-Transform Properties

PowerMult: Z{ax(n) + by(n)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

Linearity: Z{ax(n) + by(n)} = aZ{x(n)} + bZ{y(n)}

PowerMult: Z{x(n)an} = F(z / a)

LeftShift: Z{x(n +k)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

RightShift: Z{x(n - k)} = z-kF(z)

Convolution: Z{x(n)∗y(n)} = Z{x(n)} ⋅ Z{y(n)}

Page 15: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Z-Transform Properties

PowerMult: Z{ax(n) + by(n)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

Linearity: Z{ax(n) + by(n)} = aZ{x(n)} + bZ{y(n)}

PowerMult: Z{x(n)an} = F(z / a)

LeftShift: Z{x(n +k)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

RightShift: Z{x(n - k)} = z-kF(z)

Convolution: Z{x(n)∗y(n)} = Z{x(n)} ⋅ Z{y(n)}

Page 16: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Z-Transform Properties

PowerMult: Z{ax(n) + by(n)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

Linearity: Z{ax(n) + by(n)} = aZ{x(n)} + bZ{y(n)}

PowerMult: Z{x(n)an} = F(z / a)

LeftShift: Z{x(n +k)} = zkF(z) - zkx(0) - zk-1x(1) - ... - zx(k -1)

RightShift: Z{x(n - k)} = z-kF(z)

Convolution: Z{x(n)∗y(n)} = Z{x(n)} Z{y(n)}

Convolution: x ∗y ! x(n) Dn(y)n=0

∑ = Dn(x) y(n)n=0

Page 17: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

List of Z-Transforms

x(n) Z{x(n)}

(1) 1 z / (z -1)

(2) an z / (z - a)

(3) n z / (z -1)2

(4) nan z / (z - a)2

(5) n ≥ 1 ? an-1 : 0 1/ (z - a)

(6) n ≥ 1 ? Cn−1k−1an-1 : 0 1/ (z - a)k

(7) 0 ≤ n ≤ m ? 1 : 0 (1− zm) / zm−1(1- z)

(8) δ 1

Page 18: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Homogeneous Equation

Reduce the solution of LTI difference equations:

x(n +1) = Ax(n), y(n) = Cx(n), x(0) = x0

The choice of z and its power in Z{D(x)} = z-1Z{x}: •  An algebraically closed field that includes x(k), A,B,C. •  For example, if they belong to field R, choose field C.

to the easier solution of algebraic equations:

z X = AX + zx0, Y = C X ⇒ Y = C (I - z-1A)-1x0 = C(z-1A)*x0

Transfer Function

Page 19: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Conway Expansion

Partition matrix A as: A =

A11 A12

A21 A22

⎣⎢⎢

⎦⎥⎥

Then matrix A* is:

A* =

(A11 + A12A22* A21)

* A11* A12(A22 + A21A11

* A12)*

A22* A21 (A11 + A12A22

* A21)* (A22 + A21A11

* A12)*

⎣⎢⎢

⎦⎥⎥

Intuition: the entries of A* correspond to paths in

1 2 a11

a12

a21

a22

Page 20: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Conway Expansion in Fields

Partition matrix A as: A =

A11 A12

A21 A22

⎣⎢⎢

⎦⎥⎥

Then matrix A* = (I − A)-1 is:

A* =

(I - A11 - A12(I - A22)-1A21)-1 (I - A11)

-1A12(I - A22 - A21(I - A11)-1A12)-1

(I - A22)-1A21(I - A11 - A12(I - A22)-1A21)-1 (I - A22 - A21(I - A11)

-1A12)-1

⎣⎢⎢

⎦⎥⎥

Page 21: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Gaussian Elimination and A*

Consider the algebraic equation: X = AX + x0

x1 = a11x1 +a12x2 +1

x2 = a21x1 +a22x2

and vector: x0 =

10⎡

⎣⎢

⎦⎥ =

01⎡

⎣⎢

⎦⎥

Let matrix: A =

a11 a12

a21 a22

⎣⎢⎢

⎦⎥⎥

x1 = (1- a11 +a12(1- a22)-1a21)-1 = (a11 +a12a22

* a21)*

x2 = (1- a22)-1a21x1 = a22* a21x1

x1 = a11x1 +a12x2

x2 = a21x1 +a22x2 +1

x1 = (1- a11)-1a12x2 = a11

* a12x2

x2 = (1- a22 +a21(1- a11)-1a12)-1 = (a22 +a21a11

* a12)*

Page 22: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

A* =

1

1- a11 - a12

11- a22

a21

11- a11

a12

1

1- a22 - a21

11- a11

a12

11- a22

a21

1

1- a11 - a12

11- a22

a21

1

1- a22 - a21

11- a11

a12

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

A* Determinants And (I - A)-1

(A)* = 1

(1- a11)(1- a22) - a12a21

1- a22 a12

a21 1- a11

⎣⎢⎢

⎦⎥⎥

(A)* = adj(I - A)

det(I - A) = (I - A)−1

Page 23: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Consider matrix z-1A =

2z-1 z-1

z-1 2z-1

⎣⎢

⎦⎥ . Then matrix (z-1A)* is:

(z−1A)* =

1

1- 2z−1 - z-1 11- 2z−1 z-1

1

1- 2z−1 - z-1 11- 2z−1 z-1

z-1 11- 2z−1

1

1- 2z−1 - z-1 11- 2z−1 z-1

z-1 11- 2z−1 1

1- 2z−1 - z-1 11- 2z−1 z-1

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

Example

(z−1A)* =

1- 2z−1

(1- 2z-1)2 - z-2 z-1

(1- 2z-1)2 - z-2

z-1

(1- 2z-1)2 - z-2 1- 2z−1

(1- 2z-1)2 - z-2

⎢⎢⎢⎢

⎥⎥⎥⎥

Rational Function

=

z(z - 2)(z -1)(z - 3)

z(z -1)(z - 3)

z(z -1)(z - 3)

z(z - 2)(z -1)(z - 3)

⎢⎢⎢⎢

⎥⎥⎥⎥

Strict RF

Page 24: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Partial Fraction Expansion

Let

z(z - 2)(z -1)(z - 3)

Not strict. Divide:

Hence: z(z - 2)

(z -1)(z - 3)=1+ 2z - 3

(z -1)(z - 3)=1+ a

(z -1)+ b

(z - 3)

z2 − 4z + 3 z2 − 2z 1

z2 − 4z + 32z − 3

a = (2z − 3) / (z - 3)

z=1=1/ 2

b = (2z - 3) / (z -1)

z=3= 3 / 2

Therefore:

z(z - 2)(z -1)(z - 3)

=1+ 12(z -1)

+ 32(z - 3)

Page 25: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Partial Fraction Expansion

Let

z(z -1)(z - 3)

Strict so no need to divide.

a = z / (z - 3)

z=1= -1/ 2

b = z / (z -1)

z=3= 3 / 2

Hence z

(z -1)(z - 3)= a

(z -1)+ b

(z - 3)

Therefore

z(z -1)(z - 3)

= −12(z -1)

+ 32(z - 3)

Page 26: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Partial Fraction Expansion

(z−1A)* = 12

2+ 1z -1

+ 3z - 3

-1z -1

+ 3z - 3

-1z -1

+ 3z - 3

2+ 1z -1

+ 3z - 3

⎢⎢⎢⎢

⎥⎥⎥⎥

Z-1{(z−1A)* } = 1

2(n = 0)?2:0 + (n ≥1):1+ 3n : 0 (n ≥1):3n −1:0 (n ≥1)?3n −1:0 (n = 0)?2:0 + (n ≥1):1+ 3n : 0

⎣⎢

⎦⎥

Hence : Z-1{(z−1A)* } = 1

2 3n +1 3n −13n −1 3n +1

⎣⎢

⎦⎥

Page 27: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

A =

2 11 2⎡

⎣⎢

⎦⎥ , x0 =

10⎡

⎣⎢

⎦⎥ , x(n +1) = Ax(n), x(0) = x0

Example: Fixpoint Computation

The algebraic solution in transform domain is:

X = (I - z-1A)-1x0 = (z-1A)*x0

Hence the solution in time domain is:

x(n) = Z-1{(z-1A)*}x0

= 1

2 1+3n -1+3n -1+3n -1+3n

⎣⎢

⎦⎥

1 0⎡

⎣⎢

⎦⎥ = 1

2 1+3n

-1+3n

⎣⎢

⎦⎥

Page 28: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Zero Initial State

Reduce the solution of LTI difference equations:

x(n) = Ax(n -1) +Bu(n -1), y(n) = Cx(n), x(0) = 0

to the easier solution of algebraic equations:

X = A z-1 X +B z-1

U, Y = C X ⇒ Y/U = C (I - z−1A)-1 B z-1

Transfer Function

Page 29: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

A =

2 11 2⎡

⎣⎢

⎦⎥ , x0 =

10⎡

⎣⎢

⎦⎥ , C =

01⎡

⎣⎢

⎦⎥

T

, x(n +1) = Ax(n), y(n) = Cx(n), x(0) = x0

Block Diagrams

Transform: X = z-1AX + x0

x1

x2

⎣⎢⎢

⎦⎥⎥

=z-12 z-1

z-1 z-12

⎣⎢

⎦⎥

x1

x2

⎣⎢⎢

⎦⎥⎥

+10⎡

⎣⎢

⎦⎥

x1 = z−12x1 + z−1x2 +1

x2 = z−1x1 + z−12x2

z-12 z-1 z-1 z-12

x1 x2

1

z-12 z-1

z-1 z-12 x1 x2

1

Page 30: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Input and Null Initial State

A =

2 11 2⎡

⎣⎢

⎦⎥ , B =

10⎡

⎣⎢

⎦⎥ , C =

01⎡

⎣⎢

⎦⎥ , x(n +1) = Ax(n) +Bu(n), y(n) = Cx(n)

z-12 z-1 z-1 z-12

x1 x2

z-1

u

z-12 z-1

z-1 z-12 x1 x2

u z-1

Page 31: Hybrid Systems Modeling, Analysis and ControlGros… · Radu Grosu Vienna University of Technology Hybrid Systems Modeling, Analysis and Control Lecture 3

Z-Transform and Laplace Transform

•  For continuous LTI systems, LT plays the same role as the ZT does in discrete-time systems:

Z{x} = F(z) = x(n) z−n

n=0

Z-transform L-transform

L{x} = F(s) = x(t)e−st dt

0