function ScaleDataIO=scale_data(data) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Inputting a 2D matrix "data" containing the data set % This routine scales the data into the appropriate units % Data returned as "ScaleDataIO" % % Jan 2004 by Denise McKay % June 2004 % after slm fix by Denise McKay % Aug 2004 AgS % % June 2007 DM&JS, removed filtering %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ScaleDataIO=[]; % UNIT ADJUSTMENTS PCaIn=data(:,28)*249.089+101325; % convert from inH2O gauge to Pa absolute TCaIn=data(:,38)+273.15; % grab Cathode inlet temp data and convert from C to K %RHCaIn=data(:,37)/100; % grab cathode inlet RH data RHCaIn=ones(length(data(:,1)),1); % assume cathode inlet RH fully humidified PAnIn=data(:,27)*6894.76+101325; % grab Anode inlet pressure data and convert from psig to Pa absolute TAnIn=data(:,42)+273.15; % grab anonde inlet temp data and convert from C to K %RHAnIn=data(:,41)/100; % grab anode inlet RH data RHAnIn=zeros(length(data(:,1)),1); % assume anode inlet RH dry PCaOut=data(:,29)*249.089+101325; % grab Cathode outlet pressure data and convert from inH2O gauge to Pa absolute TCaOut=data(:,40)+273.15; % grab Cathode outlet temp data and convert from C to K RHCaOut=data(:,39)/100; % grab cathode outlet RH data PAnOut=data(:,45)*249.089+101325; % grab Anode outlet pressure data and convert from in H20 to Pa absolute TAnOut=data(:,44)+273.15; % grab Anode outlet temp data and convert from C to K RHAnOut=data(:,43)/100; % grab anode outlet RH data %rho_air=PCaIn./(8314.34.*TCaIn).*(28.97); %calculates air density (kg/m3) rho_air=1.2236;% air density at 15.6 degC and 1 atm (kg/m3) %rho_H2=PAnIn./(8314.34.*TAnIn).*(2.016); % calculates h2 denisty as funct of T and P (kg/m3) rho_H2=0.0838; %h2 density at 20 degC and 1 atm (kg/m3) WaCaIn=data(:,31).*(0.001/60).*rho_air; % converts volumetric flow (slm) to mass flow (kg/s) WHAnIn=data(:,30).*(0.001/60).*rho_H2; % converts volumetric flow (slm) to mass flow (kg/s) % calc vapor using ideal gas law for density of air TWPSOut=data(:,26)+273.15; % Tfc, cooling water temperature(K) out PS section TWPSIn=data(:,46)+273.15; % cooling water temperature(K) WWPSIn=data(:,48)/60; % mass flow of water into PS from l/min to kg/sek WWHMOut=data(:,47)/60; % mass flow of water out of Humidification from l/min to kg/sek time=data(:,1)*60-data(1,1)*60; % Experiment time (seconds) IFC = data(:,32); % Stack Current (Amperes) PurgeState = data(:,51); % STORE AS NEW MATRIX ScaleDataIO=[time,PCaIn,TCaIn,RHCaIn,PAnIn,TAnIn,RHAnIn,... %1,2,3,4,5,6,7 PCaOut,TCaOut,RHCaOut,PAnOut,TAnOut,RHAnOut,... %8,9,10,11,12,13, WaCaIn,IFC,TWPSOut,PurgeState]; %14,15,16,17