load simresult;
Time = sim(1, :);
Flow = sim(2:6, :);
Octane = sim(7, :);
Profit = sim(8, :);
acFlow = sim(9, end);
acProfit = sim(10, end);

figure
subplot(5, 1, 1)
plot(Time, Flow(1, :))
title('Flow 1')
axis([0 1e4 0 0.5])

subplot(5, 1, 2)
plot(Time, Flow(2, :))
title('Flow 2')
axis([0 1e4 0 0.5])

subplot(5, 1, 3)
plot(Time, Flow(5, :))
title('Total flow')
axis([0 1e4 0.999 1.001])

subplot(5, 1, 4)
plot(Time, Octane)
title('Octane')
axis([0 1e4 97.5 98.5])

subplot(5, 1, 5)
plot(Time, Profit)
title('Profit')
axis([0 1e4 0.04 0.08])

print -depsc m3_constant.eps

ProfitFactor = acProfit/acFlow
