O'Reilly logo

Applied Process Control by Michael Mulholland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6Problem Solutions – Estimation of Variables and Model Parameters from Plant Data

S_6.1 6.1.1

MATLAB® Program code for Solution 6.1

% Cross-correlations and autocorrelations for Problem 6.1
% Tank & Pipeline
clear all;
close all
 
Tend=7200;
dt=10;
Nstep=Tend/dt;
V=1;            % m3 (tank)
Vp=1;           % m3 (pipe)
F=5/3600;       % m3/s
CA1=50;         % ppm (initialised at mid-range)
 
pointer_SHIFT=round(Vp/(F*dt));
Nstack=pointer_SHIFT+1;
CA1stack=CA1*ones(Nstack,1);
pointer_NOW=Nstack;
CA0plot=zeros(Nstep,1);
CA1plot=zeros(Nstep,1);
CA2plot=zeros(Nstep,1);
tplot=zeros(Nstep,1);
N=200;         % max no. of steps in correlation functions
 
for i=1:Nstep
    CA0=100*rand();
    CA1=CA1+(dt/V)*F*(CA0-CA1);  % simple Euler integration)
    pointer_NOW=pointer_NOW+1;   % cyclical file
    if (pointer_NOW>Nstack)
 pointer_NOW=pointer_NOW-Nstack; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required