load kaskade.txt;
slutt=8200;
data=kaskade(1:slutt,:);
tid=cumsum(data(:,1));
t=tid/1000/60;
dpdata=data(:,4);
qdata=data(:,6);
zdata=data(:,7)/100;

dp=sgolayfilt(dpdata,1,21);
q=sgolayfilt(qdata,1,21);
z=sgolayfilt(zdata,1,21);

figure(1)
subplot(3,1,1)
plot(t,dp,t(700:slutt),0.02,'r')
ylabel('P2 [barg]')
xlabel('time [min]')
AXIS([0 13 0 0.15])

subplot(3,1,2)
plot(t,q)
ylabel('Massflow [kg/min]')
xlabel('time [min]')
AXIS([0 13 0 6])

subplot(3,1,3)
plot(t,z,t,0.2)
ylabel('Valve position [-]')
xlabel('time [min]')
AXIS([0 13 0 1])

clear all

load kaskade2.txt;
slutt=7050;
data=kaskade2(1:slutt,:);
tid=cumsum(data(:,1));
t=tid/1000/60;
dpdata=data(:,4);
qdata=data(:,6);
zdata=data(:,7)/100;

dp=sgolayfilt(dpdata,1,21);
q=sgolayfilt(qdata,1,21);
z=sgolayfilt(zdata,1,21);

figure(2)
subplot(3,1,1)
plot(t,dp,t(700:slutt),0.018,'r')
ylabel('P2 [barg]')
xlabel('time')
AXIS([0 14 0 0.15])

subplot(3,1,2)
plot(t,q)
ylabel('Massflow [kg/min]')
xlabel('time')
AXIS([0 14 0 6])

subplot(3,1,3)
plot(t,z,t,0.2)
ylabel('Valve position [-]')
xlabel('time')
AXIS([0 14 0 1])