# Example 2.1 CFP¶

In :
import math
#Initilization of variables
P=50 #N
Q=100 #N
beta=150 #degree # angle between P & the horizontal
#Calculations
R=math.sqrt(P**2+Q**2-(2*P*Q*math.cos(beta*math.pi/180))) # using the Trignometric solution
Alpha=math.degrees(math.asin((math.sin(beta*math.pi/180)*Q)/R))+15
#Result
print('The magnitude of resultant is %f Newton (N)'%R)
print('The direction of resultant is %f degree'%Alpha)

The magnitude of resultant is 145.465646 Newton (N)
The direction of resultant is 35.103909 degree


# Example 2.2 Addition of concurrent forces¶

In :
from __future__ import division
import math
#Initilization of variables
P=50 #N
Q=100 #N
beta=15 #degree # angle between P& the horizontal
theta=45 #degree # angle between the resultant (R) & the horizontal
#Calculations
Rx=P*math.cos(beta*math.pi/180)+Q*math.cos(theta*math.pi/180) #N
Ry=P*math.sin(beta*math.pi/180)+Q*math.sin(theta*math.pi/180) #N
R=math.sqrt((Rx**2)+(Ry**2)) #N
alpha=math.degrees(math.atan(Ry/Rx)) #degree
#Results
print('The magnitude of the resultant is %f N'%R)
print('The ange of the resultant with x-axis is %f degree'%alpha)

The magnitude of the resultant is 145.465646 N
The ange of the resultant with x-axis is 35.103909 degree


# Example 2.4 Equilibrium equations¶

In :
from __future__ import division
import math
#Initilization of variables
Tac=3.5 #kN
Tbc=3.5 #kN
alpha=20 #degree #angle made by Tac with -ve X axis
beta=50 #degree #angle made by Tbc with +ve X axis
#Calculations
theta=math.degrees(math.atan(((Tac*math.sin(alpha*math.pi/180))+(Tbc*math.sin(beta*math.pi/180)))/((Tac*math.cos(alpha*math.pi/180))-(Tbc*math.cos(beta*math.pi/180))))) #degree
P=Tac*(math.cos(alpha*math.pi/180)-math.cos(beta*math.pi/180))/(math.cos(theta*math.pi/180)) #kN # from eq'n 1
#Results
print('The maximum force that can be applied is %f kN'%P)
print('The direction of applied force is %f  degree'%theta)

The maximum force that can be applied is 4.015035 kN
The direction of applied force is 75.000000  degree


# Example 2.8 Equilibrium of a body subjected to two forces¶

In :
from __future__ import division
import math
#Initilization of variables
lAB=0.4 #m
lBC=0.3 #m
#Calculations
alpha=math.degrees(math.atan(lAB/lBC)) #degree
#Results
print('The angle which the force should make with the horizontal to keep the edge AB of the body vertical %f degree'%alpha) #here alpha=theta

The angle which the force should make with the horizontal to keep the edge AB of the body vertical 53.130102 degree


# Example 2.9 Equilibrium of a body subjected to three forces¶

In :
from __future__ import division
import math
#Initilization of variables
F=1000 #N
lAB=0.5 #m
lDC=0.25 #m #length of the perpendicular drawn from point C to AB
#Calculations
lAC=math.sqrt((0.3)**2+(0.25)**2) #m
lBC=math.sqrt((0.20)**2+(0.25)**2) #m
Sac=(lAC*F)/(lAB) #N #by law of concurrent forces
Sbc=(lBC*F)/(lAB) #N #by law of concurrent forces
#Results
print('The axial force in the bar AC(by aw of concurrent forces) is %f N'%Sac)
print('The axial force in the bar BC(by aw of concurrent forces) is %f N'%Sbc)

The axial force in the bar AC(by aw of concurrent forces) is 781.024968 N
The axial force in the bar BC(by aw of concurrent forces) is 640.312424 N


# Example 2.10 Equilibrium of a body subjected to three forces¶

In :
from __future__ import division
import math
#Initilization of variables
F3=500 #N
alpha=60 #degree #angle made by F3 with F2
beta=40 #degree #angle made by F1 with F3
theta=80 #degree #angle made by F1 with F2
#Calculations
# Solving by using law of sines
F1=(F3*math.sin(alpha*math.pi/180)/math.sin(theta*math.pi/180)) #N #by law of sines
F2=(F3*math.sin(beta*math.pi/180)/math.sin(theta*math.pi/180)) #N #by law of sines
#Resuts
print('The force F1 is %f N'%F1)
print('The force F2 is %f N'%F2)

The force F1 is 439.692621 N
The force F2 is 326.351822 N


# Example 2.11 Reaction at the hinge¶

In :
from __future__ import division
import math
#Initilization of variables
P=5000 #N
lAB=5 #m
lOB=1.443 # m
alpha=30 #degree #angle made by force P with the beam
#Calculations
theta=math.degrees(math.atan(lOB/lAB)) # degree # eq'n 1
Xa=(P*math.cos(alpha*math.pi/180)) #N #using eq'n 4
Ya=Xa*math.tan(theta*math.pi/180) #N # from eq'n 3 & 4
Rb=P*math.sin(alpha*math.pi/180)-Ya # N  from eq'n 5# substuting value of Ya in eq'n 5
Ra=math.sqrt((Xa**2)+(Ya**2)) #N
#Results
print('The X component of reaction at A is %f N'%Xa)
print('The Y component of reaction at A is %f N'%Ya)
print('The reaction at support A is %f N'%Ra)
print('The reaction at support B is %f N'%Rb)

The X component of reaction at A is 4330.127019 N
The Y component of reaction at A is 1249.674658 N
The reaction at support A is 4506.848871 N
The reaction at support B is 1250.325342 N


# Example 2.12 Reaction at the hinge¶

In :
from __future__ import division
import math
#Initilization of variables
W=1000 #N
OD=0.4 #m
AO=0.5 #m #AO=sqrt((0.4)**2+(0.3)**2)
#Calculations
Ra=W*AO/OD #N # The answer of Ra in the textbook is incorrect
#Results
print('The reaction at support A is %f  N'%Ra)
print('The reaction at support B is %f N'%Rc)
print('The angle that Rc makes with horizontal %f degree'%alpha)

The reaction at support A is 1250.000000  N
The reaction at support B is 750.000000 N
The angle that Rc makes with horizontal 53.130102 degree


# Example 2.13 Reaction at the hinge¶

In :
from __future__ import division
import math
#Initilization of variables
W=2500 #N #This load acts at point B and C.
alpha=30 #degree # angle made by T1 with +ve y-axis & T2 with +ve x-axis
#Calculations
T2=W-(((math.cos(alpha*math.pi/180))**2/(math.sin(alpha*math.pi/180)))-(math.sin(alpha*math.pi/180))) # N # substuting eq'n 1 in 2
T1=(T2*math.cos(30*math.pi/180))/(math.sin(30*math.pi/180)) #N # using eq'n 1
T3=T2 #N # By equilibrium eq'n at point C(sumFx=0)
#Results
print('Tension in portion AB is %f N'%T1)
print('Tension in portion BC is %f N'%T2)
print('Tension in portion CD is %f N'%T3)

Tension in portion AB is 4328.394968 N
Tension in portion BC is 2499.000000 N
Tension in portion CD is 2499.000000 N


# Example 2.15 Equilibrium of a body¶

In :
from __future__ import division
import math
#Initilization of variables
d=0.6 #m #diameter of the wheel
r=0.3 #m #radius of the wheel
W=1000 #N #weight of the wheel
h=0.15 #m #height of rectangular block
#Calculations
theta=math.atan((math.sqrt(h))/(math.sqrt(d-h)))
P=(W*math.tan(theta)) #N # dividing eq'n 1 & 2
#Resuts
print('The force P so that the wheel is just to roll over the block is %f N'%P)

The force P so that the wheel is just to roll over the block is 577.350269 N


# Example 2.16 Equilibrium of a Body¶

In :
from __future__ import division
import math
#Initilization of variables
Soa=1000 #N (tension)
alpha=45 #degree #where alpha=(360/8)
theta=67.5 #degree #angle made by bar AO with AB &AH
#Calcultions
Sab=Soa*(math.sin(theta*math.pi/180)/math.sin(alpha*math.pi/180)) # N # Using law of sines
Sah=Sab #N
Sob=(Sab*math.sin((180-2*(theta))*math.pi/180))/math.sin(theta*math.pi/180) #N
#Results
print('The axial force in the bar AB is %f N'%Sab) #Compression
print('The axial force in the bar OB is %f N'%Sob) #Tension

The axial force in the bar AB is 1306.562965 N
The axial force in the bar OB is 1000.000000 N


# Example 2.17 Equilibrium of a body¶

In :
from __future__ import division
import math
#Initilization of variables
W=500 #N #weight of cylinder
alpha=25 #degree #angle made by OA with horizontal
beta=65 #degree #angle made by OB with horizontal
theta=90 #degree # theta=(alpha+beta)
#Calculations
Ra=(W*math.sin(beta*math.pi/180))/math.sin(theta*math.pi/180) #N #from equilibrium eq'n
Rb=(W*math.sin(alpha*math.pi/180))/math.sin(theta*math.pi/180) #N #from equilibrium eqn's
#Results
print('The reaction at A is %f N'%Ra)
print('The reaction at B is %f N'%Rb)

The reaction at A is 453.153894 N
The reaction at B is 211.309131 N


# Example 2.18 Equilibrium of a body¶

In :
from __future__ import division
import math
#Initilization of variables
Wa=1000 #N #weight of sphere A
Wb=400 #N #weight of sphere B
Ra=0.09 #m #radius of sphere A
Rb=0.05 #m #radius of sphere B
theta=33.86 #degree #angle made by Rq with Wb
alpha=60 #degree #angle made by Rl with horizontal
#Calculations
Rq=Wb/math.cos(theta*math.pi/180) #N #using sum Fy=0 for sphere B
Rp=Rq*math.sin(theta*math.pi/180) #N #using sum Fx=0 for sphere B
Rl=(Rq*math.sin(theta*math.pi/180))/math.sin(alpha*math.pi/180) #N #using sum Fx=0 for sphere A
Rn=((Wa)+(Rq*math.cos(theta*math.pi/180))-(Rl*math.cos(alpha*math.pi/180))) #N
#Results
print('The reaction at point P is %f N'%Rp)
print('The reaction at point L is %f N'%Rl)
print('The reaction at point N is %f N'%Rn)

The reaction at point P is 268.383687 N
The reaction at point L is 309.902788 N
The reaction at point N is 1245.048606 N


# Example 2.19 Equilibrium of a body¶

In :
from __future__ import division
import math
#Initilization of variables
P=50 #N
Q=100 #N
alpha=30 #degree #angle made by Rq with +ve Y-axis
#Calculations
theta=math.degrees(math.atan((P*1/math.tan(alpha*math.pi/180)-Q*math.tan(alpha*math.pi/180))/(P+Q))) #degree
T=Q/(math.cos(theta*math.pi/180)*1/math.tan(alpha*math.pi/180)-math.sin(theta*math.pi/180)) #N
#Results
print('The tension in the string is %f N'%T)
print('The angle wich the string makes with the horizontal when the system is in equilibrium is %f N'%theta)

The tension in the string is 66.143783 N
The angle wich the string makes with the horizontal when the system is in equilibrium is 10.893395 N


# Example 2.20 Equilibrium of a body¶

In :
from __future__ import division
import math
#Initilization of variables
theta1=50.5 #degree #is the angle made between BC & and BE
theta2=36.87 #degree #is te angle ade between BA &BE
g=9.81 #m/s**2
Wa=15*g #N
Wb=40*g #N
Wc=20*g #N
#Calculations
R2=Wc/(math.sin(theta1*math.pi/180)) #N #from F.B.D of cylinder C(sum Fy=0)
R4=(Wb+R2*math.sin(theta1*math.pi/180))/math.sin(theta2*math.pi/180) #N #from F.B.D of cylinder B(sum Fy=0)
R6=R4*math.cos(theta2*math.pi/180) #N #from F.B.D of cylinder A(sum Fx=0)
#Results
print('The reaction between the cylinder A and the wall of the channel is %f N'%R6)

The reaction between the cylinder A and the wall of the channel is 784.797079 N


# Example 2.21 Equilibrium of a body¶

In :
from __future__ import division
import math
#Initilazation of variables
F=1000 #N
theta=30 #degree #angle made by the force with the beam AB
Lab=3 #m
Lae=2 #m
Lce=1 #m
#Calculations
Re=(F*Lab*math.sin(theta*math.pi/180))/Lae #N #Taking moment at A
Rd=(Re*Lce)/(Lab*math.sin(theta*math.pi/180)) #N #Taking moment about C
#Results
print('The reaction at D due to force of 1000 N acting at B is %f N'%Rd)

The reaction at D due to force of 1000 N acting at B is 500.000000 N


# Example 2.23 Equilibrium of a body¶

In :
from __future__ import division
import math
#Initilization of variables
W=1000 #N
r=0.30 #m #radius of the wheel
h=0.15 #m #height of the obstacle
#Calculations
theta=math.degrees(math.asin(1)) #degree #P is mini when sin(theta)=1 from eq'n of P
Pmini=(W*math.sqrt((2*r*h)-(h**2)))/(r*math.sin(theta*math.pi/180)) #N
#Results
print('The least force required to just turn the wheel over the block is %f N'%Pmini)
print('The angle wich should be made by Pmini with AC is %f degree'%theta)

The least force required to just turn the wheel over the block is 866.025404 N
The angle wich should be made by Pmini with AC is 90.000000 degree