A.3.3:5.7 - A constraint changes the state description
Two endpoints move in a plane and are connected by a rigid link of length l > 0. Four Cartesian coordinates obey (x2-x1)^2+(y2-y1)^2=l^2. One configuration description uses three coordinates: place the first endpoint at (X,Y) and the second at (X+l*cos(phi),Y+l*sin(phi)), with phi taken modulo a full turn. The construction makes the length constraint hold. To predict motion under an ordinary second-order mechanical law, also supply the required velocities and the forces or other interactions.
Change the question to longitudinal vibration of an elastic link. Fixed l has removed the extension that matters. Replace it with variable length r, keep its rate of change when required, and obtain the restoring interaction from the physical model. A rigid-link calculation remains useful for its earlier premise; the elastic question needs another state and law. Tong, Classical Dynamics, §2.3 supplies the generalized-coordinate method; the two-endpoint comparison here applies it.
In another practice, two queues share a fixed total of N items. Retain q1 and recover q2=N-q1, with 0<=q1<=N. If external arrivals are admitted, the state must retain the changing total or both queue sizes. The source of the constraint changes, while the construction still identifies which values can vary independently.