{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 2 - Reflexão e refração: Lei de Snell\n", "\n", "Como é o ângulo de reflexão e refração das ondas P e S para diferentes ângulos de incidência? E como isso varia dependendo das velocidades de onda sísmica do meio? A Lei de Snell explica:\n", "\n", "$$\\dfrac{\\sin \\theta_1}{V_1} = \\dfrac{\\sin \\theta_2}{V_2}$$\n", "\n", "Nessa prática, vocês deverão usar a Lei de Snell para prever e explicar o comportamento das ondas P e S ao se depararem com uma interface. \n", "\n", "Utilizaremos as simulações de ondas da biblioteca [Fatiando a Terra](http://www.fatiando.org). Essas simulações utilizam o [método de diferenças finitas](http://en.wikipedia.org/wiki/Finite_difference_method) para calcular soluções da equação da onda." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Objetivos\n", "\n", "* Entender como funciona a Lei de Snell\n", "* Observar as previsões da Lei de Snell na propagação de ondas P e S\n", "* Checar se os valores previstos na Lei de Snell são observados nas simulações" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Questão para entregar\n", "\n", "
Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(IntSlider(value=0, description=u'tempo', max=1499, step=50), FloatSlider(value=45.0, description=u'incidencia', max=90.0, step=0.5), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def plot_with_p_rays_increasing(tempo, incidencia): \n", " fig = plt.figure()\n", " ax = plt.subplot(111)\n", " p_increase.snapshot(frame=tempo, ax=ax, cutoff=0.2, cmap='Greys')\n", " fig.set_size_inches(14, 5.5)\n", " y_bottom = shape[0]*spacing\n", " y_interface = 100*spacing\n", " y_source = fonte[0]*spacing\n", " x_source = fonte[1]*spacing\n", " x_incidence = (np.tan(np.radians(incidencia))*(y_interface - y_source)\n", " + x_source)\n", " x_reflect = 2*x_incidence - x_source\n", " arg = (vp2/vp1)*np.sin(np.radians(incidencia))\n", " if arg <= 1:\n", " refract = np.arcsin(arg)\n", " x_refract = (np.tan(refract)*(y_bottom - y_interface) + x_incidence)\n", " ax.plot([x_incidence, x_refract], [y_interface, y_bottom], '-r', linewidth=2)\n", " ax.plot([x_source, x_incidence], [y_source, y_interface], '-k', linewidth=2)\n", " ax.plot([x_incidence, x_reflect], [y_interface, 0], '-b', linewidth=2)\n", " ax.hlines(y_interface, 0, shape[1]*spacing, colors='grey')\n", " \n", "ipw.interactive(plot_with_p_rays_increasing, \n", " tempo=ipw.IntSlider(value=0, min=0, max=p_increase.it, step=50),\n", " incidencia=ipw.FloatSlider(value=45, min=0, max=90, step=0.5))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Para pensar\n", "\n", "* Como será a proporção entre o ângulo de incidência e o ângulo de reflexão?\n", "* E com o ângulo de refração? \n", "* Calcule os valores com base na Lei de Snell e cheque com o que você vê no gráfico.\n", "* Como esses ângulos se relacionam com as curvaturas das frentes de onda?\n", "* Por que no final da simulação a onda refratada se separa da onda refletida e incidente?\n", "* Por que não há refração acima de um determinado ângulo?\n", "* Qual ângulo é esse?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Incidência de ondas P em meios fluidos: V1 > V2\n", "\n", "Agora vamos ver o que acontece quando a velocidade diminui com a profundidade." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "vp1_diminui = 1500\n", "vp2_diminui = 1000" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "decrease_density = np.zeros(shape, dtype='float32') + 1500\n", "decrease_velocity = np.zeros(shape, dtype='float32') + vp1_diminui\n", "decrease_density[100:,:] = 2000\n", "decrease_velocity[100:,:] = vp2_diminui" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Novamente, crie a simulação com uma fonte explosiva no topo e a avance no tempo." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "p_decrease = FDAcoustic2D(decrease_velocity, decrease_density, spacing=spacing)\n", "p_decrease.add_point_source(fonte, RickerWavelet(1, 60))" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[##################################################] | 100% Completed | 25.1s\n" ] } ], "source": [ "p_decrease.run(1500)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " " ], "text/plain": [ "Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(IntSlider(value=0, description=u'tempo', max=1499, step=50), FloatSlider(value=45.0, description=u'incidencia', max=90.0, step=0.5), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def plot_with_p_rays_decreasing(tempo, incidencia): \n", " fig = plt.figure()\n", " ax = plt.subplot(111)\n", " p_decrease.snapshot(frame=tempo, ax=ax, cutoff=0.4, cmap='Greys')\n", " fig.set_size_inches(14, 5.5)\n", " y_bottom = shape[0]*spacing\n", " y_interface = 100*spacing\n", " y_source = fonte[0]*spacing\n", " x_source = fonte[1]*spacing\n", " x_incidence = (np.tan(np.radians(incidencia))*(y_interface - y_source)\n", " + x_source)\n", " x_reflect = 2*x_incidence - x_source\n", " arg = (vp2_diminui/vp1_diminui)*np.sin(np.radians(incidencia))\n", " if arg <= 1:\n", " refract = np.arcsin(arg)\n", " x_refract = (np.tan(refract)*(y_bottom - y_interface) + x_incidence)\n", " ax.plot([x_incidence, x_refract], [y_interface, y_bottom], '-r', linewidth=2)\n", " ax.plot([x_source, x_incidence], [y_source, y_interface], '-k', linewidth=2)\n", " ax.plot([x_incidence, x_reflect], [y_interface, 0], '-b', linewidth=2)\n", " ax.hlines(y_interface, 0, shape[1]*spacing, colors='grey')\n", " \n", "ipw.interactive(plot_with_p_rays_decreasing, \n", " tempo=ipw.IntSlider(value=0, min=0, max=p_decrease.it, step=50),\n", " incidencia=ipw.FloatSlider(value=45, min=0, max=90, step=0.5))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Para pensar\n", "\n", "* Como será a proporção entre os ângulos de incidência, reflexão e refração?\n", "* Calcule os valores com base na Lei de Snell e cheque com o que você vê no gráfico.\n", "* O que mudou em relação a simulação anterior? Isso é condizente com a Lei de Snell?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Incidência de ondas P em meios sólidos\n", "\n", "Vamos fazer agora uma simulação que inclui tanto ondas P quanto ondas S propagando em um meio sólido. A onda P irá passar para um meio com velocidades maiores." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "vp1_solido = 3000\n", "vp2_solido = 4000\n", "vs1_solido = 2000\n", "vs2_solido = 3000" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "shape2 = (300, 600)\n", "l = 150\n", "twosolid_density = np.zeros(shape2, dtype='float32') + 1800\n", "twosolid_density[l:, :] = 2100\n", "twosolid_vs = np.zeros(shape2, dtype='float32') + vs1_solido\n", "twosolid_vs[l:, :] = vs2_solido\n", "twosolid_vp = np.zeros(shape2, dtype='float32') + vp1_solido\n", "twosolid_vp[l:, :] = vp2_solido" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Rode as células abaixo para criar e rodar a simulação utilizando uma fonte explosiva na superfície." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "fonte_explosiva = (70, shape[1]//4)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "ps_twosolid = FDElasticPSV(twosolid_vp, twosolid_vs, twosolid_density, spacing=spacing)\n", "ps_twosolid.add_blast_source(fonte_explosiva, GaussianWavelet(1, 100))" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[##################################################] | 100% Completed | 39.2s\n" ] } ], "source": [ "ps_twosolid.run(1200)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " " ], "text/plain": [ "Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(IntSlider(value=0, description=u'tempo', max=1199, step=50), FloatSlider(value=45.0, description=u'incidencia', max=90.0, step=0.5), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def plot_with_ps_rays(tempo, incidencia): \n", " fig = plt.figure()\n", " ax = plt.subplot(111)\n", " ps_twosolid.snapshot(frame=tempo, ax=ax, plottype=['wavefield'], \n", " cutoff=1e-6, every_particle=10, cmap='Greys')\n", " fig.set_size_inches(14, 6.5)\n", " y_bottom = shape2[0]*spacing\n", " y_interface = l*spacing\n", " y_source = fonte_explosiva[0]*spacing\n", " x_source = fonte_explosiva[1]*spacing\n", " x_incidence = (np.tan(np.radians(incidencia))*(y_interface - y_source)\n", " + x_source) \n", " ax.plot([x_source, x_incidence], [y_source, y_interface], '-k', linewidth=2)\n", " # P reflection\n", " x_preflect = (np.tan(np.radians(incidencia))*(y_interface - 0) + x_incidence)\n", " ax.plot([x_incidence, x_preflect], [y_interface, 0], '-b', linewidth=2)\n", " # S reflection\n", " sreflect = np.arcsin((vs1_solido/vp1_solido)*np.sin(np.radians(incidencia)))\n", " x_sreflect = (np.tan(sreflect)*(y_interface - 0) + x_incidence)\n", " ax.plot([x_incidence, x_sreflect], [y_interface, 0], '--b', linewidth=2)\n", " # P refraction\n", " arg = (vp2_solido/vp1_solido)*np.sin(np.radians(incidencia))\n", " if arg <= 1:\n", " prefract = np.arcsin(arg)\n", " x_prefract = (np.tan(prefract)*(y_bottom - y_interface) + x_incidence)\n", " ax.plot([x_incidence, x_prefract], [y_interface, y_bottom], '-r', linewidth=2)\n", " # S refraction\n", " arg = (vs2_solido/vp1_solido)*np.sin(np.radians(incidencia))\n", " if arg <= 1:\n", " srefract = np.arcsin(arg)\n", " x_srefract = (np.tan(srefract)*(y_bottom - y_interface) + x_incidence)\n", " ax.plot([x_incidence, x_srefract], [y_interface, y_bottom], '--r', linewidth=2) \n", " ax.hlines(y_interface, 0, shape[1]*spacing, colors='grey')\n", " \n", "ipw.interactive(plot_with_ps_rays, \n", " tempo=ipw.IntSlider(value=0, min=0, max=ps_twosolid.it, step=50),\n", " incidencia=ipw.FloatSlider(value=45, min=0, max=90, step=0.5))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Para pensar\n", "\n", "* Como é a proporção do ângulo de reflexão das ondas P e S?\n", "* E o ângulo de refração?\n", "* Como seria se a velocidade diminuísse com a profunidade?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## License and information\n", "\n", "**Course website**: https://github.com/leouieda/geofisica2\n", "\n", "**Note**: This notebook is part of the course \"Geofísica 2\" of Geology program of the \n", "[Universidade do Estado do Rio de Janeiro](http://www.uerj.br/). \n", "All content can be freely used and adapted under the terms of the \n", "[Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).\n", "\n", "![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.14" }, "widgets": { "state": { "3f9ffb1e073544a88c867f75d0f17095": { "views": [ { "cell_index": 38 } ] }, "49d842db1e4246259d45113a478a2f85": { "views": [ { "cell_index": 27 } ] }, "90d40e86a74140bc9c04871a55cee8d2": { "views": [ { "cell_index": 17 } ] } }, "version": "1.2.0" } }, "nbformat": 4, "nbformat_minor": 1 }