How to simulate the 1-D motion of a particle under constant acceleration? [duplicate]

I am trying to represent the position of an object under freefall, but am completely lost. Here is my attempt so far:

time = 0;
increment = 10;
distance := 0 - time*(time*increment);

{Dynamic[Refresh[{time++ 1, ClockGauge[DateList[]]}, UpdateInterval -> 1]],
Dynamic @ distance,
Dynamic @ Framed[Graphics[Disk[{0, distance}, 10],
PlotRange -> {{-2, 2}, {1, -1000}}]]}


Which results in:

The bar on the left should represent the position of the object under freefall, and the number to the right of the bar should represent its y coordinate. However this clearly accelerates way too fast way too soon.

Basically the main problem here is that I don't know how to translate the '10m per second per second' into a language that Mathematica can understand. Could someone help me with what formula to use?

marked as duplicate by Kuba♦, Simon Woods, ciao, Sjoerd C. de Vries, ubpdqnMay 2 '14 at 0:40

I would build your simulation with a DynamicModule showing a table made with a Grid and controlled by a Trigger. First I would define a function that calculates distance when given time and acceleration.

dist[a_, t_] := a t^2/2


Next I would get the basic functionality right. A grid showing time and distance with a trigger to control it.

With[{a = -9.8, dmax = -1000.},
With[{tmax = Sqrt[2. dmax/a]},
DynamicModule[{t = 0., d = 0.},
Grid[{
{Dynamic @ t, Dynamic[d = dist[a, t]]},
{Trigger[Dynamic @ t, {0., tmax, 1}, 1], SpanFromLeft}
}]
]]]


Only after the basic stuff was debugged, would I add the fancy stuff -- headers and gauges.

With[{a = -9.8, dmax = -1000.},
With[{tmax = Sqrt[2. dmax/a]},
DynamicModule[{t = 0., d = 0.},
Grid[{
{Style["Time", "SB"], Style["Distance", "SB"]},
{Dynamic@t, Dynamic[d = dist[a, t]]},
{AngularGauge[Dynamic @ t, {0, Ceiling @ tmax}, ScaleDivisions -> {3, 5}],
VerticalGauge[Dynamic @ d, {0, dmax}]},
{Trigger[Dynamic @ t, {0., tmax, .1}, 1.], SpanFromLeft}
}, Frame -> All]
]]]


The above implements no more than the basics of what you asked for. There is no end or refinement that could be done to make it prettier. Nevertheless, I think it provides a good example of how Mathematica provides us all the tools needed to write simple physics simulations in very few lines of code.