Σ1/(A·s)h 1.00 m0.100 m³/sh₀ 1 m2 m3 m4 m1.00 m0.100 m³/sc·√hδh / R20/(20s + 1)G(s) = δH/δQ+−qhh
0123400.10.20.3level h (m)m³/sOUTFLOW VS LEVELc·√htangenth₀ = 1 m030609012011.11.2time (s)level h (m)SMALL STEP: PUMP +10 %real tanklinear model0601201802403001234time (s)level h (m)BIG STEP: PUMP ×2real tanklinear model
Lit pipe or wire with moving dashes: water or a signal is flowing along itBack row: pump, glass tank and hole. Front: the block diagram and the one-block result G(s)Plots: outflow curve with its tangent, and two pump steps (real tank against linear model), computed from the modelThe outflow block's bent curve fades into its straight tangent: that swap is linearisationA draining water tank and its block diagram. The outflow c·√h bends, so the model is nonlinear; near the operating point h₀ = 1 m it is replaced by its tangent, which turns the model into the transfer function G(s) = 20/(20s + 1). The plots are computed from the model: the linear model matches a small pump step closely and misses a big one. Outflow through a hole goes as the square root of the depth (Torricelli's law: the water leaves at √(2gh)). Real holes pass a bit less than the ideal, a factor called the discharge coefficient; the constant c includes it.

The nonlinear tank

  1. A pump fills a tank, and water drains out of a hole in the floor. The deeper the water, the harder it pushes, so it drains faster. We want a transfer function from pump flow q to level h.

Linearise

Test it

What is happening

# step 1/10 · tank
# about: Pump q, Tank h, Hole

pump flow     q   (m³/s)   the input
water level   h   (m)      the output
tank floor    A = 1 m²

water out of the hole: q_out = c·√h
(Torricelli's law; c = 0.1 sums up the
hole's size)

The tank is a simple model with illustrative numbers: floor area 1 m², outflow 0.1·√h m³/s. Every curve and number in the figure is computed from it: the real tank by step-by-step integration (RK4, 0.01 s), the linear model by its exact solution. The Python on the steps is plain Python 3 with the math module (simple Euler steps of 0.01 s, accurate to the two decimals shown). The transfer function line uses the python-control library; control.linearize does the slope-taking automatically for a nonlinear model.