diff options
Diffstat (limited to 'Engineering_Mechanics_Statics_and_Dynamics_by_Hibbeler_and_Gupta/Chapter_2.ipynb')
-rw-r--r-- | Engineering_Mechanics_Statics_and_Dynamics_by_Hibbeler_and_Gupta/Chapter_2.ipynb | 1058 |
1 files changed, 1058 insertions, 0 deletions
diff --git a/Engineering_Mechanics_Statics_and_Dynamics_by_Hibbeler_and_Gupta/Chapter_2.ipynb b/Engineering_Mechanics_Statics_and_Dynamics_by_Hibbeler_and_Gupta/Chapter_2.ipynb new file mode 100644 index 00000000..8b8efd6a --- /dev/null +++ b/Engineering_Mechanics_Statics_and_Dynamics_by_Hibbeler_and_Gupta/Chapter_2.ipynb @@ -0,0 +1,1058 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2 : Force Vectors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.1 Page No. 20" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resultant Force F_R = 213 N\n", + "theta = 39.8 degrees\n", + "phi = 54.8 degrees\n" + ] + } + ], + "source": [ + "#Example 2.1\n", + "import math\n", + "\n", + "# The parallelogram law of addition is shown in Fig.2-10b\n", + "\n", + "# F_R is determined using law of cosines\n", + "\n", + "#Calculation\n", + "F_R = math.sqrt((100**(2))+(150**(2))-2*100*150*math.cos(115*math.pi/180)) #[Newton]\n", + "\n", + "#Result\n", + "print\"Resultant Force F_R = \",int(round(F_R)),\"N\"\n", + "\n", + "# Angle theta is determined by law of sines\n", + "\n", + "#Calculation\n", + "theta = math.asin(150*0.9063/212.6) #[Radians]\n", + "\n", + "#Result\n", + "print \"theta = \",(round(math.degrees(theta),1)),\"degrees\"\n", + "\n", + "#The direction of phi as masured from horizontal is given by\n", + "phi = 39.8 + 15.0 #[Degrees]\n", + "print\"phi = \",phi,\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.2 Page No. 21" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F_x = 1532 N\n", + "F_y = 1285 N\n", + "F_x_dash = 1769 N\n", + "F_y = 2170 N\n" + ] + } + ], + "source": [ + "# Example 2.2\n", + "import math\n", + "\n", + "# Variable Declaration\n", + "F = 2000 #[newton]\n", + "# In each case parallelogram law is used to resolve F into its two components\n", + "\n", + "# Part(a)\n", + "# The vector addition F = F_x + F_y is shown in fig2-11b\n", + "# Calculation\n", + "F_x = F*math.cos(40*math.pi/180) #[Newton]\n", + "F_y = F*math.sin(40*math.pi/180) #[Newton]\n", + "\n", + "# Result\n", + "print\"F_x = \",int((F_x)),\"N\"\n", + "print\"F_y = \",int((F_y)),\"N\"\n", + "\n", + "# Part(b)\n", + "# The vector addition F = F_x_dash + F_y is shown in fig2-11b\n", + "# Calculation\n", + "F_x_dash = F*math.sin(50*math.pi/180)/math.sin(60*math.pi/180) #[Newton]\n", + "F_y = F*math.sin(70*math.pi/180)/math.sin(60*math.pi/180) #[Newton]\n", + "\n", + "# Result\n", + "print\"F_x_dash = \",int((F_x_dash)),\"N\"\n", + "print\"F_y = \",int((F_y)),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.3 Page No. 22" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta = 76.1 degrees\n" + ] + } + ], + "source": [ + "# Example 2.3\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# The angle phi can be determined using law of cosines\n", + "\n", + "# Calculation\n", + "phi = math.asin((400/500)*math.sin(60*math.pi/180)) #[Radians]\n", + "phi = math.degrees(phi) #[Degrees]\n", + "theta = 180-60-phi #[Degrees]\n", + "\n", + "# Result\n", + "print\"theta = \",round(theta,1),\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.4 Page No. 23" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Part(a)\n", + "F1 = 653 N\n", + "F2 = 446 N\n", + "\n", + "Part(b)\n", + "F1 = 940 N\n", + "F2 = 342 N\n" + ] + } + ], + "source": [ + "# Example 2.4\n", + "import math\n", + "\n", + "# Part(a) Refer fig 2-13b\n", + "# Using parallelogram law\n", + "\n", + "# Calculation\n", + "F1 = 1000*math.sin(30*math.pi/180)/math.sin(130*math.pi/180) #[Newton]\n", + "F2 = 1000*math.sin(20*math.pi/180)/math.sin(130*math.pi/180) #[Newton]\n", + "\n", + "# Result\n", + "print\"Part(a)\"\n", + "print\"F1 = \",int(round(F1,0)),\"N\"\n", + "print\"F2 = \",int(round(F2,0)),\"N\\n\"\n", + "\n", + "# Part(b) Refer fig 2-13d\n", + "\n", + "# Calculation\n", + "F1 = 1000*math.sin(70*math.pi/180) #[Newton]\n", + "F2 = 1000*math.cos(70*math.pi/180) #[Newton]\n", + "\n", + "# Result\n", + "print\"Part(b)\"\n", + "print\"F1 = \",int(round(F1,0)),\"N\"\n", + "print\"F2 = \",int(round(F2,0)),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.5 Page No. 31" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1_x = -100 N\n", + "F1_y = 173 N\n", + "F2_x = 240 N\n", + "F2_y = 100 N\n" + ] + } + ], + "source": [ + "# Example 2.5\n", + "import math\n", + "# F1_x acts in -x direction and F1_y acts in +y direction Refer fig 2-17b\n", + "\n", + "# Calculation\n", + "F1_x = -200*math.sin(30*math.pi/180) #[Newton]\n", + "F1_y = 200*math.cos(30*math.pi/180) #[Newton]\n", + "\n", + "# Result\n", + "print\"F1_x = \",int(round(F1_x,0)),\"N\"\n", + "print\"F1_y = \",int(round(F1_y,0)),\"N\"\n", + "\n", + "# F2 is resolved into its x and y components Refer fig 2-17c\n", + "\n", + "# Calculation\n", + "F2_x = 260*(12/13) #[Newton]\n", + "F2_y = 260*(5/13) #[Newton]\n", + "\n", + "# Result\n", + "print\"F2_x = \",int(round(F2_x,0)),\"N\"\n", + "print\"F2_y = \",int(round(F2_y,0)),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.6 Page No. 32" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FR_x = 236.8 N\n", + "FR_y = 582.8 N\n", + "FR = 629 N\n", + "Theta = 67.9 degrees\n" + ] + } + ], + "source": [ + "# Example 2.6\n", + "import math\n", + "\n", + "# Variable Declaration\n", + "F1 = 600 #[Newton]\n", + "F2 = 400 #[Newton]\n", + "\n", + "# We resolve each force into x and y components Refer fig 2-18b\n", + "# Let FR be resultant force\n", + "# Let FR_x be resultant force along x direction\n", + "# Let FR_y be resultant force along y direction\n", + "\n", + "# Calculation\n", + "FR_x = F1*math.cos(30*math.pi/180) - F2*math.sin(45*math.pi/180) #[Newton]\n", + "FR_y = F1*math.sin(30*math.pi/180) + F2*math.cos(45*math.pi/180) #[Newton]\n", + "FR = math.sqrt(round(FR_x,1)**(2)+round(FR_y,1)**(2)) #[Newton]\n", + "theta = math.atan(round(FR_y,1)/round(FR_x,1)) #[Radians]\n", + "theta = math.degrees(theta) #[Degrees]\n", + "\n", + "# Result\n", + "print\"FR_x = \",round(FR_x,1),\"N\"\n", + "print\"FR_y = \",round(FR_y,1),\"N\"\n", + "print\"FR = \",int(round(FR,0)),\"N\"\n", + "print\"Theta = \",round(theta,1),\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Ex 2.7 Page No. 33" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F_R_x = -383.2 N\n", + "F_R_y = 296.8 N\n", + "F_R = 485 N\n", + "Theta = 37.8 degrees\n" + ] + } + ], + "source": [ + "# Example 2.7\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# Variable Declaration\n", + "F1 = 400 #[Newton]\n", + "F2 = 250 #[Newton]\n", + "F3 = 200 #[Newton]\n", + "\n", + "# We resolve each force into x and y components Refer fig 2-18b\n", + "# Let F_R be resultant force\n", + "# Let F_R_x be resultant force along x direction\n", + "# Let F_R_y be resultant force along y direction\n", + "\n", + "# Calculation\n", + "F_R_x = -F1 + F2*math.sin(45*math.pi/180) - F3*(4/5) #[Newton]\n", + "F_R_y = F2*math.cos(45*math.pi/180) + F3*(3/5) #[Newton]\n", + "F_R = math.sqrt(round(F_R_x,1)**(2)+round(F_R_y,1)**(2)) #[Newton]\n", + "theta = math.atan(abs(round(F_R_y,1)/round(F_R_x,1))) #[Radians]\n", + "theta = math.degrees(theta) #[Degrees]\n", + "\n", + "# Result\n", + "print\"F_R_x = \",round(F_R_x,1),\"N\"\n", + "print\"F_R_y = \",round(F_R_y,1),\"N\"\n", + "print\"F_R = \",int(round(F_R,0)),\"N\"\n", + "print\"Theta = \",round(theta,1),\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.8 Page No. 41" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "cos_alpha = +/- 0.5\n", + "F = 100 N\n" + ] + } + ], + "source": [ + "# Example 2.8\n", + "import math\n", + "\n", + "# Variable declaration\n", + "beta = 60 #[Degrees]\n", + "gamma = 45 #[Degrees]\n", + "f = 100 #[Newton]\n", + "\n", + "# Calculation\n", + "cos_alpha = math.sqrt(1-(math.cos(beta*math.pi/180)**(2))-(math.cos(gamma*math.pi/180)**(2))) #[Radians]\n", + "alpha1 = math.degrees(math.acos(+cos_alpha)) #[Degrees]\n", + "alpha2 = math.degrees(math.acos(-cos_alpha)) #[Degrees]\n", + "Fx = f*math.cos(alpha1*math.pi/180) #[Newton]\n", + "Fy = f*math.cos(beta*math.pi/180) #[Newton]\n", + "Fz = f*math.cos(gamma*math.pi/180) #[Newton]\n", + "F = math.sqrt(round(Fx**(2),1)+round(Fy**(2),1)+round(Fz**(2),1)) #[Newton]\n", + "\n", + "# Result\n", + "print\"cos_alpha = +/-\",(cos_alpha)\n", + "print\"F = \",int(F),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Ex 2.9 Page No. 42" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resultant Force FR = 191.0 N\n", + "alpha = 74.8 degrees\n", + "beta = 102.1 degrees\n", + "gamma = 19.5 degrees\n" + ] + } + ], + "source": [ + "# Example 2.9\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# Variable declaration\n", + "\n", + "F1_x = 0 #[Newton]\n", + "F1_y = 60 #[Newton]\n", + "F1_z = 80 #[Newton]\n", + "F2_x = 50 #[Newton]\n", + "F2_y = -100 #[Newton]\n", + "F2_z = 100 #[Newton]\n", + "\n", + "# Calculation\n", + "FR_x = F1_x + F2_x #[Newton]\n", + "FR_y = F1_y + F2_y #[Newton]\n", + "FR_z = F1_z + F2_z #[Newton]\n", + "\n", + "# Let F_R be resultant force\n", + "FR = round(math.sqrt(FR_x**(2)+FR_y**(2)+FR_z**(2)),1)\n", + "\n", + "# The coordinate direction angles alpha,beta and gamma are determined from components of unit vector along direction of F_R\n", + "cos_alpha = FR_x/FR\n", + "cos_beta = FR_y/FR\n", + "cos_gamma = FR_z/FR\n", + "alpha = round(math.degrees(math.acos(cos_alpha)),1) #[Degrees]\n", + "beta = round(math.degrees(math.acos(cos_beta)),1) #[Degrees]\n", + "gamma = round(math.degrees(math.acos(cos_gamma)),1) #[Degrees]\n", + "\n", + "# Result\n", + "print\"Resultant Force FR = \",(FR),\"N\"\n", + "print\"alpha = \",(alpha),\"degrees\"\n", + "print\"beta = \",(beta),\"degrees\"\n", + "print\"gamma = \",(gamma),\"degrees\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.10 Page No. 43" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1_x = 354 N\n", + "F1_y = 354 N\n", + "F1_z = 866 N\n", + "F1 = 1000 N\n", + "\n", + "F2_x = 1.06 kN\n", + "F2_y = 1.837 kN\n", + "F2_z = 2.121 kN\n", + "F2 = 3000 N\n" + ] + } + ], + "source": [ + "# Example 2.10\n", + "import math\n", + "\n", + "# For F1\n", + "\n", + "# Calculation\n", + "F1_z = int(round(1000*math.sin(60*math.pi/180),0)) #[Newton]\n", + "F1_dash = int(round(1000*math.cos(60*math.pi/180),0)) #[Newton]\n", + "F1_x = int(round(F1_dash*math.cos(45*math.pi/180),0)) #[Newton]\n", + "F1_y = int(round(F1_dash*math.sin(45*math.pi/180),0)) #[Newton]\n", + "\n", + "# F1_y has direction defined by -j\n", + "F1 = int(round(math.sqrt(F1_x**(2)+(-F1_y)**(2)+F1_z**(2)),0)) #[Newton]\n", + "\n", + "# u1 is unit vector along F1\n", + "u1_x = round(F1_x/F1,3)\n", + "u1_y = round(F1_y/F1,3)\n", + "u1_z = round(F1_z/F1,3)\n", + "alpha1 = round(math.degrees(math.acos(u1_x)),1) #[Degrees]\n", + "betaa1 = round(math.degrees(math.acos(u1_y)),1) #[Degrees]\n", + "gamma1 = round(math.degrees(math.acos(u1_z)),1) #[Degrees]\n", + "\n", + "# Result\n", + "print\"F1_x = \",F1_x,\"N\"\n", + "print\"F1_y = \",F1_y,\"N\"\n", + "print\"F1_z = \",F1_z,\"N\"\n", + "print\"F1 = \",F1,\"N\\n\"\n", + "\n", + "# For F2\n", + "\n", + "# Calculation\n", + "F2_z = int(round(3000*math.sin(45*math.pi/180),0)) #[Newton]\n", + "F2_dash = int(round(3000*math.cos(45*math.pi/180),0)) #[Newton]\n", + "F2_x = int(round(F2_dash*math.sin(30*math.pi/180),0)) #[Newton]\n", + "F2_y = int(round(F2_dash*math.cos(30*math.pi/180),0)) #[Newton]\n", + "\n", + "# F2_z has direction defined by -k\n", + "F2 = int(round(math.sqrt(F2_x**(2)+F2_y**(2)+(-F2_z)**(2)),-1)) #[Newton]\n", + "\n", + "# u1 is unit vector along F1\n", + "\n", + "u2_x = round(F2_x/F2,3)\n", + "u2_y = round(F2_y/F2,3)\n", + "u2_z = round(F2_z/F2,3)\n", + "alpha2 = round(math.degrees(math.acos(u2_x)),1) #[Degrees]\n", + "betaa2 = round(math.degrees(math.acos(u2_y)),1) #[Degrees]\n", + "gamma2 = round(math.degrees(math.acos(u2_z)),1) #[Degrees]\n", + "\n", + "# Result\n", + "print\"F2_x = \",F2_x/1000,\"kN\"\n", + "print\"F2_y = \",F2_y/1000,\"kN\"\n", + "print\"F2_z = \",F2_z/1000,\"kN\"\n", + "print\"F2 = \",F2,\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.11 Page No. 44" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "alpha2 = 107.6 degrees\n", + "beta2 = 21.8 degrees\n", + "gamma2 = 77.6 degrees\n" + ] + } + ], + "source": [ + "# Example 2.11\n", + "import math\n", + "\n", + "# Variable declaration\n", + "\n", + "F1 = 300 #[Newton]\n", + "F2 = 700 #[Newton]\n", + "FR = 800 #[Newton]\n", + "alpha1 = 45 #[Degrees]\n", + "beta1 = 60 #[Degrees]\n", + "gamma1 = 120 #[Degrees]\n", + "\n", + "# Calculation\n", + "F1_x = round(F1*math.cos(alpha1*math.pi/180),1) #[Newton]\n", + "F1_y = round(F1*math.cos(beta1*math.pi/180),1) #[Newton]\n", + "F1_z = round(F1*math.cos(gamma1*math.pi/180),1) #[Newton]\n", + "\n", + "# FR acts along +y axis\n", + "FR_x = 0 #[Newton]\n", + "FR_y = 800 #[Newton]\n", + "FR_z = 0 #[Newton]\n", + "\n", + "# FR = F1 + F2\n", + "# F2 = FR - F1\n", + "F2_x = FR_x - F1_x #[Newton]\n", + "F2_y = FR_y - F1_y #[Newton]\n", + "F2_z = FR_z - F1_z #[Newton]\n", + "alpha2 = round(math.degrees(math.acos(F2_x/F2)),1) #[Degrees]\n", + "beta2 = round(math.degrees(math.acos(F2_y/F2)),1) #[Degrees]\n", + "gamma2 = round(math.degrees(math.acos(F2_z/F2)),1) #[Degrees]\n", + "\n", + "# Result\n", + "print\"alpha2 = \",(alpha2),\"degrees\"\n", + "print\"beta2 = \",(beta2),\"degrees\"\n", + "print\"gamma2 = \",(gamma2),\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.12 Page No. 49" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "alpha = 115.4 degrees\n", + "beta = 73.4 degrees\n", + "gamma = 31.0 degrees\n" + ] + } + ], + "source": [ + "# Example 2.12\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# Variable Declaration\n", + "A_x = 1 #[meters]\n", + "A_y = 0 #[meters]\n", + "A_z = -3 #[meters]\n", + "B_x = -2 #[meters]\n", + "B_y = 2 #[meters]\n", + "B_z = 3 #[meters]\n", + "\n", + "# Calculation\n", + "# r = B - A\n", + "r_x = B_x - A_x #[meters]\n", + "r_y = B_y - A_y #[meters]\n", + "r_z = B_z - A_z #[meters]\n", + "r = math.sqrt(r_x**(2)+r_y**(2)+r_z**(2))\n", + "\n", + "# Assume u to be a unit vector along r\n", + "u_x = r_x/r\n", + "u_y = r_y/r\n", + "u_z = r_z/r\n", + "alpha = round(math.degrees(math.acos(u_x)),1) #[Degrees]\n", + "beta = round(math.degrees(math.acos(u_y)),1) #[Degrees]\n", + "gamma = round(math.degrees(math.acos(u_z)),1) #[Degrees]\n", + "\n", + "# Result\n", + "print\"alpha = \",(alpha),\"degrees\"\n", + "print\"beta = \",(beta),\"degrees\"\n", + "print\"gamma = \",(gamma),\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Ex 2.13 Page No. 51" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F_x = 30.0 N\n", + "F_y = -20.0 N\n", + "F_z = -60.0 N\n", + "alpha = 64.6 degrees\n", + "beta = 106.6 degrees\n", + "gamma = 149.0 degrees\n" + ] + } + ], + "source": [ + "# Example 2.13\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# Variable Declaration\n", + "A_x = 0 #[meters]\n", + "A_y = 0 #[meters]\n", + "A_z = 8 #[meters]\n", + "B_x = 3 #[meters]\n", + "B_y = -2 #[meters]\n", + "B_z = 2 #[meters]\n", + "\n", + "# Calculation\n", + "# r = B - A\n", + "r_x = B_x - A_x #[meters]\n", + "r_y = B_y - A_y #[meters]\n", + "r_z = B_z - A_z #[meters]\n", + "r = math.sqrt(r_x**(2)+r_y**(2)+r_z**(2))\n", + "\n", + "# Assume u to be a unit vector along r\n", + "u_x = r_x/r\n", + "u_y = r_y/r\n", + "u_z = r_z/r\n", + "\n", + "# Since F = 70 N and direction is specified by u\n", + "F_x = 70 * u_x #[Newton]\n", + "F_y = 70 * u_y #[Newton]\n", + "F_z = 70 * u_z #[Newton]\n", + "alpha = round(math.degrees(math.acos(u_x)),1) #[Degrees]\n", + "beta = round(math.degrees(math.acos(u_y)),1) #[Degrees]\n", + "gamma = round(math.degrees(math.acos(u_z)),1) #[Degrees]\n", + "\n", + "# Result\n", + "print\"F_x = \",(F_x),\"N\"\n", + "print\"F_y = \",(F_y),\"N\"\n", + "print\"F_z = \",(F_z),\"N\"\n", + "print\"alpha = \",(alpha),\"degrees\"\n", + "print\"beta = \",(beta),\"degrees\"\n", + "print\"gamma = \",(gamma),\"degrees\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.14 Page No. 52" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F_x = 313.5 N\n", + "F_y = 129.8 N\n", + "F_z = -367.3 N\n", + "F = 500.0 N\n" + ] + } + ], + "source": [ + "# Example 2.14\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# Variable Declaration\n", + "A_x = 0 #[meters]\n", + "A_y = 0 #[meters]\n", + "A_z = 2 #[meters]\n", + "B_x = 1.707 #[meters]\n", + "B_y = 0.707 #[meters]\n", + "B_z = 0 #[meters]\n", + "\n", + "# Calculation\n", + "# r = B - A\n", + "r_x = B_x - A_x #[meters]\n", + "r_y = B_y - A_y #[meters]\n", + "r_z = B_z - A_z #[meters]\n", + "r = math.sqrt(r_x**(2)+r_y**(2)+r_z**(2))\n", + "\n", + "# Assume u to be a unit vector along r\n", + "u_x = r_x/r\n", + "u_y = r_y/r\n", + "u_z = r_z/r\n", + "\n", + "# Since F = 500 N and direction is specified by u\n", + "F_x = round(500 * u_x,1) #[Newton]\n", + "F_y = round(500 * u_y,1) #[Newton]\n", + "F_z = round(500 * u_z,1) #[Newton]\n", + "F = round(math.sqrt(F_x**(2)+F_y**(2)+F_z**(2)),1) #[Newton]\n", + "\n", + "# Result\n", + "print\"F_x = \",(F_x),\"N\"\n", + "print\"F_y = \",(F_y),\"N\"\n", + "print\"F_z = \",(F_z),\"N\"\n", + "print\"F = \",(F),\"N\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Ex 2.15 Page No. 53" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FR = 217.0 N\n" + ] + } + ], + "source": [ + "# Example 2.15\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# Variable Declaration\n", + "FAB = 100 #[Newton]\n", + "FAC = 120 #[Newton]\n", + "A_x = 0 #[meters]\n", + "A_y = 0 #[meters]\n", + "A_z = 4 #[meters]\n", + "B_x = 4 #[meters]\n", + "B_y = 0 #[meters]\n", + "B_z = 0 #[meters]\n", + "C_x = 4 #[meters]\n", + "C_y = 2 #[meters]\n", + "C_z = 0 #[meters]\n", + "\n", + "# Calculation(FAB)\n", + "rAB_x = B_x - A_x #[meters]\n", + "rAB_y = B_y - A_y #[meters]\n", + "rAB_z = B_z - A_z #[meters]\n", + "rAB = round(math.sqrt(rAB_x**(2)+rAB_y**(2)+rAB_z**(2)),2)\n", + "FAB_x = round(FAB*(rAB_x/rAB),1) #[Newton]\n", + "FAB_y = round(FAB*(rAB_y/rAB),1) #[Newton]\n", + "FAB_z = round(FAB*(rAB_z/rAB),1) #[Newton]\n", + "\n", + "# Calculation(FAC)\n", + "rAC_x = C_x - A_x #[meters]\n", + "rAC_y = C_y - A_y #[meters]\n", + "rAC_z = C_z - A_z #[meters]\n", + "rAC = round(math.sqrt(rAC_x**(2)+rAC_y**(2)+rAC_z**(2)),2)\n", + "FAC_x = round(FAC*(rAC_x/rAC),1) #[Newton]\n", + "FAC_y = round(FAC*(rAC_y/rAC),1) #[Newton]\n", + "FAC_z = round(FAC*(rAC_z/rAC),1) #[Newton]\n", + "\n", + "# FR = FAB + FAC\n", + "FR_x = FAB_x + FAC_x #[Newton]\n", + "FR_y = FAB_y + FAC_y #[Newton]\n", + "FR_z = FAB_z + FAC_z #[Newton]\n", + "FR = round(math.sqrt(FR_x**(2)+FR_y**(2)+FR_z**(2)),0)\n", + "print\"FR = \",(FR),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.16 Page No. 61" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FAB = 257.1 N\n", + "FAB_x = 73.5 N\n", + "FAB_y = 220.4 N\n", + "FAB_z = 110.2 N\n", + "Fp = 155.0 N\n" + ] + } + ], + "source": [ + "# Example 2.16\n", + "import math\n", + "\n", + "# Variable Declaration\n", + "rB_x = 2 #[meters]\n", + "rB_y = 6 #[meters]\n", + "rB_z = 3 #[meters]\n", + "F_x = 0 #[Newton]\n", + "F_y = 300 #[Newton]\n", + "F_z = 0 #[Newton]\n", + "\n", + "# Calculation\n", + "F = math.sqrt(F_x**(2)+F_y**(2)+F_z**(2)) #[Newton]\n", + "# Let uB be unit vector defining direction of AB\n", + "rB = math.sqrt(rB_x**(2)+rB_y**(2)+rB_z**(2)) #[meters]\n", + "uB_x = rB_x/rB\n", + "uB_y = rB_y/rB\n", + "uB_z = rB_z/rB\n", + "\n", + "# The magnitude of component of F along AB is equal to dot product of F and unit vector uB \n", + "FAB = round(F_x*uB_x + F_y*uB_y + F_z*uB_z,1) #[Newton]\n", + "\n", + "# Expressing FAB in Cartesian form\n", + "FAB_x = round(FAB*uB_x,1) #[Newton]\n", + "FAB_y = round(FAB*uB_y,1) #[Newton]\n", + "FAB_z = round(FAB*uB_z,1) #[Newton]\n", + "FAB = round(math.sqrt(FAB_x**(2)+FAB_y**(2)+FAB_z**(2)),1) #[Newton]\n", + "\n", + "# Let Fp be perpendicular component\n", + "Fp_x = F_x - FAB_x #[Newton]\n", + "Fp_y = F_y - FAB_y #[Newton]\n", + "Fp_z = F_z - FAB_z #[Newton]\n", + "Fp = round(math.sqrt(F**(2)-FAB**(2)),0) #[Newton]\n", + "\n", + "# Result\n", + "print\"FAB = \",(FAB),\"N\"\n", + "print\"FAB_x = \",(FAB_x),\"N\"\n", + "print\"FAB_y = \",(FAB_y),\"N\"\n", + "print\"FAB_z = \",(FAB_z),\"N\"\n", + "print\"Fp = \",(Fp),\"N\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 2.17 Page No. 62" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta = 42.4 degrees\n", + "FBA = 59.1 N\n", + "Fp = 53.9 N\n" + ] + } + ], + "source": [ + "# Example 2.17\n", + "import math\n", + "from __future__ import division\n", + "\n", + "# Variable Declaration\n", + "F = 80 #[Newton]\n", + "A_x = 0\n", + "A_y = 1\n", + "A_z = 0\n", + "B_x = 2\n", + "B_y = 3\n", + "B_z = -1\n", + "C_x = 2\n", + "C_y = 0\n", + "C_z = 0\n", + "\n", + "# Calculation\n", + "rBA_x = A_x - B_x \n", + "rBA_y = A_y - B_y\n", + "rBA_z = A_z - B_z\n", + "rBC_x = C_x - B_x \n", + "rBC_y = C_y - B_y\n", + "rBC_z = C_z - B_z\n", + "rBA = round(math.sqrt(rBA_x**(2)+rBA_y**(2)+rBA_z**(2)),2)\n", + "rBC = round(math.sqrt(rBC_x**(2)+rBC_y**(2)+rBC_z**(2)),2)\n", + "theta = round(math.degrees(math.acos((rBA_x*rBC_x+rBA_y*rBC_y+rBA_z*rBC_z)/(rBA*rBC))),1)\n", + "\n", + "# let uBA be unit vector along BA\n", + "uBA_x = rBA_x/rBA\n", + "uBA_y = rBA_y/rBA\n", + "uBA_z = rBA_z/rBA\n", + "F_x = round(F*(rBC_x/rBC),2) #[Newton]\n", + "F_y = round(F*(rBC_y/rBC),2) #[Newton]\n", + "F_z = round(F*(rBC_z/rBC),2) #[Newton]\n", + "\n", + "# FBA = F.uBA\n", + "FBA = round(F_x*uBA_x + F_y*uBA_y + F_z*uBA_z,1) #[Newton]\n", + "\n", + "# Since theta was calculated FBA can be calculated by FBA = F*cos(theta)\n", + "# Let Fp be perpendicular component\n", + "Fp = round(F*math.sin(theta*math.pi/180),1) #[Newton]\n", + "\n", + "# Result\n", + "print\"theta = \",(theta),\"degrees\"\n", + "print\"FBA = \",(FBA),\"N\"\n", + "print\"Fp = \",(Fp),\"N\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [default]", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} |