0
$\begingroup$

I am trying to make a physics simulation where particles are moving inside the box like an ideal gas. However, there is a problem with the simulator.

I set bounciness for the ball and the box to be 1, all the drag forces to be zero so there is only elastic collisions. The image down below shows the bouncing of a ball, which should bounce infinitely long since there is only gravity force acting on it. However, you can see that Blender gives weird results.

What could be the problem?

Also, the simulator every time behaves differently, sometimes when ball has already stopped, it starts bouncing by itself, or, sometimes ball bounces 3 or 4 times and then stops completely.

enter image description here

$\endgroup$
5
  • $\begingroup$ The problem, modern physics professors would joke, is that you've assumed a spherical cow. All kidding aside, did you go to Dynamics in the Physics tab for the sphere and turn Damping Translation and Rotation to 0? $\endgroup$ Commented Nov 20, 2021 at 22:46
  • 2
    $\begingroup$ Also, non-deterministic behavior of physics simulations unless they've been baked, is a well known issue that the devs won't fix because 'bake the physics' is a documented workaround. $\endgroup$ Commented Nov 20, 2021 at 22:55
  • $\begingroup$ aa, haha, understood the joke xd Yes, I did turn off damping and rotation as well. I played with the sphere, it was even worse sometimes, did not bounce at all. And the baking does not help. Now that I am simulating again, it is bouncing higher and higher this time, with the old parameters. Something very weird is going on $\endgroup$
    – andrix
    Commented Nov 20, 2021 at 23:57
  • $\begingroup$ If baking isn't fixing it, you might have a genuine bug. Can you share the file (How to add a blend file) so that I can check it on my configuration? $\endgroup$ Commented Nov 21, 2021 at 0:30
  • $\begingroup$ Here you are. In this file depending of either I put sphere or mesh or convex hall or capsule. sometimes it stops bouncing, sometimes it bounces higher and higher, even with all the baking. <img src="https://blend-exchange.com/embedImage.png?bid=RqDRK2o0" /> $\endgroup$
    – andrix
    Commented Nov 21, 2021 at 11:28

3 Answers 3

1
$\begingroup$

Blender's rigid body physics are based on game-engine physics. They are built for good performance, with a minimal number of intuitive parameters, for results that look pretty much right in contexts involving solving crate-based puzzles while under attack by headcrabs.

They are only remotely like real-world physics. One reason, already mentioned elsewhere on this page, is that there is some randomness built into the sims, to prevent problems with pencils balancing on their points. Another reason is that states are sampled rather than solving all the calculus problems we'd need to do things realistically. Most visibly we see this problem manifesting in objects teleporting through colliders, but it can also affect bounces.

Consider this starting state for a rigid body sim:

enter image description here

The spheres start in collision with the ground, but at different depths. Let's advance a few frames and see what happens:

enter image description here

The spheres are pushed out of collision, but with different velocities. The one that was deeper has a higher velocity. What's happening? The rigid body sim sees that the spheres are in collision. It pushes them out of collision, creating velocity. That velocity is different for each sphere, because the distance required to push the sphere out of collision is different for each sphere.

Now, what happens when a rigid body sphere rebounds off a wall? The simulation does not see the exact moment that happens; that would require the simulation to solve some calculus problems, potentially, a huge number of them. It sees one subframe, where the body is not in collision, then, the next sub-frame it looks at, the body is in collision. How deep is it in collision? That depends heavily on the body's velocity, but it also depends, artifactually, on when exactly the sub-frame occurred.

Because of that, rebounds in Blender's rigid body system are not perfect. They are just good enough for typical use. They average out to be about realistic. If you need to solve physics problems precisely, you should be using different software to do so.

$\endgroup$
1
  • $\begingroup$ Yes, using a different software would probably be a better solution. It is just a shame, because Blender is free, easy to use and can give really nice visualizations. $\endgroup$
    – andrix
    Commented Nov 30, 2023 at 21:48
0
$\begingroup$

So in Blender version 2.93.4 a Plane with the default collision work as expected giving an infinite bounce: enter image description here

For the ideal gas simulation, I would recommend turning on the Size Deflect option and removing gravity, as well as increasing the randomised velocity, this helps to emulate the different molecule velocities. As an emitter, I just used a subdivided Ico Sphere and as a collider a cube with the default collision. enter image description here

Hope this helped

$\endgroup$
1
  • $\begingroup$ Thank you! I tried particle simulation. It is better, but not what I was looking for in the original question since particle systems do not collide with each other. So I am manually creating particles and subjecting them to physics simulation. $\endgroup$
    – andrix
    Commented Nov 21, 2021 at 22:36
0
$\begingroup$

Depending on which integrator you use, the particles sometimes bounce higher and higher, like in your example:

https://docs.blender.org/manual/en/latest/physics/particles/emitter/physics/newtonian.html?highlight=bounce#integration

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .