ODE: Mixing Problems
AI-Generated Content
ODE: Mixing Problems
Mixing problems are a cornerstone application of differential equations in engineering and applied sciences, providing a powerful framework for modeling how substances disperse in fluids. Whether designing a chemical reactor, managing a water treatment plant, or understanding pharmacology, you can translate the physical principles of conservation of mass into a solvable first-order ordinary differential equation (ODE). Mastering this process trains you to move seamlessly from a word problem to a dynamic mathematical model and its quantitative solution.
The Fundamental Law: Rate In Minus Rate Out
The entire mathematical model rests on a single, powerful principle: the net rate of change of the amount of solute in a tank equals the rate at which it flows in minus the rate at which it flows out. This is a direct statement of conservation of mass. To apply it, you must carefully define the system (usually a well-stirred tank) and identify all flows.
Let’s establish a classic scenario. A tank initially contains $V_0$ liters of brine (salt-water solution) with $A_0$ kilograms of salt dissolved. Brine containing $c_{in}$ kg/L of salt enters at a constant rate of $r_{in}$ L/min. The well-stirred mixture leaves the tank at a rate of $r_{out}$ L/min. Our goal is to find $A(t)$, the amount of salt (in kg) in the tank at any time $t$.
The rate-in is straightforward: it's the concentration of the incoming stream multiplied by its flow rate: $\text{Rate}_{in} = c_{in} \cdot r_{in}$ (kg/min).
The rate-out requires more care. The concentration of salt in the outgoing stream is the same as the concentration in the well-stirred tank at that exact moment. This concentration is the current amount of salt $A(t)$ divided by the current volume of liquid in the tank. The volume is not constant unless $r_{in} = r_{out}$. The current volume is $V(t) = V_0 + (r_{in} - r_{out})t$. Therefore, the outgoing concentration is $A(t)/V(t)$. The rate-out is this concentration times the outflow rate: $\text{Rate}_{out} = \left( \frac{A(t)}{V(t)} \right) \cdot r_{out}$.
Assembling the principle gives us the governing differential equation:
$$\frac{dA}{dt} = \text{Rate}_{in} - \text{Rate}_{out} = c_{in} r_{in} - \frac{r_{out}}{V(t)} A(t).$$
This is a linear first-order ODE for $A(t)$. The initial condition is $A(0) = A_0$.
Solving the Linear First-Order ODE for Concentration
The equation we derived, $\frac{dA}{dt} + P(t)A = Q(t)$, where $P(t) = r_{out}/V(t)$ and $Q(t) = c_{in} r_{in}$, is solvable using an integrating factor, $\mu(t)$. The form of $P(t)$ depends on the tank's volume change.
In the constant-volume case ($r_{in} = r_{out} = r$), the volume $V$ is constant. This simplifies $P(t)$ to a constant: $P = r/V$. The integrating factor is $\mu(t) = e^{\int (r/V) dt} = e^{(r/V)t}$. Multiplying through and integrating leads to the solution:
$$A(t) = (c_{in} V) + (A_0 - c_{in} V)e^{-(r/V)t}.$$
The concentration, $C(t) = A(t)/V$, is often the quantity of interest:
$$C(t) = c_{in} + \left( \frac{A_0}{V} - c_{in} \right)e^{-(r/V)t}.$$
In the variable-volume case, $V(t)$ is linear, making $P(t) = r_{out} / (V_0 + (r_{in}-r_{out})t)$. The integrating factor becomes more complex but follows the same method: $\mu(t) = e^{\int P(t) dt}$. You must compute this integral carefully, remembering the antiderivative of $1/(a+bt)$ involves a natural logarithm.
Analyzing Steady-State Behavior
A key concept in engineering analysis is the steady-state concentration, the equilibrium value the system approaches after a long time ($t \to \infty$). For stable systems, this occurs when the inflow of solute perfectly balances the outflow, meaning $dA/dt = 0$.
From our fundamental equation, setting $dA/dt = 0$ gives:
$$0 = c_{in} r_{in} - \frac{r_{out}}{V_{final}} A_{ss}.$$
Solving for the steady-state amount $A_{ss}$ yields $A_{ss} = c_{in} r_{in} \cdot (V_{final}/r_{out})$. For the constant-volume case ($V_{final}=V$, $r_{in}=r_{out}=r$), this simplifies dramatically to $A_{ss} = c_{in} V$, and thus $C_{ss} = c_{in}$. This makes physical sense: eventually, the tank's concentration must match the concentration of the incoming feed. In the solution formula $C(t) = c_{in} + (C_0 - c_{in})e^{-(r/V)t}$, you can see explicitly that as $t \to \infty$, the exponential term vanishes, leaving $C_{ss} = c_{in}$.
Modeling Cascading Tank Systems
Real-world processes often involve multiple stages. Cascading tank problems introduce interconnected systems where the output of one tank becomes the input for the next. This results in a system of coupled linear first-order ODEs.
Consider two tanks in series. Tank 1 has volume $V_1$, input concentration $c_{in}$, and flow rate $r$. Its output concentration, $C_1(t) = A_1(t)/V_1$, flows into Tank 2, which has volume $V_2$. Tank 2's output flows to waste. The governing equations become:
$$\begin{aligned}
\frac{dA_1}{dt} &= r c_{in} - r \left( \frac{A_1}{V_1} \right), \\
\frac{dA_2}{dt} &= r \left( \frac{A_1}{V_1} \right) - r \left( \frac{A_2}{V_2} \right).
\end{aligned}$$
You solve this system sequentially. First, solve for $A_1(t)$ from the first equation (it's independent of $A_2$). Substitute this solution into the second equation for $A_2$, which is now a linear ODE with a known, time-dependent input function. Solving this yields $A_2(t)$. The steady-state analysis shows both tanks eventually reach the feed concentration $c_{in}$.
Translating Physical Scenarios into Differential Equations
The most critical skill is the initial translation from a worded scenario to the correct "rate in minus rate out" equation. Follow this systematic approach:
- Define Variables: Clearly state what
$A(t)$represents (e.g., kg of salt, moles of chemical, BOD in wastewater). Define all constants: volumes, flow rates, input concentrations. - Sketch the System: Draw the tank(s), label all flows (
$r_{in}$,$r_{out}$) and concentrations ($c_{in}$,$c_{out}=A(t)/V(t)$). - Compute Rate In: (Incoming concentration) × (Incoming flow rate). Ensure unit consistency (e.g., kg/L × L/min = kg/min).
- Compute Rate Out: This is the trickiest step. First, determine if the volume is constant. Then, the outgoing concentration is always the instantaneous tank concentration,
$A(t)/V(t)$. Multiply this by the outgoing flow rate. - Write the ODE and IC: Assemble:
$dA/dt = \text{Rate}_{in} - \text{Rate}_{out}$. Write the initial condition:$A(0) = A_0$.
Common Pitfalls
- Incorrect Outflow Concentration: The most frequent error is using the initial concentration
$A_0/V_0$or the inflow concentration$c_{in}$for the outflow rate. Remember, the tank is well-stirred, so what flows out at time t has concentration$A(t)/V(t)$. - Ignoring Volume Change: Assuming constant volume when flow rates are unequal. You must use
$V(t) = V_0 + (r_{in}-r_{out})t$in the rate-out term and potentially when solving the ODE. Always check if$r_{in} = r_{out}$first. - Unit Inconsistency: Mixing units (e.g., flow rate in gallons per second with volume in liters, or mass in pounds with concentration in grams/liter). Convert all quantities to a consistent unit system before writing the equation.
- Mis-solving the Variable-Volume ODE: In the variable-volume case, treating
$P$as a constant when integrating. You must correctly compute the integrating factor$\mu(t) = e^{\int [r_{out}/(V_0 + (r_{in}-r_{out})t)] dt}$, which involves logarithmic integration.
Summary
- The core mathematical model for a single well-stirred tank is derived from conservation of mass:
$\frac{dA}{dt} = (\text{concentration}_{in} \times \text{flow}_{in}) - \left(\frac{A(t)}{V(t)} \times \text{flow}_{out}\right)$. - This leads to a linear first-order ODE. The solution method depends on whether the tank volume
$V(t)$is constant (simpler exponential solution) or changing linearly in time (requiring an integrating factor based on a logarithmic integral). - The system approaches a steady-state concentration where
$dA/dt=0$. For a constant-volume tank with equal flow rates, the steady-state concentration always equals the concentration of the incoming feed. - Cascading tank problems are modeled by systems of coupled linear ODEs, solved sequentially. The output of an upstream tank defines the input concentration for the next.
- Success hinges on a meticulous, step-by-step translation of the physical scenario into variables and equations, with special attention to calculating the correct, time-dependent outflow concentration.