Exercise set
State Estimation and Sensor Fusion Exercises
Worked mathematical engineering exercises for state estimation and sensor fusion covering state-space prediction, Kalman updates, covariance propagation, inverse-variance fusion, innovation gating, observability, EKF linearization, and validation.
These exercises practise state estimation and sensor fusion for engineering systems. The goal is not to memorize filter equations. The goal is to decide whether an estimate is credible enough for control, monitoring, digital-twin updating, navigation, inspection, or maintenance decisions.
Assume simplified models unless an exercise states otherwise. Real estimators require unit checks, timestamp alignment, sensor calibration, observability review, numerical robustness, fault handling, cybersecurity review, and validation under the operating conditions that matter.
How to Use These Exercises
For each problem, identify:
- the state being estimated;
- the measurement boundary;
- the model prediction before measurement correction;
- the uncertainty attached to model and measurement;
- the decision that would use the estimate.
A sensor-fusion estimate is not automatically better than a single sensor. It is better only when the sensor errors, timing, calibration, and physical meaning are understood well enough to combine them defensibly.
Exercise 1: State-Space Prediction for a Position-Velocity Model
A vehicle moves along one axis. The state is:
where p_k is position and v_k is velocity. Use a constant-velocity model with time step \Delta t=0.5\ \text{s}:
The current estimate is:
Find the predicted state before the next measurement.
Solution
State-transition matrix:
Prediction:
The predicted position is 13.5\ \text{m} and the predicted velocity is 3.0\ \text{m/s}.
Engineering Comment
The prediction is model-based. It assumes velocity stays constant over the next half second. If acceleration, grade, braking, or actuator lag is important, the model needs input terms or larger process uncertainty.
Exercise 2: Covariance Propagation
For the same model, the previous covariance is:
Process-noise covariance is:
Compute the predicted covariance:
Solution
First:
Then:
Add process noise:
Engineering Comment
The position uncertainty increases because uncertain velocity contributes to position prediction. The off-diagonal terms show correlation between position and velocity uncertainty. Ignoring covariance coupling can make later updates inconsistent.
Exercise 3: Scalar Kalman Update for Tank Level
An estimator predicts tank level:
with prediction variance:
A level sensor reports:
with measurement variance:
Compute the Kalman gain, updated estimate, and updated variance.
Solution
Kalman gain:
Innovation:
Updated estimate:
Updated variance:
Engineering Comment
The updated level moves toward the sensor but not all the way. The measurement is useful, but the estimator trusts the prediction more because the measurement variance is larger than the prediction variance.
Exercise 4: Inverse-Variance Fusion of Two Temperature Sensors
Two independent temperature sensors measure the same bearing housing:
- Sensor A: 78.0^\circ\text{C} with standard uncertainty 1.0^\circ\text{C};
- Sensor B: 81.0^\circ\text{C} with standard uncertainty 2.0^\circ\text{C}.
Find the inverse-variance fused estimate and its standard uncertainty.
Solution
Weights:
Fused estimate:
Combined standard uncertainty:
Engineering Comment
The fused estimate is closer to Sensor A because Sensor A is more precise. This calculation assumes independent, unbiased sensors. If both sensors are mounted on the wrong location, share the same heat-conduction error, or were calibrated incorrectly, the fused estimate can still be wrong.
Exercise 5: Innovation Gating
A pressure estimator predicts a measurement of 500\ \text{kPa}. The actual sensor reading is 518\ \text{kPa}. Innovation covariance is:
Compute the normalized innovation and normalized innovation squared. Use a scalar 95 percent chi-square threshold of approximately 3.84 for the normalized innovation squared.
Solution
Innovation:
Normalized innovation:
Normalized innovation squared:
Since:
the measurement fails the 95 percent scalar gate.
Engineering Comment
Failing the gate does not automatically mean the sensor is bad. It means the measurement is inconsistent with the prediction and stated uncertainty. The cause could be a real pressure transient, wrong operating mode, sensor bias, timestamp error, blocked impulse line, or underestimated process noise.
Exercise 6: Observability of a Position-Velocity System
For the constant-velocity model:
position is measured:
With \Delta t=1, check observability using:
Solution
With \Delta t=1:
Then:
Observability matrix:
The determinant is:
The rank is 2, so the two-state system is observable.
Engineering Comment
Velocity can be inferred from repeated position measurements because position changes over time. Practical performance still depends on sampling rate, measurement noise, excitation, and whether the constant-velocity model is reasonable.
Exercise 7: EKF Linearization for a Range Measurement
A mobile asset has state:
A fixed beacon at the origin measures range:
Find the measurement Jacobian H evaluated at \hat{x}=[3,\ 4]^T.
Solution
Partial derivatives:
At p_x=3 and p_y=4:
Therefore:
Engineering Comment
The Jacobian states how sensitive the range measurement is to small changes in each state component near the current estimate. If the estimate is far from the true state, the linearization can be misleading.
Exercise 8: Timestamp Error in Sensor Fusion
A moving machine has speed 4.0\ \text{m/s}. A position sensor timestamp is delayed by 0.20\ \text{s} but is treated as current. Estimate the position error introduced by the timestamp delay.
Solution
Position error from delay:
The delayed measurement can be biased by about 0.80\ \text{m} relative to the current state.
Engineering Comment
Timestamp error can dominate sensor noise. A high-precision sensor with poor time alignment can be worse than a lower-precision sensor with reliable timing. Sensor fusion should treat timing as part of measurement quality.
Exercise 9: Validation Bias and RMSE
An estimator is tested against independent validation data. The errors are:
in engineering units. Compute mean error and RMSE.
Solution
Mean error:
RMSE:
Engineering Comment
The estimator has modest positive bias and typical error around 0.47 units. A validation report should also check whether errors depend on operating mode, speed, temperature, load, sensor replacement, or distance from the calibration range.
Exercise 10: Prediction-Interval Coverage
A digital twin reports 90 percent prediction intervals. In an independent validation set of 60 samples, 48 measured values fall inside the reported intervals.
Compute empirical coverage and decide whether the uncertainty statement appears calibrated.
Solution
Empirical coverage:
Coverage shortfall:
The intervals are under-covering the validation data. The estimator is likely overconfident, the validation conditions differ from calibration conditions, or the uncertainty model is incomplete.
Engineering Comment
Under-coverage is dangerous when estimates drive decisions. It means the system claims more certainty than the evidence supports. Corrective actions may include increasing process noise, improving the model, adding missing uncertainty sources, separating operating modes, or restricting the valid-use envelope.
Review Checklist
For a state estimator or sensor-fusion workflow, check:
- state definition matches the engineering decision;
- units are consistent in state, measurement, and covariance;
- timestamps are aligned before fusion;
- sensor bias and calibration are reviewed;
- observability is checked for the operating modes used;
- innovation statistics are monitored;
- rejected measurements are investigated, not silently discarded;
- validation uses independent data;
- uncertainty intervals have credible empirical coverage;
- the estimator has a defined fallback state when assumptions fail.
State estimation is valuable because it makes hidden state usable. It is risky when it hides weak assumptions behind smooth plots, narrow confidence bands, or undocumented tuning.