Given Information:
The distributed-parameter system depicts chemical modelling being subjected to first order decay and the tank is mixed well vertically and laterally.
Apply finite length of segment, Δx. So, the equation formed is of the form,
VΔcΔt=Qc(x)−Q[ c(x)+∂c(x)∂xΔx ]−DAc∂c(x)∂x+DAc[ ∂c(x)∂x+∂∂x∂c(x)∂xΔx ]−kVc
Here, V
is the volume, Q
is the flow rate, c
is the concentration, D
is the dispersion coefficient, Ac
is the tank’s cross-sectional area, and k
is the first order decay coefficient.
Calculation:
Qcin=Qc0−DAc∂c0∂x …… (1)
Substitute centred finite differences for the first and the second derivatives in equation (1) to develop steady-state solution,
Dci+1−2ci+ci−1Δx2−Uci+1`−ci−12Δx−kci=0
Further simplify the equation,
(2DUΔx+kΔxU+2+ΔxUD)c0−(DUΔx)c1=(2+ΔxUD)cin …… (2)
And,
−(DUΔx+12)ci−1+(2DUΔx+kΔxU)ci−(DUΔx−12)ci+1=0 …… (3)
Also,
−(DUΔx)cn−1+(2DUΔx+kΔxU)cn=0 …… (4)
Solve the equation (2),
(2DUΔx+kΔxU+2+ΔxUD)c0−(DUΔx)c1=(2+ΔxUD)cin
Substitute D=2, U=1, cin=100, Δx=1.25, and k=0.2,
(2×21×1.25+0.2×1.251+2+1.25×12)c0−(21×1.25)c1=(2+1.25×12)100(3.2+0.25+2+0.625)c0−(1.6)c1=(2+0.625)1006.075c0−1.6c1=262.5
Hence, the required first equation is 6.075c0−1.6c1=262.5.
Solve the equation (3),
−(DUΔx+12)ci−1+(2DUΔx+kΔxU)c0−(DUΔx−12)ci+1=0
Substitute D=2, U=1, cin=100, Δx=1.25, and k=0.2,
−(21×1.25+12)ci−1+(2×21×1.25+0.2×1.251)c0−(21×1.25−12)ci+1=0−(2.1)ci−1+(3.45)c0−(1.1)ci+1=0
Hence, the required middle equation is −(2.1)ci−1+(3.45)c0−(1.1)ci+1=0.
Substitute i=1
in middle equation,
−(2.1)ci−1+(3.45)c0−(1.1)ci+1=0−(2.1)c1−1+(3.45)c1−(1.1)c1+1=0−2.1c0+3.45c1−1.1c2=0
Substitute i=2 in middle equation,
−(2.1)ci−1+(3.45)ci−(1.1)ci+1=0−(2.1)c2−1+(3.45)c2−(1.1)c2+1=0−2.1c1+3.45c2−1.1c3=0
Substitute i=3 in middle equation,
−(2.1)ci−1+(3.45)ci−(1.1)ci+1=0−(2.1)c3−1+(3.45)c3−(1.1)c3+1=0−2.1c2+3.45c3−1.1c4=0
Substitute i=4 in middle equation,
−(2.1)c4−1+(3.45)ci−(1.1)c4+1=0−(2.1)c4−1+(3.45)c4−(1.1)c4+1=0−2.1c3+3.45c4−1.1c5=0
Substitute i=5
in middle equation,
−(2.1)ci−1+(3.45)ci−(1.1)ci+1=0−(2.1)c5−1+(3.45)c5−(1.1)c5+1=0−2.1c4+3.45c5−1.1c6=0
Substitute i=6
in middle equation,
−(2.1)ci−1+(3.45)ci−(1.1)ci+1=0−(2.1)c6−1+(3.45)c6−(1.1)c6+1=0−2.1c5+3.45c6−1.1c7=0
Substitute i=7
in middle equation,
−(2.1)ci−1+(3.45)ci−(1.1)ci+1=0−(2.1)c7−1+(3.45)c7−(1.1)c7+1=0−2.1c6+3.45c7−1.1c8=0
Substitute i=8
in middle equation,
−(2.1)ci−1+(3.45)ci−(1.1)ci+1=0−(2.1)c8−1+(3.45)c8−(1.1)c8+1=0−2.1c7+3.45c8−1.1c9=0
Solve equation (4) for last equation,
−(DUΔx)cn−1+(2DUΔx+kΔxU)cn=0
Substitute D=2, U=1, cin=100, Δx=1.25, and k=0.2,
−(21×1.25)c9−1+(2×21×1.25+0.2×1.251)c9=0−1.6c8+3.45c9=0
Hence, the required last equation is −1.6c8+3.45c9=0
Write all the equations in matrix form,
[ 6.075c0−1.6c1−2.1c0+3.45c1−1.1c2−2.1c1+3.45c2−1.1c3−2.1c2+3.45c3−1.1c4−2.1c3+3.45c4−1.1c5−2.1c4+3.45c5−1.1c6−2.1c5+3.45c6−1.1c7−2.1c6+3.45c7−1.1c8−2.1c7+3.45c8−1.1c9−1.6c8+3.45c9]=[ 262.5000000000 ]
Express the matrix in tri-diagonal form,
[ 6.075−1.600000000−2.13.45−1.100000000−2.13.45−1.100000000−2.13.45−1.100000000−2.13.45−1.100000000−2.13.45−1.100000000−2.13.45−1.100000000−2.13.45−1.100000000−2.13.45−1.100000000−1.63.45 ][ c0c1c2c3c4c5c6c7c8c9 ]=[ 262.5000000000 ]
Use MATLAB to solve the above matrix.
% declare the matrix size
A = zeros(10,10);
% define the values of matrix A
A(1,1) = 6.075;
A(1,2) = -3.2;
A(2,1) = -2.1;
A(2,2) = 3.45;
A(2,3) = -1.1;
A(3,2) = -2.1;
A(3,3) = 3.45;
A(3,4) = -1.1;
A(4,3) = -2.1;
A(4,4) = 3.45;
A(4,5) = -1.1;
A(5,4) = -2.1;
A(5,5) = 3.45;
A(5,6) = -1.1;
A(6,5) = -2.1;
A(6,6) = 3.45;
A(6,7) = -1.1;
A(7,6) = -2.1;
A(7,7) = 3.45;
A(7,8) = -1.1;
A(8,7) = -2.1;
A(8,8) = 3.45;
A(8,9) = -1.1;
A(9,8) = -2.1;
A(9,9) = 3.45;
A(9,10) = -1.1;
A(10,9) = -3.2;
A(10,10) = 3.45;
% define the matrix b
b = [262.5;0;0;0;0;0;0;0;0;0];
% solve the inverse of matrix
Sol = A\b
The output of the program is given below.