#### Archived

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

# (2nd order) Runge Kutta & Rigid body dynamics

This topic is 5222 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi there, I''m trying to implement some basic rigid body stuff. I read the Baraff articles and some other documents and I want to implement a Runge Kutta solver. (I did Euler and that is simple enough). I can''t quite get my head around this: The force applied to a body is a combination of a large number of different forces (gravity, outside pushing, objects colliding) From the applied force and the body''s mass I should be able to derive the accelleration and (with Euler) derive the new speed from that. But when I want to implement the midpoint method (2nd order runge kutta) I have to to an inbetween step. This would mean (if I''m correct) that I have to re_determine the acceleration (in this case) again, but now at time t0 + 1/2*steptime. If my acceleration would be a simple function I would know how to do this, but (if I''m correct) it isn''t. So, given mass and force at time t0, how would I derive speed using second order Runge Kutta? Greetz, YarnisO. P.s. This will probably be one of those "oh, of course" cases, but right now I just can''t figure it out.

##### Share on other sites
I just realized....
If I would make force objects (GravityForce, FrictionForce, SpringForce etc.) and attach them to the bodies if appropriate (you wouldn''t realy have to implement GravityForce, but that''s just an example), then your acceleration "function" would be implemented in terms of the xxxxForce objects. And that would solve my "having no explicit acceleration function" problem, wouldn''t it????

Hmmm.... if that is right, then why did I spend the entire day thinking about this?? =0)

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631782
• Total Posts
3002324
×