6 ms·
Physics Simulations
- tapirl 9y agocool! Included here: https://www.tapirgames.com/blog/open-source-physics-engines https://www.tapirgames.com/blog/open-source-physics-engines
- philipov 9y agoThese 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 matter interactions?
- toisanji 9y agoyou should add pybullet as well.
- fwilliams 9y agoWriting a general engine to do all these things is likely not a reasonable thing to do. Complicated dynamical systems usually involve solving PDEs and for that you need to discretize your domain. How you choose to do so will drastically affect the numerical properties of your simulation. Most "real-physics" simulators tend to be specialized to a given task or even a given domain (for example simulating heat diffusion in an engine part). There's a whole literature on finite element methods to simulate various physical phenomena though it can be quite dense. The generic game physics engines use very simple models of mechanics and allow for numerical issues (e.g. by using finite differences) in exchange for being real-time. If you're looking to simulate more advanced physical phenomena for a game, you're going to have to make similar trade-offs and will have to choose which ones make for the best gameplay.
- philipov 9y agoThank you, that all sounds right. I've been looking for, perhaps not a single engine, but rather specialized libraries I could glue together that handle different aspects of the problem. Sounds like I'll have to roll my own from scratch. Can you recommend any general-purpose libraries (preferably with python bindings) for tensor calculus?
- musgravepeter 9y agoTake a look at SageManifolds: https://hyperspace.uni-frankfurt.de/2017/01/20/sagemanifolds/ https://hyperspace.uni-frankfurt.de/2017/01/20/sagemanifolds... My understanding is the numerical GR community is moving in this direction. The theory people tend to roll their own inside of Mathematica or Maple. Some Maple users use GRTensorIII (https://github.com/grtensor/grtensor https://github.com/grtensor/grtensor) Disclaimer: I am a co-creator of GRTensorIII
- philipov 9y agoThank you! This is exactly what I was looking for.
- electricslpnsld 9y ago> The generic game physics engines use very simple models of mechanics and allow for numerical issues (e.g. by using finite differences) Most modern game physics engines aren't actually discretizing an ODE or a PDE, at this point. The current standard techniques (see Nvidia's PhysX, for example) are instead solving something that look like a constraint satisfaction problem but gives force-like effects. You don't even get consistency under refinement with these methods, but they are cheap, and importantly, stable when terminated early (to remain under strict time budgets required of game based physics).
- fwilliams 9y agoInteresting. So are these minimizing some constrained energy based on the physical properties and current state of whatever you're trying to simulate? If so, I don't quite understand how you avoid solving (or approximating) a PDE/ODE. My research is mostly in meshing and I'm not familiar with real-time simulation stuff. Do you have a link to a good paper on the topic?
- musgravepeter 9y agoThis might be of interest for spacetime modeling: https://arxiv.org/abs/1712.07658 https://arxiv.org/abs/1712.07658
- ktpsns 9y agoIt isn't, mainly because it solves classical physics, i.e. Newtons equations. In contrast, your linked paper discusses numerical relativity, that's an approach to solve Einstein's general relativistic theory of gravity. While nowadays we do have a mathematically kind-of-similar formulation (an initial value formulation of a partial differential equation system which can be solved with similar techniques as classical mechanics -- so indeed with similar techniques as the "physics engines" refered here to), the bleeding edge research is at another scale. We use high performance computers to solve a large and complex system of equations (typically several MB of source code defining the system) in very large computational domains which take GB-PB of main memory on thousands of computers. It may be worth saying that numerical relativity played a key part in the last Nobel prize for the detection of gravitational waves. Nevertheless it's nice to refer to this analogy.
- jperras 9y agoThe closest thing I can think of is [Geant4](https://en.wikipedia.org/wiki/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 9y ago[deleted]
- evanb 9y agoThere's Grid https://github.com/paboyle/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/ 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.
- deleted 9y ago[deleted]
- nicois 9y agoWhen 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
- evanb 9y agoThis can be fixed with a more reliable integrator, at the expense of computational speed.
- electricslpnsld 9y agoVery cool! Would be fun to have some implicit integrators to play with, too. And visualizations of the symplectic form.
- rivaldo 9y agoAwesome 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 http://www.physicsandbox.com/projects/double-pendulum.html Demo: http://www.physicsandbox.com/projects/double-pendulum-sim.html http://www.physicsandbox.com/projects/double-pendulum-sim.ht...
- evanb 9y agoFor 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.
- effie 9y agoAn 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?
- xchip 9y agoHere 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/Physics/blob/master/ChainSimulation.html http://htmlpreview.github.io/?https://github.com/aguaviva/Ph...
- xchip 9y agoHere is my physics engine! (Works in your browser too!) http://htmlpreview.github.io/?https://github.com/aguaviva/Physics/blob/master/Friction.html http://htmlpreview.github.io/?https://github.com/aguaviva/Ph...