Let's say I have a 10cm x 10cm x 50 cm wooden stick that weights 5kg total. The 10cm x 10cm base is touching the floor and it protrudes from the floor 50cm which is the height of the stick. Based on this configuration, I would expect the wooden stick to never fall over.
Let's say I attach a 10cm x 10cm x 10cm metal box on the side of the wooden stick 40cm from the base. The metal box weighs 5kg as well. Now the center of gravity should be on the very edge of the wooden stick.
I assumed that if the center of gravity was under the wooden stick (where it makes contact with the ground), then the stick won't fall over. If it's outside the wooden stick, then the stick will fall over.
However, I tried simulating this phenomenon on Bullet and Newton physics engine. On Newton, if the metal box weighs more than 4.72 kg, it would eventually fall over. On Bullet, if the metal box weighs more than 4.9 kg, it would eventually fall over. If I move the metal box down the shaft of the wooden stick, the stick would take a longer time to fall over.
Can anybody explain this phenomenon. Even better yet, can someone give me a formula that might be useful in predicting if an object will fall over or not?