Live data from Hacker News

Physics Simulations

myphysicslab.com

21–28 of 28 posts

Re: Physics Simulations

#21
post #19

Earlier quoted context omitted.

Check out 'Position Based Dynamics' by Matthias Mueller, it was the first paper on the topic.

Most games aren’t using anything remotely near as sophisticated as that. Most games use rigid body simulations, and while the details of each implementation is different, most of them work in a similar way. The common method in open source engines is a projected gauss Seidel [0] which is used in bullet physics. Most other engines (PhysX and Havok) are to the best of my knowledge using something very similar. [0] http…

> Most other engines (PhysX and Havok) are to the best of my knowledge using something very similar.

PhysX is position based dynamics. The Mueller guy who wrote that paper was a Co-founder of PhysX (back when it was NovodeX, then purchased by Ageia, then purchased by Nvidia) and is now a lead researcher at Nvidia. [1]

> The common method in open source engines is a projected gauss Seidel [0] which is used in bullet physics.

PGS is just the numerical method that Bullet uses to solve for the collision impulses between the rigid bodies (there are tons of other possible methods, Nvidia again had a cool paper a few years back, there are also global approaches with better convergence, etc). This is solving a so-called 'Contact Dynamics' contact model [2], which originates in the work of French mechanicians in the 70s and 80s.

Actually, if op is interested in PDEs in games, check out 'Digital Molecular Matter' [3]. It was used in some Star Wars games, iirc. It is a pretty straightforward Lagrangian discretization (linear shape functions on tets) of a linearized hyperelastic energy density. They added a simple fracture model on top which allowed for cool destruction effects in games.

[1] http://matthias-mueller-fischer.ch [2] https://en.wikipedia.org/wiki/Contact_dynamics [3] https://en.wikipedia.org/wiki/Digital_Molecular_Matter

Re: Physics Simulations

#22
post #20
post #4

Earlier quoted context omitted.

These all look like physics engines for graphics rendering. They all say 2d or 3d, and that means they surely can't handle concepts like relativistic spacetime. Do you know of any libraries for doing 'backend' physical simulations, such as calculating scattering amplitudes, making projections of spacetime models onto either space-like or time-like slices, and, especially, using tensor networks for modelling condensed…

The closest thing I can think of is [Geant4]( https://en.wikipedia.org/wiki/Geant4 ), which is a monte carlo-based particle simulator. It doesn't have facilities to work with geometric models of spacetime, of course, but it's used extensively in the high energy physics community and medical imaging communities.

[deleted]

Re: Physics Simulations

#23
post #17

Awesome stuff! A few months back I found a double pendulum simulation in less than 100 lines of JavaScript. It was a ton of fun to play around with the code. Code and explanation: http://www.physicsandbox.com/projects/double-pendulum.html Demo: http://www.physicsandbox.com/projects/double-pendulum-sim.ht...

For an accurate double pendulum you almost certainly need a symplectic integrator---not just Euler's method---or risk numerical instabilities that come from nonconservation of energy.

Re: Physics Simulations

#24
post #4
post #2

cool! Included here: https://www.tapirgames.com/blog/open-source-physics-engines

These all look like physics engines for graphics rendering. They all say 2d or 3d, and that means they surely can't handle concepts like relativistic spacetime. Do you know of any libraries for doing 'backend' physical simulations, such as calculating scattering amplitudes, making projections of spacetime models onto either space-like or time-like slices, and, especially, using tensor networks for modelling condensed…

There's Grid https://github.com/paboyle/grid , which is a general data-parallel code in development with the help of Intel. And there's the USQCD software stack http://usqcd-software.github.io/ which has communications and data-parallel layers (and then applications layers which you don't need unless you're doing lattice QCD). That stack tends to be annoying to compile and can be tricky to use---I'd look at Grid.

Re: Physics Simulations

#25
post #11

When I selected the double spring and pulled back the outer mass, as I let go the distance between the two masses went negative. This caused a runaway effect, sending system energy towards infinity. Cute but the models are not very robust

This can be fixed with a more reliable integrator, at the expense of computational speed.

Re: Physics Simulations

#26
post #17

Awesome stuff! A few months back I found a double pendulum simulation in less than 100 lines of JavaScript. It was a ton of fun to play around with the code. Code and explanation: http://www.physicsandbox.com/projects/double-pendulum.html Demo: http://www.physicsandbox.com/projects/double-pendulum-sim.ht...

Here is a n-pendulum, solved both iteratively (one constraint at a time) and simultaneously (all the chain at once)

http://htmlpreview.github.io/?https://github.com/aguaviva/Ph...

Re: Physics Simulations

#27
post #23
post #17

Awesome stuff! A few months back I found a double pendulum simulation in less than 100 lines of JavaScript. It was a ton of fun to play around with the code. Code and explanation: http://www.physicsandbox.com/projects/double-pendulum.html Demo: http://www.physicsandbox.com/projects/double-pendulum-sim.ht...

For an accurate double pendulum you almost certainly need a symplectic integrator---not just Euler's method---or risk numerical instabilities that come from nonconservation of energy.

An integrator that is symplectic or conserves energy isn't necessarily accurate, especially if the dynamical system is chaotic. Can you recommend particular algorithm that is accurate for pendulum or double pendulum?

Re: Physics Simulations

#28
post #19

Earlier quoted context omitted.

Most games aren’t using anything remotely near as sophisticated as that. Most games use rigid body simulations, and while the details of each implementation is different, most of them work in a similar way. The common method in open source engines is a projected gauss Seidel [0] which is used in bullet physics. Most other engines (PhysX and Havok) are to the best of my knowledge using something very similar. [0] http…

> Most other engines (PhysX and Havok) are to the best of my knowledge using something very similar. PhysX is position based dynamics. The Mueller guy who wrote that paper was a Co-founder of PhysX (back when it was NovodeX, then purchased by Ageia, then purchased by Nvidia) and is now a lead researcher at Nvidia. [1] > The common method in open source engines is a projected gauss Seidel [0] which is used in bullet p…

Great answer!
Post reply on HN