Fixed Bed Adsorption Column Using Dimensionless Equations
2 次查看(过去 30 天)
显示 更早的评论
My group and I are trying to write a code for fixed bed adsorption with dimensionless equations and Damkohler's number. I attached an image of the equations we're trying to use and variables. We have a general idea and some code written down of what the variables are meaning but would like some help on where to go with the ODE/PDE code as we're not familiar with them. Any help, guidance, or advice would be greatly appreciated. Thank you very much in advance.
0 个评论
采纳的回答
Torsten
2023-12-1
编辑:Torsten
2023-12-1
The usual procedure is to define a grid
0 = X(1) < X(2) < ... < X(n) = 1
approximate the spatial derivative dA/dX in grid point i by
dA(i)/dx ~ (A(i)-A(i-1))/(X(i)-X(i-1)),
keep the time derivatives in their continuous form,
write the PDE system as a system of 2*n ordinary differential equations
A(1) = A_in
dA(i)/dt = - (A(i)-A(i-1))/(X(i)-X(i-1)) - q0/A_in * s(q(i),A(i)) 2<=i<=n
dq(i)/dt = s(q(i),A(i)) 1<=i<=n
and use ode15s to solve the system.
If you need further details, look up "method-of-lines".
7 个评论
Torsten
2023-12-4
To get a foundation in MATLAB programming, I suggest the MATLAB Onramp course to learn about MATLAB basics in an online course free of costs:
Torsten
2023-12-4
Here is a short code with the explicit method for the problem:
dy/dt + a*dy/dx = 0
a > 0
0 <= x <= 1
y(x,t=0) = 0 for all x
y(x=0,t) = 1 for all t
It's already very similar to yours.
a = 0.1;
tstart = 0.0;
tend = 2.0;
nt = 1000;
xstart = 0.0;
xend = 1.0;
nx = 1000;
x = linspace(xstart,xend,nx).';
dx = x(2)-x(1);
t = linspace(tstart,tend,nt);
dt = t(2)-t(1);
y = zeros(nx,nt);
y(:,1) = 0.0;
y(1,:) = 1.0;
for it = 2:nt
y(2:nx,it) = y(2:nx,it-1) - dt * a * (y(2:nx,it-1)-y(1:nx-1,it-1))./(x(2:nx)-x(1:nx-1));
end
plot(x,[y(:,1),y(:,500),y(:,1000)])
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!