Tank balance and local linear models
A nonlinear gravity-drained tank beside its local linear prediction. Explore operating points, bounded pump flow and PI disturbance rejection.
First, picture it
Will a linear model around h₀ = 0.5 m match both a small and a large flow change?
What the model says
For a constant-area tank, stored volume is V = Ah. Incoming flow qin increases volume; the gravity outlet and any extra drain remove it. Thus A h′ = qin−c√h−d. The square-root law follows a simplified gravity-driven outlet model. c collects geometry and discharge effects. It is not a linear resistance, and its units are m⁵ᐟ²/s so c√h has units m³/s.
A h′ = qin − c√h − d; δh′ = [δqin − c δh/(2√h₀) − d]/AConstant area, incompressible fluid, ideal pump; no valve lag, sensor noise or fluid momentum. RK4 at 10 ms, continuous PI, samples every 100 ms. q₀ = c√h₀ biases manual and PI commands; Δq applies only to manual mode. The linear predictor receives the actual nonlinear-loop pump flow. Extra drain is a persistent step at 30 s; zero removes it. Stop at h = 0 or 2 m, interpolating the crossing within a physics step; overflow after the rim is not modeled. The linear predictor is not clipped and can be physically invalid far from h₀.
Conservation of volume gives the state equation
For a constant-area tank, stored volume is V = Ah. Incoming flow qin increases volume; the gravity outlet and any extra drain remove it. Thus A h′ = qin−c√h−d. The square-root law follows a simplified gravity-driven outlet model. c collects geometry and discharge effects. It is not a linear resistance, and its units are m⁵ᐟ²/s so c√h has units m³/s.
At a positive operating height h₀ with no extra drain, equilibrium requires q₀ = c√h₀. The lab adds this bias to the command. A zero manual increment means maintaining the original equilibrium, not turning the pump off. If you change h₀, q₀ changes too; match the initial level to h₀ when comparing small perturbations about different equilibria.
Linearization means keeping the first-order change
Write h = h₀+δh and q = q₀+δq. The tangent approximation is c√h ≈ c√h₀ + c δh/(2√h₀). Cancel the equilibrium terms to obtain A δh′ = δq−c δh/(2√h₀)−d. The incremental transfer function is 1/[As+c/(2√h₀)], and τ₀ = 2A√h₀/c. It predicts local deviations, not absolute heights starting from zero.
The lab drives both the nonlinear plant and its linear predictor with the same applied pump signal. With A=0.1, c=0.003 and h₀=0.5, the local time constant is about 47.1 s. A small flow step should give nearby traces. A larger step moves into a region where the outlet slope differs. A longer simulation cannot repair a locally inaccurate model; it may make the steady discrepancy clearer.
A controller still needs flow authority
To hold target r after a constant extra drain d opens, the pump must supply c√r+d. Compare this value with the pump limit before tuning PI. The lab uses qrequest = q₀ + Kp(r−h) + I and continuous integral accumulation. Conditional anti-windup blocks accumulation that would worsen pump clipping. Unlike the thermal lab's zero-bias PI, this experiment exposes the operating-point bias explicitly.
An empty tank and a full tank are physical boundaries, not negative or arbitrarily large levels. This model stops at 0 or 2 m instead of inventing an overflow continuation. The linear prediction is deliberately not clipped: an impossible negative prediction is evidence that the local approximation has been used outside its domain. Replaying a stopped run does not extend its data.
Make it concrete
Pin the +0.0002 m³/s step. Change only Δq to +0.0015. Compare nonlinear height with the linear prediction driven by the identical applied pump flow.
Open the connected experimentMake a prediction before moving a control.
- PREDICTWill a linear model around h₀ = 0.5 m match both a small and a large flow change?
- CHANGE ONE THINGPin the +0.0002 m³/s step. Change only Δq to +0.0015. Compare nonlinear height with the linear prediction driven by the identical applied pump flow.
- OBSERVEPin the baseline. Compare the same time and inspect the physical input as well as the output.
- EXPLAINOutflow is c√h. The tangent slope at h₀ is c/(2√h₀), giving a local first-order model. The linear trace uses the same actual pump signal; it is not a separately controlled plant. Large excursions make the tangent less representative. The run stops at an empty tank or the 2 m rim.
Outflow is c√h. The tangent slope at h₀ is c/(2√h₀), giving a local first-order model. The linear trace uses the same actual pump signal; it is not a separately controlled plant. Large excursions make the tangent less representative. The run stops at an empty tank or the 2 m rim.
Check your understanding+
Will a linear model around h₀ = 0.5 m match both a small and a large flow change?
Outflow is c√h. The tangent slope at h₀ is c/(2√h₀), giving a local first-order model. The linear trace uses the same actual pump signal; it is not a separately controlled plant. Large excursions make the tangent less representative. The run stops at an empty tank or the 2 m rim.