92
1/46 Introduction PWA Functions Evaluation Algorithms Applications Conclusions Piecewise-affine functions: applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics Bilbao 12/04/2013

Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

1/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Piecewise-affine functions:

applications in circuit theory and control

Tomaso Poggi

Basque Center of Applied Mathematics

Bilbao

12/04/2013

Page 2: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

2/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definition

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 3: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

2/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definition

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 4: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

2/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definition

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 5: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

2/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definition

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 6: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

2/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definition

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 7: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

3/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Embedded Systems

An embedded system is a computer system designed for executing

specific tasks within a larger system

We can find them in

Mobile phones, digital cameras, mp3 players, ...

Home appliances (microwave ovens, washing machines, ...)

Cars, planes, trains, ...

Embedded systems contain processing cores that are either

microprocessors or digital circuits

⇒ Digital Signal Processor (DSP)

Page 8: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

4/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Digital Signal Processor VS Personal Computer

Personal Computer Digital Signal Processor

General purpose Specific task

High power/frequency Low power/frequency

No deterministic execution time “Real Time”

Complex operations Simple operations

Available operations on DSP (Fixed point arithmetic)

Arithmetic: +, −, ×

Comparisons: =, >, <, ≥, ≤

Boolean: NOT, AND, OR, XOR

Memory

Page 9: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

5/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Algorithms for DSP

Requirements:

Fast execution

Limited resources

Low-level programming

Strategy

On-line execution

Off-line design

Page 10: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

5/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Algorithms for DSP

Requirements:

Fast execution

Limited resources

Low-level programming

Strategy

On-line execution ⇒ Maintain simplicity

Off-line design ⇒ All the hard math here

Page 11: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

6/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definitions

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 12: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

7/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Polytopes and Simplexes (1/2)Definition

Polytope in Rn: intersection of m halfspaces (boundaries)

Ω=

x ∈ Rn : h′

jx + kj ≤ 0, j = 1, . . . ,m

Boundary: (n−1)-dimensional hyper-plane in the form

h′jx + kj = 0

Alternative definition: convex hull of vertices

Ω=

x : x =m

∑i=1

µi vi ; 0 ≤ µi ≤ 1, i = 1, . . . ,m;m

∑i=1

µi = 1

Simplex in Rn: a polytope defined by m = n+1 vertices vi

Page 13: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

8/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Polytopes and Simplexes (2/2)Examples

Polytopes

n = 2 n = 3

Simplexes

v0 v1 v0

v1

v2

v0

v1

v2

v3

n = 1 n = 2 n = 3

Page 14: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

9/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Piecewise-affine functions

fPWA

: D ⊂ Rn → R is piecewise-affine (PWA) if

its domain is partitioned in M polytopes

D = ∪Mk=1Ωk , Ωk ∩Ωh = 0, k 6= h

it is linear affine over each polytope

fPWA

(x) = f ′kx +gk , x ∈ Ωk

−1

−0.5

0

0.5

1

1.5

−1.5−1

−0.50

0.51

0

0.5

1

1.5

2

x2

Partition − 15 polytopes

x1

Page 15: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

10/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Piecewise-affine functionsSpecial case: Lattice form

Any continuous PWA function can be expressed as1

fPWA

(x) = min1≤k≤M

max1≤h≤Mφkh=1

f ′hx +gh

where Φ= [φkh] is a zero-one structure matrix:

φkh =

1, f ′kx +gk ≥ f ′hx +gh,∀x ∈Ωk

0, otherwise

Non need to define/store the partition explicitly!

1Tarela and Martínez [1999]

Page 16: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

11/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Piecewise-affine functionsSpecial case: regular partitions

Simplicial Rectangular

Used in approximation/identification problems2

Efficient evaluation algorithms

2Poggi et al. [2011], Genuit et al. [2012]

Page 17: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

12/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (1/2)Simplicial partition

Simplicial partition of D = x ∈ Rn : ai ≤ xi ≤ bi obtained by:

x1

x2

b1a1

b2

a2

Page 18: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

12/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (1/2)Simplicial partition

Simplicial partition of D = x ∈ Rn : ai ≤ xi ≤ bi obtained by:

dividing each dimensional component in mi sub-intervals ⇒

hyper-rectangles

x1

x2

b1a1

b2

a2

Nv vertices

Page 19: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

12/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (1/2)Simplicial partition

Simplicial partition of D = x ∈ Rn : ai ≤ xi ≤ bi obtained by:

dividing each dimensional component in mi sub-intervals ⇒

hyper-rectangles

partitioning each hyper-rectangle in n! simplexes

x1

x2

b1a1

b2

a2

Nv vertices

Page 20: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

13/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (2/2)Representation

Any PWAS function can be expressed:

1 Using the classical representation

fS(x) = f ′j x +gj , x ∈ Sj

2 As a sum of Nv elements

fS(x) = ∑

Nv

k=1 ck φk(x) = c ′φ(x)

Nv basis functionsNv weighting coefficients

3 By linear interpolation of the fSvalues at the n+1 simplex

vertices

fS(x) =

n

∑j=0

µj fS(vj)

Page 21: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

13/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (2/2)Representation

Any PWAS function can be expressed:

1 Using the classical representation

fS(x) = f ′j x +gj , x ∈ Sj

2 As a sum of Nv elements

fS(x) = ∑

Nv

k=1 ck φk(x) = c ′φ(x)

Nv basis functionsNv weighting coefficients

3 By linear interpolation of the fSvalues at the n+1 simplex

vertices

fS(x) =

n

∑j=0

µj fS(vj)

Page 22: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

13/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (2/2)Representation

Any PWAS function can be expressed:

1 Using the classical representation

fS(x) = f ′j x +gj , x ∈ Sj

2 As a sum of Nv elements

fS(x) = ∑

Nv

k=1 ck φk(x) = c ′φ(x)

Nv basis functionsNv weighting coefficients

3 By linear interpolation of the fSvalues at the n+1 simplex

vertices

fS(x) =

n

∑j=0

µj fS(vj)

Page 23: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

13/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (2/2)Representation

Any PWAS function can be expressed:

1 Using the classical representation

fS(x) = f ′j x +gj , x ∈ Sj

2 As a sum of Nv elements

fS(x) = ∑

Nv

k=1 ck φk(x) = c ′φ(x)

Nv basis functionsNv weighting coefficients

3 By linear interpolation of the fSvalues at the n+1 simplex

vertices

fS(x) =

n

∑j=0

µj fS(vj)

Page 24: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

13/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Simplicial PWA functions (2/2)Representation

Any PWAS function can be expressed:

1 Using the classical representation

fS(x) = f ′j x +gj , x ∈ Sj

2 As a sum of Nv elements ⇒ numerical/analytical calculations

fS(x) = ∑

Nv

k=1 ck φk(x) = c ′φ(x)

Nv basis functionsNv weighting coefficients

3 By linear interpolation of the fSvalues at the n+1 simplex

vertices ⇒ DSP implementation

fS(x) =

n

∑j=0

µj fS(vj)

Page 25: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

14/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

α-basisPWA Radial Basis Functions with fixed support

Nv hyper-pyramids (pyramids in 2D) centred at the Nv vertices

Key property:

αk(vi ) =

1, if k = i

0, if k 6= i⇒ ck = f

S(vk)

z1

z2

0 1 2 30

1

2

3

1

vk

αk(x)

Simplex

Page 26: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

14/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

α-basisPWA Radial Basis Functions with fixed support

Example: m1 = m2 = 3 ⇒ Nv = 16

Page 27: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

15/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Function approximation/identificationwith PWAS functions

original function

f (x)

P W A

approximated function

fS(x)

−3−2

−10

12

3

−3

−2

−1

0

1

2

3

−6

−4

−2

0

2

4

6

x1x2

fP

WL

Two types of problems

Approximation: f is known (analytically)

Identification: some samples of f are available

Page 28: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

15/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Function approximation/identificationwith PWAS functions

original function

f (x)

−2−1

01

2

−2−1

01

2

−6

−4

−2

0

2

4

6 P W A

approximated function

fS(x)

−3−2

−10

12

3

−3

−2

−1

0

1

2

3

−6

−4

−2

0

2

4

6

x1x2

fP

WL

Two types of problems

Approximation: f is known (analytically)

Identification: some samples of f are available

Page 29: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

16/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definitions

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 30: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

17/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Calculation of the value of a PWA function

Evaluation algorithms suitable for fast calculations

Partition dependent:

PWA: calculate fPWA

(x)

1 Find the index i such that x ∈ Ωi

2 Evaluate the affine expression f ′i x + gi

Lattice PWA: calculate fPWA

(x)

1 Efficient only in limited circumstances

PWAS: calculate fPWAS(x)

1 Scaling

2 Linear interpolation

Page 31: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

17/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Calculation of the value of a PWA function

Evaluation algorithms suitable for fast calculations

Partition dependent:

PWA: calculate fPWA

(x) −→ Point Location Problem

1 Find the index i such that x ∈ Ωi

2 Evaluate the affine expression f ′i x + gi

Lattice PWA: calculate fPWA

(x)

1 Efficient only in limited circumstances

PWAS: calculate fPWAS(x)

1 Scaling

2 Linear interpolation

Page 32: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

17/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Calculation of the value of a PWA function

Evaluation algorithms suitable for fast calculations

Partition dependent:

PWA: calculate fPWA

(x) −→ Point Location Problem

1 Find the index i such that x ∈ Ωi

2 Evaluate the affine expression f ′i x + gi

Lattice PWA: calculate fPWA

(x) −→ Apply definition as is

1 Efficient only in limited circumstances

PWAS: calculate fPWAS(x)

1 Scaling

2 Linear interpolation

Page 33: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

17/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Calculation of the value of a PWA function

Evaluation algorithms suitable for fast calculations

Partition dependent:

PWA: calculate fPWA

(x) −→ Point Location Problem

1 Find the index i such that x ∈ Ωi

2 Evaluate the affine expression f ′i x + gi

Lattice PWA: calculate fPWA

(x) −→ Apply definition as is

1 Efficient only in limited circumstances

PWAS: calculate fPWAS(x) −→ Khun’s decomposition

1 Scaling

2 Linear interpolation

Page 34: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

Page 35: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

Page 36: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

Page 37: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

Page 38: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

e3

Page 39: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

e3

Page 40: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

e3

e4

Page 41: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

e3

e4

Page 42: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

e3

e4

Page 43: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

18/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (1/2)Combinatorial solution

Given Me boundaries, find i such that x ∈ Ωi

Combinatorial algorithm

for j = 1 to Me do

compare x with ej :

hjx + kj ≤ 0

end for

M and Me can be very large!

A more efficient solution

exists

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e2

e3

e4

Page 44: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

19/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (2/2)Binary search tree

Clever choice of the sequence of edges

The tree is built off-line3

The tree is explored on-line by a DSP

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

root

e4

Ω5 Ω3

e3

Ω4 e2

Ω1Ω2

>

>≤

≤ >

>≤

3Tøndel et al. [2002], Fuchs et al. [2010]

Page 45: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

19/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (2/2)Binary search tree

Clever choice of the sequence of edges

The tree is built off-line3

The tree is explored on-line by a DSP

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e1:e1

root

e4

Ω5 Ω3

e3

Ω4 e2

Ω1Ω2

>

>≤

≤ >

>≤

e1

root

3Tøndel et al. [2002], Fuchs et al. [2010]

Page 46: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

19/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (2/2)Binary search tree

Clever choice of the sequence of edges

The tree is built off-line3

The tree is explored on-line by a DSP

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1

e1: h1x + k1 > 0e1

root

e4

Ω5 Ω3

e3

Ω4 e2

Ω1Ω2

>

>≤

≤ >

>≤

e1

root

>

3Tøndel et al. [2002], Fuchs et al. [2010]

Page 47: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

19/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (2/2)Binary search tree

Clever choice of the sequence of edges

The tree is built off-line3

The tree is explored on-line by a DSP

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1 e4

e1: h1x + k1 > 0

e4:

e1

root

e4

Ω5 Ω3

e3

Ω4 e2

Ω1Ω2

>

>≤

≤ >

>≤

e1

root

>

e4

3Tøndel et al. [2002], Fuchs et al. [2010]

Page 48: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

19/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (2/2)Binary search tree

Clever choice of the sequence of edges

The tree is built off-line3

The tree is explored on-line by a DSP

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1 e4

e1: h1x + k1 > 0

e4: h4x + k4 > 0

e1

root

e4

Ω5 Ω3

e3

Ω4 e2

Ω1Ω2

>

>≤

≤ >

>≤

e1

root

>

e4

>

3Tøndel et al. [2002], Fuchs et al. [2010]

Page 49: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

19/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (2/2)Binary search tree

Clever choice of the sequence of edges

The tree is built off-line3

The tree is explored on-line by a DSP

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1 e4

e1: h1x + k1 > 0

e4: h4x + k4 > 0

Ω3 : f3x +g3

e1

root

e4

Ω5 Ω3

e3

Ω4 e2

Ω1Ω2

>

>≤

≤ >

>≤

e1

root

>

e4

>

Ω3

3Tøndel et al. [2002], Fuchs et al. [2010]

Page 50: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

19/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Point Location Problem (2/2)Binary search tree

Clever choice of the sequence of edges

The tree is built off-line3

The tree is explored on-line by a DSP

e1 e4

e3

e2

Ω1

Ω2

Ω3

Ω4

Ω5

x

e1 e4

e1: h1x + k1 > 0

e4: h4x + k4 > 0

Ω3 : f3x +g3

e1

root

e4

Ω5 Ω3

e3

Ω4 e2

Ω1Ω2

>

>≤

≤ >

>≤

e1

root

>

e4

>

Ω3

Only sums, multiplications and comparisons!

3Tøndel et al. [2002], Fuchs et al. [2010]

Page 51: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

20/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Evaluation in lattice form

Direct application of the formula

fPWA

(x) = min1≤k≤M

max1≤h≤Mφkh=1

f ′hx +gh

Key result4: If some regions share the same affine expression

∃Ωh,Ωk , Ωh 6=Ωk : fh = fk , gh = gk

It is possible to remove rows and columns from Φ= [φkh]

Different regions can be joined

4Wen et al. [2009]

Page 52: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

21/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Evaluation of a PWAS function (1/2)Scaling

Fast and simple evaluation algorithm exploiting5

the regularity of the partition

local linearity

xi is scaled to zi ∈ [0,mi ] by a linear transformation

Dz

z1

z2

uk

0 1 2 3 40

1

2

3

D

x1

x2

vk

x01 x1

1 x21 x3

1 x41

x02

x12

x22

x32

T

uk = T (vk)

5Parodi et al. [2005]

Page 53: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

22/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Evaluation of a PWAS function (2/2)Interpolation

Linear interpolation of the fS

values at the n+1 simplex vertices

fS(z) =

n

∑j=0

µj czj , cz

j = fS(uz

j )

z1

z2

0 1 2 3 40

1

2

3

z

⌊z⌋

uz0 uz

1

uz2

zδ1

δ2

⌊zi⌋ integer parts

δi = zi −⌊zi⌋ fractional parts

z =n

∑j=0

µj uzj

µj : obtained by ordering δi

uzj : vertices around z obtained from ⌊z⌋ and δi

Page 54: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

22/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Evaluation of a PWAS function (2/2)Interpolation

Linear interpolation of the fS

values at the n+1 simplex vertices

fS(z) =

n

∑j=0

µj czj , cz

j = fS(uz

j )

z1

z2

0 1 2 3 40

1

2

3

z

⌊z⌋

uz0 uz

1

uz2

zδ1

δ2

⌊zi⌋ integer parts

δi = zi −⌊zi⌋ fractional parts

z =n

∑j=0

µj uzj

µj : obtained by ordering δi

uzj : vertices around z obtained from ⌊z⌋ and δi

Page 55: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

22/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Evaluation of a PWAS function (2/2)Interpolation

Linear interpolation of the fS

values at the n+1 simplex vertices

fS(z) =

n

∑j=0

µj czj , cz

j = fS(uz

j )

z1

z2

0 1 2 3 40

1

2

3

z

⌊z⌋

uz0 uz

1

uz2

zδ1

δ2

⌊zi⌋ integer parts

δi = zi −⌊zi⌋ fractional parts

z =n

∑j=0

µj uzj

µj : obtained by ordering δi

uzj : vertices around z obtained from ⌊z⌋ and δi

Page 56: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

23/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Complexity analysis

PWA functions (point location problem)

Memory: (M +Me)(n+1)

Time: O(log(M)n)

Continuous PWA functions (lattice form)

Memory: < M(n+1)

Time: < O(M)

PWAS functions

Memory: Nv

Time: O(n)

Page 57: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

24/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definitions

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 58: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

25/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

PWA functions applications

Model Predictive Control

Lyapunov functions (hints)

Virtual sensors (nonlinear state observers)

Dynamical system modelling (hints)

Page 59: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

26/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlControl of dynamical systems under constraints

x(t +1) = f (x(t),u(t))

y(t) = g(x(t))

u(t) y(t)

x1

x2

x0

Problem: find a control law that

Page 60: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

26/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlControl of dynamical systems under constraints

x(t +1) = f (x(t),u(t))

y(t) = g(x(t))

u(t) y(t)

u(t) = u(x(t))

DSP

x1

x2

x0

Problem: find a control law that

regularises the system to the origin

Page 61: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

26/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlControl of dynamical systems under constraints

x(t +1) = f (x(t),u(t))

y(t) = g(x(t))

um ≤ u(t)≤ uM ym ≤ y(t)≤ yM

u(t) = u(x(t))

DSP

x1

x2

x0

Problem: find a control law that

regularises the system to the origin

fulfils constraints on u(t), x(t) and y(t)

Page 62: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

26/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlControl of dynamical systems under constraints

x(t +1) = f (x(t),u(t))

y(t) = g(x(t))

um ≤ u(t)≤ uM ym ≤ y(t)≤ yM

u(t) = u(x(t))

DSP

x1

x2

x0

Problem: find a control law that

regularises the system to the origin

fulfils constraints on u(t), x(t) and y(t)

Solution: Receding Horizon Control

1 At time t calculate N control moves u0, . . . ,uN−1

2 Apply u0 and discard the remaining control moves

3 At time t + 1 repeat the procedure

Page 63: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

27/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlFormulation of the optimisation problem6

N control moves obtained by optimisation

minu0,...,uN−1

N−1

∑k=0

L (xk ,uk)+LF (xN)

xk+1 = f (xk ,uk), k = 0, . . . ,N − 1

x0 = x(t)

uk ∈ U , k = 0, . . . ,N − 1

xk ∈ X , k = 0, . . . ,N − 1

xN ∈ XN

Input and state weight

Final state weight

System dynamics

Feasibility constraints

Constraint on final state

(stability)

6Alessio and Bemporad [2009]

Page 64: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

27/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlFormulation of the optimisation problem6

N control moves obtained by optimisation

minu0,...,uN−1

N−1

∑k=0

L (xk ,uk)+LF (xN)

xk+1 = f (xk ,uk), k = 0, . . . ,N − 1

x0 = x(t)

uk ∈ U , k = 0, . . . ,N − 1

xk ∈ X , k = 0, . . . ,N − 1

xN ∈ XN

Input and state weight

Final state weight

System dynamics

Feasibility constraints

Constraint on final state

(stability)

6Alessio and Bemporad [2009]

Page 65: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

27/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlFormulation of the optimisation problem6

N control moves obtained by optimisation

minu0,...,uN−1

N−1

∑k=0

L (xk ,uk)+LF (xN)

xk+1 = f (xk ,uk), k = 0, . . . ,N − 1

x0 = x(t)

uk ∈ U , k = 0, . . . ,N − 1

xk ∈ X , k = 0, . . . ,N − 1

xN ∈ XN

Input and state weight

Final state weight

System dynamics

Feasibility constraints

Constraint on final state

(stability)

6Alessio and Bemporad [2009]

Page 66: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

27/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlFormulation of the optimisation problem6

N control moves obtained by optimisation

minu0,...,uN−1

N−1

∑k=0

L (xk ,uk)+LF (xN)

xk+1 = f (xk ,uk), k = 0, . . . ,N − 1

x0 = x(t)

uk ∈ U , k = 0, . . . ,N − 1

xk ∈ X , k = 0, . . . ,N − 1

xN ∈ XN

Input and state weight

Final state weight

System dynamics

Feasibility constraints

Constraint on final state

(stability)

6Alessio and Bemporad [2009]

Page 67: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

27/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlFormulation of the optimisation problem6

N control moves obtained by optimisation

minu0,...,uN−1

N−1

∑k=0

L (xk ,uk)+LF (xN)

xk+1 = f (xk ,uk), k = 0, . . . ,N − 1

x0 = x(t)

uk ∈ U , k = 0, . . . ,N − 1

xk ∈ X , k = 0, . . . ,N − 1

xN ∈ XN

Input and state weight

Final state weight

System dynamics

Feasibility constraints

Constraint on final state

(stability)

6Alessio and Bemporad [2009]

Page 68: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

27/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlFormulation of the optimisation problem6

N control moves obtained by optimisation

minu0,...,uN−1

N−1

∑k=0

L (xk ,uk)+LF (xN)

xk+1 = f (xk ,uk), k = 0, . . . ,N − 1

x0 = x(t)

uk ∈ U , k = 0, . . . ,N − 1

xk ∈ X , k = 0, . . . ,N − 1

xN ∈ XN

Input and state weight

Final state weight

System dynamics

Feasibility constraints

Constraint on final state

(stability)

Non-convex optimisation problem ⇒ hard to solve

There are simpler but relevant cases

6Alessio and Bemporad [2009]

Page 69: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

28/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlLinear system, quadratic cost, linear constraints

minu0,...,uN−1

N−1

∑k=0

||Qxk ||2 + ||Ruk ||2+ ||PxN ||2

xk+1 = Axk +Buk , k = 0, . . . ,N − 1

x0 = x(t)

Huuk ≤ ku, k = 0, . . . ,N − 1

Hxxk ≤ kx , k = 0, . . . ,N − 1

HNxN ≤ kN

Q and R are tuning parameters

if P solution of the Riccati equation

⇒ Stability is guaranteed

Page 70: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

29/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Explicit Model Predictive ControlLinear system, quadratic cost, linear constraints

Called z , [u′0, . . . ,u

′N−1]

′, the optimisation problem can be rewritten

as a Multi-parametric Quadratic Programming (mpQP)

minz

1

2z ′Hz + x ′(t)Cz

Gz −W −Sx(t)≤ 0

Key result:7

There exists an explicit solution u(t) = u0 = uPWA(x(t))

PWA function defined over the state space

7Bemporad et al. [2002]

Page 71: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

29/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Explicit Model Predictive ControlLinear system, quadratic cost, linear constraints

Called z , [u′0, . . . ,u

′N−1]

′, the optimisation problem can be rewritten

as a Multi-parametric Quadratic Programming (mpQP)

minz

1

2z ′Hz + x ′(t)Cz

Gz −W −Sx(t)≤ 0

Key result:7

There exists an explicit solution u(t) = u0 = uPWA(x(t))

PWA function defined over the state space

No need to solve an optimisation problem on-line!

7Bemporad et al. [2002]

Page 72: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

30/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlOther formulations and extensions

One-norm

minz

N−1

∑k=0

||Qxk ||1 + ||Ruk ||1+ ||PxN ||1

xk+1 = Axk +Buk , k = 0, . . . ,N−1

x0 = x(t)

Huuk ≤ ku , k = 0, . . . ,N−1

Hx xk ≤ kx , k = 0, . . .,N −1

HN xN ≤ kN

Infinite-norm

minz

N−1

∑k=0

||Qxk ||∞ + ||Ruk ||∞+ ||PxN ||∞

xk+1 = Axk +Buk , k = 0, . . . ,N−1

x0 = x(t)

Huuk ≤ ku , k = 0, . . . ,N−1

Hx xk ≤ kx , k = 0, . . . ,N −1

HN xN ≤ kN

PWA model

minz

N−1

∑k=0

||Qxk ||2 + ||Ruk ||2+ ||PxN ||2

xk+1 = fPWA

(xk ,uk ), k = 0, . . .,N −1

x0 = x(t)

Huuk ≤ ku , k = 0, . . . ,N−1

Hx xk ≤ kx , k = 0, . . . ,N−1

HN xN ≤ kN

Tracking

minz

N−1

∑k=0

||Q(yk − rk )||2 + ||R(uk −uk−1)||2

xk+1 = Axk +Buk , k = 0, . . . ,N−1

yk = Cxk , k = 0, . . .,N −1

x0 = x(t)

Huuk ≤ ku , k = 0, . . . ,N−1

Hx xk ≤ kx , k = 0, . . .,N −1

Page 73: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

31/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Approximated MPCwith PWAS functions

Given

The optimal solution u0

A PWAS function uS = c ′φ(x) defined over a simplicial

partition

Solve8

minc

D(u0(x)−uS)

2dx

Gc ≤ W

Constraints Gc ≤ W ensure feasibility

More efficient implementations in DSP

8Poggi et al. [2011]

Page 74: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

32/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlClosed-loop dynamics and stability

Closed loop dynamics are given by

x(t +1) = Ax(t)+Bu(t) = Ax +B(fkx(t)+ gk) = fkx(t)+gk

Closed-loop stability:

Optimal MPC solution

Final state constraints

A posteriori analysis (Lyapunov function)

Approximated MPC

Further constraints must be inserted

A posteriori analysis (Lyapunov function)

Page 75: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

32/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlClosed-loop dynamics and stability

Closed loop dynamics are given by

x(t +1) = Ax(t)+Bu(t) = Ax +B(fkx(t)+ gk) = fkx(t)+gk

Closed-loop stability:

Optimal MPC solution

Final state constraints

A posteriori analysis (Lyapunov function)

Approximated MPC

Further constraints must be inserted

A posteriori analysis (Lyapunov function)

Page 76: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

32/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlClosed-loop dynamics and stability

Closed loop dynamics are given by

x(t +1) = Ax(t)+Bu(t) = Ax +B(fkx(t)+ gk) = fkx(t)+gk

Closed-loop stability:

Optimal MPC solution

Final state constraints

A posteriori analysis (Lyapunov function)

Approximated MPC

Further constraints must be inserted

A posteriori analysis (Lyapunov function)

Page 77: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

32/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Model Predictive ControlClosed-loop dynamics and stability

Closed loop dynamics are given by

x(t +1) = Ax(t)+Bu(t) = Ax +B(fkx(t)+ gk) = fkx(t)+gk

Closed-loop stability:

Optimal MPC solution

Final state constraints

A posteriori analysis (Lyapunov function)

Approximated MPC

Further constraints must be inserted

A posteriori analysis (Lyapunov function)

Page 78: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

33/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

PWA Lyapunov Functions (1/2)

If there exist a function V (x) : D → R, three real values

α > 0, β > 0, λ ∈ (0,1), and an integer number p > 0 such that,

for all x ∈ D and all k ∈ 1, . . . ,M,

α‖x‖p ≤ V (x)≤ β‖x‖p

V (fkx +gk)−λV (x)≤ 0, x ∈ Ωk

then, the origin of the system is

asymptotically stable in D in case p = 1;

exponentially stable in D in case p > 1.

Page 79: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

33/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

PWA Lyapunov Functions (1/2)

If there exist a function V (x) : D → R, three real values

α > 0, β > 0, λ ∈ (0,1), and an integer number p > 0 such that,

for all x ∈ D and all k ∈ 1, . . . ,M,

α‖x‖p ≤ V (x)≤ β‖x‖p

V (fkx +gk)−λV (x)≤ 0, x ∈ Ωk

then, the origin of the system is

asymptotically stable in D in case p = 1;

exponentially stable in D in case p > 1.

It is possible to build PWA Lyapunov functions!

Page 80: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

34/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

PWA Lyapunov Functions (2/2)

A PWA Lyapunov function V (x) = wkx + zk , x ∈ Ωk can be found

by solving the following Linear Programming9

α‖v‖∞ ≤ whv + zh ≤ β‖v‖∞ ∀ v ∈ vert(Ωh)

wk(fhv +gh)+ zk −λ (wh(v)− zh)≤ 0 ∀ v ∈ vert(Ωhk) : Thk = 1

where [Thk ] is the reachability matrix

Thk ,

1 if ∃ x ∈Ωh s.t. fhx +gh ∈ Ωk

0 otherwiseReachability matrix

Ωhk = x ∈ Ωh : fhx +gh ∈Ωk Starting regions

9Grieder et al. [2005]

Page 81: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

35/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Virtual sensors

A virtual sensor is a nonlinear state observer

S

O

DSP

u(t)y(t)

z(t)

z(t)

S :

x(t +1) = g(x(t),u(t))

y(t) = hy(x(t))+η(t)

z(t) = hz(x(t))+ξ (t)

h, gy , gz unknown

u(t) ∈ Rnu , y(t) ∈ R

ny

always available

z(t) ∈R available for t ≤ T

z(t) estimate of z(t), t > T

Page 82: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

36/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Virtual SensorsStandard two-step approach

1 Identify a model S for S

from available data

linear/nonlinear systems identification

2 Design a state observer

from identified model

e.g., Kalman filter, Extended Kalman filter, . . .

Both step 1 and 2 could be hard to accomplish

Alternative solution: single-step approach

Identify the observer from data ⇒ Direct Virtual Sensor

Page 83: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

37/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Direct Virtual Sensors (DVS)Identifying a virtual sensor from time series10

Consider a time-window of size N:

Ut = u(τ)tτ=t−N+1 Yt = y(τ)t

τ=t−N+1

Zt = z(τ)tτ=t−N+1 Zt = z(τ)t

τ=t−N+1

DVS structure: dynamical PWAS system

z(t +1) = fS(Ut ,Yt+1, Zt) = c ′φ(Ut ,Yt+1, Zt)

Weights given by

minc

T−1

∑t=N

[z(t +1)− fS(Ut ,Yt+1,Zt)]

2

10Poggi et al. [2012]

Page 84: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

38/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Direct Virtual SensorsConvergence analysis: DVS VS two-step approach

i) The vector of parameters guarantees the minimisation of the

variance of the estimation error among all the virtual sensors

with the same structure, i.e., fS

∗ = argminf

S

E[

(z(t)− z(t))2]

.

ii) If it is possible to express the two-step observer in regression

form as a particular realisation of the virtual sensor, one

obtains that the performance of the DVS is better than or

equal to that of the two-step observer.

iii) If ii holds and there exists a set of parameters of the two-step

observer that describes exactly the system, then the DVS is a

minimum variance filter.

Page 85: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

39/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Other applicationsDynamical Systems Modelling

PWA dynamical systems arise in the following cases

Linear system under Model Predictive Control

Smooth maps approximated by PWA functions

Circuit implementation of nonlinear systems11

Hybrid Systems modelling

Continuous dynamics described by linear difference equations;

discrete dynamics described by finite state machines

Equivalence with PWA systems12

11Poggi et al. [2009]12Bemporad [2004]

Page 86: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

40/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Outline

1 Embedded systems

2 PWA functions

Definitions

Classes and representation forms

3 Evaluation of PWA functions

4 Applications

Model Predictive Control

Virtual sensors (nonlinear state observers)

Others

5 Conclusions

Matlab software and toolboxes

Open issues

Page 87: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

41/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Conclusions

PWA functions are a framework to solve many problems

Optimal control

State estimation

Approximation/identification

. . .

They combine simplicity and complexity

Simplicity ⇒ easy to calculate

Complexity ⇒ approximation capabilities

Page 88: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

42/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Open issues

Model Predictive Control

Direct Approximated Explicit MPC

Virtual Sensors

A real application as a proof of concept

Evaluation algorithms for DSP

Simplicial non-uniform partitions

Exploit lattice PWA form

Page 89: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

43/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Related SoftwareToolboxes for Matlab

Multi-Parametric Toolbox (MPT)

MPC solvers

Computational geometry (polytopes)

Lyapunov functions

Hybrid Toolbox

MPC solvers

Hybrid systems modelling

MOBY-DIC Toolbox

Approximated Explicit MPC

Lyapunov functions

Virtual Sensors

Page 90: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

44/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Suggested bibliography I

A. Alessio and A. Bemporad. A survey on explicit model predictive control. Lecture Notes in Control and

Information Sciences, 384:345–369, 2009.

A. Bemporad. Efficient conversion of mixed logical dynamical systems into an equivalent piecewise affine form.

IEEE Transactions on Automatic Control, 49(5):832–838, 2004.

A. Bemporad, M. Morari, V. Dua, and E.N. Pistikopoulos. The explicit linear quadratic regulator for constrained

systems. Automatica, 38(1):3–20, 2002.

A.N. Fuchs, C.N. Jones, and M. Morari. Optimized decision trees for point location in polytopic data sets-

application to explicit mpc. pages 5507–5512, 2010.

B.A.G. Genuit, L. Lu, and W.P.M.H. Heemels. Approximation of explicit model predictive control using regular

piecewise affine functions: An input-to-state stability approach. IET Control Theory and Applications, 6(8):

1015–1028, 2012.

P. Grieder, M. Kvasnica, M. Baotic, and M. Morari. Stabilizing low complexity feedback control of constrained

piecewise affine systems. Automatica, 41(10):1683–1694, 2005.

M. Parodi, M. Storace, and P. Julián. Synthesis of multiport resistors with piecewise-linear characteristics: A

mixed-signal architecture. International Journal of Circuit Theory and Applications, 33(4):307–319, 2005.

T. Poggi, A. Sciutto, and M. Storace. Piecewise linear implementation of nonlinear dynamical systems: From

theory to practice. Electronics Letters, 45(19):966–967, 2009.

T. Poggi, A. Bemporad, A. Oliveri, and M. Storace. Ultra-fast stabilizing model predictive control via canonical

piecewise affine approximations. IEEE Transactions on Automatic Control, 56(12):2883–2897, 2011.

Page 91: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

45/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Suggested bibliography II

T. Poggi, M. Rubagotti, A. Bemporad, and M. Storace. High-speed piecewise affine virtual sensors. IEEE

Transactions on Industrial Electronics, 59(2):1228–1237, 2012.

J.M. Tarela and M.V. Martínez. Region configurations for realizability of lattice piecewise-linear models.

Mathematical and Computer Modelling, 30(11-12):17–27, 1999.

P. Tøndel, T.A. Johansen, and A. Bemporad. Computation and approximation of piecewise affine control laws via

binary search trees. volume 3, pages 3144–3149, 2002.

C. Wen, X. Ma, and B.E. Ydstie. Analytical expression of explicit mpc solution via lattice piecewise-affine function.

Automatica, 45(4):910–917, 2009.

Page 92: Piecewise-affine functions: applications in circuit theory and control · 2013. 4. 15. · applications in circuit theory and control Tomaso Poggi Basque Center of Applied Mathematics

46/46

Introduction PWA Functions Evaluation Algorithms Applications Conclusions

Thanks

Questions and comments are welcome!