Position integration

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Position integration

Postby zak » Thu Nov 15, 2012 12:26 pm

I have a strange result with position integration.

If i have a body in the origin with no velocity, and i apply an acceleration a, after a step i aspect a body position in accord with the physics laws:

velocity = a * step
position = 0.5 * a * step * step

instead i obtain:

velocity = a * step
position = velocity * step = a * step * step

I obtain the double quantity of that I expected.

Is it a bug or a project choise?
Newton 2.35, exact solver.

Thank you.
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am

Re: Position integration

Postby Julio Jerez » Thu Nov 15, 2012 12:52 pm

zak wrote:velocity = a * step
position = 0.5 * a * step * step

This is the particular solution of the equation of motion for a particule under constant acceleration.
position = 0.5 * a * step * step
the 0.5 comes from knowing that acceleration a, is constant and solving the equation analytically assuming initial velocity is zero.
when the acceleration is not constant, the solution is wrong for all other cases, and using that particular solution of a diffrencail equation as if it was a general solution of the same equation in a numercial integration proccess, is a very bad idea.

Instead we use the the general differencial equation of motion and we use an appropiate numercial integration to calculate a good aproximation to the solution, because the acceleration is a secund order differencial equation
first integrate acceleration to obtain first derivative, then integrate velocity to obtain the secund derivative.
zak wrote:velocity = a * step
position = velocity * step = a * step * step

this is the correct solution for all cases because generates an aproximation that minizes the error when the integeration is numerical.

for example if instead of a constant acceleration the force was a spring, the first solution will always generate an explosion, while the secund solution is stable if the integation step is smaller compared to the period of the spring natural frequecy.
believe me the first method is the one method you do not want to use if you do not have the analytically expression that you can integrate numerically.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest