%  Plot pressure versus time for a schematic figure
% showing low and high frequency variation.

A1 = 10;
A2 = A1 / 5;
tau1 = 4*24;
tau2 = tau1/80;
% hour=0:24;
t=linspace(0,24,401);
nmid=200;
tmid=t(nmid);
p0=1010;
p1 = p0+A1*sin(2*pi*t/tau1);
p2 =    A2*sin(2*pi*t/tau2);
p = p1+p2;
s1 = (2*pi/tau1)*A1*cos(2*pi*t/tau1);
s2 = (2*pi/tau2)*A2*cos(2*pi*t/tau2);
slope = s1+s2;
s1mid=s1(nmid);
smid=slope(nmid);
l1=p1(nmid)+s1mid*(t-tmid);
line=p(nmid)+smid*(t-tmid);

plot(t,p1,'LineWidth',2); hold on
plot(t,p,'y-','LineWidth',1)
plot(t(1:4:401),l1(1:4:401),'y.','LineWidth',1)
plot(t,line,'y--','LineWidth',2)
set(gca,'xtick',[0 3 6 9 12 15 18 21 24])
grid on
axis([0,24,1008,1022]);

title('\bf PRESSURE v. TIME');
print -deps fig1.eps
hold off
return
