import math
#Declaration Of Variables
#Horizontal Forces
F1=200 #N
F2=100 #N
F3=300 #N
#Calculations
#Analytical Method
#When all forces are acting in same Direction,resultant is
R=F1+F2+F3 #N
#When Force 100 N is acting in opposite direction
R2=F1-F2+F3 #N
#Graphical Method
#Let P1,P2,P3 be the forces
#Suppose 100 N=1 cm
P1=F1*F2**-1 #cm
P2=F2*F2**-1 #cm
P3=F3*F2**-1 #cm
#When All Forces act in same direction
ab=2 #cm to represent F1
bc=1 #cm to represent F2
cd=3 #cm to represent F3
#by Measurement
ad=6 #cm
R3=6*F2 #N
#When F2 acts in opposite direction
#draw bc in opposite Direction
#By Measurement,Length
ad=4 #cm
R4=4*F2 #N
#Result
print"Resultant of forces analytically:When all forces are acting in same Direction",round(R,2),"N"
print" :When Force 100 N is acting in opposite direction",round(R2,2),"N"
print"Resultant of forces Graphically:When All Forces act in same direction",round(R3,2),"N"
print" :When Force 100 N is acting in opposite direction",round(R4,2),"N"
import math
from math import sin, cos, tan, radians, pi
import numpy as np
#Declaration Of Variables
#Forces
P=240 #N
Q=200 #N
alpha=60 #Degrees #Angle Between forces
#Calculations
#Magnitude of Resultant Force is
R=(P**2+Q**2+2*P*Q*cos(alpha*pi*180**-1))**0.5 #N
#Using sine formula
#P*(sin(beta))**-1=Q*(sin(rho))**-1=R*(sin(180-alpha))**-1
X=(P*sin((180-alpha)*180**-1*pi)*R**-1)
beta=np.arcsin(X)*(180*pi**-1) #degrees
Y=(Q*sin((180-alpha)*180**-1*pi)*R**-1)
rho=np.arcsin(Y)*(180*pi**-1) #degrees
#Result
print"Magnitude of Resultant is",round(R,2),"N"
print"angle beta is",round(beta,2),"Degrees"
print"Angle rho is",round(rho,3),"Degrees"
import math
from math import sin, cos, tan, radians, pi
#Declaration Of Variables
R=400 #N #resultant
beta=35 #Degrees
rho=25 #Derees
#Calculations
#Angle Between two forces
alpha=beta+rho #Degrees
#Using sine formula
#P*(sin(beta))**-1=Q*(sin(rho))**-1=R*(sin(180-alpha))**-1
#After further simplifying we get
P=R*sin(beta*180**-1*pi)*(sin((180-alpha)*180**-1*pi))**-1 #N
Q=R*sin(rho*180**-1*pi)*(sin((180-alpha)*180**-1*pi))**-1 #N
#Result
print"Two forces Are:P",round(P,2),"P"
print" :Q",round(Q,3),"Q"
import math
from math import sin, cos, tan, radians, pi
import numpy as np
#Declaration Of Variables
#Forces
P=240 #N
Q=200 #N
R=400 #N
#Calculations
#Using Equation of Resultant,we get
#R=(P**2+Q**2+2*P*Q*cos(alpha))**0.5
#After Further simplifying we get
#Let cos(alpha)=X
X=(R**2-P**2-Q**2)*(2*P*Q)**-1
alpha=np.arccos(X)*(180*pi**-1) #Degrees
#Using sine formula
#P*(sin(beta))**-1=Q*(sin(rho))**-1=R*(sin(180-alpha))**-1
#After further simplifying we get
X=(P*sin((180-alpha)*180**-1*pi)*R**-1)
beta=np.arcsin(X)*(180*pi**-1) #degrees
Y=(Q*sin((180-alpha)*180**-1*pi)*R**-1)
rho=np.arcsin(Y)*(180*pi**-1) #degrees
#Result
print"Values of:alpha",round(alpha,2),"Degrees"
print" :beta",round(beta,2),"Degrees"
print" :rho",round(rho,2),"Degrees"
import math
from math import sin, cos, tan, radians, pi
#Declaration Of Variables
F=100 #N
theta=30 #Degrees #Angle made by Force with axis
#Calculations
#Force acting in X-direction
F_x=F*cos(theta*180**-1*pi) #N
#Force acting in Y-direction
F_y=F*sin(theta*180**-1*pi) #N
#Result
print"Components of Force along X directions",round(F_x,2),"N"
print"Components Of force along Y direction",round(F_y,2),"N"
import math
from math import sin, cos, tan, radians, pi
#Declaration Of Variables
W=100 #N #Weight
theta=30 #Degrees
#Calculations
#Component of weight perpendicular to plane
W1=W*cos(theta*180**-1*pi) #N
#Component of weight parallel to plane
W2=W*sin(theta*180**-1*pi) #N
#Result
print"Component of weight:perpendicular to plane",round(W1,2),"N"
print" :parallel to plane",round(W2,2),"N"
#Answer for Component of weight:perpendicular to plane is incorrect
import math
from math import sin, cos, tan, radians, pi
import numpy as np
#Declaration Of Variables
#Lengths
L_BA=50 #cm
L_AO=25 #cm
theta=45 #Degrees #angle made by crank bith L_BO
F1=2500 #N Force ererted on connecting rod
#Calculations
#Let alpha be the angle made by connecting rod with hte perpendicular drawn to L_BO
L_AC=L_AO*sin(theta*pi*180**-1)
alpha=np.arcsin(L_AC*L_BA**-1)*(180*pi**-1) #degrees
#Horizontal force of connecting rod
H_A=F1*cos(round(alpha,2)*pi*180**-1)
#Vertical force of connecting rod
V_A=F1*sin(round(alpha,2)*pi*180**-1)
#Part-2
#LEt angle OAD be beta
beta=theta+alpha #Degrees
#Component of force AD along AO
F_AO1=F1*cos(round(beta,2)*pi*180**-1) #degrees
#Component of force AD along AE
F_AO2=F1*sin(round(beta,2)*pi*180**-1) #degrees
#Result
print"Resolving Forces of connecting rod:H_A",round(H_A,2),"KN"
print" :V_A",round(V_A,2),"KN"
print"Resolving forces of crank:F_AO2",round(F_AO2,2),"KN"
print" :F_AO1",round(F_AO1,2),"KN"
import math
from math import sin, cos, tan, radians, pi
import numpy as np
#Declaration Of Variables
#Forces
F1=104 #N
F2=156 #N
F3=252 #N
F4=228 #N
#Angles
alpha1=10 #Degrees
alpha2=24 #Degrees
alpha3=3 #Degrees
alpha4=9 #Degrees
#Calculations
#Resolving force F1
F1_V=F1*sin(alpha1*pi*180**-1) #N
F1_H=F1*cos(alpha1*pi*180**-1) #N
#Resolving Force F2
F2_V=F2*cos(alpha2*pi*180**-1) #N
F2_H=-F2*sin(alpha2*pi*180**-1) #N
#Resolving Force F3
F3_H=-F3*cos(alpha3*pi*180**-1) #N
F3_V=F3*sin(alpha3*pi*180**-1) #N
#Resolving Force F4
F4_H=-F4*sin(alpha4*pi*180**-1) #N
F4_V=F4*cos(alpha4*pi*180**-1) #N
#Sum of Horizontal Forces
H=F1_H+F2_H+F3_H+F4_H #N
#Sum of vertical Forces
V=F1_V+F2_V-F3_V-F4_V #N
#Resultant
R=(H**2+V**2)**0.5
#Direction
theta=np.arctan(V*H**-1)*(180*pi**-1)
#Result
print"Magnitude of Resultant",round(R,2),"N"
print"Direction of Resultant",round(theta,2),"Degrees"
import math
from math import sin, cos, tan, radians, pi
import numpy as np
#Declaration Of Variables
#Forces
F1=10 #KN
F3=20 #KN
F4=40 #KN
#Inclination
theta1=30 #Degree
theta3=90 #degree
theta3=120 #degree
R=72 #KN #Resultant
#Calculations
#Sum of horizontal Forces
#F2*cos(theta2)=11.34...................1
#Sum of vertical Forces
#F2*sin(theta2)=12.36.....................2
#Dividing equation 2 by 1 and further simplifying we get
theta2=np.arctan(1.0899)*(180*pi**-1)
#Force
F2=12.36*(sin(theta2*180**-1*pi))**-1 #KN
#Result
print"Magnitude of Force is",round(F2,2),"KN"
print"Direction of force is",round(theta2,2),"Degrees"
import math
from math import sin, cos, tan, radians, pi
import numpy as np
#Declaration Of Variables
#Lengths
L_OC=4 #m
L_BC=3 #m
#Forces
F_O=20 #N
F_C=35 #N
F_B=25 #N
F_A=50 #N
#Calculations
#Resultant Forces
R1=(F_A**2+F_O**2)**0.5 #N
R2=(F_B**2+F_C**2)**0.5 #N
#Angle
theta1=np.arctan(F_O*F_A**-1)*(180*pi**-1) #Degrees
theta2=np.arctan(F_B*F_C**-1)*(180*pi**-1) #Degrees
#Angle between these two Forces
theta3=theta1+theta2 #Degrees
#Resultant of Forces R1 & R2
P=(R1**2+R2**2+2*R1*R2*cos(theta3*pi*180**-1))**0.5 #N
#Angle made by Resultant P with R1
S1=(R2*sin(theta3*pi*180**-1))
S2=R1+R2*cos(theta3*pi*180**-1)
alpha=np.arctan(S1*S2**-1)*(180*pi**-1)
#Angle made by resultant P with vertical in anticlock wise direction
theta4=alpha-theta1 #Degrees
#Result
print"Magnitude of Force",round(P,2),"N"
print"Direction of force",round(theta4,2),"N"