from numpy import *
dtr = pi/180 # degree-to-radian conversion
R,X,Y = 0.5, 3.0, 4.0 # m
limit = 24.0 # kN.m
First note that, in equilibrium, $\left |\vec{T} \right | = T = W$.
For a given $T$, the maximum moment would be at the greatest perpendiculat distance from A to the line of action of force $\vec{T}$. Therefore the greatest momemt arm is the distance from A through C (at the pulley center), to the opposite side of the pulley. A little geometry will show that $\alpha$ is equal to the angle that $\vec{r}_{AC}$ makes with the $-x$ axis, so
$$\tan \alpha = \frac{|\vec{r}_{ACy}|}{|\vec{r}_{ACx}|}$$rAC = array((-X,Y,0))
alpha = arctan(abs(rAC[1]/rAC[0]))

Since $\vec{T}$ (at maximum moment) will be perpendicular to $\hat{u}_{AC}$, we can use the moment arms shown in the figure.
So the total moment about A is
$$M_A = W L_1 + W L_2$$where $L_1=X-R$ and $L_2=\sqrt{X^2+Y^2}+R$.
L1 = X-R
L2 = sqrt(X**2+Y**2) + R
W = limit / (L1+L2)
print ('angle of max moment is alpha=',alpha/dtr,'deg')
print ('maximum weight is W=',W,'kN')
FA = array(( 34000., 0, 0 )) # lb
FB = array(( 29870., 0, 4400 )) # lb
rOA = array(( 8., 27., -8 )) # ft
rOB = array(( -85., 0, 21 )) # ft
MO = cross(rOA,FA) + cross(rOB,FB)
print (MO)
x1,x2 = 10., 13. # in; OAx, ODx
y = 13. # in
z1,z2 = 15., 18. # in; OBz, BCz
T_mag = 68. # lb
P_mag = 105. # lb
F_mag = 220. # lb
# define position and force vectors
rOA = array(( x1, y, 0 ))
rOB = array(( 0, 0, z1 ))
rOC = array(( 0, 0, z1+z2 ))
rOD = array(( x2, 0, z1+z2 ))
F = F_mag*array((0,-1,0))
P = P_mag*array((0,-1,0))
rCA = rOA - rOC
uCA = rCA / sqrt(sum(rCA**2))
T = T_mag*uCA
# perform cross products
rBC = rOC - rOB
rBD = rOD - rOB
MB = cross(rBC,T) + cross(rBD,F)
MO = cross(rOC,T) + cross(rOD,F) + cross(rOB,P)
print ('answer:')
print (' MB=',MB,'in.lb')
print (' MO=',MO,'in.lb')

A rectangular piece of sheet metal is clamped along edge AB in a machine called a brake. The sheet is to be bent along line AB by applying a y-direction force F. Determine the moment about line AB if F = 245 lb.
x1,x2 = 24., 11. # in; left-to-right
z = 12. # in
F_mag = 205. # lb
# define vectors
rOA = array(( 0, 0, z ))
rOB = array(( x1, 0, 0 ))
rOC = array(( x1+x2, 0, z ))
F = F_mag*array((0,1,0))
# do the work (vector method)
rBC = rOC - rOB
MB = cross(rBC,F)
rAB = rOB - rOA
uAB = rAB / sqrt(sum(rAB**2))
M_AB = dot(MB,uAB)
print ('moment about line AB=',M_AB,'in.lb')
X = 8. # in
Y = 2. # in
AB_lim = 6.3 # in.lb
BC_lim = 5.0 # in.lb
Compute the moment of the force about point B:
$$\vec{M}_B = \vec{r}_{BD} \times \vec{F} = Y \hat{\jmath} \times (-F \hat{k}) = -YF \hat{\imath} $$Then dot this with the two unit vectors $\hat{u}_{BA}$ and $\hat{u}_{BC}$.
$$M_{BA} = -YF$$and
$$M_{BC} = -YF \hat{\imath} \cdot \hat{u}_{BC} = \frac{-XYF}{\sqrt{X^2+Y^2}} $$Set the moment about the line to the given limit and compute what force is required in each case.
rBD = array(( 0., Y, 0.))
rBC = array(( X, Y, 0.))
uBA = array(( 1., 0, 0.))
uBC = rBC/sqrt(sum(rBC**2))
# force limits for each moment:
F_AB = AB_lim / Y
F_BC = BC_lim * sqrt(X**2+Y**2) / (X*Y)
print ('force limit for AB is',F_AB,'lb')
print ('force limit for BC is',F_BC,'lb')
The lesser of these is the answer.
f = 0.3 # fraction of normal force contributing to applied force
NA = 7. # N
r = 23. # mm
FA = f*NA
FB = FA
NB = NA
M = -2*r*FA
print ('FA=',FA,'N')
print ('FB=',FB,'N')
print ('NB=',NB,'N')
print ('M=',M,'N.mm in the x-direction')
Careful about the sign of the $\hat{\imath}$ component of $\vec{M}$.
F1,F2 = 200.,265. # N; upper, lower
y1,y2,y3 = 1.0,2.0,4.5 # m; bottom, mid, top
M1 = F1*(y3-y2)*array((0.,0,-1))
M2 = F2*(y2-y1)*array((1.,0, 0))
print ('total moment M=',M1+M2,'N.m')
radius = 60e-3 # m
FA_mag = 555. # N
FB_mag = 636. # N
FC_mag = 724. # N
QB = 30*dtr # radians
QC = 30*dtr # radians
# part a
khat = array((0.,0.,1.))
FA = -FA_mag*khat
FB = -FB_mag*khat
FC = -FC_mag*khat
FR = FA + FB + FC
rOA = radius*array((1.,0,0))
rOB = radius*array((-sin(QB), cos(QB), 0))
rOC = radius*array((-sin(QC),-cos(QC), 0))
MO = cross(rOA,FA) + cross(rOB,FB) + cross(rOC,FC)
print (cross(rOA,FA))
print (cross(rOB,FB))
print (cross(rOC,FC))
# part b
MO_mag = sqrt(sum(MO**2))
uM = MO/MO_mag
uM_perp = array((uM[1],-uM[0], 0))
FR_mag = sqrt(sum(FR**2))
r_mag = MO_mag/FR_mag
r = r_mag*uM_perp
print ('check moment:',cross(r,FR))
# answers:
print ('(a)')
print (' FRz=',FR[2],'N')
print (' MO=(',MO[0],'i +',MO[1],'j)N.m')
print ('(b)')
print (' FRz=',FR[2],'N')
print (' x=',r[0]*1e3,'mm')
print (' y=',r[1]*1e3,'mm')
F1 = 6.07 # kN
F2 = 2.84 # kN
F3 = 4.76 # kN
x1,x2 = 2.76,1.14 # m left,right
# part a
FR = -F1 - F2 - F3
MR = F1*x2 - F3*x1
# part b
r = MR/FR
x = x1+x2+r
# answers
print ('(a)')
print (' FR=',FR,'kN')
print (' MR=',MR,'kN.m')
print ('(b)')
print (' FR=',FR,'kN')
print (' x=',x,'m')