{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Exploration of discrete states \n", "#### J Wang, _UMass Dartmouth_, www.faculty.umassd.edu/j.wang/\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 1 Discrete energies (not as weird as it seems) \n", "- Visually manipulate possible wave function of Schrodiner eqn in a 1D box.\n", "- Wave function ($A,B,k = $ adjustable parameters): $ \\frac{d^2\\psi}{dx}+ k^2 \\psi=0, \\quad \\psi = A \\cos(kx )+ B \\sin(k x ), \\quad k = \\frac{\\sqrt{2mE}}{\\hbar}$\n", "- Activity: Interactively inspect the wave function to observe that discrete energies are a natural result of finding continuous wave functions. " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Load libraries, initialize, actual templates for my class to use in HW" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "from ipywidgets import interact\n", "import matplotlib.pyplot as plt\n", "from numpy import *\n", "\n", "a = 1.0 # width\n", "x = linspace(0, a, 100) # grid" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "fragment" } }, "source": [ "#### Main visualization $\\quad \\psi = A \\cos(kx )+ B \\sin(k x ), \\quad k=n\\pi/a$" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "def psi(A, B, k):\n", " wf = A*cos(k*x) + B*sin(k*x)\n", " return wf\n", "\n", "def plotwf(A=1, B=1, n=1.2):\n", " plt.plot([0, 0, a, a],[1, 0, 0, 1], 'k-') # the well\n", " wf = psi(A, B, n*pi/a)\n", " plt.plot(x, wf, 'b-', lw=2) # plot w.f.\n", " plt.xlabel('x'), plt.ylabel('Wave function')" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Interactive plotting, $ \\psi = A \\cos(kx )+ B \\sin(k x ), \\quad k=n\\frac{\\pi}{a}$" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": false, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "57f2cb12b5794da0b1a0c4d4ae62e13d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(FloatSlider(value=1.0, description='A', max=1.0), FloatSlider(value=1.0, description='B'…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "interact(plotwf, A = (0,1,0.1), B=(0,1,0.1), n=(0,5,.2));" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true, "slideshow": { "slide_type": "slide" } }, "source": [ "### Observations, $ \\psi = A \\cos(kx )+ B \\sin(k x ), \\quad k=n\\pi/a$\n", "1. \"$A$\" must be 0 for $\\psi(x=0)$ to be zero for arbitrary $B$ and $n$.\n", "3. \"$B$\" controls scale only (normalization), $\\psi = B \\sin(k x )$.\n", "3. \"$n$\" must be an integer for $\\psi(x=a)$ to be zero.\n", "4. Only when $n=$ an integer will $\\psi$ be continuous across the well to the outside where $\\psi=0$.\n", "5. Discrete $n$, hence discrete energies, are a natural result of obtaining physically acceptable, continuous solutions from an ODE.\n", "6. Discrete energies are as natural as discrete harmonics on a guitar string from classical mechanics." ] } ], "metadata": { "kernelspec": { "display_name": "VPython", "language": "python", "name": "vpython" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.0" } }, "nbformat": 4, "nbformat_minor": 1 }