Simple newtonian simulations giving wrong results
Posted: Mon Mar 15, 2010 3:34 pm
Hi !
I'm experimenting with Bullet to determine if it is the tool I need for a physics simulation project. I plan to move around a rigid body on a plane, with a few constraints, mainly the friction and hinge joints, and log its instant speeds.
Before considering a "complex" scenario, I went to validate some basic newtonian equations. First, I want to apply a constant force to the body and mesure its speed after 5 seconds. Second, I want to measure the effect of friction on the final speed of the body, again after 5 seconds. I actually piggyback on the clientMoveAndDisplay callback to apply forces, display the linear speeds and verify my end condition.
1) The body's mass is 100kg. The friction for both the plane and the body (a simple box, roughly the size of an human) is set to 0. Its initial speed is set to (10, 0 0). A central force of (100, 0, 0) is applied (at each step), so the expected acceleration is 1.0 (F=ma). After 5 seconds, I expect the speed to be 15 unit per second on the X axis (V=V0+at). The simulation indicates 10.7, which is far from the count.
2) Same mass, same initial speed. Friction set at 1 for the plane and 0.01 for the body, resulting in a coefficient U of 0.01. The resulting force is therefore 9.8 (F=mgU). Let's round it a 10. No other forces are applied. I would expect the body to cruise at about 9.5 after 5 seconds (F=ma, a = 0.1, V=V0-at). Simulation gives me 9.93.
Are my physics rusty ? Or have I overlooked something in my experimental setup ?
Thanks
Tom
I'm experimenting with Bullet to determine if it is the tool I need for a physics simulation project. I plan to move around a rigid body on a plane, with a few constraints, mainly the friction and hinge joints, and log its instant speeds.
Before considering a "complex" scenario, I went to validate some basic newtonian equations. First, I want to apply a constant force to the body and mesure its speed after 5 seconds. Second, I want to measure the effect of friction on the final speed of the body, again after 5 seconds. I actually piggyback on the clientMoveAndDisplay callback to apply forces, display the linear speeds and verify my end condition.
1) The body's mass is 100kg. The friction for both the plane and the body (a simple box, roughly the size of an human) is set to 0. Its initial speed is set to (10, 0 0). A central force of (100, 0, 0) is applied (at each step), so the expected acceleration is 1.0 (F=ma). After 5 seconds, I expect the speed to be 15 unit per second on the X axis (V=V0+at). The simulation indicates 10.7, which is far from the count.
2) Same mass, same initial speed. Friction set at 1 for the plane and 0.01 for the body, resulting in a coefficient U of 0.01. The resulting force is therefore 9.8 (F=mgU). Let's round it a 10. No other forces are applied. I would expect the body to cruise at about 9.5 after 5 seconds (F=ma, a = 0.1, V=V0-at). Simulation gives me 9.93.
Are my physics rusty ? Or have I overlooked something in my experimental setup ?
Thanks
Tom