# Modelling of Stefan Maxwell equation

I am trying to solve Maxwell Stefan's equation over a membrane to get the transient mole fraction distribution over the membrane thickness 'z'. But somehow I am not able to code it using ODE45, more likely I am not able to write the system to solve using ODE45. It will be really great if someone can help me with the primary syntaxes and function. The equation I am trying to solve is

$$\frac{dy_{H_2}}{dz}={\frac{1}{C \times D_{H_2,{H_2O}}}}\left[y_{H_2}(N_{H_2}+N_{H_2O})-N_{H_2}\right]$$

where C is concentration, $$D_{H_2,H_2O}$$ is the binary diffusion coefficient, N is molar flux and y is mole fraction

• How does the index $j$ play into these equations? You have an entire matrix of $D_{ij}$s as well as $N$ indexed by $j$ – whpowell96 Apr 17 at 3:37
• So do I see this right that, in reality, the equation simply has the form $y'(t)=Cy(t)-D$ where $y(t)$ is the solution and $C,D$ are constants? – Wolfgang Bangerth Apr 17 at 15:54
• @AnantShirsath: But what can be more accurate than writing down the exact solution as a function of $C$ and $D$, i.e., the various coefficients you have in the equation? – Wolfgang Bangerth Apr 18 at 1:46