Why the Choice of Variables Matters
A model is only as useful as the information its variables preserve. A quantity that changes over time may be central to the system’s evolution, while another quantity is measured because it is useful to observe or report. Those roles are related, but they are not automatically the same.
For example, a reservoir’s water volume changes as water enters and leaves. Its water level can be measured and may be the quantity people care about. The level, however, depends on both the volume and the reservoir’s shape. Choosing carefully lets us write the evolution in the variable directly governed by the balance, then calculate the measured output from that variable.
This builds on stock-rate-total model architecture: a state variable often represents stored or accumulated quantity, and its rate describes how that quantity changes. The additional question here is how to distinguish such a state from an observable derived from it.
States and Observables
In a differential-equation model, the state is commonly written as \(\mathbf{x}(t)\), with its evolution described by an equation of the form
Here \(\mathbf{u}\) represents known inputs, such as a prescribed control or an externally supplied flow, and \(\mathbf{p}\) represents fixed model parameters. An observable can be written as \(y(t)=G(t,\mathbf{x}(t),\mathbf{u}(t),\mathbf{p})\). This notation expresses two different jobs: the state equation describes how the model evolves, while the output relation describes what is reported or measured.
A measured quantity is not automatically a state variable. It may be a state, but it may instead be calculated from the state. Conversely, a quantity can be a state even when it is not directly measured, if it is needed to represent the system’s evolution. The appropriate choice depends on the model: states must retain the information needed for its evolution, while observables can be chosen for practical or scientific interest.
Worked Example: Reservoir Volume as the State and Level as the Observable
Worked Example: Reservoir Volume as the State and Level as the Observable
Suppose a reservoir has horizontal cross-sectional area \(A(h)=8+2h\) square metres when its water level is \(h\) metres above the bottom. Let \(V\) be the volume of water, and suppose the net flow into the reservoir at a particular instant is \(2\) cubic metres per minute. Find the volume and level at \(h=2\) metres, and calculate the instantaneous rate of change of level.
The cross-sectional area tells us how much volume is added by a small increase in level. Therefore, the volume up to height \(h\) is the integral of the area from the bottom to that height:
At \(h=2\), the volume is
The volume is the natural state here because the net flow directly determines its rate: \(\frac{dV}{dt}=2\text{ m}^3/\text{min}\) at the instant under consideration. To find the level rate, differentiate the geometric relation \(V=8h+h^2\) with respect to time:
At \(h=2\), the area is \(8+2(2)=12\text{ m}^2\). Thus
Check by substituting the level rate back into the differentiated volume relation: \((8+2(2))(1/6)=12(1/6)=2\text{ m}^3/\text{min}\), which is the given volume rate. The calculation shows why a volume rate and a level rate are different: the reservoir’s area at the water surface converts one rate into the other.
Why the Chain Rule Connects State and Output
The reservoir calculation is an instance of a general rule. Suppose a scalar state \(x(t)\) determines an observable through \(y(t)=g(x(t))\), where \(g\) is differentiable at the relevant state value. The chain rule gives
This says that the output’s rate depends both on how quickly the state changes and on how sensitive the output is to changes in that state. It also explains why one cannot generally copy a rate from a state variable to an observable: the factor \(g'(x(t))\) may not be \(1\).
If the relation is instead written directly as \(y=g(x)\), the observable’s derivative can be found from that formula when it is differentiable. A useful modeling check is to make sure the state-to-output relation is appropriate over the range being considered. If the same state value could correspond to several different output values, a single-valued function \(y=g(x)\) would not describe the observable without adding further information.
Worked Example: A Derived Pressure Reading
Worked Example: A Derived Pressure Reading
Use the reservoir above, where \(V(h)=8h+h^2\), and suppose a pressure sensor at the bottom reports the pressure due to the water column. Take water density as \(1000\text{ kg/m}^3\) and gravitational acceleration as \(9.8\text{ m/s}^2\). Find the pressure when the volume is \(48\text{ m}^3\).
First determine the level. Solving \(V=8h+h^2\) for the nonnegative level gives
At \(V=48\text{ m}^3\), this gives \(h=-4+\sqrt{16+48}=-4+\sqrt{64}=-4+8=4\text{ m}\). The pressure due to the water column is \(p=\rho gh\), so
Check the geometric relation: \(V(4)=8(4)+4^2=32+16=48\text{ m}^3\), as specified. Substituting the recovered level into the pressure formula gives \(1000(9.8)(4)=39200\text{ Pa}\). In this model, pressure is another observable derived from the state through the level. The sensor reading is useful, but it does not replace the volume state used to describe storage.
When More Than One State Is Needed
A single observable can conceal distinctions that matter to a model. If separate parts of a system can change independently, one state variable may not preserve enough information to describe their evolution. A total can be a useful output while failing to reveal how that total is distributed.
Worked Example: Two Reservoirs and an Informative State Vector
Consider two vertical reservoirs, each with constant cross-sectional area \(5\text{ m}^2\). Let their water volumes be \(V_1\) and \(V_2\), and their levels be \(h_1\) and \(h_2\). At a particular instant, suppose \(V_1=30\text{ m}^3\), \(V_2=10\text{ m}^3\), \(\frac{dV_1}{dt}=1\text{ m}^3/\text{min}\), and \(\frac{dV_2}{dt}=-0.5\text{ m}^3/\text{min}\). Find the levels, the total volume and its rate, and the level difference and its rate.
Because each cross-sectional area is constant, the volume-level relations are \(V_1=5h_1\) and \(V_2=5h_2\). Therefore,
The state vector is \(\mathbf{x}=(V_1,V_2)\). The total-volume observable is \(y_{\mathrm{total}}=V_1+V_2\), so its value and rate are
The level-difference observable is \(y_{\mathrm{diff}}=h_1-h_2=(V_1-V_2)/5\). Its value and rate are
Check the rate calculations from the level equations: \(\frac{dh_1}{dt}=1/5=0.2\text{ m/min}\) and \(\frac{dh_2}{dt}=-0.5/5=-0.1\text{ m/min}\). Their sum in volume rates is \(0.5\text{ m}^3/\text{min}\), and their difference in level rates is \(0.2-(-0.1)=0.3\text{ m/min}\), matching the outputs above. The total volume alone does not determine the distribution: volumes \((30,10)\) and \((20,20)\) both total \(40\text{ m}^3\), but their level differences are \(4\text{ m}\) and \(0\text{ m}\). Keeping both volumes as states preserves this distinction.
A Practical Selection Test
When choosing variables for a model, ask what information must be retained to describe the system’s changing condition. Then separate that information from quantities calculated for observation or reporting.
List quantities whose values evolve over time and could be needed to describe the system.
If two different conditions have the same proposed state values but can evolve differently under the same known inputs, the state description is missing relevant information.
Specify how each measured or reported output is calculated from the states and any relevant known inputs or parameters.
When an output depends on a changing state, use the chain rule rather than assuming the output and state have equal rates.
This test is a guide, not a rule that every model must use one particular set of states. Different state choices may describe the same system, but each choice must support a coherent evolution model and a clear connection to the quantities of interest. In the reservoir example, volume is convenient because the net flow directly specifies its rate. Level is still essential as an observable, and it could be used as the evolving variable if its rate equation were obtained from the volume-level relation.
A Common Mistake: Treating a Level Rate as a Volume Rate
A tempting but incorrect calculation is to say that a net inflow of \(2\text{ m}^3/\text{min}\) means the reservoir level rises at \(2\text{ m/min}\). This confuses two different quantities. In the example, the water surface area at \(h=2\text{ m}\) is \(12\text{ m}^2\), so a one-metre rise would correspond locally to about \(12\text{ m}^3\) of added water, not \(1\text{ m}^3\).
The incorrect value fails a direct check: substituting it into \(\frac{dV}{dt}=(8+2h)\frac{dh}{dt}\) at \(h=2\) gives \(12(2)=24\text{ m}^3/\text{min}\), not the specified \(2\text{ m}^3/\text{min}\). The corrected value gives \(12(1/6)=2\text{ m}^3/\text{min}\). Checking the rate against the state-to-output relation catches the mistake.
Why the Distinction Is Useful
Separating states from observables makes a model easier to construct, interpret, and check. The state variables express the evolving condition that the model must track. Observables connect that condition to measurements, decisions, or reported quantities. One state can support several observables, as reservoir volume supports both level and pressure; several states can also be summarized by a single output, as two reservoir volumes are summarized by their total.
The distinction also helps identify missing information. If an output is being used as the only state, ask whether the same output value could represent different underlying conditions that behave differently. If so, the output alone is not a sufficient state description. Choosing variables carefully at the start prevents a model from losing distinctions it needs later.
Check Your Understanding
For each question, identify what should be a state, what should be an observable, and what relation connects them.
- In the widening reservoir, why is volume convenient as the state when the net flow is known?
- At a given instant, what information is needed to convert a volume rate into a level rate?
- For a single reservoir, give two observables that can be calculated from its volume state.
- Why can the total volume of two reservoirs fail to describe their full state?
- What condition must hold for an output \(y=g(x)\) to have rate \(\frac{dy}{dt}=g'(x)\frac{dx}{dt}\)?