% copyright Thomas Mc Avoy 1998
% Program to determine labels for calculated gain matrices

function [Glabel]=gainlbl

Mlabel=zeros(41,14);
Vlabel=zeros(41,16);
Glabel=zeros(41,5);

Mlabel(1,:)='A Feed Flow   ';
Mlabel(2,:)='D Feed Flow   ';
Mlabel(3,:)='E Feed Flow   ';
Mlabel(4,:)='C Feed Flow   ';
Mlabel(5,:)='Recycle Flow  ';
Mlabel(6,:)='Reactor Feed  ';
Mlabel(7,:)='Reactor Pres. ';
Mlabel(8,:)='Reactor Levl. ';
Mlabel(9,:)='Reactor Temp. ';
Mlabel(10,:)='Purge Flow    ';
Mlabel(11,:)='Separa. Temp. ';
Mlabel(12,:)='Separa. Levl. ';
Mlabel(13,:)='Separa. Pres. ';
Mlabel(14,:)='Sep. Exit Flow';
Mlabel(15,:)='Stripper Levl.';
Mlabel(16,:)='Stripper Pres.';
Mlabel(17,:)='Product Flow  ';
Mlabel(18,:)='Stripper Temp.';
Mlabel(19,:)='Steam Flow    ';
Mlabel(20,:)='Compress. Work';
Mlabel(21,:)='React CW Temp.';
Mlabel(22,:)='Conds CW Temp.';
Mlabel(23,:)='React Feed %A ';
Mlabel(24,:)='React Feed %B ';
Mlabel(25,:)='React Feed %C ';
Mlabel(26,:)='React Feed %D ';
Mlabel(27,:)='React Feed %E ';
Mlabel(28,:)='React Feed %F ';
Mlabel(29,:)='Purge Gas  %A ';
Mlabel(30,:)='Purge Gas  %B ';
Mlabel(31,:)='Purge Gas  %C ';
Mlabel(32,:)='Purge Gas  %D ';
Mlabel(33,:)='Purge Gas  %E ';
Mlabel(34,:)='Purge Gas  %F ';
Mlabel(35,:)='Purge Gas  %G ';
Mlabel(36,:)='Purge Gas  %H ';
Mlabel(37,:)='Product    %D ';
Mlabel(38,:)='Product    %E ';
Mlabel(39,:)='Product    %F ';
Mlabel(40,:)='Product    %G ';
Mlabel(41,:)='Product    %H ';
%Mlabel=['Meas. Variable';Mlabel];
for i=1:41
	if i<10
		Glabel(i,1)=num2str(i);
	else
		Glabel(i,1:2)=num2str(i);
	end
end
for i=1:9
	Glabel(i,1:5)=[Glabel(i,1),'    '];
end
for i=10:41
	Glabel(i,1:5)=[Glabel(i,1:2),'   '];
end
% No. is 5 characters long, measured variables are 14 characters
% long, and manipulated variables are 16 characters long.
m=1;
for i=1:12
		if i==1
		Vlabel(m,:)='   D Feed Valve ';
		elseif i==2
		Vlabel(m,:)='   E Feed Valve ';	
		elseif i==3
		Vlabel(m,:)='   A Feed Valve ';
		elseif i==4
		Vlabel(m,:)='   C Feed Valve ';	
		elseif i==5
		Vlabel(m,:)='   Recycle Valve';
		elseif i==6
		Vlabel(m,:)='   Purge  Valve ';
		elseif i==7
		Vlabel(m,:)='   Sep Out Valve';
		elseif i==8
		Vlabel(m,:)='   Product Valve';
		elseif i==9
		Vlabel(m,:)='   Steam Valve  ';
		elseif i==10
		Vlabel(m,:)='   Rea CW Valve ';
		elseif i==11
		Vlabel(m,:)='   Con CW Valve ';
		else
		Vlabel(m,:)='   Agitator     ';
		end
		m=m+1;
end
for i=13:41
	Vlabel(i,1:16)='                ';
end
Glabel=['     ','Meas. Variable','   Man. Variable';Glabel,Mlabel,Vlabel];



