Professional Documents
Culture Documents
Process Control Project 1
Process Control Project 1
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 1 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
Project 1
Table of Contents
Background ................................................................................................................................... 3
Objective(s).................................................................................................................................... 4
Approach ....................................................................................................................................... 5
Symbols and Given Data ............................................................................................................ 7
Calculations .................................................................................................................................. 8
Summary of Results ................................................................................................................... 13
Discussion ................................................................................................................................... 15
References ................................................................................................................................... 15
Source Code ................................................................................................................................ 15
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 2 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
The model derived for Problem 3.7.15 of Riggs et al. (2020) is expanded to include these
effects. For the base case, consider that the hot-water heater is well mixed and has a water
holdup of V=30 gallons. Assume that initially the water temperature is 120°F. At time equal to
zero, hot water is withdrawn at rate of F = w = 5 gallons per minute and 5 gallons per
minute of cold water at 60°F are simultaneously added. (w is the mass flow rate of the water).
Assume that the heat addition rate to the hot-water heater is constant at 6 x 104 BTU/h and is
applied at the instant the hot water is removed from the tank. Please see Figure 1 for a
schematic of the process.
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 3 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
Objective(s)
1. Scenario 1: Simulate the base case, obtaining a plot of the tank outlet temperature T as a
function of time from 0 to 100 minutes. Only include the dynamics of the tank itself. Identify
the following parameters. Use the identified parameter values for the subsequent scenarios.
a. process time constant, min
b. process gain, ∆℉/𝐵𝑇𝑈/𝑚𝑖𝑛
c. time for temperature to drop to 90°F, min
d. time to new steady state, minutes
2. Scenario 2: To Scenario 1 add a control valve on the inlet stream and a thermocouple on the
tank outlet. Incorporate the valve (𝜏𝑣 =10 sec) and sensor dynamics (𝜏𝑠 =75 sec) to the modeling
equations. Co-plot the tank temperature with and without the valve/sensor dynamics from 0
to 100 minutes.
3. Scenario 3: Add to Scenario 2 a thermocouple transport delay of 1 minute. Add the time
course of the tank temperature including the transport delay to the plot of Scenario 2. Hint:
For a signal 𝑠(𝑡), its delayed version 𝑠𝑑 (𝑡) with delay value 𝜃 is defined as (where 𝑠0 is intial value of
𝑠(𝑡))
𝑠0 𝑖𝑓 𝑡 < 𝜃
𝑠𝑑 (𝑡) = {
𝑠(𝑡 − 𝜃) 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
4. Scenario 4: Contaminate the signal in Scenario 3 with noise corresponding to the repeatability
of a thermocouple in a thermowell. Use equation 3.8.1 (p. 134) of your text to generate the
added noise. If needed, employ a sampling time of 1 minute. Add the time course of the tank
temperature including the noise to the plot of Scenario 3. The equation 3.8.1 is (where
standard deviation 𝜎 is obtained from Table 2.4 as in your homework, 𝑥𝑛 is a random number
between 0 and 1)
1.961𝜎(𝑥𝑛 − 0.5)
𝑦𝑛 =
[(𝑥𝑛 + 0.002432)(1.002432 − 𝑥𝑛 )]0.203
5. Scenario 5: Apply a digital exponential filter EWMA to the signal from Scenario 4, using the
heuristic for setting the filtering time constant. Employ a sampling time of 1 minute. Add the
time course of the tank temperature including the filter to the plot of Scenario 4.
6. Scenario 6: Compute the sum of the squared errors (SSE) for the filtered and unfiltered signals
from Scenarios 4 and 5 over the range of 50 to 100 minutes. Do this for several different sets
SSE f
of random numbers. What is the upper bound for the ratio
SSEnf ?
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 4 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
(3) Determine whether spatial variations are important. State whether macroscopic or
microscopic method should be used, and whether you should get an ODE or PDE:
Spatial variations of process variables are not important in this case since there are no
substantial temperature gradients within the tank. The macroscopic method, lumped-parameter
model, will be used to model the system as a whole without considering spatial variations in
detail. Since the model uses macroscopic modelling, we will use Ordinary Differential
Equations.
(4) Write appropriate conservation equations (mass, mole, energy and so forth). Do not
forget initial conditions:
No generation of mass
𝐺 = 0, 𝜔𝑖 − 𝜔 = 0 (1)
Balance of mass:
(𝑑(𝜌𝑉))
=0 (2)
𝑑𝑇
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 5 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
̂
𝑑𝑈
= 𝜌𝑉𝐶𝑝 𝑑𝑇 (5)
𝑑𝑇
̂ = 𝐶𝑝 (𝑇 − 𝑇𝑟𝑒𝑓 )
𝐻 (6)
𝑑𝑈
̂) + 𝑄
= −∆(𝑤𝐻 (7)
𝑑𝑇
𝑑𝑇𝑟𝑒𝑓
= 0, 𝐶𝑣 = 𝐶𝑝 (9)
𝑑𝑡
(5) Perform degree of freedom analysis. Hint: process variables with given values can be
considered as constants.
There is no additional degree of freedom. The total number of unknown variables is one (T(t).
Number of equations is also one. Hence, degree of freedom (DOF) = 1 -1 = 0. Therefore, degree
of freedom analysis will be straightforward.
(6) Simplify the model in the form of standard ODE. Plug in values to compute time
constant, and process gain analytically based on your model. Hint: for a generic first-order
𝑑𝑦(𝑡)
ODE 𝜏 + 𝑦(𝑡) = 𝐾𝑢 + 𝑑(𝑡) where 𝑦(𝑡) is output and 𝑢(𝑡) is a constant step input, and
𝑑𝑡
d(t) is disturbance independent of u(t) and y(t), Then the time constant is 𝜏, and gain is 𝐾. Do
not forget initial conditions.
𝑑𝑇
𝑀𝐶𝑝 𝑑𝑡 = 𝑤[𝐶𝑝 (𝑇𝑖 − 𝑇)] + 𝑄 (10)
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 6 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
Symbols and Given Data (List Symbols and Data for the Model Established Above)
Symbol Description
𝐾𝑝 process gain
𝑇𝑓 Sensor temperature
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 7 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
Calculations
For each scenario, list your calculation procedures and the model (represented by
symbols not numbers) to be simulated, show the figure plot. Use your obtained time
constant or gain from the plots for all scenarios.
(1) Scenario 1:
First, we can find the time constant using the model below.
62.4
𝜌∗𝑉 𝜌∗𝑉 ( ) ∗ 30𝑔𝑎𝑙
𝜏𝑝 = = = 7.48052 = 6 𝑚𝑖𝑛𝑢𝑡𝑒𝑠
𝜔 𝜌 ∗ 𝐹𝑠𝑝𝑒𝑐 62.4 5𝑔𝑎𝑙
( ) ∗ min
7.48052
The density is divided by 7.48052 to change it to gal from ft3
9: 92.0007
X: 90
11: 89.7378
(90 − 89.7378)(11 − 9)
𝑋= + 9 = 10.77 𝑚𝑖𝑛
92.0007 − 89.7378
Time until a steady state is reached.
45: 85.9976
X: 84.0180
40: 84.0245
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 8 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
(2) Scenario 2:
𝑑𝐹 𝐹𝑠𝑝𝑒𝑐 − 𝐹
=
𝑑𝑡 𝜏𝑣
𝑔𝑎𝑙
5−𝐹 (5−𝐹)
min
Solving this gives: 1 = 0.16667 min
10∗
60
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 9 of 7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
𝑑𝑇𝑠 𝑇 − 𝑇𝑠
=
𝑑𝑡 𝜏 𝑇𝑠
Solving this:
(𝑇 − 𝑇𝑠 )℉ (𝑇 − 𝑇𝑠 )℉
=
1 1.25 min
75sec ∗ 60
(3) Scenario 3:
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 10 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
Incorporating a transport delay of 1 minute, the dynamic model of the actuator will be:
If 𝑡𝑖𝑚𝑒 ≤ 1 𝑚𝑖𝑛,
𝑑𝑇𝑠
=0
𝑑𝑡
Otherwise,
𝑑𝑇𝑠 𝑇 − 𝑇𝑠 (𝑇 − 𝑇𝑠 )℉
= =
𝑑𝑡 𝜏 𝑇𝑠 1.25 min
(4) Scenario 4:
The contribution of sensor noise will assume a Gaussian form for white noise, which is
represented by:
1.961σ(xn − 0.5)
𝑦𝑛 =
[(xn + 0.002432)(1.002432 − xn )]0.203
Here:
𝑥𝑛 = 𝑟𝑎𝑛𝑑𝑜𝑚 𝑛𝑢𝑚𝑏𝑒𝑟𝑠 𝑓𝑟𝑜𝑚 0 𝑡𝑜 1, This is generated 100 times, yielding 100 values for yn
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 11 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
σ = 0.9
(5) Scenario 5:
Applying a digital exponential filter EWMA to the signal from Scenario 4 using the
following equation.
Here,
∆𝑡
𝛼 𝑖𝑠 𝑎 𝑑𝑖𝑚𝑒𝑛𝑠𝑖𝑜𝑛𝑙𝑒𝑠𝑠 𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑒𝑑 𝑏𝑦 𝜏
𝑓 +∆𝑡
𝑖 = 2,3,4,5, … ,101.
𝑇𝑓 (𝑖) = 𝑜𝑢𝑡𝑝𝑢𝑡 𝑜𝑓 𝑓𝑖𝑙𝑡𝑒𝑟𝑒𝑑 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒
To compute the filtered temperature from 1 to 100 in the equation above, we will use a
for loop (2:101)
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 12 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
(6) Scenario 6:
The equation below was used to compute the sum of squared errors from 50 to 100 minutes.
𝑛
2
∑(𝑦𝑖 − 𝑓(𝑥𝑖 ))
𝑖=1
The equation below is the SSE for the unfiltered signal, which analyzes scenario 4 to 5.
101
∑ (𝑇𝑠𝑛 − 𝑇𝑠 )2 = 38.975
𝑖=51
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 13 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
Summary of Results
The process time constant was found to be 6 minutes. The process gain was 0.0240°𝐹/𝐵𝑇𝑈/𝑚𝑖𝑛
The system requires 10.77 minutes to drop to 90 °F while it needs approximately 40.82 to reach a
steady state. SSE for filtered signal is 17.348 while SSE for unfiltered signal is 38.975. This gives
a ratio of 0.4451 between the two SSEs.
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 14 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
Discussion
In scenario 1, the temperature starts at 120°F and reduces exponentially over time due to
cooling of the hot water in the tank. The reduction follows an exponential decay curve, with a
time constant of 6 minutes. Introducing the valve adds dynamics to the system, leading to a
slight variation in temperature at the initial stages. Temperature takes slightly longer to achieve
a new steady state. Adding noise increases oscillation, making it less smooth compared to
others. Filtering the system tries to smoothen it, reducing the variations due to noise.
References
Source Code
% Time vector
% Plot Scenario 1
figure;
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
grid on;
% Time vector
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 16 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
T1(1) = 120;
T2(1) = 120;
for i = 2:length(t)
dT1 = (5 * 8.342 * (60 - T1(i - 1)) / 41.708 + (6e4 * 1/60) / (1 * 41.708)) * dt;
dT2 = (5 * 8.342 * (60 - T2(i - 1)) / 41.708 + (6e4 * 1/60) / (1 * 41.708)) * dt;
end
% Plot Scenario 1 with and without valve dynamics on the same graph
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 17 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
figure;
hold on;
xlabel('Time (min)');
ylabel('Temperature (°F)');
legend('show');
grid on;
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 18 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
t3 = X2:0.1:100;
T3 = zeros(size(t3));
for i = 1:length(t3)
T3(i) = T1(index);
else
T3(i) = T1(end);
end
end
end
figure;
hold on;
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 19 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
legend('show');
grid on;
t3 = X2:0.1:100;
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 20 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
T3 = zeros(size(t3));
for i = 1:length(t3)
T3(i) = T1(index);
else
T3(i) = T1(end);
end
end
end
noise = zeros(size(t3));
for i = 1:length(t3)
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 21 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
end
T3_noisy = T3 + noise;
figure;
hold on;
xlabel('Time (min)');
ylabel('Temperature (°F)');
legend('show');
grid on;
alpha = 0.2;
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 22 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
T4_filtered = zeros(size(T4));
T4_filtered(1) = T4(1);
for i = 2:length(T4)
end
figure;
hold on;
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
legend('show');
grid on;
Summary
load('scenario1_data.mat');
load('scenario2_data.mat');
load('scenario3_data.mat');
load('scenario4_data.mat');
load('scenario5_data.mat');
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 23 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
figure;
% Scenario 1
subplot(5,1,1);
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
grid on;
% Scenario 2
subplot(5,1,2);
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
grid on;
% Scenario 3
subplot(5,1,3);
hold on;
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
legend('show');
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 24 of
7
CHE 4353 Project 1 Name: Mason Campbell Signature: ______________________
grid on;
% Scenario 4
subplot(5,1,4);
hold on;
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
legend('show');
grid on;
% Scenario 5
subplot(5,1,5);
xlabel('Time (minutes)');
ylabel('Temperature (°F)');
legend('show');
grid on;
tightfig;
This project is adapted from a previous process control project by Dr. Ted Wiesner. Page 25 of
7