clc
clear all

load Openloop
load Te
load SIMC
load IMC
load Adaptive

z1 = Openloop (:,1);
z2 = SIMC (:,1);
z3 = IMC (:,1);
z4 = Te (:,1);
z5 = Adaptive (:,1);

P1_max = Openloop (:,2);
P2_max = SIMC (:,2);
P3_max = IMC (:,2);
P4_max = Te (:,2);
P5_max = Adaptive (:,2);


figure (1)
plot (z1,P1_max,'m',z2,P2_max,'g',z3,P3_max,'b',z4,P4_max,'r',z5,P5_max,'k','LineWidth',2.25);
legend ('Open loop','Shams','IMC based','Trial and error','Simple online',5);
hold on



P1_min = Openloop (:,3);
P2_min = SIMC (:,3);
P3_min = IMC (:,3);
P4_min = Te (:,3);
P5_min = Adaptive (:,3);

figure (1)
plot (z1,P1_min,'m',z2,P2_min,'g',z3,P3_min,'b',z4,P4_min,'r',z5,P5_min,'k','LineWidth',2.25);
grid on
xlabel ('Valve opening [Z]');
ylabel('Inlet Pressure [Kpa]');
title ('Comparison of different tuning methods from simulations');

