MATLAB Reconciliation

Preview:

DESCRIPTION

linear algebra

Citation preview

Data Reconciliation with MATLAB... from “actual experience”!

Felipe Aristizábal

Department of Chemical EngineeringMcGill University

Montréal, QuébecJuly 31, 2013

Objectives

We will cover:The “basic fundamentals” of data reconciliation.Linear and Bilinear systems.MATLAB implementation.

Problem Description

Using mass balances, calculate the value of F6:

FI101

FI103

FI105

FI106

FI102

FI104

1

2

3

4

5 6

Stream Name kt/hFI-101 F1 110.5FI-102 F2 60.8FI-103 F3 35.0FI-104 F4 68.9FI-105 F5 38.6FI-106 F6 ????

Many solutions possible. Redundant measurements.

Data Reconciliation

All measurements have errors.Take advantage of redundant information.Formulate as constrained optimization problem.Analytical solution for linear and bilinear constraints.

Linear Constraints

Minimize: J(y) =(y − y)TV−1(y − y)Subject to: Ay =0

Where:

y : m by 1 vector of raw measurements.y : m by 1 vector of estimates.V : m by m covariance matrix.A: Incidence matrix - mass balances.

Analytical Solution: Linear Data Reconciliation

Using Lagrange multipliers ....... the estimates, y , can be calculated from:

W = I − VAT (AVAT )−1Ay = Wy

Cov(y) = WVW T

Procedure (MATLAB)1 Create y from measurements2 Obtain V from measurement standard deviations (V = diag(σ2

i ))3 Use mass balances to obtain A4 Calculate W , y5 Extra: what are estimates standard deviations, σi?

σi =√

diag(Cov(y))

Example: Linear DR

1

2

3

4

5 6

Stream Raw Standar Reconciled StandarNo. Measurement Deviation, σ Flow Deviation σ

(kt/h) (kt/h) (kt/h) (kt/h)1 110.5 0.82 103.2 0.422 60.8 0.53 65.4 0.373 35.0 0.46 37.8 0.304 68.9 0.71 65.4 0.375 38.6 0.45 37.8 0.306 101.4 1.20 103.2 0.42

Example: Bilinear System

F1x1,1x1,2

F2x2,1x2,2

F3x3,1x3,2

Non-Linear Constraints

F1x1,1 − F2x2,1 − F3x3,1 = 0x1,1 + x1,2 = 1...

Transform tocomponent flow

fij = Fixij

F1f1,1f1,2

F2f2,1f2,2

F3f3,1f3,2

Linear Constraints

f1,1 − f2,1 − f3,1 = 0F1 − f1,1 − f1,2 = 0...

Example: Bilinear System (cont.)

Approximate the variance of the new variables,

V (fij) ≈ x2ijV (Fi ) + F 2

i V (xij)

Variable Raw Standar ReconciledName Measurement Deviation, σ Measurement

F1 1095.5 54.8 1010.2x1,1 0.4822 0.0048 0.4808x1,2 0.5170 0.0052 0.5192F2 478.4 23.9 500.1x2,1 0.9410 0.0094 0.9518x2,2 0.0501 0.0005 0.0480F3 488.2 24.4 510.1x3,1 0.0197 0.0002 0.0190x3,2 0.9748 0.0097 0.9810

Recommended