{ "metadata": { "name": "", "signature": "sha256:e0a3c82f63ba6c9b1024aa1af3173d756a9472701d2d54b4deba67c4061530ae" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "$$E(t) \\propto exp[i(\\omega_0 t - \\phi(t))]$$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "from ipywidgets import StaticInteract, RangeWidget, RadioWidget" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "$\\phi_0$ - the zeroth order phase or the absolute phase\n", "$$E(t) = E_0 exp[-(t/\\tau_G)^2]exp[i(\\omega_0 t+\\phi_0)]$$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def plot(a,b):\n", " fig, ax = plt.subplots(figsize=(5, 5),\n", " subplot_kw={'axisbg':'#EEEEEE',\n", " 'axisbelow':True})\n", " ax.grid(color='w', linewidth=2, linestyle='solid')\n", " t = np.linspace(-2*np.pi,2*np.pi,100)\n", " ax.plot(t,np.exp(-t**2/4)*np.sin(t*a+b), lw=2, alpha=0.4, label=a)\n", " ax.set_xlim(-2*np.pi, +2*np.pi)\n", " ax.legend(loc='upper right')\n", "# ax.set_ylim(-2.5, 2.5)\n", " return fig" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "StaticInteract(plot,a=RangeWidget(1., 5., 2.), b=RangeWidget(0, +2., 0.5))" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", " \n", " \n", "