Solving the mixture problem using Euler’s step method

Up a level : Differential Equations
Previous page : Brine mixture, case 4, inflow≠outflow, brine in
Next page : Graphing all solutions

We may also find approximate solutions using Euler’s step method. We can use

\frac{{dy}}{{dt}} = {k_1}{r_1} - \frac{y}{V}{r_2}

This will give us the following algorithm:

\begin{array}{l} y \leftarrow {y_0}\\ t \leftarrow 0\\ V \leftarrow {V_0}\\ {\rm{repeat}}\\ \quad V \leftarrow V - \left( {{r_2} - {r_1}} \right)\Delta t\\ \quad y \leftarrow y + \left( {{k_1}{r_1} - \frac{y}{V}{r_1}} \right)\Delta t\\ \quad t \leftarrow t + \Delta t\\ {\rm{until}}\;t > {t_{\max }} \end{array}

The arrows stand for “is given the value”.

This is implemented on the next page.

Up a level : Differential Equations
Previous page : Brine mixture, case 4, inflow≠outflow, brine in
Next page : Graphing all solutionsLast modified: Dec 28, 2023 @ 17:30