# Chapter 2 : Force Vectors¶

## Ex 2.1 Page No. 20¶

In [8]:
#Example 2.1
import math
from __future__ import division

# The parallelogram law of addition is shown in Fig.2-10b

# F_R is determined using law of cosines

#Calculation
F_R = math.sqrt((100**(2))+(150**(2))-2*100*150*math.cos(115*math.pi/180)) #[Newton]

#Result
print"Resultant Force F_R = ",int(round(F_R)),"N"

# Angle theta is determined by law of sines

#Calculation

#Result
print "theta = ",(round(math.degrees(theta),1)),"degrees"

#The direction of phi as masured from horizontal is given by
phi = 39.8 + 15.0  #[Degrees]
print"phi = ",phi,"degrees"

Resultant Force F_R =  213 N
theta =  39.8 degrees
phi =  54.8 degrees


## Ex 2.2 Page No. 21¶

In [1]:
# Example 2.2
import math
from __future__ import division

# Variable Declaration
F = 2000  #[newton]
# In each case parallelogram law is used to resolve F into its two components

# Part(a)
# The vector addition F = F_x + F_y is shown in fig2-11b
# Calculation
F_x = F*math.cos(40*math.pi/180) #[Newton]
F_y = F*math.sin(40*math.pi/180) #[Newton]

# Result
print"F_x = ",int((F_x)),"N"
print"F_y = ",int((F_y)),"N"

# Part(b)
# The vector addition F = F_x_dash + F_y is shown in fig2-11b
# Calculation
F_x_dash = F*math.sin(50*math.pi/180)/math.sin(60*math.pi/180) #[Newton]
F_y = F*math.sin(70*math.pi/180)/math.sin(60*math.pi/180) #[Newton]

# Result
print"F_x_dash = ",int((F_x_dash)),"N"
print"F_y = ",int((F_y)),"N"

F_x =  1532 N
F_y =  1285 N
F_x_dash =  1769 N
F_y =  2170 N


## Ex 2.3 Page No. 22¶

In [4]:
# Example 2.3
import math
from __future__ import division

# The angle phi can be determined using law of cosines

# Calculation
phi = math.degrees(phi) #[Degrees]
theta = 180-60-phi  #[Degrees]

# Result
print"theta = ",round(theta,1),"degrees"

theta =  76.1 degrees


## Ex 2.4 Page No. 23¶

In [95]:
# Example 2.4
import math
from __future__ import division

# Part(a) Refer fig 2-13b
# Using parallelogram law

# Calculation
F1 = 1000*math.sin(30*math.pi/180)/math.sin(130*math.pi/180)  #[Newton]
F2 = 1000*math.sin(20*math.pi/180)/math.sin(130*math.pi/180)  #[Newton]

# Result
print"Part(a)"
print"F1 = ",int(round(F1,0)),"N"
print"F2 = ",int(round(F2,0)),"N\n"

# Part(b) Refer fig 2-13d

# Calculation
F1 = 1000*math.sin(70*math.pi/180)  #[Newton]
F2 = 1000*math.cos(70*math.pi/180)  #[Newton]

# Result
print"Part(b)"
print"F1 = ",int(round(F1,0)),"N"
print"F2 = ",int(round(F2,0)),"N"

Part(a)
F1 =  653 N
F2 =  446 N

Part(b)
F1 =  940 N
F2 =  342 N


## Ex 2.5 Page No. 31¶

In [98]:
# Example 2.5
import math
from __future__ import division

# F1_x acts in -x direction and F1_y acts in +y direction Refer fig 2-17b

# Calculation
F1_x =  -200*math.sin(30*math.pi/180)  #[Newton]
F1_y =  200*math.cos(30*math.pi/180)  #[Newton]

# Result
print"F1_x = ",int(round(F1_x,0)),"N"
print"F1_y = ",int(round(F1_y,0)),"N"

# F2 is resolved into its x and y components Refer fig 2-17c

# Calculation
F2_x = 260*(12/13)  #[Newton]
F2_y = 260*(5/13)  #[Newton]

# Result
print"F2_x = ",int(round(F2_x,0)),"N"
print"F2_y = ",int(round(F2_y,0)),"N"

F1_x =  -100 N
F1_y =  173 N
F2_x =  240 N
F2_y =  100 N


## Ex 2.6 Page No. 32¶

In [5]:
# Example 2.6
import math
from __future__ import division

# Variable Declaration
F1 = 600  #[Newton]
F2 = 400  #[Newton]

# We resolve each force into x and y components Refer fig 2-18b
# Let FR be resultant force
# Let FR_x be resultant force along x direction
# Let FR_y be resultant force along y direction

# Calculation
FR_x = F1*math.cos(30*math.pi/180) - F2*math.sin(45*math.pi/180)  #[Newton]
FR_y = F1*math.sin(30*math.pi/180) + F2*math.cos(45*math.pi/180)  #[Newton]
FR = math.sqrt(round(FR_x,1)**(2)+round(FR_y,1)**(2))  #[Newton]
theta = math.degrees(theta) #[Degrees]

# Result
print"FR_x = ",round(FR_x,1),"N"
print"FR_y = ",round(FR_y,1),"N"
print"FR = ",int(round(FR,0)),"N"
print"Theta = ",round(theta,1),"degrees"

FR_x =  236.8 N
FR_y =  582.8 N
FR =  629 N
Theta =  67.9 degrees


## Ex 2.7 Page No. 33¶

In [6]:
# Example 2.7
import math
from __future__ import division

# Variable Declaration
F1 = 400  #[Newton]
F2 = 250  #[Newton]
F3 = 200  #[Newton]

# We resolve each force into x and y components Refer fig 2-18b
# Let F_R be resultant force
# Let F_R_x be resultant force along x direction
# Let F_R_y be resultant force along y direction

# Calculation
F_R_x = -F1 + F2*math.sin(45*math.pi/180) - F3*(4/5)  #[Newton]
F_R_y = F2*math.cos(45*math.pi/180) + F3*(3/5)  #[Newton]
F_R = math.sqrt(round(F_R_x,1)**(2)+round(F_R_y,1)**(2))  #[Newton]
theta = math.degrees(theta) #[Degrees]

# Result
print"F_R_x = ",round(F_R_x,1),"N"
print"F_R_y = ",round(F_R_y,1),"N"
print"F_R = ",int(round(F_R,0)),"N"
print"Theta = ",round(theta,1),"degrees"

F_R_x =  -383.2 N
F_R_y =  296.8 N
F_R =  485 N
Theta =  37.8 degrees


## Ex 2.8 Page No. 41¶

In [3]:
# Example 2.8
import math
from __future__ import division

# Variable declaration
beta = 60  #[Degrees]
gamma = 45  #[Degrees]
f = 100 #[Newton]

# Calculation
alpha1 = math.degrees(math.acos(+cos_alpha))   #[Degrees]
alpha2 = math.degrees(math.acos(-cos_alpha))   #[Degrees]
Fx = f*math.cos(alpha1*math.pi/180)  #[Newton]
Fy = f*math.cos(beta*math.pi/180)  #[Newton]
Fz = f*math.cos(gamma*math.pi/180)  #[Newton]
F = math.sqrt(round(Fx**(2),1)+round(Fy**(2),1)+round(Fz**(2),1))  #[Newton]

# Result
print"cos_alpha = +/-",(cos_alpha)
print"F = ",int(F),"N"

cos_alpha = +/- 0.5
F =  100 N


## Ex 2.9 Page No. 42¶

In [13]:
# Example 2.9
import math
from __future__ import division

# Variable declaration

F1_x = 0   #[Newton]
F1_y = 60  #[Newton]
F1_z = 80  #[Newton]
F2_x = 50  #[Newton]
F2_y = -100  #[Newton]
F2_z = 100  #[Newton]

# Calculation
FR_x = F1_x + F2_x  #[Newton]
FR_y = F1_y + F2_y  #[Newton]
FR_z = F1_z + F2_z  #[Newton]

# Let F_R be resultant force
FR = round(math.sqrt(FR_x**(2)+FR_y**(2)+FR_z**(2)),1)

# The coordinate direction angles alpha,beta and gamma are determined from components of unit vector along direction of F_R
cos_alpha = FR_x/FR
cos_beta = FR_y/FR
cos_gamma = FR_z/FR
alpha = round(math.degrees(math.acos(cos_alpha)),1)  #[Degrees]
beta = round(math.degrees(math.acos(cos_beta)),1)  #[Degrees]
gamma = round(math.degrees(math.acos(cos_gamma)),1)  #[Degrees]

# Result
print"Resultant Force FR = ",(FR),"N"
print"alpha = ",(alpha),"degrees"
print"beta = ",(beta),"degrees"
print"gamma = ",(gamma),"degrees"

Resultant Force FR =  191.0 N
alpha =  74.8 degrees
beta =  102.1 degrees
gamma =  19.5 degrees


## Ex 2.10 Page No. 43¶

In [25]:
# Example 2.10
import math
from __future__ import division

# For F1

# Calculation
F1_z = int(round(1000*math.sin(60*math.pi/180),0))  #[Newton]
F1_dash = int(round(1000*math.cos(60*math.pi/180),0))  #[Newton]
F1_x = int(round(F1_dash*math.cos(45*math.pi/180),0))  #[Newton]
F1_y = int(round(F1_dash*math.sin(45*math.pi/180),0))  #[Newton]

# F1_y has direction defined by -j
F1 = int(round(math.sqrt(F1_x**(2)+(-F1_y)**(2)+F1_z**(2)),0))  #[Newton]

# u1 is unit vector along F1
u1_x = round(F1_x/F1,3)
u1_y = round(F1_y/F1,3)
u1_z = round(F1_z/F1,3)
alpha1 = round(math.degrees(math.acos(u1_x)),1)  #[Degrees]
betaa1 = round(math.degrees(math.acos(u1_y)),1)  #[Degrees]
gamma1 = round(math.degrees(math.acos(u1_z)),1)  #[Degrees]

# Result
print"F1_x = ",F1_x,"N"
print"F1_y = ",F1_y,"N"
print"F1_z = ",F1_z,"N"
print"F1 = ",F1,"N\n"

# For F2

# Calculation
F2_z = int(round(3000*math.sin(45*math.pi/180),0))  #[Newton]
F2_dash = int(round(3000*math.cos(45*math.pi/180),0))  #[Newton]
F2_x = int(round(F2_dash*math.sin(30*math.pi/180),0))  #[Newton]
F2_y = int(round(F2_dash*math.cos(30*math.pi/180),0))  #[Newton]

# F2_z has direction defined by -k
F2 = int(round(math.sqrt(F2_x**(2)+F2_y**(2)+(-F2_z)**(2)),-1))  #[Newton]

# u1 is unit vector along F1

u2_x = round(F2_x/F2,3)
u2_y = round(F2_y/F2,3)
u2_z = round(F2_z/F2,3)
alpha2 = round(math.degrees(math.acos(u2_x)),1)  #[Degrees]
betaa2 = round(math.degrees(math.acos(u2_y)),1)  #[Degrees]
gamma2 = round(math.degrees(math.acos(u2_z)),1)  #[Degrees]

# Result
print"F2_x = ",F2_x/1000,"kN"
print"F2_y = ",F2_y/1000,"kN"
print"F2_z = ",F2_z/1000,"kN"
print"F2 = ",F2,"N"

F1_x =  354 N
F1_y =  354 N
F1_z =  866 N
F1 =  1000 N

F2_x =  1.06 kN
F2_y =  1.837 kN
F2_z =  2.121 kN
F2 =  3000 N


## Ex 2.11 Page No. 44¶

In [35]:
# Example 2.11
import math
from __future__ import division

# Variable declaration

F1 = 300   #[Newton]
F2 = 700   #[Newton]
FR = 800   #[Newton]
alpha1 = 45  #[Degrees]
beta1 = 60  #[Degrees]
gamma1 = 120  #[Degrees]

# Calculation
F1_x = round(F1*math.cos(alpha1*math.pi/180),1)  #[Newton]
F1_y = round(F1*math.cos(beta1*math.pi/180),1)  #[Newton]
F1_z = round(F1*math.cos(gamma1*math.pi/180),1)  #[Newton]

# FR acts along +y axis
FR_x = 0  #[Newton]
FR_y = 800  #[Newton]
FR_z = 0  #[Newton]

# FR = F1 + F2
# F2 = FR - F1
F2_x = FR_x - F1_x  #[Newton]
F2_y = FR_y - F1_y  #[Newton]
F2_z = FR_z - F1_z  #[Newton]
alpha2 = round(math.degrees(math.acos(F2_x/F2)),1)  #[Degrees]
beta2 = round(math.degrees(math.acos(F2_y/F2)),1)  #[Degrees]
gamma2 = round(math.degrees(math.acos(F2_z/F2)),1)  #[Degrees]

# Result
print"alpha2 = ",(alpha2),"degrees"
print"beta2 = ",(beta2),"degrees"
print"gamma2 = ",(gamma2),"degrees"

alpha2 =  107.6 degrees
beta2 =  21.8 degrees
gamma2 =  77.6 degrees


## Ex 2.12 Page No. 49¶

In [40]:
# Example 2.12
import math
from __future__ import division

# Variable Declaration
A_x = 1  #[meters]
A_y = 0  #[meters]
A_z = -3  #[meters]
B_x = -2  #[meters]
B_y = 2  #[meters]
B_z = 3  #[meters]

# Calculation
# r = B - A
r_x =  B_x - A_x  #[meters]
r_y = B_y - A_y  #[meters]
r_z = B_z - A_z  #[meters]
r = math.sqrt(r_x**(2)+r_y**(2)+r_z**(2))

# Assume u to be a unit vector along r
u_x  = r_x/r
u_y  = r_y/r
u_z  = r_z/r
alpha = round(math.degrees(math.acos(u_x)),1)  #[Degrees]
beta = round(math.degrees(math.acos(u_y)),1)  #[Degrees]
gamma = round(math.degrees(math.acos(u_z)),1)  #[Degrees]

# Result
print"alpha = ",(alpha),"degrees"
print"beta = ",(beta),"degrees"
print"gamma = ",(gamma),"degrees"

alpha =  115.4 degrees
beta =  73.4 degrees
gamma =  31.0 degrees


## Ex 2.13 Page No. 51¶

In [8]:
# Example 2.13
import math
from __future__ import division

# Variable Declaration
A_x = 0  #[meters]
A_y = 0  #[meters]
A_z = 8  #[meters]
B_x = 3  #[meters]
B_y = -2  #[meters]
B_z = 2  #[meters]

# Calculation
# r = B - A
r_x =  B_x - A_x  #[meters]
r_y = B_y - A_y  #[meters]
r_z = B_z - A_z  #[meters]
r = math.sqrt(r_x**(2)+r_y**(2)+r_z**(2))

# Assume u to be a unit vector along r
u_x  = r_x/r
u_y  = r_y/r
u_z  = r_z/r

# Since F = 70 N and direction is specified by u
F_x = 70 * u_x  #[Newton]
F_y = 70 * u_y  #[Newton]
F_z = 70 * u_z  #[Newton]
alpha = round(math.degrees(math.acos(u_x)),1)  #[Degrees]
beta = round(math.degrees(math.acos(u_y)),1)  #[Degrees]
gamma = round(math.degrees(math.acos(u_z)),1)  #[Degrees]

# Result
print"F_x = ",(F_x),"N"
print"F_y = ",(F_y),"N"
print"F_z = ",(F_z),"N"
print"alpha = ",(alpha),"degrees"
print"beta = ",(beta),"degrees"
print"gamma = ",(gamma),"degrees"

F_x =  30.0 N
F_y =  -20.0 N
F_z =  -60.0 N
alpha =  64.6 degrees
beta =  106.6 degrees
gamma =  149.0 degrees


## Ex 2.14 Page No. 52¶

In [8]:
# Example 2.14
import math
from __future__ import division

# Variable Declaration
A_x = 0  #[meters]
A_y = 0  #[meters]
A_z = 2  #[meters]
B_x = 1.707  #[meters]
B_y = 0.707  #[meters]
B_z = 0  #[meters]

# Calculation
# r = B - A
r_x =  B_x - A_x  #[meters]
r_y = B_y - A_y  #[meters]
r_z = B_z - A_z  #[meters]
r = math.sqrt(r_x**(2)+r_y**(2)+r_z**(2))

# Assume u to be a unit vector along r
u_x  = r_x/r
u_y  = r_y/r
u_z  = r_z/r

# Since F = 500 N and direction is specified by u
F_x = round(500 * u_x,1)  #[Newton]
F_y = round(500 * u_y,1)  #[Newton]
F_z = round(500 * u_z,1)  #[Newton]
F = round(math.sqrt(F_x**(2)+F_y**(2)+F_z**(2)),1)  #[Newton]

# Result
print"F_x = ",(F_x),"N"
print"F_y = ",(F_y),"N"
print"F_z = ",(F_z),"N"
print"F = ",(F),"N"

F_x =  313.5 N
F_y =  129.8 N
F_z =  -367.3 N
F =  500.0 N


## Ex 2.15 Page No. 53¶

In [27]:
# Example 2.15
import math
from __future__ import division

# Variable Declaration
FAB = 100 #[Newton]
FAC = 120 #[Newton]
A_x = 0  #[meters]
A_y = 0  #[meters]
A_z = 4  #[meters]
B_x = 4  #[meters]
B_y = 0  #[meters]
B_z = 0  #[meters]
C_x = 4  #[meters]
C_y = 2  #[meters]
C_z = 0  #[meters]

# Calculation(FAB)
rAB_x = B_x - A_x  #[meters]
rAB_y = B_y - A_y  #[meters]
rAB_z = B_z - A_z  #[meters]
rAB = round(math.sqrt(rAB_x**(2)+rAB_y**(2)+rAB_z**(2)),2)
FAB_x = round(FAB*(rAB_x/rAB),1) #[Newton]
FAB_y = round(FAB*(rAB_y/rAB),1) #[Newton]
FAB_z = round(FAB*(rAB_z/rAB),1) #[Newton]

# Calculation(FAC)
rAC_x = C_x - A_x  #[meters]
rAC_y = C_y - A_y  #[meters]
rAC_z = C_z - A_z  #[meters]
rAC = round(math.sqrt(rAC_x**(2)+rAC_y**(2)+rAC_z**(2)),2)
FAC_x = round(FAC*(rAC_x/rAC),1) #[Newton]
FAC_y = round(FAC*(rAC_y/rAC),1) #[Newton]
FAC_z = round(FAC*(rAC_z/rAC),1) #[Newton]

# FR = FAB + FAC
FR_x = FAB_x + FAC_x   #[Newton]
FR_y = FAB_y + FAC_y   #[Newton]
FR_z = FAB_z + FAC_z   #[Newton]
FR = round(math.sqrt(FR_x**(2)+FR_y**(2)+FR_z**(2)),0)
print"FR = ",(FR),"N"

FR =  217.0 N


## Ex 2.16 Page No. 61¶

In [31]:
# Example 2.16
import math
from __future__ import division

# Variable Declaration
rB_x = 2  #[meters]
rB_y = 6  #[meters]
rB_z = 3  #[meters]
F_x = 0   #[Newton]
F_y = 300    #[Newton]
F_z = 0   #[Newton]

# Calculation
F = math.sqrt(F_x**(2)+F_y**(2)+F_z**(2))   #[Newton]
# Let uB be unit vector defining direction of AB
rB = math.sqrt(rB_x**(2)+rB_y**(2)+rB_z**(2))  #[meters]
uB_x = rB_x/rB
uB_y = rB_y/rB
uB_z = rB_z/rB

# The magnitude of component of F along AB is equal to dot product of F and unit vector uB
FAB = round(F_x*uB_x + F_y*uB_y + F_z*uB_z,1)   #[Newton]

# Expressing FAB in Cartesian form
FAB_x = round(FAB*uB_x,1)   #[Newton]
FAB_y = round(FAB*uB_y,1)   #[Newton]
FAB_z = round(FAB*uB_z,1)   #[Newton]
FAB = round(math.sqrt(FAB_x**(2)+FAB_y**(2)+FAB_z**(2)),1)   #[Newton]

# Let Fp be perpendicular component
Fp_x = F_x - FAB_x   #[Newton]
Fp_y = F_y - FAB_y   #[Newton]
Fp_z = F_z - FAB_z   #[Newton]
Fp = round(math.sqrt(F**(2)-FAB**(2)),0)   #[Newton]

# Result
print"FAB = ",(FAB),"N"
print"FAB_x = ",(FAB_x),"N"
print"FAB_y = ",(FAB_y),"N"
print"FAB_z = ",(FAB_z),"N"
print"Fp = ",(Fp),"N"

FAB =  257.1 N
FAB_x =  73.5 N
FAB_y =  220.4 N
FAB_z =  110.2 N
Fp =  155.0 N


## Ex 2.17 Page No. 62¶

In [7]:
# Example 2.17
import math
from __future__ import division

# Variable Declaration
F = 80  #[Newton]
A_x = 0
A_y = 1
A_z = 0
B_x = 2
B_y = 3
B_z = -1
C_x  = 2
C_y  = 0
C_z = 0

# Calculation
rBA_x = A_x - B_x
rBA_y = A_y - B_y
rBA_z = A_z - B_z
rBC_x = C_x - B_x
rBC_y = C_y - B_y
rBC_z = C_z - B_z
rBA = round(math.sqrt(rBA_x**(2)+rBA_y**(2)+rBA_z**(2)),2)
rBC = round(math.sqrt(rBC_x**(2)+rBC_y**(2)+rBC_z**(2)),2)
theta = round(math.degrees(math.acos((rBA_x*rBC_x+rBA_y*rBC_y+rBA_z*rBC_z)/(rBA*rBC))),1)

# let uBA be unit vector along BA
uBA_x = rBA_x/rBA
uBA_y = rBA_y/rBA
uBA_z = rBA_z/rBA
F_x = round(F*(rBC_x/rBC),2) #[Newton]
F_y = round(F*(rBC_y/rBC),2)  #[Newton]
F_z = round(F*(rBC_z/rBC),2)  #[Newton]

# FBA = F.uBA
FBA = round(F_x*uBA_x + F_y*uBA_y + F_z*uBA_z,1) #[Newton]

# Since theta was calculated FBA can be calculated by FBA = F*cos(theta)
# Let Fp be perpendicular component
Fp = round(F*math.sin(theta*math.pi/180),1)  #[Newton]

# Result
print"theta = ",(theta),"degrees"
print"FBA = ",(FBA),"N"
print"Fp = ",(Fp),"N"

theta =  42.4 degrees
FBA =  59.1 N
Fp =  53.9 N

In [ ]: