Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Tank 1 start level (required)
-
Unit m Default 0.5 Range 0.05 to 2
About this input
The level of tank 1 at time 0 with free levels, 0.05 to 2 m (the rim). Set by dragging its water line on the canvas.
- Tank 2 start level (required)
-
Unit m Default 0.5 Range 0.05 to 2
About this input
The level of tank 2 at time 0 with free levels, 0.05 to 2 m.
- Tank 3 start level (required)
-
Unit m Default 0.5 Range 0.05 to 2
About this input
The level of tank 3 at time 0 with free levels, 0.05 to 2 m.
- Tank 1 start concentration (required)
-
Unit g/L Default 0 Range 0 to 1000
About this input
The dye already in tank 1 at time 0, 0 to 1000 grams per litre (in the tank table).
- Tank 2 start concentration (required)
-
Unit g/L Default 0 Range 0 to 1000
About this input
The dye already in tank 2 at time 0, 0 to 1000 grams per litre (in the tank table).
- Tank 3 start concentration (required)
-
Unit g/L Default 0 Range 0 to 1000
About this input
The dye already in tank 3 at time 0, 0 to 1000 grams per litre (in the tank table).
- Tank 1 cross-section (required)
-
Unit m² Default 0.5 Range 0.1 to 5
About this input
The cross-section of tank 1 with free levels, 0.1 to 5 square metres (in the tank table). A tank of cross-section A at level h holds 1000 x A x h litres.
- Tank 1 volume (required)
-
Unit L Default 500 Range 10 to 5000
About this input
The volume of tank 1 with fixed levels, 10 to 5000 litres. Set by dragging its water line on the canvas (10 L steps) or typed in the tank popover.
- Tank 2 volume (required)
-
Unit L Default 500 Range 10 to 5000
About this input
The volume of tank 2 with fixed levels, 10 to 5000 litres (used with 2 or 3 tanks).
- Tank 3 volume (required)
-
Unit L Default 500 Range 10 to 5000
About this input
The volume of tank 3 with fixed levels, 10 to 5000 litres (used with 3 tanks).
- Tank 2 cross-section (required)
-
Unit m² Default 0.5 Range 0.1 to 5
About this input
The cross-section of tank 2 with free levels, 0.1 to 5 square metres (in the tank table).
- Tank 3 cross-section (required)
-
Unit m² Default 0.5 Range 0.1 to 5
About this input
The cross-section of tank 3 with free levels, 0.1 to 5 square metres (in the tank table).
- Number of tanks (required)
-
Default 3 Range 1 to 3
About this input
How many well-mixed tanks stand in the row: 1, 2 or 3. The feed enters tank 1, each tank overflows into the next, and the last tank is the outlet. Added or removed with the + Tank and - Tank chips on the canvas.
- Feed concentration (required)
-
Unit g/L Default 10 Range 0 to 1000
About this input
The dye in the feed with a step change, 0 to 1000 grams per litre. With a dye pulse the feed is clean water.
- Feed flow (required)
-
Unit L/min Default 50 Range 1 to 1000
About this input
The flow of the feed into tank 1, 1 to 1000 litres per minute. With fixed levels every tank passes it; with free levels each tank settles where its outlet carries it away.
- Feed (required)
-
Default Step change Allowed Step change, Dye pulse
About this input
Step change: from time 0 the feed carries dye at the feed concentration. Dye pulse: the feed is clean water and a dose of dye is mixed into tank 1 at time 0. Chosen with a chip on the canvas.
- Challenge number (required)
-
Default 0 Range 0 to 5
About this input
Pick a challenge from 1 to 5, or 0 for none. A challenge fixes its own settings and leaves only some inputs to you.
- Decay rate (required)
-
Unit per min Default 0 Range 0 to 10
About this input
A first-order decay shared by every tank (a dye that breaks down), 0 to 10 per minute. 0 means the dye is conserved.
- Duration (required)
-
Unit min Default 120 Range 1 to 600
About this input
The simulated time, 1 to 600 minutes. The model takes 200 equal steps, so the time step is the duration over 200.
- Level mode (required)
-
Default Fixed levels Allowed Fixed levels, Free levels
About this input
Fixed levels: each tank holds a constant volume and every tank passes the same flow (a recycle pump is possible). Free levels: each tank drains through its outlet by gravity and its level moves until the outlet carries away what comes in. Chosen with a chip on the canvas.
- Tank 3 outlet size (required)
-
Unit L/min at 1 m Default 50 Range 1 to 500
About this input
The outlet of tank 3 with free levels, 1 to 500 litres per minute at a 1 m level (in the tank table).
- Pulse dose (required)
-
Unit g Default 1000 Range 0 to 100000
About this input
The dye mixed into tank 1 at time 0 with a dye pulse, 0 to 100000 grams.
- Recycle flow (required)
-
Unit L/min Default 0 Range 0 to 2000
About this input
The flow pumped from the last tank back to tank 1, 0 to 2000 litres per minute. Used only with fixed levels and 2 or 3 tanks; it stirs the tanks into one another.
- Prediction: the outlet concentration at 30 minutes
-
When omitted Blank
Unit g/L Default Not set Range 0 to 1000
About this input
Challenge 1 only: your prediction of the last tank's concentration 30 minutes after the feed steps up, in grams per litre. Blank until you predict; 0 is a real prediction.
- Tank 1 outlet size (required)
-
Unit L/min at 1 m Default 50 Range 1 to 500
About this input
The outlet of tank 1 with free levels: its outflow at a 1 m level, 1 to 500 litres per minute (in the tank table). The outflow grows with the square root of the level.
- Tank 2 outlet size (required)
-
Unit L/min at 1 m Default 50 Range 1 to 500
About this input
The outlet of tank 2 with free levels, 1 to 500 litres per minute at a 1 m level (in the tank table).
Outputs
- Pulse dose used
-
Unit g
About this output
The pulse dose the model used, grams (blank with a step change).
- Overflow time
-
Unit min
About this output
When a free-level tank passes the 2 m rim, the time it reaches the rim (the run stops there), minutes.
- Time of the outlet peak
-
Unit min
About this output
With a dye pulse, the time of the outlet peak, minutes.
- Outlet peak of the pulse
-
Unit g/L
About this output
With a dye pulse, the highest outlet concentration, refined by a parabola through three rows, grams per litre.
- Tank that overflowed
-
No unit declared
About this output
The tank that overflowed (1, 2 or 3).
- Model version
-
No unit declared
About this output
The model version.
- Model Status
-
No unit declared
About this output
OK, CHECK: (the results are shown but need care) or NOT VALID: (an input cannot be used; the results are empty), with the reason.
- Mixing time (outlet within 5%)
-
Unit min
About this output
The mixing time t95 after a step change: when the outlet comes within 5% of its total change and stays there, read from the rows by linear interpolation. Blank with a dye pulse, a run that stopped, no real change, or an outlet not mixed by the end.
- Formula module versions
-
No unit declared
About this output
The formula modules the model is built from, with their versions.
- The run, row by row: the time, each tank's level, concentration and outflow, and the exact outlet for equal tanks
-
No unit declared
About this output
The run row by row, n = 0 to 200: the time, each tank's level (free levels), concentration and outflow, and the exact outlet for equal clean tanks. Rows after a stop are blank; while challenge 1 waits for a prediction only row 0 is given.
- Number of tanks used
-
No unit declared
About this output
The number of tanks the model used (a challenge may fix it).
- Time step
-
Unit min
About this output
The time step, the duration over 200, minutes.
- Each tank: its steady volume and level, its start and steady concentration, its residence time and its highest level in the run
-
No unit declared
About this output
One row per tank in the row: its steady volume and level, its start and steady concentration, its residence time and its highest level in the run.
- Step ratio
-
No unit declared
About this output
The time step times the fastest rate in the model. Above 1 the curves lose accuracy; above 2.785, the method's stability limit, they can blow up.
- Largest error against the exact curve
-
Unit g/L
About this output
For equal clean tanks without recycle, the largest difference between the computed outlet and the exact cascade curve, grams per litre.
- Recycle flow used
-
Unit L/min
About this output
The recycle in effect, litres per minute (0 with one tank or free levels).
- Steady outlet concentration
-
Unit g/L
About this output
The outlet concentration the tanks settle at, in closed form, grams per litre (0 with a dye pulse).
- Mixing time of one tank of the same volume
-
Unit min
About this output
The exact mixing time of one well-mixed tank holding the same total volume, ln(20)/(feed/volume + decay), for comparison (fixed levels and a step change).
- Mean residence time (measured)
-
Unit min
About this output
With a dye pulse, the mean time the dye spent in the tanks, measured from the outflow (only the dye that left by the end counts), minutes.
- Decay rate used
-
Unit per min
About this output
The decay rate the model used, per minute.
- Colour scale, highest
-
Unit g/L
About this output
The top of the dye colour scale, the largest of the feed and start concentrations (1 when all are 0), grams per litre.
- Duration used
-
Unit min
About this output
The simulated time the model used, minutes.
- Drawing capacity of each tank
-
Unit L
About this output
With fixed levels, the capacity each tank is drawn with: the first of 50, 100, 200, 500, 1000, 2000 or 5000 litres that holds the largest tank.
- Challenge result
-
No unit declared
About this output
No challenge selected, MET or NOT MET.
- Challenge goal
-
No unit declared
About this output
What the selected challenge asks.
- Challenge feedback
-
No unit declared
About this output
The prompt while challenge 1 waits for a prediction, then a hint or the explanation once met.
- Challenge score
-
No unit declared
About this output
100 when the selected challenge is met, else 0.
- Challenge: the value scored
-
No unit declared
About this output
The value the selected challenge scores (blank while challenge 1 waits for a prediction).
- Level mode used
-
No unit declared
About this output
The level mode the model used.
- Mass ledger residual
-
Unit g
About this output
The mass ledger: dye in the tanks now, minus at the start, minus fed in, plus out, plus decayed, grams. With fixed levels it closes to rounding; with free levels it shows the method's small error.
- Mean residence time (exact)
-
Unit min
About this output
The mean residence time, the total volume over the feed (with free levels the steady volumes), minutes.
- Longest stable duration
-
Unit min
About this output
The longest duration whose time step keeps the step ratio within the stability limit, minutes.
- Highest steady level
-
Unit m
About this output
With free levels, the highest steady level of any tank, metres; the narrowest outlet fills highest.
- Feed concentration used
-
Unit g/L
About this output
The feed concentration in effect, grams per litre (0 with a dye pulse).
- Share of the dye recovered
-
No unit declared
About this output
With a dye pulse, the share of the starting dye that left through the outlet by the end of the run.
- Feed used
-
No unit declared
About this output
The feed the model used.
- Feed flow used
-
Unit L/min
About this output
The feed flow the model used, litres per minute.
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This lab follows dye through one, two or three well-mixed tanks standing in a row. A feed enters tank 1, each tank overflows into the next, and the last tank is the outlet. The tanks run in one of two level modes. With fixed levels each tank holds a constant volume, every tank passes the same flow, and a recycle pump can return part of the outflow from the last tank to tank 1. With free levels each tank is a cylinder that drains by gravity through an outlet whose flow grows with the square root of its level, so each level rises or falls until the outlet carries away what comes in. The feed is either a step change (from time 0 the feed carries dye) or a dye pulse (clean feed, and a dose of dye mixed into tank 1 at time 0). One first-order decay rate, shared by every tank, can make the dye break down on the way.
The model integrates the tank train with 200 steps of the classic fourth-order Runge-Kutta method and, beside the run, computes every steady state in closed form. It reports the outlet mixing time against one tank of the same total volume, the outlet peak and the measured residence time of a pulse, the steady levels and any overflow, a dye mass ledger, the exact cascade curve for equal tanks, and how the time step compares with the method's stability limit. Five challenges are scored by the model.
It is a lab for learning how mixing spreads through tanks in series: why more tanks of the same total volume make the outlet start later but finish sooner, why a pulse spreads into a hump, why decay removes more dye in series than in one big tank, and how recycle blurs a train back into one tank. It is not a process, water-treatment or engineering design method. Real tanks short-circuit, have dead zones and change with temperature; a mixing time from this lab is a property of ideal tanks, not of a real vessel.
The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the tanks with their water lines and dye colour, the pipes and their flows, the outlet and tank concentration curves, the level curves, the exact cascade curve and the tank table. The page computes no concentration, level, mixing time or residence time itself.
Inputs and units
Volumes are in litres (L), flows in litres per minute (L/min), concentrations in grams per litre (g/L), doses in grams (g), levels in metres (m), cross-sections in square metres (m²), time in minutes. A tank of cross-section A at level h holds 1000 × A × h litres.
| Input | Meaning and unit |
|---|---|
| Number of tanks | 1, 2 or 3 (default 3): how many well-mixed tanks stand in the row. |
| Level mode | Fixed levels (default) or Free levels. |
| Feed | Step change (default) or Dye pulse. |
| Tank 1, 2 and 3 volume | 10 to 5000 L each (default 500): the constant volume of each tank with fixed levels. |
| Tank 1, 2 and 3 start level | 0.05 to 2 m each (default 0.5): each tank's level at time 0 with free levels. 2 m is the rim. |
| Feed flow | 1 to 1000 L/min (default 50): the flow into tank 1. |
| Feed concentration | 0 to 1000 g/L (default 10): the dye in the feed with a step change. With a dye pulse the feed is clean water. |
| Pulse dose | 0 to 100000 g (default 1000): the dye mixed into tank 1 at time 0 with a dye pulse. |
| Tank 1, 2 and 3 start concentration | 0 to 1000 g/L each (default 0): the dye already in each tank at time 0. |
| Decay rate | 0 to 10 per minute (default 0): one first-order decay shared by every tank. 0 means the dye is conserved. |
| Recycle flow | 0 to 2000 L/min (default 0): the flow pumped from the last tank back to tank 1. Used only with fixed levels and 2 or 3 tanks. |
| Tank 1, 2 and 3 cross-section | 0.1 to 5 m² each (default 0.5): each tank's cross-section with free levels. |
| Tank 1, 2 and 3 outlet size | 1 to 500 L/min at a 1 m level each (default 50): each outlet's flow when its tank stands at 1 m, with free levels. |
| Duration | 1 to 600 minutes (default 120): the simulated time. The time step is the duration over 200. |
| Challenge number | 0 for free exploration, or 1 to 5 to load a challenge. |
| Prediction: the outlet concentration at 30 minutes | Blank, or 0 to 1000 g/L: your answer for challenge 1. Blank means not yet predicted; 0 is a real prediction. |
Every input except the prediction is required, and each is checked on the value entered, even when the chosen mode does not use it.
Where each input is set:
- On the canvas only: the number of tanks (the + Tank and - Tank chips), the level mode and the feed (two chips), and each tank's water line. Dragging a water line sets that tank's volume with fixed levels, in 10 L steps (a volume can also be typed in the tank's popover), or its start level with free levels, in 0.01 m steps. None of these is in the input panel.
- In the input panel: the feed flow, the duration, the feed concentration (step change only), the pulse dose (dye pulse only), the decay rate, the recycle flow (fixed levels with 2 or 3 tanks only) and the challenge picker. The prediction box appears only while challenge 1 is selected.
- In the Tanks table of the input panel: each tank's start concentration, and with free levels its cross-section and outlet size. Rows beyond the number of tanks are hidden.
Governing relationships
The well-mixed tank balance. Each tank is perfectly mixed, so the liquid leaving it has the tank's own concentration. For a tank of volume V and concentration c, receiving a flow Q_in at concentration c_up and losing dye to decay at rate k, the dye balance is d(V·c)/dt = Q_in·c_up - Q_out·c - k·V·c, with dV/dt = Q_in - Q_out. Substituting the second into the first gives the concentration form the model uses in both modes:
dc/dt = Q_in·(c_up - c)/V - k·c.
Fixed levels. With feed flow Q_F, feed concentration c_F (0 with a dye pulse), recycle R in effect (0 with one tank) and Q_t = Q_F + R, the flow through every tank:
- tank 1: dc₁/dt = (Q_F·(c_F - c₁) + R·(c_N - c₁))/V₁ - k·c₁, where c_N is the last tank's concentration;
- tank i from 2 to N: dc_i/dt = Q_t·(c_(i-1) - c_i)/V_i - k·c_i.
The levels do not move.
Free levels. Each outlet obeys the square-root (Torricelli) law Q_i = Q_ref,i·√(h_i / 1 m), where Q_ref,i is the outlet size and h_i the level. Tank 1 receives the feed and tank i receives the outflow of tank i - 1:
- dh_i/dt = (Q_in,i - Q_i)/(1000·A_i), with A_i the cross-section;
- dc_i/dt = Q_in,i·(c_up,i - c_i)/(1000·A_i·h_i) - k·c_i, with c_up,1 = c_F and c_up,i = c_(i-1).
Inside the derivative a level is taken as at least 1 mm, so a trial value can never give a negative square root or a zero volume.
Steady states, in closed form. With fixed levels, for i from 2 to N let a_i = Q_t/(Q_t + k·V_i) and let P be the product of the a_i (1 with one tank). Then c₁ = Q_F·c_F/((Q_t + k·V₁) - R·P) and ci = a_i·c*(i-1). With no recycle this is the textbook cascade: the steady outlet is c_F divided by the product of (1 + k·τ_i) over the tanks, with τ_i the residence time of tank i. With free levels every tank passes the whole feed at steady state, so tank i settles at h*_i = (Q_F/Q_ref,i)², holds V*_i = 1000·A_i·h*_i litres, and c*i = c*(i-1)·Q_F/(Q_F
- k·V*_i), starting from c_F. With a dye pulse every steady concentration is 0.
Residence times. Each tank's residence time is its volume (with free levels its steady volume) over the flow through it. The mean residence time of the system is the total volume over the feed flow, with or without recycle.
The integration. The classic fourth-order Runge-Kutta method takes 200 equal steps of h = duration/200. Each step evaluates the derivative four times (at the start, twice at the half step, once at the full step) and advances by h/6 times (k₁ + 2·k₂ + 2·k₃ + k₄). Three running totals are integrated with the same steps: the dye that has left through the outlet, the dye that has decayed, and the time-weighted dye that has left.
The stop rule. After each step the run stops if, with free levels, a level passes the 2 m rim (an overflow) or falls below 1 cm, or if a concentration exceeds one million times the top of the colour scale. Rows after a stop are blank.
The step ratio. The step ratio is the time step times the fastest rate in the model. With free levels and with fixed levels without recycle it is exact: the largest of Q_F/V_i + k (fixed levels), or of Q_ref,i/(2000·A_i·√h_i) and Q_in,i/(1000·A_i·h_i) + k (free levels, over the run). With recycle it is a safe upper bound, the largest of (Q_t/V_i + k) + e_i, with e₁ = R/V₁ and e_i = Q_t/V_i for the later tanks, so it can flag a run that is in fact stable. The classic Runge-Kutta method stays stable on a decaying mode while the step ratio is at most about 2.785; above 1 the curves already lose accuracy.
The guaranteed level bounds (free levels). Tank 1's level moves steadily from its start toward its steady level, and each later tank's inflow lies between the smallest and largest outflow of the tank before it. So the lowest level tank 1 can reach is the smaller of its start and steady levels, and for tank i it is the smaller of its start level and (Q_ref,(i-1)/Q_ref,i)² times the lowest level of tank i - 1. The highest level follows the same rule with larger in place of smaller. The longest stable duration is 200 × 2.785 over the fastest rate these bounds allow.
Mixing time t95 (step change). The outlet's total change is its start value minus the steady outlet; the band is 5% of the size of that change. The mixing time is the moment the outlet enters the band for the last time: the model finds the last row outside the band and interpolates linearly to the band edge between that row and the next.
One tank of the same volume. For one well-mixed tank of total volume V_tot the distance to steady state shrinks as exp(-(Q_F/V_tot + k)·t), so its mixing time is exactly ln(20)/(Q_F/V_tot + k).
Dye pulse measures. The outlet peak is the largest outlet concentration over the rows, refined by the vertex of a parabola through that row and its two neighbours. The measured mean residence time is the time-weighted dye that left divided by the dye that left. The share of the dye recovered is the dye that left divided by the dye in the tanks at time 0.
The mass ledger. The residual is the dye in the tanks now, minus the dye at the start, minus the dye fed in, plus the dye that left, plus the dye that decayed. With fixed levels the dye mass is a linear function of the concentrations, which the Runge-Kutta method conserves exactly, so the residual is rounding. With free levels the mass is a product of level and concentration, and the residual measures the method's error.
The exact cascade curve. For equal tanks with fixed levels, no recycle and clean tanks at the start, the outlet has an exact form. With q = Q_F/V, a = q + k and N tanks, a step change gives c_N(t) = c*_N·(1 - e^(-a·t)·(1 + a·t + (a·t)²/2 + ... up to N terms)), and a pulse gives the Erlang hump c_N(t) = c₁(0)·(q·t)^(N-1)/(N-1)!·e^(-a·t), the tanks-in-series residence time distribution. The largest difference between this curve and the computed outlet is reported as the largest error.
Calculation sequence
- Check the inputs in the order of the list under Errors and warnings, on the values entered.
- In a challenge, replace the inputs the challenge fixes with its own values.
- Derive the recycle in effect, the flow through each tank, the feed concentration in effect, the time step, the start levels and concentrations (the pulse dose divided by tank 1's volume at time 0 is added to tank 1), and the top of the colour scale.
- Compute the steady state of every tank, the residence times, the mean residence time, and with free levels the guaranteed level bounds; refuse a free-level run that could fall below 5 cm.
- Run the 200 Runge-Kutta steps row by row, with the running totals, applying the stop rule after each step.
- Read the step ratio, the mixing time, the one-tank comparison, the pulse measures, the highest levels, any overflow, the mass ledger and the exact cascade curve from the rows.
- Set the status and, in a challenge, score it.
Outputs and interpretation
- Mixing time (outlet within 5%): after a step change, the time t95 at which the outlet comes within 5% of its total change and stays there, in minutes. Blank with a dye pulse, a run that stopped, no real change, or an outlet not mixed by the end.
- Steady outlet concentration: the concentration the outlet settles at, in closed form, g/L (0 with a dye pulse).
- Mean residence time (exact): the total volume over the feed flow (with free levels the steady volumes), minutes.
- Mixing time of one tank of the same volume: the exact t95 of one tank holding the same total volume, for comparison; fixed levels and a step change only.
- Mean residence time (measured), outlet peak of the pulse, time of the outlet peak, share of the dye recovered: dye pulse only. The measured mean counts only the dye that left by the end. With no decay its exact value is the total volume over the feed; with decay it is shorter, because the dye that stays longest decays most.
- Highest steady level: with free levels, the highest steady level of any tank, metres; the narrowest outlet fills highest. Overflow time and tank that overflowed: when a free-level tank passes the 2 m rim, when and which.
- Mass ledger residual (grams), largest error against the exact curve (g/L, equal clean tanks without recycle only), step ratio, longest stable duration (minutes) and time step (minutes).
- Settings used: the number of tanks, level mode, feed, feed flow, feed concentration, pulse dose, decay rate, recycle and duration in effect (a challenge may fix them), and the model version.
- Tank table: for each tank, its steady volume and level, its start and steady concentration, its residence time and its highest level in the run.
- The run, row by row: 201 rows from time 0 to the duration, each with the time, every tank's level (free levels), concentration and outflow, and the exact outlet for equal clean tanks.
Reading the canvas: the tanks fill with colour from clear (0) to the darkest shade at the top of the colour scale, the largest of the feed and start concentrations. The player steps through the 201 rows, one frame per row. The outlet chart shows the last tank's concentration with the steady outlet as a horizontal line and t95 as a vertical marker; the other tanks' curves, the level curves and the dashed exact cascade curve appear at higher learning levels.
What to take from the lab: splitting one volume into more tanks in series makes the outlet curve steeper, so it starts later and finishes sooner; a pulse spreads into a hump whose mean is the residence time; decay in series removes more dye than decay in one big tank of the same volume, because less dye slips straight through; recycle stirs the tanks into one another; and with free levels each tank settles where its outlet carries exactly the feed, at a level that grows with the square of the feed.
Challenges
Each challenge fixes its own settings and leaves only some inputs to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met.
- Predict the outlet. Predict the outlet concentration of three clean 500-litre tanks 30 minutes after the feed steps to 10 grams per litre, within 0.25 g/L. The measured value is the last tank's concentration at row 50 (30 minutes with the 120-minute run). Met when your prediction is within 0.25 g/L of it.
- Mix faster. Split 1500 litres into up to three tanks so the outlet comes within 5% of its final value within 65 minutes. Met when the total volume is within 0.5 L of 1500 and the mixing time is at most 65 minutes.
- Treat the outflow. With a decay rate of 0.05 per minute, split 1500 litres into up to three tanks so the steady outlet is below 3 grams per litre. Met when the total is within 0.5 L of 1500 and the steady outlet is below 3 g/L.
- Fill to the rim. With free levels and outlets of 50, 40 and 60 litres per minute, set the feed so the fullest tank settles between 1.9 m and the 2 m rim. Met when no tank overflows during the run and the highest steady level is from 1.9 m to 2 m.
- Three tanks into one. Add recycle to three 500-litre tanks until the outlet takes at least 95% as long to mix as one 1500-litre tank, without a coarse-step warning. Met when the mixing time is at least 95% of the one-tank mixing time and the step ratio is at most 1.
Challenge 1 holds back the answer until you predict: while the prediction is blank, the mixing time and the measured value are blank, rows 1 to 200 of the run are blank (only time 0 is shown, so the tanks do not fill), and the challenge reads NOT MET with the prompt to predict first. The steady outlet, the mean residence time, the one-tank comparison and the tank table stay visible. Once you enter any number, 0 included, every result appears and the challenge is scored. Challenges 2 to 5 hold nothing back: their results are feedback on your own split, feed or recycle. A prediction entered with no challenge, or in challenges 2 to 5, changes nothing.
Validation and status logic
The status reads the first match in the list under Errors and warnings. The input checks (the first twelve NOT VALID messages) use the values you entered, inside a challenge too. The dry-tank refusal and the CHECK messages use the values in effect after a challenge has fixed its own. CHECK messages apply inside challenges as well: challenge 4 starts with an overflow, on purpose. A challenge number that is not a whole number from 0 to 5 counts as no challenge.
Assumptions and limitations
- At most three tanks in a row, each perfectly mixed at every instant; one feed into tank 1; no side feeds or splits; no dead zones or short-circuiting.
- Fixed levels: constant volumes, with optional recycle from the last tank to the first. Free levels: cylindrical tanks with the square-root outlet law, no recycle; a level above the 2 m rim overflows and stops the run.
- One first-order decay rate shared by every tank; no other reaction. Density and temperature do not change.
- 200 fixed Runge-Kutta steps. The step ratio is exact for free levels and for fixed levels without recycle, and a conservative bound with recycle, so a run with recycle can read beyond the limit and still complete.
- The free-level bounds are conservative for the transient; the steady levels are exact.
- t95 is read from the 201 rows by linear interpolation and needs a complete run. The pulse peak is interpolated by a parabola through three rows. The measured mean residence time counts only dye that left by the end.
- A value within about 1×10⁻⁹ (relative) of a threshold, such as the t95 band, the rim, the 1 cm floor, the 5 cm refusal, the step-ratio limits 1 and 2.785, or a challenge band, may fall either side of it.
Restrictions and non-computing states
Under NOT VALID every result, every row of the run and every tank table entry is blank, except the model version, the challenge result (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.
A run that stops early (an overflow, a level below 1 cm, a concentration out of range, or a blow-up beyond the stability limit) shows its rows up to the stop and blank rows after it; the mixing time is blank.
In challenge 1, until you predict, the results described under Challenges are held back.
Errors and warnings
The status messages, first match wins (tank i is the first tank concerned):
- NOT VALID: the number of tanks must be 1, 2 or 3
- NOT VALID: choose the level mode and the feed from their lists
- NOT VALID: each tank volume must be from 10 to 5000 litres
- NOT VALID: the feed flow must be from 1 to 1000 litres per minute
- NOT VALID: the feed and starting concentrations must be from 0 to 1000 grams per litre
- NOT VALID: the pulse dose must be from 0 to 100000 grams
- NOT VALID: the decay rate must be from 0 to 10 per minute
- NOT VALID: the recycle flow must be from 0 to 2000 litres per minute
- NOT VALID: each cross-section must be from 0.1 to 5 square metres, and each outlet size from 1 to 500 litres per minute
- NOT VALID: each starting level must be from 0.05 to 2 metres
- NOT VALID: the duration must be from 1 to 600 minutes
- NOT VALID: the challenge number must be a whole number from 0 to 5, and the outlet prediction blank or a number from 0 to 1000
- NOT VALID: with free levels tank i could run almost dry (below 5 cm); raise the feed, narrow that tank's outlet or start it fuller: the guaranteed lowest level of that tank is under 5 cm.
- CHECK: the time step is beyond the method's stability limit, so the run blew up and stopped early; shorten the duration: the run stopped and the step ratio is above 2.785.
- CHECK: tank i overflowed: its level passed the 2 m rim, so the run stops there; lower the feed or widen that tank's outlet: free levels; the overflow time and tank are shown.
- CHECK: a level or concentration left its possible range, so the run stopped early; shorten the duration: a level below 1 cm or a concentration out of range stopped the run within the stability limit.
- CHECK: the time step is beyond the method's stability limit (step ratio above 2.785), so the curves can be wrong; shorten the duration: the run completed, but the step ratio is above 2.785.
- CHECK: the time step is coarse (step ratio above 1), so the curves lose accuracy; shorten the duration
- CHECK: at this feed tank i cannot settle below the 2 m rim; a longer run would overflow it: free levels, the run completed, and that tank's steady level is above 2 m.
- CHECK: more than 1% of the dye is still in the tanks at the end, so the measured mean residence time is too short; run longer: dye pulse.
- CHECK: the outlet has not come within 5% of its steady value by the end of the run; run longer: step change, with a real change in the outlet.
- OK
References
This laboratory is an educational model of well-mixed tanks in series. Each tank obeys the mass balance of a perfectly stirred tank, rate of change of dye equals dye in minus dye out minus dye decayed, in the concentration form that holds for fixed and changing volumes. With free levels each outlet follows the square-root law that comes from Torricelli's theorem. The train is integrated with the classic fourth-order Runge-Kutta method, and the results for equal tanks are set beside the tanks-in-series model: its step response and its Erlang residence-time hump.
Sources and further reading
- The mixing problem for one well-stirred tank, its balance of rate in and rate out, and its exponential approach to a limit: W. F. Trench, Elementary Differential Equations with Boundary Value Problems, section 4.2, Cooling and Mixing, LibreTexts Mathematics. LibreTexts
- The classic fourth-order Runge-Kutta method and its four slopes: W. F. Trench, Elementary Differential Equations with Boundary Value Problems, section 3.3, The Runge-Kutta Method, LibreTexts Mathematics. LibreTexts
- Torricelli's theorem, the speed of liquid leaving an opening below a free surface, behind the square-root outlet law: OpenStax, College Physics 2e, section 12.3, The Most General Applications of Bernoulli's Equation. OpenStax
- The tanks-in-series model, its residence-time distribution and first-order reaction in stirred tanks in series: O. Levenspiel, Chemical Reaction Engineering, 3rd edition, John Wiley and Sons, 1999, chapter 14, The Tanks-in-Series Model.
No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.
This laboratory is for learning. Its results hold only within its stated ranges; real tanks short-circuit and have dead zones, so a mixing time from ideal tanks is not a design figure for a real vessel.
Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.