% plots system reponse 
%
% Written by : Knut Åge Meland
% email: knutagemeland@gmail.com
%%
clear all
close all
clc

%fil som skal loades
filename= 'P1_Kc10_38.lvm';
%hvor bilde lagres
dir = 'c:\users\knutage\desktop\Master oppgave\Master_source\bilder\matlabfig\P1\tuning\';

%set x akse
starttime=182;
endtime= 332;
%set akse span(y akse)
par.Air_span    = [2.5, 3.5];
par.Water_span  = [0,   7.5];
par.P1_span     = [22,   30];
par.P2_span     = [0,   50];
par.P3_span     = [0,   50];
par.P4_span     = [0,   50];
par.dp_span     = [-1,  6];
par.slug_span   = [0,   6];
par.sp_span     = [0,   50];
par.valve_span  = [0,   40];


%% Processing data:
%step1: plot
[t, P1, P2, P3]= plotter(filename, starttime, endtime, par, 1.5 );
[P1f]=filterplotter(t,P1,4, 1/(4*4));
figure(1)
hold on
plot(t,P1f,'-r')
legend('P1','SP','P1(filtered)','Location', 'NorthWest')
%step2 :save
save_figure(1, dir)
