clc
clear all
load Data1
load Data2
load Data3
load Data4

dt = 0.002;
t1_init = 145;
t2_init = 234;
t3_init = 257;
t4_init = 320;


y1 = Data1 (:,1);
y2 = Data2 (:,1);
y3 = Data3 (:,1);
y4 = Data4 (:,1);


n1 = length(y1);
n2 = length(y2);
n3 = length(y3);
n4 = length(y4);


t1 = 0:dt:(n1-1)*dt;
t2 = 0:dt:(n2-1)*dt;
t3 = 0:dt:(n3-1)*dt;
t4 = 0:dt:(n4-1)*dt;

r1 = [1.53*ones(1,t1_init/dt) 1.73*ones(1,n1-t1_init/dt)];
r2 = [1.73*ones(1,t2_init/dt) 1.54*ones(1,n2-t2_init/dt)];
r3 = [1.54*ones(1,t3_init/dt) 1.73*ones(1,n3-t3_init/dt)];
r4 = [1.49*ones(1,t4_init/dt) 1.70*ones(1,n4-t4_init/dt)];



figure (1)
clf

subplot (2,2,1);
plot (t1,r1,'r','LineWidth',1.5);
hold on
plot (t1,y1,'k','LineWidth',1.5);
xlim ([0 300]);
ylabel('Inlet pressure [bar]');
legend('Setpoint','Data',2)
title ('Test-1')
grid on

subplot(2,2,2);
plot (t2,r2,'r','LineWidth',1.5);
hold on
plot (t2,y2,'k','LineWidth',1.5);
xlim ([0 775]);
ylabel('Inlet pressure [bar]');
legend('Setpoint','Data',2)
title ('Test-2')
grid on

subplot(2,2,3);
plot (t3,r3,'r','LineWidth',1.5);
hold on
plot (t3,y3,'k','LineWidth',1.5);
xlim ([0 700]);
xlabel ('time [sec]');
ylabel('Inlet pressure [bar]');
legend('Setpoint','Data',2)
title ('Test-3')
grid on

subplot(2,2,4);
plot (t4,r4,'r','LineWidth',1.5);
hold on
plot (t4,y4,'k','LineWidth',1.5);
xlim ([0 900]);
xlabel ('time [sec]');
ylabel('Inlet pressure [bar]');
legend('Setpoint','Data',2)
title ('Test-4')
grid on


