summaryrefslogtreecommitdiff
path: root/Concise_Physics_by_H_Matyaka/3-Waves.ipynb
blob: d4a2733258ec561a322bcf286fdf24b54cdb0a94 (plain)
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
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 3: Waves"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.1: refraction_and_incidence_angle.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//calculation of angle of refraction\n",
"rj=(sind(6)/0.76)//from snells law\n",
"x=asind(rj)\n",
"printf('the refractive index of jelly is %3.3f deg',x)\n",
"// calculating angle of incidence\n",
"printf('\nsince angle of refraction and angle of incidence are alternate angles , angle of incidence is %3.3f deg',x)\n",
"//calculating angle of refraction\n",
"np=0.59/0.76 // according to relationship of media\n",
"jnp=sind(7.9)/0.78\n",
"rp=asind(jnp)\n",
"printf('\nthe angle of refraction  is %3.3f deg',rp)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.2: critical_angle.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//input data\n",
"a=1.28 //refractive index of X\n",
"b=1.41 //refractive index of Y\n",
"//calculation of condition for total internal reflection\n",
"x=(a/b) \n",
"c=asind(x) // calculating critical angle\n",
"//output\n",
"printf('light incident with an angle greater than %3.3f degrees will be totally internally reflected',c)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.3: wavespeed_in_medium.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//input data\n",
"nb=0.67 //refractive index\n",
"va=3.45*10^3\n",
"//calculation\n",
"vb=va/nb //snells law\n",
"//output\n",
"printf('the speed of the wave in medium b is %3.3f m/s',vb)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.4: frequency_for_antinode.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//input data\n",
"f=120 //lowest frequency \n",
"//calculation\n",
"x=3*f // the next higher frequency is thrice the lowest frequency\n",
"//output\n",
"printf('the next higher frequency where the antinode is formed is at %3.3f Hz',x)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.5: wave_frequency_speed.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//input data\n",
"amp=3.4*10^-5 //amplitude of the wave\n",
"af=5.7*10^2 //angular frequency\n",
"k=20 //wavenumber\n",
"//calculation\n",
"//wave frequency\n",
"f=af/(2*%pi)\n",
"l=(2*%pi)/k\n",
"v=f*l\n",
"printf('the wave frequency is %3.3f and the speed is %3.3f  m/s',f,v)\n",
"//calculating greatest speed for the wave to pass through\n",
"vmax=af*amp //greatest speed\n",
"//output\n",
"printf('\nthe greatest value of speed for the wave to pass through is %3.3f m/s',vmax)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 3.6: wave_attributes.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"k=16\n",
"w=23\n",
"//calculation\n",
"//1.wavelength\n",
"l=2*%pi/k\n",
"//output\n",
"printf('the wavelength is %3.3f m',l)\n",
"//2.wavespeed\n",
"v=(l*w)/(2*%pi)\n",
"printf('\nthe wavespeed is %3.3f m/s',v)\n",
"//3.pase difference\n",
"pha=(0.5*2*%pi)/0.39 // phase difference of molecules 0.5m apart \n",
"printf('\n the phase difference is %3.3f radians',pha)"
   ]
   }
],
"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
}