None Notebook

This notebook contains material from cbe30338-2021; content is available on Github.

< 3.9 Lab Assignment 4: Solution | Contents | Tag Index | 4.1 Data/Process/Operational Historian >

Open in Colab

Download

4.0 Process Analytics

4.0.1 Learning Goals

4.0.1.1 Process Historians

Process historians are widely used throughout the process industries. The core function is to record and provide access to time series data for process tags.

The tclab library includes the basic functions of a process historian implemented using SQLite, a widely used database for web applications and internet connected devices.

What you should be able to do:


Study Question. The following list of data sources has been specified for the tclab historian. lab.T1 and lab.T1 are current values of temperatures T1 and T2.

`sources = [["T1", lambda: lab.T1], ["T_ave", lambda: (lab.T1 + lab.T1)/2], ["T2", lab.T2]]`

Study Question. Suppose you've written a novel control algorithm. The algorithm generates a floating point value that is denoted by the Python variable y_est. Given a list of data sources sources, add a source for this quantity with the tag "Y_EST".

Study Question. Suppose you have implemented a contrrol algorithm for a bioreactor application that utilizes a state space model. The state vector x has two elements representing temperature T and concentration C. Create a list of sources for the historian to record this data with tags "T" and "C".


4.0.1.2 State-Space Models

A linear state-space model is written in the form

\begin{align} \frac{dx}{dt} & = A x + B_u u + B_d d \\ y & = C x \end{align}

where $x$ is the state vector with $n$ elements, $u$ is a vector of manipulable inputs, $d$ is a vector of disturbance inputs, and $y$ is a vector of process measurements.

What you should be able to do:


Study Question. Suppose $x$ has five elements, $u$ has two elements, and $d$ has 1 element, and there is one process measurement. What are the dimensions of matrices $A$, $B_u$, $B_d$, and $C$?

Study Question. Someone has proposed a different model a temperature control device that includes heat transfer to the surround assembly. The model is written

\begin{align} C_{p,1}\frac{dT_1}{dt} & = U_a(T_2 - T_1) + Q_1 \\ C_{p,2}\frac{dT_2}{dt} & = U_a(T_1 - T_2) + U_b(T_{amb} - T_2) \end{align}

where $Q_1$ is the manipulable input, $T_2$ is measured, and $T_{amb}$ is an unmeasured external disturbance.


4.0.1.3 State Estimation

State estimation is a form of real-time process analytics employed in control systems. State estimation combines process models with real-time process measurements to provide estimates of process variables that may not be directly measureable.

At each time step $t_k$ there are two calculations to perform:

\begin{align} \hat{x}_k^{pred} & = \hat{x}_{k-1} + (t_k - t_{k-1}) ( A \hat{x}_{k-1} + B_u u_{k-1} + B_d \hat{d}_{k-1}) \\ \hat{y}_k^{pred} & = C \hat{x}_k^{pred} \end{align} $$\hat{x}_{k} = \hat{x}_{k}^{pred} - (t_k - t_{k-1})L (\hat{y}_{k}^{pred} - y_k)$$

$L$ is a matrix of observer gains.

The estimation error is given by $e = \hat{x} - {x}$ which satisfies the differential equations

\begin{align} \frac{de}{dt} & = (A - LC) e + B_d (\hat{d}-d) \end{align}

where $d$ is the unmeasured disturbance, and $\hat{d}$ is an apriori estimate of $d$. If the estimate is accurate, then $d = \hat{d}$.


Study Question. For a system with 2 states and 1 measurement, what is the dimension of the matrix $L$?

Study Question. For the same system, what is the dimension of the product $LC$?

Study Question. Suppose you are given numerical values for $A$, $L$, and $C$, how could you determine if the observer will be stable?

Study Question. The following charts test the performance of two different observers for the same system consisting of a single heater/sensor assembly. T1 is the measured temperature, Ts is the estimated sensor temperature, Th is the estimated heater temperature.


< 3.9 Lab Assignment 4: Solution | Contents | Tag Index | 4.1 Data/Process/Operational Historian >

Open in Colab

Download