Skip to content

Chapter 1: g-h filter mistake in equation? #369

Open
@patrick-llgc

Description

@patrick-llgc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions