In: Mechanical Engineering
use python.
Consider 4 blocks with different masses mi connected by ropes of negligible mass. Three of the blocks lie on an inclined plane and the fourth lies in the direction of the gravity vector. The coefficients of friction between the blocks and the inclined plane are µi. The equations of motion governing these four blocks are described by the following system of equations:
T1 + m1a = m1g(sin(theta) - µ1*cos(theta))
-T1 + T2 +m2a = m2g(sin(theta) - µ2*cos(theta))
-T2 + T3 + m3a = m3g(sin(theta) - µ3*cos(theta))
-T3 + m4a = -m4g
Where the Ti denote the tensile forces in the ropes and a is the acceleration of the system. Determine a and the three Ti for θ = 45°, g = 9.82 m/s2 , {mi} = [10, 4, 5, 6]^T kg, and {µi} = [0.25, 0.3, 0.2]^T
The output to the command terminal prompt within Spyder should read:
T1 =
T2 =
T3 =
a =
All values should be printed out to 4 significant digits of accuracy and units must be assigned.
import math
import numpy as np
theta = math.pi / 4
g = 9.82
m = [10,4,5,6]
mu = [0.25,0.3,0.2]
# coeffients of variables T1, T2, T3, a in order in each equation
a = np.array([1, 0, 0, m[0]], [-1, 1, 0, m[1]], [0, -1, 1, m[2]], [0,0,-1,m[3]])
# RHS values of the equations
b = np.array([m[0] * g* (math.sin(theta) - mu[0] * math.cos(theta)), m[1] * g * (math.sin(theta) - mu[1] * math.cos(theta)), m[2] * g * (math.sin(theta) - mu[2] * math.cos(theta)), -m[3] * g])
T = np.linalg.solve(a, b)
print("T1 = " + T[0])
print("T2 = " + T[1])
print("T3 = " + T[2])
print("a = " + T[3])