I am working with Unscented Kalman Filter (UKF) in thermal modelling of a box.

I have 3 state variables ($T$ temperature, heating $h_h$ and cooling rates $h_c$) in my model and I am observing just one of them ($T$). I am working with the filterpy python library following this example. My main equation is the following:

$\hat{T} = T + (- h_c(T-T_e) + h_h ) \Delta t$

where $T_e$ is the external temperature - not measured - just assumed.

If I initialise the state matrix correctly (i.e. I provide an approximation of the simulated $h_h$ and $h_c$ parameters) the filter converges and provides a correct estimation of $h_h$ and $h_c$ coefficients.

If I initialise the state matrix providing just correct $h_c$ and I put a coarse guess of $h_h$, the filter estimates correctly the temperature but the cooling/heating coefficients converge to some nonsense numbers (from the physical point of view).

Is there any way of putting constraints on the state variables in the UKF?


  • $\begingroup$ yeah, we don't wanna stinky Kalman filter. $\endgroup$ – robert bristow-johnson Apr 6 '18 at 10:02
  • $\begingroup$ of course, that's why I went for UKF :) $\endgroup$ – mikel Apr 6 '18 at 10:16
  • $\begingroup$ Like every other sort of Kalman filter, you have to look in detail at the implementation. A UKF doesn’t require that the state transition (state update) be continuous everywhere, so you should be able to clamp the range of some state variables. There are other possible ways of doing it as well. Google “Constrained Kalman Filter”. $\endgroup$ – Stanley Pawlukiewicz Apr 6 '18 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.