CHAPTER 05 / Model-based experiments

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.

THE SHORT ANSWER

A gravity-drained tank obeys the volume balance A ḣ = qin − c√h − d, which is nonlinear because outflow grows with the square root of the water level h. Linearizing about an equilibrium level h₀, where inflow balances outflow, gives a first-order model for small level changes with local time constant τ = 2A√h₀/c. The local model fits small deviations but loses accuracy for large ones and ignores the empty and full limits.

Ah˙=qin−ch−d,τ=2Ah0cA\dot h=q_{\mathrm{in}}-c\sqrt h-d,\qquad \tau=\frac{2A\sqrt{h_0}}{c}
WHAT YOU WILL LEARN

Use a flow balance to find an equilibrium and a local response time.

Linearization uses a slope at an operating point. A draining tank makes both the nonlinear law and its local slope easy to see.

Review the previous lesson: A useful model near one operating point
START WITH AN EXAMPLE

First, picture it

Open a tap above a tank with a hole in its bottom. The water rises if more flows in than out. As the level rises, the pressure at the hole rises too, so the outlet flow grows. This makes the response depend on the starting level.

THE IDEA

Build the idea step by step

For a tank with constant cross-sectional area, stored volume equals area times height. Subtract the outlet flow and any extra drain from inlet flow to find the rate of volume change. Divide by area to get the rate of height change. We use a simple gravity-outlet model where outlet flow grows with the square root of height. Around one equilibrium, replace that square-root curve by its tangent. The resulting time constant tells us how quickly small level changes die away.

Read the equations

Ah˙=qin−ch−dA\dot h=q_{\mathrm{in}}-c\sqrt h-d

Water level rises when inlet flow exceeds gravity outflow and any extra drain.

τ=2Ah0c\tau=\frac{2A\sqrt{h_0}}{c}

Near an equilibrium height, this local time constant sets the speed of a small level change.

What the symbols mean

AA
tank cross-sectional area, in square metres
hh
water height, in metres
qinq_{\mathrm{in}}
inlet flow, in cubic metres per second
cc
gravity outlet coefficient, in metres to the five-halves per second
dd
extra drain flow, in cubic metres per second
h0h_0
equilibrium water height, metres
τ\tau
local time constant, seconds
h˙\dot h
rate of water-level change, metres per second

The model assumes constant area and an ideal pump. It applies only while the tank contains water and has not overflowed. The lab stops at an empty tank or its 2 metre rim. A local linear prediction can cross these physical limits, so do not treat it as a valid water level there.

WORKED EXAMPLE

Find a local tank time constant

  1. Take area 1 square metre, outlet coefficient 0.02, and no extra drain. At height 1 metre, outlet flow is 0.02 cubic metres per second.

    qout=0.021=0.02 m3/sq_{\mathrm{out}}=0.02\sqrt1=0.02\ \mathrm{m^3/s}
  2. An equal inlet flow holds this height steady. The local outlet slope is 0.01 square metres per second.

    dqoutdh∣1=0.0221=0.01 m2/s\left.\frac{dq_{\mathrm{out}}}{dh}\right|_{1}=\frac{0.02}{2\sqrt1}=0.01\ \mathrm{m^2/s}
  3. Divide area by that slope. Small level changes relax on a 100 second time scale; far from 1 metre the slope changes.

    τ=1/0.01=100 s\tau=1/0.01=100\ \mathrm s
More detail and model assumptions
A CLOSER LOOK

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.

A CLOSER LOOK

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 CLOSER LOOK

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.

TRY IT

Connect the example to the lab

The worked example used a 1 m² tank at 1 m. The connected experiment starts a 0.1 m² tank at h₀ = 0.5 m, where the local time constant is about 47.1 s; compare a small and a large flow step with the linear prediction.

Open the connected experiment
YOUR EXPERIMENT

Make a prediction before moving a control.

  1. PREDICTWill a linear model around h₀ = 0.5 m match both a small and a large flow change?
  2. 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.
  3. OBSERVEPin the baseline, then compare the nonlinear level, the linear prediction and the applied pump flow at the same times.
  4. 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.
BE CAREFUL

The lab adds the equilibrium flow q₀ = c√h₀ to the pump command. A manual increment of zero therefore holds the original level; it does not switch the pump off.

Check your understanding+

For the lab tank (A = 0.1 m², c = 0.003 m⁵ᐟ²/s), how does the local time constant τ₀ = 2A√h₀/c change if the operating level rises from 0.25 m to 1 m?

It doubles, from about 33.3 s to about 66.7 s, because τ₀ is proportional to √h₀. Small changes around a higher level settle more slowly.
PRACTICE PROBLEMS

Solve these before opening the solutions

Work each problem on paper first. Open the answer to check yours, then the full solution if you need the steps, and mark how it went.

  1. A tank has area A = 0.2 m² and outlet coefficient c = 0.004 m^(5/2)/s, with no extra drain. (a) At the operating height h0 = 0.81 m, find the equilibrium inflow, the local outlet slope and the local time constant. (b) Repeat the time constant for h0 = 0.25 m and explain the difference.

    Ah˙=qin−chA\dot h=q_{\mathrm{in}}-c\sqrt h
    Show answer

    AnswerAt 0.81 m: q0 = 0.0036 m³/s, slope ≈ 0.00222 m²/s and τ = 90 s. At 0.25 m the tank responds faster, with τ = 50 s.

    q0=0.0036 m3/s,c2h0≈0.00222 m2/s,τ(0.81)=90 s,τ(0.25)=50 sq_0=0.0036\ \mathrm{m^3/s},\quad \frac{c}{2\sqrt{h_0}}\approx0.00222\ \mathrm{m^2/s},\quad \tau(0.81)=90\ \mathrm s,\quad \tau(0.25)=50\ \mathrm s
    Show full solution

    Solution

    1. At equilibrium the inflow equals the gravity outflow.

      q0=ch0=0.004×0.9=0.0036 m3/sq_0=c\sqrt{h_0}=0.004\times0.9=0.0036\ \mathrm{m^3/s}
    2. The tangent slope of the outflow curve at h0 sets how strongly the outlet resists a small level change.

      dqoutdh∣h0=c2h0=0.0041.8≈0.00222 m2/s\left.\frac{dq_{\mathrm{out}}}{dh}\right|_{h_0}=\frac{c}{2\sqrt{h_0}}=\frac{0.004}{1.8}\approx0.00222\ \mathrm{m^2/s}
    3. Divide the area by that slope.

      τ=2Ah0c=2×0.2×0.90.004=90 s\tau=\frac{2A\sqrt{h_0}}{c}=\frac{2\times0.2\times0.9}{0.004}=90\ \mathrm s
    4. At a lower level the outflow curve is steeper, so small deviations are pushed back faster.

      τ(0.25)=2×0.2×0.50.004=50 s\tau(0.25)=\frac{2\times0.2\times0.5}{0.004}=50\ \mathrm s
  2. Start the same tank at equilibrium at h0 = 0.81 m. The inflow then steps by δq and stays there. For δq = +0.0002 m³/s and δq = +0.0018 m³/s, compare the final level predicted by the linear model with the final level of the nonlinear tank. Neither case reaches the 2 m rim.

    Show answer

    AnswerThe small step gives 0.900 m (linear) against 0.9025 m (nonlinear). The large step gives 1.62 m against 1.8225 m, so the linear rise is 20% short.

    δq=0.0002: 0.900 vs 0.9025 mδq=0.0018: 1.62 vs 1.8225 m\delta q=0.0002:\ 0.900\ \mathrm{vs}\ 0.9025\ \mathrm m\qquad \delta q=0.0018:\ 1.62\ \mathrm{vs}\ 1.8225\ \mathrm m
    Show full solution

    Solution

    1. The linear model's steady gain is the inverse of the outlet slope, 2√h0/c = 450 s/m².

      δh∞=2h0c δq=450 δq ⇒ 0.09 m,0.81 m\delta h_\infty=\frac{2\sqrt{h_0}}{c}\,\delta q=450\,\delta q\ \Rightarrow\ 0.09\ \mathrm m,\quad 0.81\ \mathrm m
    2. The nonlinear tank settles where the new inflow equals c√h.

      h∞=(q0+δqc)2:(0.00380.004)2=0.9025 m,(0.00540.004)2=1.8225 mh_\infty=\left(\frac{q_0+\delta q}{c}\right)^2:\qquad \left(\frac{0.0038}{0.004}\right)^2=0.9025\ \mathrm m,\qquad \left(\frac{0.0054}{0.004}\right)^2=1.8225\ \mathrm m
    3. For the large step the true rise is 1.0125 m but the tangent predicts 0.81 m. Above h0 the real outflow curve flattens, so the true level must climb higher to drain the extra flow.

      1.0125−0.811.0125=0.20\frac{1.0125-0.81}{1.0125}=0.20
  3. From the same equilibrium at 0.81 m, the inflow instead drops by 0.003 m³/s, leaving 0.0006 m³/s. (a) What final level does the linear model predict? (b) At what time does the linear prediction cross zero height? (c) Where does the nonlinear tank actually settle?

    Show answer

    AnswerThe linear model predicts an impossible −0.54 m and crosses zero at about 82.5 s. The real tank never empties; it settles at 0.0225 m.

    hlin(∞)=−0.54 m,t0≈82.5 s,htrue(∞)=0.0225 mh_{\mathrm{lin}}(\infty)=-0.54\ \mathrm m,\qquad t_0\approx82.5\ \mathrm s,\qquad h_{\mathrm{true}}(\infty)=0.0225\ \mathrm m
    Show full solution

    Solution

    1. Scale the step by the local gain of 450 s/m².

      δh∞=450×(−0.003)=−1.35 m ⇒ h∞=0.81−1.35=−0.54 m\delta h_\infty=450\times(-0.003)=-1.35\ \mathrm m\ \Rightarrow\ h_\infty=0.81-1.35=-0.54\ \mathrm m
    2. The linear deviation follows a first-order curve with τ = 90 s. It reaches −0.81 m, an empty tank, when 60% of the final change has happened.

      −1.35 (1−e−t/90)=−0.81 ⇒ e−t/90=0.4 ⇒ t=90ln⁡2.5≈82.5 s-1.35\,(1-e^{-t/90})=-0.81\ \Rightarrow\ e^{-t/90}=0.4\ \Rightarrow\ t=90\ln2.5\approx82.5\ \mathrm s
    3. The nonlinear outflow c√h shrinks as the level falls, so the tank finds a new, low equilibrium. A negative linear prediction is evidence that the tangent model has been used far outside its operating point, not a level the tank can reach.

      h∞=(0.00060.004)2=0.152=0.0225 mh_\infty=\left(\frac{0.0006}{0.004}\right)^2=0.15^2=0.0225\ \mathrm m
  4. The same tank must hold r = 1.0 m while an extra drain removes d = 0.0015 m³/s. The pump can deliver at most 0.005 m³/s. (a) What steady inflow does the target require? (b) If the pump stays at its limit, at what level does the tank settle? (c) Explain what an integrator without anti-windup does in this situation.

    Ah˙=qin−ch−dA\dot h=q_{\mathrm{in}}-c\sqrt h-d
    Show answer

    AnswerThe target needs 0.0055 m³/s, more than the pump can give. At full pump flow the level settles near 0.766 m, and an unprotected integrator keeps growing.

    qneed=0.0055>0.005 m3/s,h∞=(0.00350.004)2≈0.766 mq_{\mathrm{need}}=0.0055>0.005\ \mathrm{m^3/s},\qquad h_\infty=\left(\frac{0.0035}{0.004}\right)^2\approx0.766\ \mathrm m
    Show full solution

    Solution

    1. At the target level, the pump must replace the gravity outflow and the extra drain.

      qneed=cr+d=0.004×1+0.0015=0.0055 m3/sq_{\mathrm{need}}=c\sqrt r+d=0.004\times1+0.0015=0.0055\ \mathrm{m^3/s}
    2. That exceeds the 0.005 m³/s limit, so no controller tuning can hold 1.0 m.

      0.0055>0.0050.0055>0.005
    3. With the pump saturated, the level settles where the outflow equals what is left after the drain.

      ch∞=0.005−0.0015=0.0035 ⇒ h∞=0.8752≈0.766 mc\sqrt{h_\infty}=0.005-0.0015=0.0035\ \Rightarrow\ h_\infty=0.875^2\approx0.766\ \mathrm m
    4. The error stays near 0.234 m, so a plain integrator keeps accumulating while the pump cannot respond. If the drain later closes, that stored integral can drive a large overshoot. Conditional anti-windup stops the accumulation that would worsen clipping.

Mark each exercise after you check your answer. Marks stay in this browser.

KEY TERMS

Terms this lecture teaches

All terms in the glossary →
QUESTIONS STUDENTS ASK

Frequently asked questions

Why is the tank level model nonlinear?

Outflow through a gravity outlet grows with the square root of the water height, c√h, not in proportion to it. Doubling the level raises the outflow by only about 41%, so the response to a combined change is not the sum of the separate responses.

Why does the local time constant depend on the operating level?

The tangent slope of the outflow curve, c/(2√h₀), gets smaller as the level rises, so the time constant τ = 2A√h₀/c grows with √h₀. Quadrupling the operating level doubles the local time constant.

Why can a linearized tank model predict a negative water level?

The linear model extends the tangent indefinitely and knows nothing about an empty or full tank. An impossible prediction shows that the approximation is being used far outside its operating range; it is not a real level.

How much pump flow is needed to hold a level against an extra drain?

At steady state inflow must equal outflow, so holding a target level r against a constant extra drain d needs qin = c√r + d. Compare this with the pump limit before tuning a controller, because no PI gain can supply flow the pump cannot deliver.

Why the next lesson follows

An electrical circuit also stores energy in more than one state. Its equations reveal oscillation as well as settling.

YOUR PROGRESS

Finished the reading and the exercises? Mark the lecture as done to tick it on the syllabus. Progress stays in this browser.

EIGENROOM · https://eigenroom.com/theory/tank-linearization · Updated 2026-11-15