Modeling and Analysis of Dynamic Systems

Similar documents
Least Squares Estimation Namrata Vaswani,

Modeling and Analysis of Dynamic Systems

EECE Adaptive Control

Linear Models for Regression

9 Multi-Model State Estimation

Modeling and Analysis of Dynamic Systems

4 Derivations of the Discrete-Time Kalman Filter

Kalman Filter. Predict: Update: x k k 1 = F k x k 1 k 1 + B k u k P k k 1 = F k P k 1 k 1 F T k + Q

Nonlinear System Identification Using MLP Dr.-Ing. Sudchai Boonto

Least Squares and Kalman Filtering Questions: me,

ELEC system identification workshop. Subspace methods

REGLERTEKNIK AUTOMATIC CONTROL LINKÖPING

Infinite Horizon LQ. Given continuous-time state equation. Find the control function u(t) to minimize

Modeling and Analysis of Dynamic Systems

NONLINEAR INTEGRAL MINIMUM VARIANCE-LIKE CONTROL WITH APPLICATION TO AN AIRCRAFT SYSTEM

Expressions for the covariance matrix of covariance data

RECURSIVE SUBSPACE IDENTIFICATION IN THE LEAST SQUARES FRAMEWORK

Kalman-Filter-Based Time-Varying Parameter Estimation via Retrospective Optimization of the Process Noise Covariance

Managing Uncertainty

1 Kalman Filter Introduction

6.4 Kalman Filter Equations

The Kalman Filter. Data Assimilation & Inverse Problems from Weather Forecasting to Neuroscience. Sarah Dance

ECE521 week 3: 23/26 January 2017

SIMON FRASER UNIVERSITY School of Engineering Science

Statistical and Adaptive Signal Processing

ROBOTICS 01PEEQW. Basilio Bona DAUIN Politecnico di Torino

Cautious Data Driven Fault Detection and Isolation applied to the Wind Turbine Benchmark

ECE531 Lecture 11: Dynamic Parameter Estimation: Kalman-Bucy Filter

Lecture 2: From Linear Regression to Kalman Filter and Beyond

Lecture: Simultaneous Equation Model (Wooldridge s Book Chapter 16)

Exponential Convergence Bounds in Least Squares Estimation: Identification of Viscoelastic Properties in Atomic Force Microscopy

DESIGNING A KALMAN FILTER WHEN NO NOISE COVARIANCE INFORMATION IS AVAILABLE. Robert Bos,1 Xavier Bombois Paul M. J. Van den Hof

Lessons in Estimation Theory for Signal Processing, Communications, and Control

Unbiased minimum variance estimation for systems with unknown exogenous inputs

Modeling and Identification of Dynamic Systems (vimmd312, 2018)

Least Squares. Ken Kreutz-Delgado (Nuno Vasconcelos) ECE 175A Winter UCSD

ENGR352 Problem Set 02

11. Further Issues in Using OLS with TS Data

CS 532: 3D Computer Vision 6 th Set of Notes

Derivation of the Kalman Filter

Ch. 15 Forecasting. 1.1 Forecasts Based on Conditional Expectations

EL1820 Modeling of Dynamical Systems

A recursive algorithm based on the extended Kalman filter for the training of feedforward neural models. Isabelle Rivals and Léon Personnaz

Introduction to Unscented Kalman Filter

Adaptive Noise Cancellation

Sensor Fusion, 2014 Lecture 1: 1 Lectures

Parametric Output Error Based Identification and Fault Detection in Structures Under Earthquake Excitation

Unsupervised Learning: Projections

L06. LINEAR KALMAN FILTERS. NA568 Mobile Robotics: Methods & Algorithms

Further Results on Model Structure Validation for Closed Loop System Identification

Time Series Analysis

Online monitoring of MPC disturbance models using closed-loop data

Lecture 22: Variance and Covariance

Lecture 2: From Linear Regression to Kalman Filter and Beyond

Modeling and Analysis of Dynamic Systems

RECURSIVE ESTIMATION AND KALMAN FILTERING

Modeling and Analysis of Dynamic Systems

6.435, System Identification

Image enhancement. Why image enhancement? Why image enhancement? Why image enhancement? Example of artifacts caused by image encoding

Probabilistic Fundamentals in Robotics. DAUIN Politecnico di Torino July 2010

Some Time-Series Models

1 Introduction to Generalized Least Squares

Basic Concepts in Data Reconciliation. Chapter 6: Steady-State Data Reconciliation with Model Uncertainties

Identification of ARX, OE, FIR models with the least squares method

6.435, System Identification

2D Image Processing. Bayes filter implementation: Kalman filter

Introduction to Estimation Methods for Time Series models. Lecture 1

y k = ( ) x k + v k. w q wk i 0 0 wk

Control Systems Lab - SC4070 System Identification and Linearization

Introduction to Data Assimilation. Reima Eresmaa Finnish Meteorological Institute

Statistics 910, #15 1. Kalman Filter

In the bivariate regression model, the original parameterization is. Y i = β 1 + β 2 X2 + β 2 X2. + β 2 (X 2i X 2 ) + ε i (2)

APPROXIMATE SOLUTION OF A SYSTEM OF LINEAR EQUATIONS WITH RANDOM PERTURBATIONS

Parametric Signal Modeling and Linear Prediction Theory 1. Discrete-time Stochastic Processes (cont d)

Review of Classical Least Squares. James L. Powell Department of Economics University of California, Berkeley

Title without the persistently exciting c. works must be obtained from the IEE

Statistics Homework #4

Mathematical Optimisation, Chpt 2: Linear Equations and inequalities

Lecture Note 12: Kalman Filter

Adaptive Robust Tracking Control of Robot Manipulators in the Task-space under Uncertainties

Design of Norm-Optimal Iterative Learning Controllers: The Effect of an Iteration-Domain Kalman Filter for Disturbance Estimation

Lecture 3: Multiple Regression

c i r i i=1 r 1 = [1, 2] r 2 = [0, 1] r 3 = [3, 4].

EM-algorithm for Training of State-space Models with Application to Time Series Prediction

DESIGN AND IMPLEMENTATION OF SENSORLESS SPEED CONTROL FOR INDUCTION MOTOR DRIVE USING AN OPTIMIZED EXTENDED KALMAN FILTER

ARIMA Modelling and Forecasting

Introduction to System Identification and Adaptive Control

Modeling and Analysis of Dynamic Systems

Elements of Multivariate Time Series Analysis

Adaptive ensemble Kalman filtering of nonlinear systems

Adaptive Filters. un [ ] yn [ ] w. yn n wun k. - Adaptive filter (FIR): yn n n w nun k. (1) Identification. Unknown System + (2) Inverse modeling

Cheng Soon Ong & Christian Walder. Canberra February June 2018

Modelling Non-linear and Non-stationary Time Series

Lecture 16: State Space Model and Kalman Filter Bus 41910, Time Series Analysis, Mr. R. Tsay

Linear Regression and Its Applications

Linear System Theory. Wonhee Kim Lecture 1. March 7, 2018

3. ESTIMATION OF SIGNALS USING A LEAST SQUARES TECHNIQUE

Optimal State Estimators for Linear Systems with Unknown Inputs

Principles of forecasting

ESTIMATION THEORY. Chapter Estimation of Random Variables

Transcription:

Modeling and Analysis of Dynamic Systems by Dr. Guillaume Ducard c Fall 2016 Institute for Dynamic Systems and Control ETH Zurich, Switzerland G. Ducard c 1

Outline 1 Lecture 9: Model Parametrization 2 G. Ducard c 2

Outline Lecture 9: Model Parametrization 1 Lecture 9: Model Parametrization 2 G. Ducard c 3

Introduction Lecture 9: Model Parametrization You came up with a mathematical model of a system, which contains some parameters (ex: mass, elasticity, specific heat,...). Now you need to run experiments to identify the model parameters. How to proceed? G. Ducard c 4

Introduction Lecture 9: Model Parametrization Least Squares Methods: Classical LS methods for static and linear systems closed-form solutions available. Nonlinear LS methods for dynamic and nonlinear systems only numerical (optimization) solutions available. Remark: there are closed-form approaches for linear dynamic systems as well. See master-level courses (e.g. Introduction to Recursive Filtering and Estimation ). G. Ducard c 5

Planning experiments is about knowing What excitation of the system : choice of correct input signals What to measure in the system (choice of sensors, their location, etc.) Measurements for linear or nonlinear model identification Frequency content of the excitation signals Noise level at input and output of the system Safety issues are best to efficiently identify the system parameters. Choose signals such that all the relevant dynamics and static effects inside the plant are excited with the correct amount of input energy. in p. 75-76 script. G. Ducard c 6

The data obtained experimentally may be used for two purposes: 1 To identify unknown system structures and system parameters. Using a first set of data: u 1,y r,1 u y 1 r,1 Real Plant Modeled System y m 2 To validate the results of the system modeling and parameter identification. Using a second set of data: u 2,y r,2 u y 2 r,2 Real Plant Modeled System y m G. Ducard c 7

A word of caution: It is of fundamental importance not to use the same data set for both purposes. The real quality of a parameterized model may only be assessed by: comparing the prediction of that model with measurement data that have not been used in the model parametrization. u y 2 r,2 Real Plant Modeled System y m Remark: the model and its identification are validated if: for the same input signal u 2, the output signals y r,2 and y m are sufficiently similar. G. Ducard c 8

Outline Lecture 9: Model Parametrization 1 Lecture 9: Model Parametrization 2 G. Ducard c 9

Introduction Lecture 9: Model Parametrization Least Squares estimation is used to fit the parameters of a linear and static model (model that mathematically describes inputs/outputs of the system). The model is never exact: for the same input signals there will be a difference between the outputs of the model, and true system outputs modeling errors. Remark: These errors may be considered a deterministic or stochastic variables. Both formulations are equivalent, as long as these errors are completely unpredictable and not correlated with the inputs. G. Ducard c 10

LS Formulation Lecture 9: Model Parametrization e u System s model y Figure: Elementary least-squares model structure. It is assumed that the output of the real system may be approximated by the output of the system s model with some model error e according to the linear equation: y(k) = h T (u(k)) π +e(k) with: k [1,...,r]: discrete-time instant G. Ducard c 11

y(k) = h T (u(k)) π +e(k) k: represents the index of discrete time (discrete-time instant k) u(k) R m input vector y(k) R is the output signal (measurement) (scalar). π R q is the vector of the q unknown parameters (those we want to estimate). h(.) R q is the regressor, depends on u in a nonlinear but algebraic way. e(k) is the error (scalar). Typically, there are more measurements than unknown parameters: (r q). G. Ducard c 12

LS Objective: Estimate π R q is the vector of unknown parameters (those we want to estimate) such that the model error e is minimized. In order to do that, let s formulate the problem into a matrix form (derived on the blackboard during the class). + Example. G. Ducard c 13

Outline Lecture 9: Model Parametrization 1 Lecture 9: Model Parametrization 2 G. Ducard c 14

Least-square solution and comments π LS = [ H T W H ] 1 HT W ỹ The regression matrix H must have full column rank, i.e., all q parameters (π 1,π 2,...π q ) are required to explain the data. Moore-Penrose inverse: M = (M T M) 1 M T, M R r q, r > q, rank{m} = q G. Ducard c 15

Least-square solution and comments If the error e is an uncorrelated white noise signal with: mean value 0 and variance σ, then 1 the expected value of the parameter estimation π LS is equal to its true value, a E(π LS ) = π true 2 covariance matrix: Σ = σ 2 (H T W H) 1. a Of course, only if the model perfectly describes the true system. G. Ducard c 16

Least Squares Solution: geometric interpretation Particular case: q = 2, r = 3 The result of the LS identification can be geometrically interpreted: the columns of H define the directions (projection vectors) that define a plane (defined by the 2 vectors in this case: h 1 h2 ) and therefore, ẽ LS is perpendicular to that plane. ỹ = Hπ LS +ẽ LS [ πls,1 ỹ = [ h 1 h 2 ] π LS,2 ] +ẽ LS ỹ = π LS,1 h 1 +π LS,2 h 2 +ẽ LS G. Ducard c 17

ỹ h1 ẽ LS π LS,2 h 2 h2 π LS,1 h 1 G. Ducard c 18

Outline Lecture 9: Model Parametrization 1 Lecture 9: Model Parametrization 2 G. Ducard c 19

Iterative Least Squares: Up to now, a batch-like approach 1 has been assumed: Problems: π LS = [ H T W H ] 1 HT W ỹ 1 The computation the matrix inversion part is the most time-consuming step. 2 Assuming that r measurements have been taken, a solution has been computed, numerically very inefficient to repeat the full matrix inversion procedure when an additional measurement data becomes available. 1 Batch-like approach: 1. all measurement are made, 2. data are organized in the LS pb formulation, 3. the LS solution is computed once G. Ducard c 20

Instead, an iterative solution of the form π LS (r +1) = f (π LS (r),y(r +1)), initialized by π LS (0) = E{π} would be much more efficient. How do we build up a recursive Least-Squares algorithm? G. Ducard c 21

Recursive LS Formulation 1 Start: π LS = [ H T W H ] 1 HT W ỹ G. Ducard c 22

Recursive LS Formulation 1 Start: π LS = [ H T W H ] 1 HT W ỹ 2 Simplification: consider weighting matrix simply as W = I (extension with W easily possible). π LS = [ H T H ] 1 HT ỹ G. Ducard c 23

Recursive LS Formulation 1 Start: π LS = [ H T W H ] 1 HT W ỹ 2 Simplification: consider weighting matrix simply as W = I (extension with W easily possible). π LS = [ H T H ] 1 HT ỹ 3 Formulate matrix products as sums: [ r 1 π LS (r) = h(k) h (k)] T k=1 r h(k) y(k) k=1 G. Ducard c 24

Recursive LS Formulation 1 Start: π LS = [ H T W H ] 1 HT W ỹ 2 Simplification: consider weighting matrix simply as W = I (extension with W easily possible). π LS = [ H T H ] 1 HT ỹ 3 Formulate matrix products as sums: [ r 1 π LS (r) = h(k) h (k)] T k=1 4 Use matrix inversion Lemma r h(k) y(k) k=1 G. Ducard c 25

Matrix Inversion Lemma Suppose M R n n is a regular matrix (det(m) 0), and v R n is a column vector, which satisfies the condition: 1+v T M 1 v 0. In this case: [M +v v T ] 1 = M 1 1 1+v T M 1 v M 1 v v T M 1 Remarks Proof by inspection: multiply from the left with M +v v T. Main advantage of this lemma: no additional matrix inversion than M 1 is needed. Inversion of the new matrix M +v v T may be carried out very efficiently. G. Ducard c 26

[ r 1 r π LS (r) = h(k) h (k)] T h(k) y(k) k=1 k=1 To simplify the notation, a matrix Ω is defined as: Ω(r) = Then compute Ω(r +1): [ r h(k) h T (k) k=1 ] 1 Ω(r +1) = = [ r+1 h(k) h T (k) k=1 ] 1 [ r h(k) h T (k)+h(r +1) h T (r +1) ] 1 k=1 G. Ducard c 27

[ r Ω(r +1) = h(k) h T (k)+h(r +1) h T (r +1) k=1 ] 1 we use the Inversion Lemma: [M +v v T ] 1 = M 1 Recursive formulation of the matrix inverse Ω(r +1) = Ω(r) 1 1+v T M 1 v M 1 v v T M 1 1 1+c(r +1) Ω(r) h(r +1) ht (r +1) Ω(r) where c(r +1) = h T (r +1) Ω(r) h(r +1) (scalar). G. Ducard c 28

r π LS (r) = Ω(r) h(k) y(k) k=1 How to compute recursively the estimate? r+1 π LS (r +1) = Ω(r +1) h(k) y(k) k=1 [ ] 1 = Ω(r) 1+c(r +1) Ω(r)h(r +1)hT (r +1)Ω(r) ( r ) h(k) y(k)+h(r +1) y(r +1) k=1 G. Ducard c 29

π LS(r+1) = Ω (r) and r h (k) y (k) + Ω (r) h (r+1) y (r+1) k=1 } {{ } π LS(r) 1 Ω 1+c (r) h (r+1) h T (r+1) Ω (r) (r+1) r h (k) y (k) k=1 } {{ } π LS(r) 1 Ω 1+c (r) h (r+1) h T (r+1) Ω (r) h (r+1) (r+1) }{{} c (r+1) y (r+1) c (r+1) 1+c (r+1) = 1 1+c (r+1) 1 G. Ducard c 30

π LS(r+1) = π LS(r) + Ω (r) h (r+1) y (r+1) }{{} 1 Ω 1+c (r) h (r+1) h T (r+1) π LS(r) (r+1) + 1 1 1+c (r+1) }{{} Ω (r) h (r+1) y (r+1) π LS(r+1) = 1 π LS(r) Ω 1+c (r) h (r+1) h T (r+1) π LS(r) (r+1) }{{} 1 + Ω 1+c (r) h (r+1) (r+1) }{{} y (r+1) G. Ducard c 31

Recursive computation of the parameter vector π LS(r) 1 ( ) π LS(r+1) = π LS(r) + Ω 1+c (r) h (r+1) y (r+1) h T (r+1) π LS(r) (r+1) with Recursive update of the gain matrix Ω Ω (r+1) = Ω (r) 1 1+c (r+1) Ω (r) h (r+1) h T (r+1) Ω (r) where c (r+1) = h T (r+1) Ω (r) h (r+1) (scalar). and Initialization π LS(0), Ω (0) G. Ducard c 32

Recursive computation of the parameter vector π LS(r) 1 ( ) π LS(r+1) = π LS(r) + Ω 1+c (r) h (r+1) y (r+1) h T (r+1) π LS(r) (r+1) can be rewritten as: ( ) π LS(r+1) = π LS(r) +δ(r +1) y (r+1) h T (r+1) π LS(r) Comments on the recursive formulation: The blue term is a vector indicating the correction direction: δ(r + 1) applied by the innovation term (or prediction error). Interesting to note that the correction direction is not dependent on the magnitude of the prediction error. G. Ducard c 33

Outline Lecture 9: Model Parametrization 1 Lecture 9: Model Parametrization 2 G. Ducard c 34

Exponential Forgetting New error weighting for the recursive case ǫ(r) = r λ r k [y(k) h T (k) π LS (k)] 2, λ < 1 k=1 This introduces an exponential forgetting process: older errors have a smaller influence on the result of the parameter estimation. Can cope with slowly varying parameters. Update equations π LS(r+1) = π LS(r) + Ω (r+1) = 1 λ Ω (r) 1 [ ] Ω λ+c (r) h (r+1) y (r+1) h T (r+1) π LS(r) (r+1) ] [ I 1 λ+c (r+1) h (r+1) h T (r+1) Ω (r) G. Ducard c 35

Outline Lecture 9: Model Parametrization 1 Lecture 9: Model Parametrization 2 G. Ducard c 36

Kaczmarz s projection algorithm Each new prediction error : e (r+1) = y (r+1) h T (r+1) π (r) contains new information on the parameters π only in the direction of h (r+1). Therefore, π (r+1) is sought, which requires the smallest possible change π (r+1) π (r) to explain the new observation Cost function to minimize: J(π) = 1 2 [π (r+1) π (r) ] T (π(r+1) π (r) )+µ [y (r+1) h T (r+1) π (r+1)] Necessary conditions for the minimum: J π (r+1) = 0 J µ = 0 G. Ducard c 37

Solve this linear equations for π(r +1) and µ π (r+1) = π (r) + Usually this solution is modified as h(r +1) h T (r +1) h (r+1) [y(r +1) h T (r+1) π (r)] γ h (r+1) π (r+1) = π (r) + λ+h T (r+1) h (r+1) [y(r +1) h T (r+1) π(r)] 0 < γ < 2, 0 < λ < 1 to achieve desired convergence and forgetting. Discussions Kaczmarz projection algorithm requires less computational efforts than regular LS It converges much slower than regular LS algorithm. Choice of algorithm depending on resources at hand and convergence speed requirements. G. Ducard c 38

Next lecture + Upcoming Exercise Next lecture Stability Analysis Properties of Linear Systems Next exercises: Least squares Parameter identification G. Ducard c 39