38
Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions Seminario de Aplicaciones de la Matem´ atica SV-Regression for the Identification of Nonlinear Systems Juan Carlos G´ omez FCEIA, Universidad Nacional de Rosario and CIFASIS Rosario, Argentina {gomez}@cifasis-conicet.gov.ar Seminario de Aplicaciones de la Matem´ atica - November 07, 2014 1 / 38

SV-Regression for the Identification of Nonlinear Systems

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Seminario de Aplicaciones de la Matematica

SV-Regression for the Identification of Nonlinear

Systems

Juan Carlos Gomez

FCEIA, Universidad Nacional de Rosarioand CIFASIS

Rosario, Argentina

{gomez}@cifasis-conicet.gov.ar

Seminario de Aplicaciones de la Matematica - November 07, 2014

1 / 38

Page 2: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Outline

1 Introduction

2 SV-RegressionLinear CaseNonlinear Case

3 Wiener Model Identification

4 Application: PEM Fuel Cell System

5 Simulation Results

6 Conclusions

2 / 38

Page 3: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Introduction

Support Vector Machines (SVM) is a black-box approachintended for solving classification and function estimationproblems.

It has been applied in many fields such as machine learning,mathematics and statistics, pattern recognition, signalprocessing, and optimization.

Many successful applications have been reported in theliterature.

The method is specially suited when data are given in a highdimensional input space, where parametric modelingapproaches would require the estimation of a huge amount ofunknown parameters, facing a curse of dimensionality.

3 / 38

Page 4: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Introduction

The estimation of functions based on SVM consists inminimizing a specific loss function in a reproducing kernelHilbert space (RKHS).

The problem formulation is in terms of a constrainedoptimization problem.

The constraints relate to model evaluation on training data.

This primal problem is expressed in terms of a feature map.

The feature map need not be explicitly known, but instead itcan be implicitly defined in terms of an associated positivedefinite kernel function (the so-called kernel trick in themachine learning literature).

4 / 38

Page 5: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Introduction

The primal problem is usually solved in its dual formulation,resorting to Lagrange multipliers associated with the modelconstraints.

The solution of the Dual Problem leads to convex quadraticprogramming (QP) problems with box constraints, for whichefficient algorithms exist.

5 / 38

Page 6: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case

Suppose we are given training input-output data{x(n), y(n)}Nn=1, where x(n) ∈ X, the input space (forinstance X = Rd), and y(n) ∈ R. Our goal is to find afunction f(x) that has at most an ε deviation from themeasured output y(n) for all the training data(n = 1, · · · , N), and at the same time is as flat as possible.This is the so-called ε-SV regression formulation.

Let consider the case of a linear function f , that is

f(x) = 〈a,x〉+ w, (1)

with a ∈ X, and w ∈ R, and where 〈 , 〉 denotes the dotproduct in X, and where w is an additive white noise term.

Flatness in the linear case in (1) means that one seeks for asmall a. One way to ensure this is to minimize the norm ||a||2.

6 / 38

Page 7: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

We can write this problem as a convex optimization problem:

mina

12||a||2,

subject to

{y(n)− 〈a,x(n)〉 − w(n) ≤ ε,〈a,x(n)〉+ w(n)− y(n) ≤ ε (2)

There is a tacit assumption in (2) that such a function fexists so that it can approximate all pairs (x(n), y(n)) withε-precision, or, in other words, that the convex optimizationproblem is feasible. However this is not always the case, andwe must allow for some errors. This is taken into account byintroducing slack variables ξn, ξ∗n to cope with the otherwiseinfeasible constraints of the optimization problem (2),[Vapnik, 1995].

7 / 38

Page 8: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

We arrive then to the following formulation

mina,ξn,ξ∗n

12||a||2 + γ

N∑n=1

(ξn + ξ∗n),

subject to

y(n)− 〈a,x(n)〉 − w(n) ≤ ε+ ξn〈a,x(n)〉+ w(n)− y(n) ≤ ε+ ξ∗nξn, ξ

∗n ≥ 0

(3)

γ > 0 is a regularization constant determining a tradeoffbetween model complexity and fitting accuracy to theexperimental data.

This corresponds to dealing with the so-called ε-insensitivityloss function |ξ|ε defined as

|ξ|ε ={

0 if |ξ| ≤ ε|ξ| − ε otherwise

8 / 38

Page 9: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

The figure depicts the situation. Only the points outside theshaded region (the so-called ε-tube) contribute to the costfunction.

9 / 38

Page 10: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

Primal Formulation for ε-SV Regression

mina,ξn,ξ∗n

12||a||2 + γ

N∑n=1

(ξn + ξ∗n),

subject to

y(n)− 〈a,x(n)〉 − w(n) ≤ ε+ ξn〈a,x(n)〉+ w(n)− y(n) ≤ ε+ ξ∗nξn, ξ

∗n ≥ 0

(4)

The optimization problem in (4) can be solved more easily inits dual formulation, using Lagrange multipliers. Moreoverthe dual formulation provides the key for extendingSV-Regression to nonlinear functions.

10 / 38

Page 11: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

To formulate the dual problem we must write the Lagrangianfunction Lε. It can be proved that this function has, at thesolution, a saddle point with respect to the primal variables(weights a, w(n) and slack variables ξn, ξ∗n) and to the dualvariables (the Lagrange multipliers associated with theconstraints).The Lagrangian is given by

Lε =12||a||2 + γ

N∑n=1

(ξn + ξ∗n)−N∑n=1

(ηnξn + η∗nξ∗n)

+N∑n=1

αn (y(n)− 〈a,x(n)〉 − w(n)− ε− ξn)

+N∑n=1

α∗n (−y(n) + 〈a,x(n)〉+ w(n)− ε− ξ∗n) ,

11 / 38

Page 12: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

Here, αn, α∗n ≥ 0 are the Lagrange multipliers associated with

the first 2 constraints in (4) and ηn, η∗n ≥ 0 are the Lagrange

multipliers associated with the 2 last constraints in (4).

The solution of the optimization problem is obtained by minimizingLε with respect to the primal variables a, ξn, ξ∗n, w(n), and

maximizing it with respect to the dual variables αn, α∗n, ηn, η

∗n.

12 / 38

Page 13: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

This leads to the following dual optimization problem

maxαn,α∗n

−12

N∑n,k=1

(αn − α∗n)(αk − α∗k) 〈x(n),x(k)〉

−εN∑n=1

(αn + α∗n) +N∑n=1

y(n)(αn − α∗n) (5)

subject toN∑n=1

(αn − α∗n) = 0

αn, α∗n ∈ [0, γ], n = 1, · · · , N

which is a quadratic programming (QP) problem with boxconstraints.

13 / 38

Page 14: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

It is easy to prove that an estimate of the weights a can thenbe computed as

a =N∑n=1

(αn − α∗n)x(n). (6)

Note that this estimate depends only on the training datax(n), and the Lagrange multipliers, solution of the dualoptimization problem (5).

The estimate of function f is then given by

f(x) =N∑n=1

(αn − α∗n) 〈x(n),x〉+ w (7)

This is called the dual representation of the system.

14 / 38

Page 15: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Linear case (cont.)

Note that the evaluation of f depends only on the dotproducts with the training data. Although the number ofterms in the dual representation (7) equals the number ofdata points N , only a reduced number of terms correspondingto a small number of vectors x(n), will have non vanishingcoefficients (αn − α∗n). These are the so-called supportvectors.

Note also that the weights a need not be explicitly computedin order to estimate function f .

15 / 38

Page 16: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Nonlinear case

To make the SV-Regression algorithm nonlinear, we cansimply pre-process the training data x by a nonlinear mapg : X→ F , into some feature space F , and then apply thestandard SV-Regression algorithm.

The linear model structure (1) now becomes

y(n) = f(x(n)) = 〈a,g(x(n))〉+ w(n), (8)

which can be written as

y(n) = f(x(n)) = aTg(x(n)) + w(n). (9)

16 / 38

Page 17: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Nonlinear case (cont.)

We can then restate the dual optimization problem (5) as:

maxαn,α∗n

−12

N∑n,k=1

(αn − α∗n)(αk − α∗k) 〈g(x(n)),g(x(k))〉

−εN∑n=1

(αn + α∗n) +N∑n=1

y(n)(αn − α∗n) (10)

subject toN∑n=1

(αn − α∗n) = 0

αn, α∗n ∈ [0, γ], n = 1, · · · , N

17 / 38

Page 18: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Nonlinear case (cont.)

Note that it suffices to know 〈g(x(n)),g(x(k))〉 rather thanexplicitly g(x(n)). We then define the positive definite kernelK(x(n),x(k)) as [Mercer, 1909](kernel trick):

K(x(n),x(k)) , 〈g(x(n)),g(x(k))〉 = gT (x(n))g(x(k)).(11)

18 / 38

Page 19: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Nonlinear case (cont.)

The dual optimization problem (10) can then be written as:

maxαn,α∗n

−12

N∑n,k=1

(αn − α∗n)(αk − α∗k)K(x(n),x(k))

−εN∑n=1

(αn + α∗n) +N∑n=1

y(n)(αn − α∗n) (12)

subject toN∑n=1

(αn − α∗n) = 0

αn, α∗n ∈ [0, γ], n = 1, · · · , N

Quadratic Programming (QP) problem with boxconstraints.

19 / 38

Page 20: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Nonlinear case (cont.)

Note that in the nonlinear setting, the optimization problemcorresponds to finding the flattest function in feature space,not in input space.

The dual model representation is the given by:

y(n) = f(x(n)) =N∑k=1

(αk − α∗k)K(x(k),x(n)) + w(n). (13)

20 / 38

Page 21: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

SV-Regression - Nonlinear case (cont.)

The number of support vectors will depend on the choice ofε, γ and the chosen kernel function.

Commonly used kernels are Linear kernels, Polynomial kernels,Gaussian Radial Basis Functions kernels, MultiLayerPerceptrons.

Linear Kernel

K(x(n),x(k)) , xT (n)x(k)

Polynomial Kernel

K(x(n),x(k)) , (xT (n)x(k) + τ)d, τ ≥ 0

Gaussian Radial Basis Functions (GRBF) Kernel

K(x(n),x(k)) , exp(−‖x(n)− x(k)‖22/σ2)

21 / 38

Page 22: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Wiener model ID

Multi-Input Single Output Wiener model structures areconsidered.

The model can be described as

v(n) = G(q−1)u(n), (14)

y(n) = N (v(n)), (15)

y(n) = y(n) + w(n). (16)

22 / 38

Page 23: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Wiener model ID (cont.)

The LTI block is represented as

G(q−1) =p∑`=1

b`B`(q−1),

b` ∈ Rm×m are unknown (matrix) parameters{B`(q−1)

}∞`=1

are rational orthonormal bases on H2(T).

Orthonormal Bases with Fixed Poles are considered

B`(q) =

1− |ξ`|2

q − ξ`

`−1∏i=1

(1− ξiqq − ξi

), ` ≥ 2

B1(q) =

√1− |ξ1|2

q − ξ1,

23 / 38

Page 24: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Wiener model ID (cont.)

Parameterized Wiener Model

24 / 38

Page 25: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Wiener model ID (cont.)

Defining

x , [x11, x

21, · · · , xm1 , · · · , x1

p, x2p, · · · , xmp ]T ,

b , [b1,b2, · · · ,bp],v , [v1, v2, · · · , vm]T ,

then v = bx, and y(n) = N (v(n)) = N (bx(n)) , N (x(n)).The nonlinear block N (x(n)) is represented as

N (x(n)) =r∑i=1

aigi(x(n)),

ai ∈ R, i = 1, 2, · · · , r, are unknown parametersgi(·) : Rmp 7→ R, i = 1, 2, · · · , r, are (user defined) nonlinearbasis functions

25 / 38

Page 26: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Wiener model ID (cont.)

The Wiener model equation can be written as

y(n) = aTg(x(n)) + w(n), (17)

where

a , [a1, a2, · · · , ar]T ,g(x(n)) , [g1(x(n)), g2(x(n)), · · · , gr(x(n))]T .

Note that the Wiener model equation (17) is of the form (9),so that the SV-Regression technique developed in the previoussections can be applied to identify the system.

The estimated model is given by eq. (13) with the parametergiven by the solution of the dual optimization problem in (12).

26 / 38

Page 27: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

PEMFC System

This application on PEM Fuel Cells was done in collaborationwith Dr. Diego Feroldi, CIFASIS, and published in thefollowing paper:

Gomez, J.C. and Feroldi, D. (2013). SVM-based Identificationof the Air Supply System in a Polymer Electrolyte MembraneFuel Cell. In Proceedings of the XV Reunion de Trabajo enProcesamiento de la Informacion y Control (RPIC2013), pp.579-584, Bariloche, Argentina, September 16-20, 2013.

27 / 38

Page 28: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

PEMFC System

Polymer Electrolite Membrane Fuel Cells (PEMFC) are efficientdevices for the generation of clean energy for both stationary and

mobile applications.28 / 38

Page 29: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

PEMFC System (cont.)

PEMFCs have high power density, solid electrolyte, long celland stack life, and low corrosion. In addition, they operate atlow temperatures, which enables fast star-up.

They generate clean energy, the only by-products being waterand heat.

Control of the air supply subsystem is fundamental to achieveefficiency of PEMFCs. The air flow excess is reflected by theoxygen excess ratio, which is the ratio of oxygen supplied tooxygen used in the cathode.

The air supply subsystem is composed of the air compressor,the supply manifold, the humidifier, the cathode, and thereturn manifold. The hydrogen supply is performed from apressurized tank.

29 / 38

Page 30: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

PEMFC System (cont.)

Control of the oxygen excess ratio is usually approachedthrough manipulation of the compressor motor voltage, whilethe current being drawn can be considered as a disturbance.

For identification purposes, the compressor motor voltage (u1)and the current being drawn (u2) are considered as the inputsto the system, while the oxygen excess ratio (y) is consideredas the output.

30 / 38

Page 31: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Simulation Results

For identification purposes, the compressor motor voltage (u1)and the current being drawn (u2) are considered as the inputsto the system, while the oxygen excess ratio (y) is consideredas the output.

Computational model excited with multilevel random signalsat the inputs u1 and u2.

1000 samples of the inputs and the output were collected witha sampling period Ts = 0.1 s.

First 500 samples used for estimation

Remaining 500 samples used for validation31 / 38

Page 32: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Simulation Results (cont.)

Input-Output Estimation and Validation data

32 / 38

Page 33: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Simulation Results (cont.)

SVM design parameters: ε = 0.01, γ = 2000, σ2 = 290Laguerre bases: ξ = 0.25, model order = 6

Best Linear Approximation model computed using CVAalgorithm in n4sid routine, best order n = 4.

33 / 38

Page 34: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Simulation Results (cont.)

Validation results

34 / 38

Page 35: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Simulation Results (cont.)

Influence of ε

35 / 38

Page 36: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Simulation Results (cont.)

Influence of pole location

36 / 38

Page 37: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Conclusions

A new MISO Wiener model identification method based onSupport Vector Regression is introduced.

The method is applied to estimate a simplified (but nonlinear)model of the air supply system in a PEM fuel cell.

The estimated model proved to have good predictivecapabilities even when large deviations from the PEMFCoperating point are considered.

The predictive capabilities of the estimated model arecompared with those of the Best Linear Approximation of thesystem, which is shown to be not capable to accuratelyrepresent the system when large deviations from the operatingpoint are considered.

37 / 38

Page 38: SV-Regression for the Identification of Nonlinear Systems

Outline Introduction SV-Regression Wiener ID PEMFC System Simulation Results Conclusions

Muchas Gracias !!!

SV-Regression for the Identification of Nonlinear

Systems

Juan Carlos Gomez

FCEIA, Universidad Nacional de Rosarioand CIFASIS

Rosario, Argentina

{gomez}@cifasis-conicet.gov.ar

Seminario de Aplicaciones de la Matematica - November 07, 2014

38 / 38