summaryrefslogtreecommitdiff
path: root/Engineering_Mechanics_by_A._K._Tayal/Chapter19.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Engineering_Mechanics_by_A._K._Tayal/Chapter19.ipynb')
-rw-r--r--Engineering_Mechanics_by_A._K._Tayal/Chapter19.ipynb230
1 files changed, 230 insertions, 0 deletions
diff --git a/Engineering_Mechanics_by_A._K._Tayal/Chapter19.ipynb b/Engineering_Mechanics_by_A._K._Tayal/Chapter19.ipynb
new file mode 100644
index 00000000..08d8c932
--- /dev/null
+++ b/Engineering_Mechanics_by_A._K._Tayal/Chapter19.ipynb
@@ -0,0 +1,230 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 19 Relative Motion"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 19.1 Relative Velocity"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The velocity at which the stone appears to hit the person travelling in the train is 11.180340 m/s\n",
+ "The direction of the stone is 26.565051 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# Initilization of variables\n",
+ "v_t=10 # m/s # velocity of the train\n",
+ "v_s=5 # m/s # velocity of the stone\n",
+ "# Calculations\n",
+ "# Let v_r be the relative velocity, which is given as, (from triangle law)\n",
+ "v_r=math.sqrt(v_t**2+v_s**2) # m/s\n",
+ "# The direction ofthe stone is,\n",
+ "theta=math.degrees(math.atan(v_s/v_t)) # degree\n",
+ "# Results\n",
+ "print('The velocity at which the stone appears to hit the person travelling in the train is %f m/s'%v_r)\n",
+ "print('The direction of the stone is %f degree'%theta)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 19.2 Relative Velocity"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The magnitude of relative velocity of ship B with respect to ship A is 6.994832 m/s\n",
+ "The direction of the relative velocity is 14.638807 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Initilization of variables\n",
+ "v_A=5 # m/s # speed of ship A\n",
+ "v_B=2.5 # m/s # speed of ship B\n",
+ "theta=135 # degree # angle between the two ships\n",
+ "# Calculations\n",
+ "# Here,\n",
+ "OA=v_A # m/s\n",
+ "OB=v_B # m/s\n",
+ "# The magnitude of relative velocity is given by cosine law as,\n",
+ "AB=math.sqrt((OA**2)+(OB**2)-(2*OA*OB*math.cos(theta*math.pi/180))) # m/s\n",
+ "# where AB gives the relative velocity of ship B with respect to ship A\n",
+ "# Applying sine law to find the direction, Let alpha be the direction of the reative velocity, then\n",
+ "alpha=math.degrees(math.asin((OB*math.sin(theta*math.pi/180))/(AB))) # degree\n",
+ "# Results\n",
+ "print('The magnitude of relative velocity of ship B with respect to ship A is %f m/s'%AB)\n",
+ "print('The direction of the relative velocity is %f degree'%alpha)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 19.3 Relative Velocity"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The magnitude of absolute velocity is 18.943769 km/hr\n",
+ "The direction of absolute velocity is 86.709116 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy\n",
+ "# Initilization of variables\n",
+ "v_c=20 # km/hr # speed at which the cyclist is riding to west\n",
+ "theta_1=45 # degree # angle made by rain with the cyclist when he rides at 20 km/hr\n",
+ "V_c=12 # km/hr # changed speed\n",
+ "theta_2=30 # degree # changed angle when the cyclist rides at 12 km/hr\n",
+ "# Calculations\n",
+ "# Solving eq'ns 1 & 2 simultaneously to get the values of components(v_R_x & v_R_y) of absolute velocity v_R. We use matrix to solve eqn's 1 & 2.\n",
+ "A=numpy.matrix('1 1;1 0.577')\n",
+ "B=numpy.matrix('20;12')\n",
+ "C=numpy.linalg.inv(A)*B # km/hr\n",
+ "# The X component of relative velocity (v_R_x) is C(1)\n",
+ "# The Y component of relative velocity (v_R_y) is C(2)\n",
+ "# Calculations\n",
+ "# Relative velocity (v_R) is given as,\n",
+ "v_R=math.sqrt((C[0])**2+(C[1])**2) # km/hr\n",
+ "# And the direction of absolute velocity of rain is theta, is given as\n",
+ "theta=math.degrees(math.atan(C[1]/C[0])) # degree\n",
+ "# Results \n",
+ "print('The magnitude of absolute velocity is %f km/hr'%v_R)\n",
+ "print('The direction of absolute velocity is %f degree'%theta)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 19.4 Relative Velocity"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The relative position of car A relative to car B is 53.851648 m\n",
+ "The direction of car A w.r.t car B is 21.801409 degree\n",
+ "The velocity of car A relative to car B is 11.180340 m/s\n",
+ "The direction of car A w.r.t (for relative velocity)is 26.565051 degree\n",
+ "The acceleration of car A relative to car B is 1 m/s**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Initiization of variables\n",
+ "a=1 # m/s**2 # acceleration of car A\n",
+ "u_B=36*(1000/3600) # m/s # velocity of car B\n",
+ "u=0 # m/s # initial velocity of car A\n",
+ "d=32.5 # m # position of car A from north of crossing\n",
+ "t=5 # seconds\n",
+ "# Calculations\n",
+ "# CAR A: Absolute motion using eq'n v=u+at we have,\n",
+ "v=u+(a*t) # m/s\n",
+ "# Now distance travelled by car A after 5 seconds is given by, s_A=u*t+(1/2)*a*t**2\n",
+ "s_A=(u*t)+((1/2)*a*t**2)\n",
+ "# Now, let the position of car A after 5 seconds be y_A\n",
+ "y_A=d-s_A # m # \n",
+ "# CAR B:\n",
+ "# let a_B be the acceleration of car B\n",
+ "a_B=0 # m/s\n",
+ "# Now position of car B is s_B\n",
+ "s_B=(u_B*t)+((1/2)*a_B*t**2) # m\n",
+ "x_B=s_B # m\n",
+ "# Let the Relative position of car A with respect to car B be BA & its direction be theta, then from fig. 19.9(b)\n",
+ "OA=y_A\n",
+ "OB=x_B\n",
+ "BA=math.sqrt(OA**2+OB**2) # m\n",
+ "theta=math.degrees(math.atan(OA/OB)) # degree\n",
+ "# Let the relative velocity of car A w.r.t. the car B be v_AB & the angle be phi. Then from fig 19.9(c). Consider small alphabets\n",
+ "oa=v\n",
+ "ob=u_B\n",
+ "v_AB=math.sqrt(oa**2+ob**2) # m/s\n",
+ "phi=math.degrees(math.atan(oa/ob)) # degree\n",
+ "# Let the relative acceleration of car A w.r.t. car B be a_A/B.Then,\n",
+ "a_AB=a-a_B # m/s^2\n",
+ "# Results\n",
+ "print('The relative position of car A relative to car B is %f m'%BA)\n",
+ "print('The direction of car A w.r.t car B is %f degree'%theta)\n",
+ "print('The velocity of car A relative to car B is %f m/s'%v_AB)\n",
+ "print('The direction of car A w.r.t (for relative velocity)is %f degree'%phi)\n",
+ "print('The acceleration of car A relative to car B is %d m/s**2'%a_AB)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.5.1"
+ },
+ "widgets": {
+ "state": {},
+ "version": "1.1.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}