Presentation is loading. Please wait.

Presentation is loading. Please wait.

Matlab Tutorial for State Space Analysis and System Identification

Similar presentations


Presentation on theme: "Matlab Tutorial for State Space Analysis and System Identification"— Presentation transcript:

1 Matlab Tutorial for State Space Analysis and System Identification
CS 851 Feedback Control of Computing Systems Matlab Tutorial for State Space Analysis and System Identification Vibha Prasad

2 CS 851 Feedback Control of Computing Systems
Overview Review of Chapter 7 Review of Chapter 10 Examples Followed in the Tutorial Specifying LTI systems with space-state models System response System Analysis Controller Design Tools System identification

3 CS 851 Feedback Control of Computing Systems
Chapter 7 Review State space models: Scalable approach to model MIMO systems State vector: x(k) State Model equations: x(k +1) = Ax(k) + Bu(k) y(k) = Cx(k) State vector: x(k): set of state variables Steady-state Gain = C(I - A)-1B Final value theorem: G(1) Equation:how the system changes How the system variables/state affects the output

4 Chapter 7 Review (Contd.)
CS 851 Feedback Control of Computing Systems Chapter 7 Review (Contd.) System Analysis Characteristic polynomial, det(zI – A) Poles = eigenvalues of A Steady-state Gain = C(I - A)-1B Equivalence: w(k) = Tx(k) w(k + 1) = (TAT-1)w(k) + (TB)u(k) y(k) = (CT-1)w(k) Many techniques for solving transfer functions apply to state space as well. Settling time and max overshoot are computed just as they were with transfer function models. Stesdy state systems have certain characteristics that are not observed in other models

5 Chapter 7 Review (Contd.)
CS 851 Feedback Control of Computing Systems Chapter 7 Review (Contd.) Controllability: system can be driven to an arbitrary state by properly choosing a set of inputs. C = [ An-1B An-2B AB B ] System controllable if controllability matrix C is invertible Observability: all the state can be inferred from its outputs. O = [ CAn-1 CAn CA C ] System observable if observability matrix O is invertible Steady state gain can be found using the final value theorem just as before.

6 CS 851 Feedback Control of Computing Systems
Chapter 10 Review State Feedback Architecture Static state feedback Similar to proportional control Does not include a reference point Static state feedback with precompensation Can track reference points Poor disturbance rejection Dynamic state feedback Similar to PI control for SISO systems Can track reference input and reject disturbance

7 Chapter 10 Review (Contd.)
CS 851 Feedback Control of Computing Systems Chapter 10 Review (Contd.) State feedback controller design Pole placement Specify max settling time and overshoot (ks* and Mp*) Obtain desired dominant poles of the closed –loop system Ks* = - 4/ log(|r|) Mp* = eπ/|θ| Construct the desired characteristic polynomial Other poles should have magnitude less than 0.25r Construct the modeled characteristic equation Equate coefficients of the desired and modeled characteristic polynomial and calculate gains

8 Chapter 10 Review (Contd.)
CS 851 Feedback Control of Computing Systems Chapter 10 Review (Contd.) State feedback controller design (contd.) LQR – Linear Quadratic Regulation Chooses feedback gains to minimize a weighted sum of control error and control effort J = ½ ∑ [ xT(k)Qx(k) + uT(k)Ru(k)] Select Q and R Compute feedback gains K Predict control system performance or run simulations Choose new Q and R and repeat the above steps if the performance is not suitable Consider Control Errors (Δx(k)) and Control Effort (Δu(k)), where x is the state vector and u is control input Reduce Control Errors: reduce settling time and overshoot Reduce Control Effort: reduce noise sensitivity Q: cost of state variation (control error) R:cost of input variation (control effort)

9 Examples followed in the tutorial
CS 851 Feedback Control of Computing Systems Examples followed in the tutorial SISO System Example Tandem Queue MIMO System Example Apache HTTP Server

10 CS 851 Feedback Control of Computing Systems
Tandem Queue Say something about: SISO systems Tandem queue Control input, K(k)= size of buffer 1 Measured output, R(k) = end-to-end response time x1(k + 1) = 0.13x1(k) – 0.069u(k) x2(k + 1) = 0.46x1(k) x2(k) y(k) = x1(k) + x2(k)

11 CS 851 Feedback Control of Computing Systems
Apache HTTP Server Measured CPU Controller Apache HTTP Server KeepAlive MaxClients Reference MEM Sya something about: MIMO systems Apache HTTP server x1(k + 1) = 0.54x1(k) – 0.11x2(k) u1(k) u2(k) x2(k + 1) = x1(k) x2(k) u1(k) u2(k) y1(k) = x1(k) y2(k) = x2(k)

12 System Identification
CS 851 Feedback Control of Computing Systems System Identification The system identification task is one of the most time consuming tasks in advanced control implementation projects. Problems: System analyst should have extensive background knowledge about the system, control theory, discrete time systems, optimization, statistics etc. Large no. of design variables. Solution: Understand the various system identification methods and associated decision variables. Effectively use a priori knowledge regarding the system to be identified and the purpose of the intended controller. Explain System ID How to design the experiment? How much data to collect? How to choose the model structure? Experience, prior knowledge How to deal with noise? Data contains noise hence the measurements are unreliable. Preprocess data, filter How do we measure the quality of the model? How will the purpose of the model affect the identification? How do we handle non-linear and time-varying effects?

13 System Identification Procedure
CS 851 Feedback Control of Computing Systems System Identification Procedure Design experiment and collect data. Examine the data. Preprocess the data. Detrending, prefiltering, outlier removal Model structure selection Depends on the application. Compute best model in the model structure. Examine the properties of the model obtained. Model validation This in terms of the system identification toolbox. The flowchart tells us what the text covers and what we started out at the beginning of the semester Define the model scope: Stochastics Model structure Workloads Choose the input signal such that the data carries maximum information. Examine the data. Preprocess the data. Reduce the influence of noise Select and define a model structure. Use prior knowledge Model Validation: Is the model good enough? Good is subjective and depends on the purpose of the model. If the model is good enough, then stop; otherwise go back to step 3 to try another model structure. You can also try other estimation methods (step 4), or work further on the input-output data (steps 1 and 2). Design an experiment and collect data.

14 System Identification Procedure
CS 851 Feedback Control of Computing Systems System Identification Procedure Experimental design issues Which signals to measure? How much data is needed? Input signal selection Sampling period selection Choose the input signal such that the data carries maximum information. Input signal selection: Range of values of the input signal Coverage of values within the operating region Richness in exciting the dynamics of the target system

15 System Identification Procedure
CS 851 Feedback Control of Computing Systems System Identification Procedure Examine the data Plot the data Preprocess the data Filter the data Remove trends in the data Reduce noise Remove outliers Resample the data Sensitive to noise Difficult to apply a short impulse big enough such that the response is much larger than the noise

16 System Identification Procedure
CS 851 Feedback Control of Computing Systems System Identification Procedure Model Structure Selection Many standard model structures are available depending on the approach (how to model the influence of the input and the disturbances). Model structure should suit the actual system. Finding the best model structure and model order is an iterative procedure. Model structure should suit the actual system. clear purpose of the system Many standard model structures are available depending on the approach (how to model the influence of the input and the disturbances). using a priori knowledge of the system analyst

17 System Identification Procedure
CS 851 Feedback Control of Computing Systems System Identification Procedure Compute the best model in the model structure. Parameter Estimation Examine the properties of the model Poles and zeros Model Output Transient response Compute the best model in the model structure according to input-output data and goodness to fit criterion General prediction error methods

18 System Identification Procedure
CS 851 Feedback Control of Computing Systems System Identification Procedure Model validation techniques Simulation Plot the measured output time series versus the predicted output from the model Crossvalidation Simulate on a data set different from the one used for parameter estimation. For the number of different model structures, plot the error and select the minimum. Is the model good enough? Good is subjective and depends on the purpose of the model. A model is of no use unless it is validated! Check the residuals Pole-zero cancellation Cross validation

19 System Identification Toolbox
CS 851 Feedback Control of Computing Systems System Identification Toolbox System Identification Toolbox provides features to build mathematical models of dynamic systems based on observed system data. MATLAB Example

20 CS 851 Feedback Control of Computing Systems Thank You
Questions? Thank You


Download ppt "Matlab Tutorial for State Space Analysis and System Identification"

Similar presentations


Ads by Google