Python Advanced #3 - Physics problem of block sliding down incline

In this post, we will look at the Physics problem of a block sliding down an incline.  We will be computing the weight component of the block in the direction of the incline and the frictional force between the block and the surface of the incline.  A comparison of these two forces will tell us whether the block will slide down the incline or stay put.

In the figure below, we have a block of weight, W, on an incline of angle, a.  Since we know that a triangle is 180 degrees and that the angle in the lower right hand corner is 90 degrees, we can compute angle b as (180 - 90 - a)


The normal force acts perpendicular to the surface of the incline.  It is the force of the surface acting on the block.  We can compute the angle of the normal force from the vertical as 90 - b which is equal to angle, a.  So, the normal force, N, is equal to W * cos(a).  In case you are having difficulties with this concept, I show the math below.

Recall from above that angle b = 180 - 90 - a, which can be simplified to b = 90 - a.

Moving a to the left hand side gives:

a + b = 90

Moving b to the right hand side gives

a = 90 - b.




We now compute the weight in the direction down the incline which is:

W * cos(b)

We can compute the frictional force as the coefficient of static friction * N where N = W * cos(a)


The Python code for this problem is straightforward.  Remember to use float as your variable type since the user may enter decimals.  Also, remember to import the math module since you will be converting degrees to radians and using the cosine function.


To test the code we have a block of 50 lbs, an angle of 30 degrees, and a coefficient of static friction of 0.4.  With these values, the block slides down the incline.


In order for the block not to slide down the incline, the coefficient of static friction needs to be increased or the angle needs to be decreased.  For the next test, the angle is reduced to 15 degrees.


Comments