1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 19: Relative Motion"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 19.1: Relative_Velocity.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// 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=sqrt(v_t^2+v_s^2) // m/s\n",
"// The direction ofthe stone is,\n",
"theta=atand(v_s/v_t) // degree\n",
"// Results\n",
"clc\n",
"printf('The velocity at which the stone appears to hit the person travelling in the train is %f m/s \n',v_r)\n",
"printf('The direction of the stone is %f degree \n',theta)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 19.2: Relative_Velocity.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"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=sqrt((OA^2)+(OB^2)-(2*OA*OB*cosd(theta))) // 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=asind((OB*sind(theta))/(AB)) // degree\n",
"// Results\n",
"clc\n",
"printf('The magnitude of relative velocity of ship B with respect to ship A is %f m/s \n',AB)\n",
"printf('The direction of the relative velocity is %f degree \n',alpha)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 19.3: Relative_Velocity.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// 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=[1 1;1 0.577]\n",
"B=[20;12]\n",
"C=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=sqrt((C(1))^2+(C(2))^2) // km/hr\n",
"// And the direction of absolute velocity of rain is theta, is given as\n",
"theta=atand(C(2)/C(1)) // degree\n",
"// Results \n",
"clc\n",
"printf('The magnitude of absolute velocity is %f km/hr \n',v_R)\n",
"printf('The direction of absolute velocity is %f degree \n',theta)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 19.4: Relative_Velocity.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"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=sqrt(OA^2+OB^2) // m\n",
"theta=atand(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=sqrt(oa^2+ob^2) // m/s\n",
"phi=atand(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",
"clc\n",
"printf('The relative position of car A relative to car B is %f m \n',BA)\n",
"printf('The direction of car A w.r.t car B is %f degree \n',theta)\n",
"printf('The velocity of car A relative to car B is %f m/s \n',v_AB)\n",
"printf('The direction of car A w.r.t (for relative velocity)is %f degree \n',phi)\n",
"printf('The acceleration of car A relative to car B is %f m/s^2 \n',a_AB)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sce",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "scilab",
"version": "0.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|