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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 4: Waves"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 4.1: amplitude_and_pressure_change.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//INPUT DATA\n",
"w=1.8 //wavelength\n",
"//calulation\n",
"y=sind(15*360/180)//displacement at 15cm from reflector\n",
"//output\n",
"printf('1. at 45cm, antinode occurs and hence pressure is minimum')\n",
"printf('\n 2. at 90cm node arises and hence pressure is maximum')\n",
"printf('\n 3. at 15cm frm reflector the displacement is %3.3f',y)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 4.3: length_of_tube.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//INPUT DATA\n",
"f=520 //frequency\n",
"t2=293 //air temperature to produce fundamental +273\n",
"t1=273// 0deg C\n",
"v1=330//speed of sound waves\n",
"//calculation\n",
"v2=330*(293/273)^0.5 //speed at 20 deg C\n",
"l=v2/f//wavelength\n",
"len=l/4 - 0.01 //length\n",
"//output\n",
"printf('the length of tube is %3.3f m',len)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 4.4: frequency_of_beats.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//INPUT DATA\n",
"v1=330 //speed of sound\n",
"t3=303 //fundamental temperature for the air\n",
"t1=273// 0deg C\n",
"//calculation\n",
"v3=v1*(t3/t1)^0.5 //new speed of sound\n",
"f=v3/0.66 //frequency\n",
"fb=f-520 //frequency of beats\n",
"//output\n",
"printf('the frequency of beats is %3.3f Hz',fb)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 4.5: fundamental_frequency.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//INPUT DATA\n",
"T=100 //tension\n",
"l=1.5 //length\n",
"m=0.3*10^-6 //mass\n",
"//calculation\n",
"f=(T/(m/l))^0.5/(2*l)//fundamental frequency produced \n",
"//output\n",
"printf('the fundamental frequency produced is %3.3f Hz',f)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 4.6: doppler_effect.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//INPUT DATA\n",
"f=150 //frequency \n",
"v=320 //speed of sound\n",
"ul=11 //speed with which listener approaches\n",
"us=7 //speed of source\n",
"//calculation\n",
"fa=f*v/(v-us)//doppler effect\n",
"fa1=(v+ul)*f/(v)//doppler effect\n",
"fa2=(v+ul)*f/(v-us)//doppler effect\n",
"//output\n",
"printf('frequency when source moves at 7ms^-1 %3.3f Hz',fa)\n",
"\n",
"printf('\n frequency when listener moves at 11ms^-1 %3.3f Hz',fa1)\n",
"printf('\n frequency when source moves at 7ms^-1 and listener at 11ms^-1 %3.3f Hz',fa2)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 4.7: apparent_frequency_change.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//INPUT DATA\n",
"us=264 //speed of jet fighter\n",
"x=71.7\n",
"v=340 //velocity of sound\n",
"f=1*10^3 //frequency\n",
"//calculation\n",
"usd=us*cosd(x)//horizontal component of velocity\n",
"fr= (v*f)/(v-usd) -((v*f)/(v+usd))//frequency range ,doppler effect\n",
"//output\n",
"printf('the frequency range is %3.3f Hz ',fr)"
]
}
],
"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
}
|