Question: Complete the following MATLAB code: % Homework05.m % The Haber process, also called the Haber-Bosch process, % is the nitrogen fixation reaction over an enriched
Complete the following MATLAB code:
% Homework05.m
% The Haber process, also called the Haber-Bosch process,
% is the nitrogen fixation reaction over an enriched iron or
% ruthenium catalyst. The final stage, which is the actual Haber process,
% is the synthesis of ammonia using with nitrogen and hydrogen gases.
% N2 (g) + 3 H2 (g) --> 2 NH3 (g)
% (A, 2 points)
% Complete the Stoichiometric Table for a stoichiometric feed
% (assuming that all the species will remain in the gas-phase for
% this system). Select nitrogen as your reference reactant.
clc;
clear;
% (B, 2 points)
% Formulate the equations for the molar fractions of all species
% (for the scenario where there is no condensation), and plot the gas
% composition as a function of the conversion of nitrogen.
% All we need to do is recover the molar fractions and plot them
% as a function of the conversion.
% Initial conditions
FAo = 1; % It doesn't really matter (just remind stoichiometric feed).
% stoichiometric feed
thetaB = ??; % What is this?
thetaC = 0;
thetaI = 0;
xA = linspace(0, 1, 51)';
FA = FAo *??; % Stoichiometric table??
FB = FAo *??; % Stoichiometric table??
FC = FAo *??; % Stoichiometric table??
FI = FAo * thetaI;
FTo = FAo * (1 + thetaB + thetaC + thetaI);
delta = ??; % What is this?
yAo = ??; % What is this?
epsilon = ??; % What is this?
FT = FTo * ??; % What is FT as a function of epsilon? See Chapter 4 Slide #24.
yA = FA./FT;
yB = FB./FT;
yC = FC./FT;
yI = FI./FT;
% Plot Molar fractions (yA, yB, and yC) vs. xA
figure(1)
plot (xA, yA, 'rx:', xA, yB, 'r+:', xA, yC, 'bo:')
title ('Homework No. 5 - Part (B) - Gas Composition vs. xA')
grid;
xlabel ('N_2 conversion, x_A');
ylabel ('Molar fraction, y_i');
legend ('N_2', 'H_2', 'NH_3');
% (C, 3 points)
% If this reaction were to be performed isothermally at constant pressure,
% for what conversion of nitrogen would condensation begin
% if the operating pressure were 20, 50, or 100 bars?
% Plot the conversion of nitrogen as a function of temperature
% (for 0 oC
% Assume that only ammonia can be condensed at these (P and T) conditions.
% Use the NIST database (http://webbook.nist.gov/chemistry/)
% to find out Antoine's coefficients (i.e., vapor pressure
% as a function of temperature) for ammonia.
% Antoine Equation Parameters
% log10(P) = A - [B / (T + C)],
% where P = vapor pressure (bar) and T = temperature (K)
% Temperature (K) A B C Reference
% 164.0 - 239.6 3.18757 506.713 -80.78 Stull, 1947
% 239.6 - 371.5 ??? ??? ??? Stull, 1947
% Coefficients calculated by NIST from author's data.
% Since our temperature range is 0 oC
A = ??; % Find these numbers for ammonia (http://webbook.nist.gov/chemistry/)
B = ??;
C = ??;
T = linspace (0, 100, 21)';
TK = T + 273.15;
denom = TK + C;
log10P = A - B./denom;
PC_vap = 10.^log10P; % Ammonia vapor pressure from Antoine Equation
% Here we need to compare the partial pressure of ammonia
% with the ammonia vapor pressure as a function of temperature.
% If the partial pressure of ammonia (pC) is grater than the ammonia
% vapor pressure (PC_vap), then condensation will occur.
% pC >= PC_vap
% pC = yC * P >= PC_vap
% where yC = yAo * (thetaC + 2*xA)/(1 + epsilon*xA)
% yC >= PC_vap/P, where yC_crit = PC_vap/P
% yC_crit = yAo * (thetaC + 2*xA)/(1 + epsilon*xA)
% (yC_crit/yAo) * (1 + epsilon*xA) = thetaC + (2*xA)
% xA = ???
figure(2)
title ('Homework No. 5 - Part (C) - Critical conversion vs. T')
hold on;
PT = [20; 50; 100]; % This is the pressure range (P = 20, 50, 100 bars).
for i = 1:length(PT)
P = PT(i);
yC_crit = PC_vap./P;
y1 = yC_crit./yAo;
xA_crit = ??; % What is this? See the derivation above.
switch i
case 1
plot (T, xA_crit, 'rx:'); % Plot Temperature vs. xA at P = 20
case 2
plot (T, xA_crit, 'k+:'); % Plot Temperature vs. xA at P = 50
case 3
plot (T, xA_crit, 'bo:'); % Plot Temperature vs. xA at P = 100
end
end
grid;
ylabel ('N_2 conversion, x_A');
xlabel ('Temperature, T [^oC]');
legend ('P = 20 bar', 'P = 50 bar', 'P = 100 bar');
axis ([0 100 0 1])
hold off
% (D, 3 points)
% Investigate the effect of adding inerts to the feed.
% What would these results suggest?
% Explain your analysis/recommendations with actual calculations.
% Hint!
% The amount of inerts will change the value of "epsilon"
% through the initial molar fraction of N2 (yAo).
figure(3)
title ('Homework No. 5 - Part (D) - Critical conversion vs. T')
hold on;
theta = [0; 0.5; 2];
for i = 1:length(theta)
P = 100;
thetaI = theta(i); % Since inert gas (I) is added to the feed
FTo = FAo * (1 + thetaB + thetaC + thetaI);
delta = -1-3+2;
yAo = FAo/FTo;
epsilon = delta*yAo;
yC_crit = PC_vap./P; % This is derived from (C)
y1 = yC_crit./yAo;
xA_crit = ??; % What is this? See the derivation above.
switch i
case 1
plot (T, xA_crit, 'rx:'); % Plot Temperature vs. xA at thetaI = 0
case 2
plot (T, xA_crit, 'k+:'); % Plot Temperature vs. xA at thetaI = 0.5
case 3
plot (T, xA_crit, 'bo:'); % Plot Temperature vs. xA at thetaI = 2
end
end
grid;
ylabel ('N_2 conversion, x_A');
xlabel ('Temperature, T [^oC]');
legend ('\theta_I = 0', '\theta_I = 0.5', '\theta_I = 2');
axis ([0 100 0 1])
hold off

The Haber process, also called the Haber-Bosch process, is the nitrogen fixation reaction over an enriched iron or ruthenium catalyst. The final stage, which is the actual Haber process, is the synthesis of ammonia using with nitrogen and hydrogen gases. N2 (g) +3 H2 (g) > 2 NH3 (g) (A, 5 points) Complete the Stoichiometric Table for a stoichiometric feed (assuming that all the species will remain in the gas-phase for this system). Select nitrogen as your reference reactant. Fomuioie the equatio fohe lar facions of al species (for the scenario whero (B, 5 Formulate the equations for the molar fractions of all species (for the scenario where there is no condensation), and plot the gas composition as a function of the conversion of nitrogen. (C, 5 points, extra credit) If this reaction were to be performed isothermally at constant pressure, for what conversion of nitrogen would condensation begin if the operating pressure were 20, 50, or 100 bars? Plot the conversion of nitrogen as a function of temperature (for 0 C s T s 100 C) at which condensation will start Assume that only ammonia can be condensed at these (P and T) conditions. Use the NIST database (http://webbook.nist.gov/chemistryL) to find out Antoine's coefficients (i.e., vapor pressure as a function of temperature) for ammonia. (D, 5 points, extra credit) Investigate the effect of adding inerts to the feed. What would these results suggest? Explain your analysis/recommendations with actual calculations. The Haber process, also called the Haber-Bosch process, is the nitrogen fixation reaction over an enriched iron or ruthenium catalyst. The final stage, which is the actual Haber process, is the synthesis of ammonia using with nitrogen and hydrogen gases. N2 (g) +3 H2 (g) > 2 NH3 (g) (A, 5 points) Complete the Stoichiometric Table for a stoichiometric feed (assuming that all the species will remain in the gas-phase for this system). Select nitrogen as your reference reactant. Fomuioie the equatio fohe lar facions of al species (for the scenario whero (B, 5 Formulate the equations for the molar fractions of all species (for the scenario where there is no condensation), and plot the gas composition as a function of the conversion of nitrogen. (C, 5 points, extra credit) If this reaction were to be performed isothermally at constant pressure, for what conversion of nitrogen would condensation begin if the operating pressure were 20, 50, or 100 bars? Plot the conversion of nitrogen as a function of temperature (for 0 C s T s 100 C) at which condensation will start Assume that only ammonia can be condensed at these (P and T) conditions. Use the NIST database (http://webbook.nist.gov/chemistryL) to find out Antoine's coefficients (i.e., vapor pressure as a function of temperature) for ammonia. (D, 5 points, extra credit) Investigate the effect of adding inerts to the feed. What would these results suggest? Explain your analysis/recommendations with actual calculations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
