Imagine you are the structural engineer and it is your job to determine if a cantilever design is stable or not.
We will start with one block & continue adding blocks to form a cantilever structure and then:
1) You will use Python to find the center of mass of a combination of Jenga blocks.
2) You will write code to determine if it is stable or not.
Key point: Since the depth for all our blocks will be 5 cm (whether horizontally or vertically placed); we will be able to focus on the 2D dimensions of x & y (the length and height) which simplifies this 3D problem.
Assume we have just one block laying flat horizontally, can you calculate where the center of mass would be?
Center of Mass: You probably realized that the center of mass is half of the x-length and half of the y-distance.
Stability: Intuitively, we can see that the one horizontal block can be balanced on a single support beam. But how can we predict or calculate that?
If you recall from the previous videos, stability requires that the center of mass be located within the base. In our case, the base is within the bottom horizontal block (within the 15cm).
Let's calculate the center of mass and check for stability using the Trinket below.
Step 1. Add the necessary code to calculate the center of mass (COM) of the first block.
Step 2. Add the necessary code to calculate if the COM is within the 15cm base. If so, print "The structure is stable" and if not, print
"The structure is unstable."
Way to go!
Now that you've figured out how to determine COM and stability for one block, let's add a second block.