Implicit finite difference scheme in MATLAB for 1D Mobile-Immobile Model (MIM) with linear sorption and degradation
I am trying to write a MATLAB code to solve the 1D Mobile-Immobile Model (MIM) for solute transport in porous media. My model includes both linear sorption (retardation) and first-order degradation.
The governing equations are:
Mobile Region:
Immobile Region:
Where:
and are the concentrations in the mobile and immobile regions.
and are retardation factors.
and are volumetric water contents.
and are first-order degradation rates.
is the mass transfer coefficient.
My Goal:
I want to implement a fully implicit finite difference scheme (Backward Euler in time, Central Difference for dispersion, and Upwind for advection) to ensure unconditional numerical stability.
My Issue:
I am comfortable assembling the sparse tridiagonal matrix for a standard Advection-Dispersion Equation (ADE). However, because the MIM equations are coupled, I am unsure of the best practice for assembling the coefficient matrix in MATLAB.
Specifically:
1. Should I decouple the equations by solving the immobile equation first at the current time step and substituting it into the mobile equation?
2. Or is it better to construct a larger block-diagonal sparse matrix to solve and simultaneously at ? If so, how should the indices be structured in MATLAB (`spdiags` or `sparse`) to represent this coupled system efficiently?
Any brief examples or structural advice on setting up the implicit matrix and right-hand side for this coupled system would be greatly appreciated.I am trying to write a MATLAB code to solve the 1D Mobile-Immobile Model (MIM) for solute transport in porous media. My model includes both linear sorption (retardation) and first-order degradation.
The governing equations are:
Mobile Region:
Immobile Region:
Where:
and are the concentrations in the mobile and immobile regions.
and are retardation factors.
and are volumetric water contents.
and are first-order degradation rates.
is the mass transfer coefficient.
My Goal:
I want to implement a fully implicit finite difference scheme (Backward Euler in time, Central Difference for dispersion, and Upwind for advection) to ensure unconditional numerical stability.
My Issue:
I am comfortable assembling the sparse tridiagonal matrix for a standard Advection-Dispersion Equation (ADE). However, because the MIM equations are coupled, I am unsure of the best practice for assembling the coefficient matrix in MATLAB.
Specifically:
1. Should I decouple the equations by solving the immobile equation first at the current time step and substituting it into the mobile equation?
2. Or is it better to construct a larger block-diagonal sparse matrix to solve and simultaneously at ? If so, how should the indices be structured in MATLAB (`spdiags` or `sparse`) to represent this coupled system efficiently?
Any brief examples or structural advice on setting up the implicit matrix and right-hand side for this coupled system would be greatly appreciated. I am trying to write a MATLAB code to solve the 1D Mobile-Immobile Model (MIM) for solute transport in porous media. My model includes both linear sorption (retardation) and first-order degradation.
The governing equations are:
Mobile Region:
Immobile Region:
Where:
and are the concentrations in the mobile and immobile regions.
and are retardation factors.
and are volumetric water contents.
and are first-order degradation rates.
is the mass transfer coefficient.
My Goal:
I want to implement a fully implicit finite difference scheme (Backward Euler in time, Central Difference for dispersion, and Upwind for advection) to ensure unconditional numerical stability.
My Issue:
I am comfortable assembling the sparse tridiagonal matrix for a standard Advection-Dispersion Equation (ADE). However, because the MIM equations are coupled, I am unsure of the best practice for assembling the coefficient matrix in MATLAB.
Specifically:
1. Should I decouple the equations by solving the immobile equation first at the current time step and substituting it into the mobile equation?
2. Or is it better to construct a larger block-diagonal sparse matrix to solve and simultaneously at ? If so, how should the indices be structured in MATLAB (`spdiags` or `sparse`) to represent this coupled system efficiently?
Any brief examples or structural advice on setting up the implicit matrix and right-hand side for this coupled system would be greatly appreciated. matlab, mobile-immobile model MATLAB Answers — New Questions









