Open
Description
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
Labels
No labels
Activity