Closed
Description
Amazing/Inspiring work here, thank you for sharing the fruits of your research.
It does not impact the message of the section(effect of acceleration) but this code was confusing for me because it appears to be wrong if we are generating position as a function of time with constant acceleration:
for i in range(count):
zs.append(x0 + dx*i + randn()*noise_factor)
dx += accel
return zs
The calculation of position using x0 + dx*i
at step i, implies that velocity was constant (at its current value) for all i up to and including the current step. This overestimates the position. A more accurate representation of the position would be yielded with:
for i in range(count):
zs.append(x0 + accel*i**2/2.0 + dx*i + randn()*noise_factor)
return zs
If there is a desire to stick with a discritized form of the motion equation, something similar to the following might be better, although there is probably a more eloquent way to write it:
zs = [x0]
for i in range(1, count):
dx += accel
zs.append(zs[-1] + dx + randn()*noise_factor)
return zs
Metadata
Metadata
Assignees
Labels
No labels
Activity