In [1]:

```
import math
# Given Data
F = 100.; # lb , Vertical force applied to end of lever
theta = 60.; # degree, angle made by lever with +ve X axis
l = 24.; # , length of lever
# Calculations and Results
# a ) Momemt about O
d = l*math.cos(math.radians(theta)); # mm ,perpendicular dismath.tance from o to the line of action
Mo = F*d; # N.m, Magnitude of moment about O
print "Magnitude of moment about O of the 500 N is %d lb.in and it is in clockwise direction\
\n as force tends to rotate lever clockwise"%(Mo);
# b) Horizontal force
d = l*math.sin(math.radians(theta)); #in, perpendicular dismath.tance from o to the line of action
F = Mo/d; # N, Horizontal Force at A required to produce same Moment about O
print "Magnitude of Horizontal Force at A required to produce same Moment about O is %f lb "%(F);
# c)Smallest force
# F is smaller when d is maximum in expression Mo = F*d, so we choose force perpendicular to OA
Mo = 1200. #in lb
d = 24. # in ,perpendicular dismath.tance from o to the line of action
F = Mo/d; # N, Smallest Force at A required to produce same Moment about O
print "Magnitude of smallest Force at A required to produce same Moment about O is %f lb "%(F);
#d) 1200 N vertical force
Mo = 1200.; # lb-in,
F = 240. #in lb
d = Mo/F; # m, perpendicular dismath.tance from o to the line of action of force
OB = d/math.cos(math.radians(theta)); #m, dismath.tance of point B from O
print "Verical force of 1200 N must act at %f in far from the shaft to create same moment about O"%(OB);
```

In [2]:

```
import math
from numpy.linalg import det
# Given data
F = 800.; # N , Force applied on bracket
theta = 60.; # degree, angle made by lever with +ve X axis
theta = theta*math.pi/180; # Conversion of angle into radian
r_AB = [-0.2, 0.16]; #m vector drawn from B to A resolved in recmath.tangular component
# Calculations
F = [F*math.cos(theta), F*math.sin(theta)] #N , vector F resolved in recmath.tangular component
k = 1; # Unit vector along Z axis
# M_B = r_AB * F relation 3.7 from section 3.5
M_B = det([r_AB, F])*k; # N.m
# Results
print "The moment of force 800 N about B is %.2f N.m . -ve sign shows its acting clockwise"%(M_B);
```

In [4]:

```
import math
# Given data
P = 30.; # lb, Force applied to shift lever
alpha = 20.; # degree, angle made by force P with -ve X axis
# Calculations
Q = P*math.sin(math.radians(alpha)) #in degree
d = 3 #in ft
M_o = Q*d #N.m , here negative signs are taken as each component creates moment clockwise
# Results
print "The moment of force P about B is %.2f lb-ft . -ve sign shows its acting clockwise"%(M_o);
```

In [6]:

```
import math
from numpy.linalg import norm,det
# Given data
# M_A = r_CA * F relation 3.7 from section 3.5
f = 200.; # N , Magnitude of Force directed along CD
r_CA = [0.3,0, 0.08]; #m, vector AC reprecsented in recmath.tangular component
#lambda = CD/norm(CD)-m, Unit vector along CD
#F = f*lambda; #m, Force
CD = [-0.3, 0.24, -0.32]; #Vector CD resolved into recmath.tangular component
# norm(CD); m, magnitude of vector CD
# Calculations
lambda1 = CD/norm(CD); #m, Unit vector along CD
F = f*lambda1; #m, Force
# M_A = r_CA * F relation 3.7 from section 3.5
#i = 1; j = 1; k = 1; Unit vectors along X, Y and Z direction respectively
# Componenets of moment M_A along X,Y and Z direction respectively
M_Ax = det([[r_CA[1],r_CA[2]],[F[1], F[2]]]); #N.m
M_Ay = -det([[r_CA[0],r_CA[2]] , [F[0],F[2]]]); #N.m
M_Az = det([[r_CA[0],r_CA[1]],[F[0], F[1]]]); # N.m
# Results
print "Answer can be written as M_B = %.2f N.m i + %.2f N.m j + %.2f N.m k "%(M_Ax,M_Ay,M_Az);
```

In [7]:

```
#Given data
# Moment arms
Fx = -30.; #in lb
Fy = 20.; #in lb
Fz = 20.; #in lb
#couple Forces
x = 18.; #iN
y = 12.; #iN
z = 9.; #iN
# Calculations
Mx = Fx*x; #N.m, Component of Moment along X axis
My = Fy*y; #N.m, Component of Moment along Y axis
Mz = Fz*z; #N.m, Component of Moment along Z axis
# Results
#This three moments represent component of math.single couple M
print "Couple M equivalent to two couple can be written as M = %.2f lb-in i + %.2f lb-in j + %.2f lb-in k "%(Mx,My,Mz);
```

In [8]:

```
import math
# Given Data
Mo = 24.; #N.m *k, Couple of moment
f = -400.; #N, Magnitude of force
OB = 300.; #mm,Dismath.tance of force from point O
theta = 60.; # degree, angle made by lever with +ve X axis
# Calculations and Results
x = math.cos(math.radians(theta))
BC = Mo/(-f*x); #m
BC = BC*1000; #mm, Conversion into millimeter
print (BC)
OC = OB+BC; #mm, Dismath.tance from the shaft to the point of application of this equivalenet force
print "Distance from the shaft to the point of application of this equivalenet single force is %f mm"%(OC)
```