%
% SPC charts of clarifier data
%
n = 100;
t = (1:n)*50/(n+1);
%
load qin.dat;
x = spline( qin(:,1), qin(:,2), t );
clear qin;
%
load cout.dat;
y = spline( cout(:,1), cout(:,2), t );
clear cout;
%
% scatter plot
%
figure;
plot( x, y, 'o' );
sxlabel( '\20Flowrate in m^3/s' );
sylabel( '\20Suspended solids in FTU' );
%
linreg( y, x, ones(size(x)) );
%
% run charts
%
figure;
[ hy2l hax ] = plotyy( t, x, 'w-', t, y, 'w-', ...
          [ 0 0 0 0 50 -6 6 0 200 ] );
%
ticlablt( hax(1), 0 );
ticlabgt( hax(2), 100 );
%
sxlabel( '\20Time in hours' );
sylabel( '\20Flowrate in m^3/s' );
sy2label( '\20Suspended solids in FTU' );
%
i = find( t > 0 & t < 28 );
m = mean(y(i));
cl = 3 * std(y(i));
h = line( [ 0 50 ], [ 12*(m+cl)/200-6 12*(m+cl)/200-6 ] );
set( h, 'linestyle', '--' );
h = line( [ 0 50 ], [ 12*(m-cl)/200-6 12*(m-cl)/200-6 ] );
set( h, 'linestyle', '--' );
%
