Code covered by the BSD License

# Simulation of Cascade PID Control and Model Predictive Control for a gas separation plant

### Hiroumi Mita (view profile)

Simulation of control in a gas separator process by membrane separation.

u_y_plot3_eng.m
```% This program is used to plot calculated data
%
% MathWorks Inc.
% 2010-06-21 Hiroumi mita

figure(1)
subplot(311);
hold on
p1=plot(y2(:,1))
p2=plot(u2(:,16),'--r')
xlim([0,25000])
ylim([0.2,0.5])
xlabel('Time[s]')
ylabel('Pressure[atm]')
legend('Gas Separator1 Gas Density of Permeation Part[-]','Set Point of Gas Density of Permeation Part[-]')
title('Gas Separator1')
hold off

subplot(312);
hold on
p3=plot(y2(:,2))
p4=plot(u2(:,17),'--r')
xlim([0,25000])
ylim([0.2,0.9])
xlabel('Time[s]')
ylabel('Pressure[atm]')
legend('Gas Separator2 Gas Density of Permeation Part[-]','Set Point of Gas Density of Permeation Part[-]')
title('Gas Separator2')
hold off

subplot(313);
hold on
p5=plot(y2(:,3))
p6=plot(u2(:,15),'--r')
xlim([0,25000])
ylim([0.2,1.0])
xlabel('Time[s]')
ylabel('Pressure[atm]')
legend('Gas Separator3 Gas Density of Permeation Part[-]','Set Point of Gas Density of Permeation Part[-]')
title('Gas Separator3')
hold off

set(p1,'LineWidth',2)
set(p2,'LineWidth',2)
set(p3,'LineWidth',2)
set(p4,'LineWidth',2)
set(p5,'LineWidth',2)
set(p6,'LineWidth',2)
% figure1 end

figure(2)
subplot(611);
p1=plot(u2(:,1),'-.')
hold on
p2=plot(u2(:,2),'r')
xlim([0,25000])
ylim([1 2.2])
title('Gas Separator1 Presssure of Material Part[atm]')
legend('Setpoints','Controlled Variables')
hold off

subplot(612);
p3=plot(u2(:,3),'-.')
hold on
p4=plot(u2(:,4),'r')
xlim([0,25000])
ylim([0.2 1.4])
title('Gas Separator1 Presssure of Permeation Part[atm]')
hold off

subplot(613);
p5=plot(u2(:,5),'-.')
hold on
p6=plot(u2(:,6),'r')
xlim([0,25000])
ylim([1 2.2])
title('Gas Separator2 Presssure of Material Part[atm]')
hold off

subplot(614);
p7=plot(u2(:,7),'-.')
hold on
p8=plot(u2(:,8),'r')
xlim([0,25000])
ylim([0.2 1.4])
title('Gas Separator2 Presssure of Permeation Part[atm]')
hold off

subplot(615);
p9=plot(u2(:,9),'-.')
hold on
p10=plot(u2(:,10),'r')
xlim([0,25000])
ylim([1 2.2])
title('Gas Separator3  Presssure of Material Part[atm]')
hold off

subplot(616);
p11=plot(u2(:,11),'-.')
hold on
p12=plot(u2(:,12),'r')
xlim([0,25000])
ylim([0.2 1.4])
title('Gas Separator3  Presssure of Permeation Part[atm]')
xlabel('Time[s]')
hold off

set(p1,'LineWidth',2)
set(p3,'LineWidth',2)
set(p5,'LineWidth',2)
set(p7,'LineWidth',2)
set(p9,'LineWidth',2)
set(p11,'LineWidth',2)
```