Skip to main content
gamedev.net
🔒 Locked

Integration-method?

Started by sesam 2 replies 550+ views
Original Post
sesam
sesam
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!
sQuid
sQuid
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
uutee
uutee
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
sesam
sesam
Thanks for replying!

I''ll try to find it in the internet...

Sesam

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.