clc
clear all

load Openloop
load IMC
load Adaptive

z1 = Openloop (:,1);
z2 = IMC (:,1);
z3 = Adaptive (:,1);

P1_max = Openloop (:,2);
P2_max = IMC (:,2);
P3_max = Adaptive (:,2);


figure (1)
plot (z1,P1_max,'m',z2,P2_max,'b',z3,P3_max,'k','LineWidth',2.25);
legend ('Open loop','IMC based','Simple online',3);
hold on


P1_min = Openloop (:,3);
P2_min = IMC (:,3);
P3_min = Adaptive (:,3);

figure (1)
plot (z1,P1_min,'m',z2,P2_min,'b',z3,P3_min,'k','LineWidth',2.25);
grid on
xlabel ('Valve opening [Z]');
ylabel('Inlet Pressure [Kpa]');
title ('Comparison of different tuning methods from experiments with valve 2');
