I want to solve 3 coupled PDEs equations. They depend on time, radius and length. I used the method of lines (MOL) and converted them to a system of ODEs in time. Now I want to solve them using MATLAB. Here are the equations:
\begin{align} &\frac{\partial C_{i,p}}{\partial t} + \frac{u_{cp}C_{i,p}}{r} + C_{i,p}\frac{\partial u_{cp}}{\partial r} + u_{cp} \frac{\partial C_{i,p}}{\partial r} - D_{eff}\left(\frac{\partial^2 C_{i,p}}{\partial r^2} + \frac{1}{r} \frac{\partial C_{i,p}}{\partial r}\right) = - \frac{(1-\epsilon_f)}{\epsilon_f} \rho_f \frac{\partial q_i}{\partial t}\\ &\frac{\partial q_i}{\partial t} = k_s (q_i^{eq} - q_i)\\ &q_i^{eq} = \frac{q_s b P_i}{[1 + (bP_i)^n]^{1/n}}\\ &q_s = q_{s0} \exp\left[\eta \left(1 - \frac{T}{T_0}\right)\right]\\ &b = b_0 \exp\left[\frac{-\Delta H}{R T_0}\left(1 - \frac{T_0}{T}\right)\right]\\ &\eta = A + B\left(1 -\frac{T_0}{T}\right)\\ &P_i = C_{i,p}/RT\\ &T = T_f\\ &\rho C_{pf}\frac{\partial T_f}{\partial t}-\frac{\lambda_f}{(1-\epsilon_f)} \left[\frac{\partial^{2}T_f}{\partial r^{2}}+\frac{1}{r}\frac{\partial T_f}{\partial r}+\frac{\partial^{2}T_f}{\partial z^{2}}\right] = \rho_f \Delta H_{ads} \frac{\partial q_{i}}{\partial t} \end{align}
I want to use ode15s
to solve them. I create one matrix where the rows indicate radius nodes and the columns indicate length nodes. I have a problem because they are coupled together and I cant use ode15s for solving them. Because ode15s
solve one equation from time=[0:end] and then solve another. I want to solve all of the equations step by step, first for time=1 then time=2, etc. Can anyone help me solve this set of ODEs using ode15
in MATLAB?