# What am I doing wrong?? (Physics steps, framerate, substeps question)

Hi guys. I’m working on a physics experiment, and one of the steps is to simulate it in Blender. So…here is my file.
http://www.pasteall.org/blend/27744

Here is what is supposed to happen. A moving object with known velocity and mass collides with a pendulum, thus transferring its energy to said pendulum. Then, we see how high the pendulum travels (measured from its position at rest)

The equation I used to calculate it was mgh=E, where m is the mass of the pendulum (.1Kg in the blend file), g is acceleration due to gravity, E is energy, and h is the height that the mass reaches at the amplitude of its swing.

SO. I calculated h to be .01276m, or 1.276cm. Then to test the simulation, I put a block whose height was set to 1.276cm in the scene, and measured it against the simulated amplitude of the pendulum. If you download the blend file and run the game engine, you can see that the pendulum swings slightly farther than 1.276cm. Why is this? Something with collisions perhaps?

I tried fiddling with the physics substeps and found that when set to 8, it was decently accurate (the height the pendulum reached was off by about 2mm) but can we get any more accurate than that? Also when you set the physics substeps to something like 30 or 50, the simulation goes WAY off and swings almost a full circle.

Any help would be greatly appreciated!!

Any ideas, guys?

Bullet is not meant to be 100% accurate at physics,

the thing is it’s designed for speed, and I am not sure how deep it’s floats go…

I think in order to get the accuracy your looking for, your going to have to talk to someone over at http://bulletphysics.org/

Edit -I was confused about his setup, I though he was already using force,

I guess I was wrong ?

bullet is 100% accurate?

Please disregard what Blueprint says about it being bullets fault. In this case, bullet is being plenty accurate. Speeds are well within permissible values etc. Problems arise with bullet if you have small objects moving really really fast, weird shape objects (non-flat faces) and a few other things. None that I know of are present here

What is going wrong is with how you move your moving block. You’ve hit one the most confusing things to do with the game engine: the ‘loc’ column in ‘simple motion’ is not the way you want to move an object.

Why?
It’s a teleporter. Every time the logic brick get’s run, it teleports a very small increment in the direction you specify. You’ll notice this means it goes through the end stop.

Why is this bad?
Because your moving block doesn’t follow physics, so you can’t expect a physical result from it.

Solution:
Instead of using simple motion, use ‘Servo Motion’ it is available from the same logic brick, and is a drop-down at the top. Put your maximum velocity in the ‘Linear Velocity’ boxes, and put the maximum/minimum force if can exert in the ‘force’ boxes. You have some other wierd stuff with your file as well, such as the pendulum itself is a ‘ghost’ object, your bounds are strange (if it’s a box/cube, use box, and use tolerances around 0.5-5cm)

After a little playing I got it to hit the pendulum correctly, but: