Archived

This topic is now archived and is closed to further replies.

sesam

Integration-method?

Recommended Posts

sesam    122
Hello! I have a problem with doing the integration-over-time in my physic-engine. So here''s the problem: at time t0 i have the status sBegin: position (vector) orientation (3x3-matrix) linear velocity (vector) angular velocity (vector) i also have the derivate of sBegin: velocity (vector) rotated orientation (3x3-matrix) force (vector) torque (vector) so how do i get the status of sEnd if i know the time-difference(dt) between t0 and t1? Thanks!

Share this post


Link to post
Share on other sites
sQuid    149
If you want to know the change in some physical quantity like Force you can use the approximate expression

ΔF = (dF/dt) Δt

which is valid for small timesteps Δt

Share this post


Link to post
Share on other sites
uutee    142
Basically you have s(t) (state at time t), s''(t) (rate of change of state at time t).

This isn''t enough information for solving the differential equation *analytically* (ie. exactly). You''d need to know the form of s''(t) and integrate that over time analytically - which in most cases (ie. non-toy ones) is (practically, don''t know if theoretically too) almost impossible.

So you need to use an approximation method. The simplest is the Euler approximation:

s(t+h) = s(t) + s''(t)*h

As sQuid pointed out, this is accurate enough for small timesteps h. In rigid body dynamics this approximation is usually good enough, because rigid bodies usually only have small and stable forces acting on them (what I mean is that large and unstable forces can blow-up the simulator with a bad approximation method and a large timestep).

See Numerical Recipes in C (available on the Internet as .pdfs) for more information about some of more accurate and more stable integration methods.

- Mikko Kauppila

Share this post


Link to post
Share on other sites