Lite / Independent Engineering Research / Week 14
State-space form: x[k+1] = A·x[k] + B·u[k] + w[k]
To predict where a lander will be in one second, what is the smallest set of numbers you need to know right now?
Why should I care?
Every estimator from here on needs a model of how the state moves between measurements. State-space form is the shared language: the same A and B matrices describe a rover, a lander or a satellite, and the noise term w is where the filter's Q will come from.
- Define the state of a system as the minimal information that predicts its future.
- Write a sampled model in the form x[k+1] = A·x[k] + B·u[k] + w[k].
- Form a closed-loop matrix A − BK and judge discrete stability from eigenvalues.
Predict
A lander at position 2 m, velocity 1 m/s, thrust acceleration 0.4 m/s², time step 0.5 s. Next position?
- 2.5 m
- 2.55 m
- 2.7 m
- 3.0 m
Guess first, then reveal
p + Δt·v + ½Δt²·u = 2 + 0.5 + 0.125 × 0.4 = 2.55 m. And the velocity becomes 1 + 0.5 × 0.4 = 1.2 m/s.
Discover
In the Code Lab, write A = [[1, Δt], [0, 1]] and B = [Δt²/2, Δt] for Δt = 0.5 s. Step a lander from p = 2 m, v = 1 m/s for 10 steps with u = 0.4 m/s², then add process noise w with σ = 0.05 on each state and run it 5 times. Plot the spread of final positions.
What the interactive shows (text version)
The Code Lab activity is a matrix-stepping exercise that can be done on paper: ten steps of p ← p + 0.5v + 0.125u, v ← v + 0.5u, starting at p = 2, v = 1, u = 0.4.
Understand
What is a state?
The state x[k] is a vector holding just enough to predict the future given the inputs: for a moving body, position and velocity; for a heater, temperature. Inputs u[k] are what we command (thrust, wheel speed). Outputs y[k] = C·x[k] + v[k] are what sensors see, with measurement noise v.
The sampled model
x[k+1] = A·x[k] + B·u[k] + w[k]. A says how the state evolves on its own, B how inputs push it, and w is process noise: unmodelled disturbances such as wheel slip or a gust. For constant-acceleration motion over Δt, A = [[1, Δt], [0, 1]], B = [Δt²/2, Δt]ᵀ.
Closed loop and stability
With state feedback u = −K·x, the loop becomes x[k+1] = (A − BK)·x[k]. A discrete-time linear system is stable when every eigenvalue λ of its matrix has |λ| < 1: each step multiplies the modes by λ, so they shrink. |λ| = 1 is marginal, |λ| > 1 grows without bound.
Explain it another way
Intuitive
The state is the system's memory. Knowing where the lander is and how fast it is going, you can roll the clock forward one tick at a time, nudging it with each command.
Technical
Continuous models ẋ = F·x + G·u discretise exactly as A = e^{FΔt}, B = ∫₀^Δt e^{Fτ}dτ·G under zero-order hold. For the double integrator this gives the A and B above exactly.
Mathematical
Eigenvalues of A = [[0.9, 0.1], [0, 0.8]] are 0.9 and 0.8 (upper triangular): stable. Each step the slow mode shrinks by 10%: after 22 steps it is about 10% of its start (0.9²² ≈ 0.098).
Applied
A Mars lander's guidance runs exactly this kind of model many times a second, predicting position and velocity from accelerometer-measured thrust and correcting with radar altimeter readings.
Worked example 1
x = [p; v] = [10; −2], Δt = 1 s, u = 0.5 m/s². Find x[k+1].
p = 10 − 2 + 0.25 = 8.25 m; v = −2 + 0.5 = −1.5 m/s.
Worked example 2
Is x[k+1] = [[1.1, 0], [0, 0.5]]·x[k] stable?
Eigenvalues 1.1 and 0.5. |1.1| > 1, so one mode grows 10% per step: unstable.
Common mix-ups
The state is everything you can measure.
✓ The state is what you need to predict the future. Some of it (velocity, sensor bias) may never be measured directly.Discrete systems are stable when eigenvalues are negative.
✓ That is the continuous-time rule. In discrete time the test is |λ| < 1.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
Add a third state, a constant accelerometer bias b, so the true acceleration is u − b. Write the new 3 × 3 A and the 3 × 1 B. Which state can no sensor that measures position alone ever see directly, and how could a filter still estimate it?
Reflect
Why does a filter need a model of the dynamics at all, rather than just averaging measurements?
Write your answer on paper or in your own notes. Lite never stores what you write.