{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 3 : Motion in a Straight Line"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.1 , page : 43"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(a)\n",
"The average velocity of the car in going from O to P = 20.0 m/s\n",
"The average speed of the car in going from O to P = 20.0 m/s\n",
"(b)\n",
"The average velocity of the car in going from O to P and back to Q = 10.0 m/s\n",
"The average speed of the car in going from O to P and back to Q = 20.0 m/s\n"
]
}
],
"source": [
"# Importing module\n",
"\n",
"import math\n",
"\n",
"# Variable declaration\n",
"\n",
"l1=360 # The distance from O to P in m\n",
"l2=120 # The distance from P to Q in m\n",
"t1=18 # The time taken to travel OP in s\n",
"t2=6 # The time taken to travel PQ in s\n",
"d1=360 # The displacement from O to P in m\n",
"d2=(l1-l2) # The displacement from P to Q in m\n",
"p1=360 # The total pathlength from O to P in m\n",
"p2=(l1+l2) # The total pathlength from O to P and p to Q in m\n",
"\n",
"# Calculation\n",
"\n",
"#(a)\n",
"a_v1=d1/t1\n",
"a_s1=p1/t1\n",
"\n",
"#(b)\n",
"a_v2=d2/(t1+t2)\n",
"a_s2=p2/(t1+t2)\n",
"\n",
"# Result\n",
"\n",
"print(\"(a)\")\n",
"print(\"The average velocity of the car in going from O to P =\",a_v1,\"m/s\")\n",
"print(\"The average speed of the car in going from O to P =\",a_s1,\"m/s\")\n",
"print(\"(b)\")\n",
"print(\"The average velocity of the car in going from O to P and back to Q =\",a_v2,\"m/s\")\n",
"print(\"The average speed of the car in going from O to P and back to Q =\",a_s2,\"m/s\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.2 , page : 45"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The velocity at t = 0.0 s = 0 m/s\n",
"The velocity at t = 2.0 s = 10 m/s\n",
"The average velocity between t = 2.0 s and t = 4.0 s = 15.0 m/s\n"
]
}
],
"source": [
"# Importing module\n",
"\n",
"import math\n",
"import numpy as np\n",
"\n",
"# Variable declaration\n",
" \n",
"a=8.5 # Distance in m\n",
"b=2.5 # Acceleration in m/s²\n",
"\n",
"# Calculation\n",
"\n",
"# In notation of differential calculus, the velocity is v = dx/dt = d (a+bt²)/dt = 2bt = 5.0t\n",
"\n",
"p0=np.polyval([0,5,0],0) # Velocity at t= 1.0 s\n",
"p2=np.polyval([0,5,0],2) # Velocity at t= 2.0 s\n",
"p4=np.polyval([0,5,0],4) # Velocity at t= 4.0 s\n",
"avg_v=(p2+p4)/2\n",
"\n",
"# Result\n",
"\n",
"print(\"The velocity at t = 0.0 s =\",p0,\"m/s\")\n",
"print(\"The velocity at t = 2.0 s =\",p2,\"m/s\")\n",
"print(\"The average velocity between t = 2.0 s and t = 4.0 s =\",avg_v,\"m/s\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.3 , page : 48 "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The equations of motion for constant acceleration using method of calculus are as follows.\n",
"v = v_o + at\n",
"x = x_o + v_ot + (1/2)at²\n",
"v²= v²_o + 2a(x - x_o)\n"
]
}
],
"source": [
"# Calculation\n",
"\n",
"# By definition, a = dv/dt\n",
"# .i.e dv = adt\n",
"# Integrating on both sides we get, v - v_o = at or v = v_o + at\n",
"# Further we know that, v = dx/dt\n",
"# .i.e dx = vdt\n",
"# Integrating on both sides we get, x - x_o = v_ot + (1/2)at² or x = x_o + v_ot + (1/2)at² \n",
"# Now we can write, a = dv/dt = (dv/dx)(dx/dt) = v(dv/dx) \n",
"# .i.e. v dv = a dx\n",
"# Integrating on both sides we get, (v² - v²_o) = a(x - x_o) or v² = v²_o + 2a(x - x_o)\n",
"\n",
"# Result\n",
"\n",
"print(\"The equations of motion for constant acceleration using method of calculus are as follows.\")\n",
"print(\"v = v_o + at\")\n",
"print(\"x = x_o + v_ot + (1/2)at²\")\n",
"print(\"v²= v²_o + 2a(x - x_o)\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.4 , page : 48 "
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(a) The height at which the ball has risen = 20.0 m\n",
"(b) The time taken before the ball to hit the ground = 5.0 s\n"
]
}
],
"source": [
"# Importing module\n",
"\n",
"import sympy\n",
"\n",
"# Variable declaration\n",
"\n",
"t = sympy.symbols('t')\n",
"v_o=20 # Initial velocity in m/s\n",
"y_o=25 # Height of the initial point from ground in m\n",
"a=-10 # Acceleration due to gravity\n",
"v=0\n",
"y=0\n",
"\n",
"# Calculation\n",
"\n",
"#(a)\n",
"# Let us take the y-axis in the vertically upward direction with zero at the ground\n",
"# Since v=(v_o)²+2ah\n",
"h=(-(v_o)**2)/(2*a)\n",
"\n",
"#(b)\n",
"# The total time taken can also be calculated by noting the coordinates of initial and final positions of the ball with respect to the origin chosen\n",
"# and using equation (y - y_0) = v_ot + (1/2)at² \n",
"# Substituting the values in the above equation we get the quadratic equation for t as , 5t² - 20t - 25 = 0 \n",
"t = round(max(sympy.solve(5*t**2 - 20*t -y_o,t)),0)\n",
"\n",
"# Result\n",
"\n",
"print(\"(a) The height at which the ball has risen =\",h,\"m\")\n",
"print(\"(b) The time taken before the ball to hit the ground =\",t,\"s\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.5 , page : 49 "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The motion of an object under free fall can be explained by the following equations\n",
"v = 0 - g t = 9.8t m/s\n",
"y = 0 - (1/2)gt² = 4.9t² m\n",
"v² = 0 - 2gy = -19.6 y m²/s²\n"
]
}
],
"source": [
"# Calculation\n",
"\n",
"# If air resistance is neglected, the object is said to be in free fall.\n",
"# If the height through which the object falls is small compared to the earths radius, g can be taken to be constant, equal to 9.8 ms².\n",
"# Free fall is thus a case of motion with uniform acceleration. \n",
"# We assume that the motion is in y-direction, more correctly in y-direction because we choose upward direction as positive.\n",
"# Since the acceleration due to gravity is always downward, it is in the negative direction.\n",
"# Then we have, a = g = 9.8 ms²\n",
"# The object is released from rest at y = 0. Therefore, v_0 = 0 and the equations of motion become as follows\n",
"# v = 0 - g t = 9.8t m/s \n",
"# y = 0 - (1/2)gt² = 4.9t² m\n",
"# v² = 0 - 2gy = -19.6 y m²/s²\n",
"\n",
"# Result\n",
"\n",
"print(\"The motion of an object under free fall can be explained by the following equations\")\n",
"print(\"v = 0 - g t = 9.8t m/s\")\n",
"print(\"y = 0 - (1/2)gt² = 4.9t² m\")\n",
"print(\"v² = 0 - 2gy = -19.6 y m²/s²\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.6 , page : 50 "
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Let us divide the time interval of motion of an object under free fall into many equal intervals τ and find out the distancestraversed during successive intervals of time.\n",
"Since initial velocity is zero, we have\n",
"Using this equation, we can calculate the position of the object after different time intervals, 0, τ, 2τ, 3τ which are given in second column of Table 3.2. If we take (1/ 2) gτ2 as y0 the position coordinate after first time interval τ, then third column gives the positions in the unit of yo. The fourth column gives the distances traversed in successive τs. We find that the distances are in the simple ratio 1: 3: 5: 7: 9: 11 as shown in the last column. This law was established by Galileo Galilei (1564-1642) who was the first to make quantitative studies of free fall.\n",
"Hence the proof.\n"
]
}
],
"source": [
"# Result\n",
"\n",
"print(\"Let us divide the time interval of motion of an object under free fall into many equal intervals τ and find out the distancestraversed during successive intervals of time.\")\n",
"print(\"Since initial velocity is zero, we have\")\n",
"print(\"Using this equation, we can calculate the position of the object after different time intervals, 0, τ, 2τ, 3τ which are given in second column of Table 3.2. If we take (1/ 2) gτ2 as y0 the position coordinate after first time interval τ, then third column gives the positions in the unit of yo. The fourth column gives the distances traversed in successive τs. We find that the distances are in the simple ratio 1: 3: 5: 7: 9: 11 as shown in the last column. This law was established by Galileo Galilei (1564-1642) who was the first to make quantitative studies of free fall.\")\n",
"print(\"Hence the proof.\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.7 , page : 50 "
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The stopping distance, d_s = -v²_o / 2a\n"
]
}
],
"source": [
"# Calculation\n",
"\n",
"# Let the distance travelled by the vehicle before it stops be d_s.\n",
"# Then, using equation of motion v² = v²_o + 2ax, and noting that v = 0, we have the stopping distance as given below,\n",
"# The stopping distance, d_s = -v²_o / 2a\n",
"\n",
"# Result\n",
"\n",
"print(\"The stopping distance, d_s = -v²_o / 2a\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.8 , page : 51 "
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reaction Time = 0.2 s\n"
]
}
],
"source": [
"# Importing module\n",
"\n",
"import math\n",
"\n",
"# Variable declaration\n",
" \n",
"v0=0 # Initial velocity in m\n",
"g=9.8 # Acceleration due to gravity\n",
"d=21 # Distance travelled in cm \n",
"\n",
"# Calculation\n",
"\n",
"d=21*10**-2\n",
"t=math.sqrt((2*d)/g) # Reaction time = √(2d/g)\n",
"\n",
"# Result\n",
"\n",
"print(\"Reaction Time =\",round(t,1),\"s\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3.9 , page : 52 "
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(a) Relative velocity of train B with respect to tain A = -40.0 m/s\n",
"(b) Relative velocity of ground with respect to train B = 25.0 m/s\n",
"(c) Speed of the monkey = 10.0 m/s\n"
]
}
],
"source": [
"# Importing module\n",
"\n",
"import math\n",
"\n",
"# Variable declaration\n",
"\n",
"# Choose the positive direction of X-axis to be from South to North\n",
"V_A=54 # The speed of train A in km/h\n",
"V_B=-90 # The speed of train B in km/h\n",
"V_MA=-18 # The relative speed of monkey km/h\n",
"\n",
"# Calculation\n",
"\n",
"V_A=54*(5/18) # The speed of train A in m/s\n",
"V_B=-90*(5/18) # The speed of train B in m/s\n",
"V_MA=-18*(5/18) # The relative speed of monkey m/s\n",
"\n",
"#(a)\n",
"V_BA=V_B-V_A # Relative velocity of train B with respect to A\n",
"\n",
"#(b)\n",
"V_GB=0-V_B # Relative velocity of ground with respect to train B\n",
"\n",
"#(c)\n",
"# Since V_MA = V_M - V_A\n",
"V_M=V_MA+V_A\n",
"\n",
"# Result\n",
"\n",
"print(\"(a) Relative velocity of train B with respect to tain A =\",V_BA,\"m/s\")\n",
"print(\"(b) Relative velocity of ground with respect to train B =\",V_GB,\"m/s\")\n",
"print(\"(c) Speed of the monkey =\",V_M,\"m/s\")\n"
]
}
],
"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.4.3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}