Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "In classical physics, where the speeds of source and the receiver relative to the medium are lower than the velocity of waves in the medium, the relationship between observed frequency $f$ and emitted frequency $f_\\text{0}$ is given by\n",
  8. "\\begin{equation}\n",
  9. "f = \\left( \\frac{c + v_\\text{r}}{c + v_\\text{s}} \\right) f_0 \\,\n",
  10. "\\end{equation}\n",
  11. "here\n",
  12. "* $c \\;$ is the velocity of waves in the medium;\n",
  13. "* $v_\\text{r} \\,$ is the velocity of the receiver relative to the medium; positive if the receiver is moving towards the source (and negative in the other direction);\n",
  14. "* $v_\\text{s} \\,$ is the velocity of the source relative to the medium; positive if the source is moving away from the receiver (and negative in the other direction).\n",
  15. "\n",
  16. "The frequency is decreased if either is moving away from the other."
  17. ]
  18. },
  19. {
  20. "cell_type": "code",
  21. "execution_count": 3,
  22. "metadata": {
  23. "collapsed": true
  24. },
  25. "outputs": [],
  26. "source": [
  27. "def f(c,vr,vs,f0):\n",
  28. " return ((c + vr) / (c + vs)) * f0 "
  29. ]
  30. },
  31. {
  32. "cell_type": "markdown",
  33. "metadata": {},
  34. "source": [
  35. "the ambulance is approaching you"
  36. ]
  37. },
  38. {
  39. "cell_type": "code",
  40. "execution_count": 5,
  41. "metadata": {
  42. "collapsed": false
  43. },
  44. "outputs": [
  45. {
  46. "data": {
  47. "text/plain": [
  48. "743.3168316831684"
  49. ]
  50. },
  51. "execution_count": 5,
  52. "metadata": {},
  53. "output_type": "execute_result"
  54. }
  55. ],
  56. "source": [
  57. "c=343.2\n",
  58. "vr=0\n",
  59. "vs=-20\n",
  60. "f0=700\n",
  61. "f(c,vr,vs,f0)"
  62. ]
  63. },
  64. {
  65. "cell_type": "markdown",
  66. "metadata": {},
  67. "source": [
  68. "the ambulance is driving away from you"
  69. ]
  70. },
  71. {
  72. "cell_type": "code",
  73. "execution_count": 6,
  74. "metadata": {
  75. "collapsed": false
  76. },
  77. "outputs": [
  78. {
  79. "data": {
  80. "text/plain": [
  81. "661.453744493392"
  82. ]
  83. },
  84. "execution_count": 6,
  85. "metadata": {},
  86. "output_type": "execute_result"
  87. }
  88. ],
  89. "source": [
  90. "c=343.2\n",
  91. "vr=0\n",
  92. "vs=20\n",
  93. "f0=700\n",
  94. "f(c,vr,vs,f0)"
  95. ]
  96. },
  97. {
  98. "cell_type": "markdown",
  99. "metadata": {},
  100. "source": [
  101. "You are approaching the ambulance"
  102. ]
  103. },
  104. {
  105. "cell_type": "code",
  106. "execution_count": 7,
  107. "metadata": {
  108. "collapsed": false
  109. },
  110. "outputs": [
  111. {
  112. "data": {
  113. "text/plain": [
  114. "740.7925407925408"
  115. ]
  116. },
  117. "execution_count": 7,
  118. "metadata": {},
  119. "output_type": "execute_result"
  120. }
  121. ],
  122. "source": [
  123. "c=343.2\n",
  124. "vr=20\n",
  125. "vs=0\n",
  126. "f0=700\n",
  127. "f(c,vr,vs,f0)"
  128. ]
  129. },
  130. {
  131. "cell_type": "markdown",
  132. "metadata": {},
  133. "source": [
  134. "You are running away from the police car"
  135. ]
  136. },
  137. {
  138. "cell_type": "code",
  139. "execution_count": 8,
  140. "metadata": {
  141. "collapsed": false
  142. },
  143. "outputs": [
  144. {
  145. "data": {
  146. "text/plain": [
  147. "659.2074592074592"
  148. ]
  149. },
  150. "execution_count": 8,
  151. "metadata": {},
  152. "output_type": "execute_result"
  153. }
  154. ],
  155. "source": [
  156. "c=343.2\n",
  157. "vr=-20\n",
  158. "vs=0\n",
  159. "f0=700\n",
  160. "f(c,vr,vs,f0)"
  161. ]
  162. },
  163. {
  164. "cell_type": "markdown",
  165. "metadata": {},
  166. "source": [
  167. "If nothing is moving "
  168. ]
  169. },
  170. {
  171. "cell_type": "code",
  172. "execution_count": 9,
  173. "metadata": {
  174. "collapsed": false
  175. },
  176. "outputs": [
  177. {
  178. "data": {
  179. "text/plain": [
  180. "700.0"
  181. ]
  182. },
  183. "execution_count": 9,
  184. "metadata": {},
  185. "output_type": "execute_result"
  186. }
  187. ],
  188. "source": [
  189. "c=343.2\n",
  190. "vr=0\n",
  191. "vs=0\n",
  192. "f0=700\n",
  193. "f(c,vr,vs,f0)"
  194. ]
  195. },
  196. {
  197. "cell_type": "code",
  198. "execution_count": null,
  199. "metadata": {
  200. "collapsed": true
  201. },
  202. "outputs": [],
  203. "source": []
  204. }
  205. ],
  206. "metadata": {
  207. "kernelspec": {
  208. "display_name": "Python 2",
  209. "language": "python",
  210. "name": "python2"
  211. },
  212. "language_info": {
  213. "codemirror_mode": {
  214. "name": "ipython",
  215. "version": 2
  216. },
  217. "file_extension": ".py",
  218. "mimetype": "text/x-python",
  219. "name": "python",
  220. "nbconvert_exporter": "python",
  221. "pygments_lexer": "ipython2",
  222. "version": "2.7.9"
  223. }
  224. },
  225. "nbformat": 4,
  226. "nbformat_minor": 0
  227. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement