Kalman-and-Bayesian-Filters-in-Python icon indicating copy to clipboard operation
Kalman-and-Bayesian-Filters-in-Python copied to clipboard

Chapter 1: g-h filter mistake in equation?

Open patrick-llgc opened this issue 4 years ago • 1 comments

First of all, thanks for the wonderful book, and I am enjoying every line of your witty and clear writing.

In session Exercise: The Effect of Acceleration, there seems to be a mistake in the formulation of the equation.

In gen_data function,

def gen_data(x0, dx, count, noise_factor, accel=0.):
    zs = []
    for i in range(count):
        zs.append(x0 + accel * (i**2) / 2 + dx*i + randn()*noise_factor)
        dx += accel
    return zs

There should be no need for the dx += accel line as the line above already accounts for the speed change in the quadratic accel term. In other words, the displacement x = x0 + v0 * t + 1/2 * a * t**2.

patrick-llgc avatar Feb 13 '21 05:02 patrick-llgc

See https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/issues/381

PebetoUofC avatar Feb 03 '22 01:02 PebetoUofC