(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 18649, 558] NotebookOptionsPosition[ 18175, 538] NotebookOutlinePosition[ 18536, 554] CellTagsIndexPosition[ 18493, 551] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "The first three stationary states of a particle in the potential V=", Cell[BoxData[ StyleBox[ RowBox[{ StyleBox[" ", FontColor->GrayLevel[0]], RowBox[{ StyleBox["g", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"(", RowBox[{"1", "-", FractionBox["2", RowBox[{"1", "+", SuperscriptBox[ RowBox[{"Tanh", "[", RowBox[{"\[Lambda]", " ", "x"}], "]"}], "2"]}]]}], ")"}], FontColor->GrayLevel[0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]]}]}], "Text", Background->GrayLevel[1]]], CellChangeTimes->{{3.430861973809867*^9, 3.4308620612355795`*^9}, { 3.430862188508589*^9, 3.4308622096790304`*^9}, {3.4308623033637424`*^9, 3.4308623499807744`*^9}, {3.4308625117233486`*^9, 3.4308625179623203`*^9}, {3.430862854816693*^9, 3.4308629070618176`*^9}, { 3.430862962992242*^9, 3.4308629846233454`*^9}, {3.4308631029034243`*^9, 3.430863145684941*^9}}] }], "Section", CellChangeTimes->{{3.430863315238747*^9, 3.4308633785798273`*^9}, { 3.43108498897875*^9, 3.431084989588125*^9}}], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{ StyleBox[ RowBox[{ "The", " ", "code", " ", "below", " ", "solves", " ", "the", " ", "time"}], "Text"], StyleBox["-", "Text"], RowBox[{ StyleBox["independent", "Text"], StyleBox[" ", "Text"], StyleBox[ StyleBox[ RowBox[{"Sc", StyleBox[ StyleBox[ StyleBox["h", "Text", FontColor->RGBColor[0, 0, 1]], "Text", FontColor->RGBColor[0, 0, 1]], "Text", FontColor->RGBColor[0, 0, 1]], "roedinger"}]], "Text"], StyleBox[" ", "Text"], StyleBox["equation", "Text"], StyleBox[" ", "Text"], StyleBox["for", "Text"], StyleBox[" ", "Text"], StyleBox["the", "Text"], StyleBox[" ", "Text"], StyleBox["potential", "Text"], StyleBox[ StyleBox[ RowBox[{" ", " "}]], "Text"], StyleBox["V", "Text"]}]}], StyleBox["=", "Text"], RowBox[{ RowBox[{ StyleBox["10", "Text", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["(", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"1", "-", FractionBox["2", RowBox[{"1", "+", SuperscriptBox[ RowBox[{"Tanh", "[", RowBox[{"\[Lambda]", " ", "x"}], "]"}], "2"]}]]}], "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[")", "Text", FontColor->RGBColor[0, 0, 1]]}], StyleBox[ RowBox[{ StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], " "}]], StyleBox["with", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["the", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["boundary", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["condition", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["that", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"\[Psi]", "[", RowBox[{"-", "\[Infinity]"}], "]"}], "Text", FontColor->RGBColor[0, 0, 1]]}], StyleBox["=", "Text", FontColor->RGBColor[0, 0, 1]], RowBox[{ RowBox[{ StyleBox["0", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], " "}]], RowBox[{ StyleBox["(", "Text", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["and", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["an", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["arbitrary", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["normalization", "Text", FontColor->RGBColor[0, 0, 1]]}], StyleBox[")", "Text", FontColor->RGBColor[0, 0, 1]]}], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["and", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["an", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["energy", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"En", ".", " ", "For"}], "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["a", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["random", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["value", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["of", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["En", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["the", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["solution", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["will", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["not", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["be", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["zero", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["at", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["x", "Text", FontColor->RGBColor[0, 0, 1]]}], StyleBox["=", "Text", FontColor->RGBColor[0, 0, 1]], RowBox[{ RowBox[{ StyleBox["\[Infinity]", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["and", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["is", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["not", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ StyleBox[ RowBox[{" ", " "}]], "Text", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["acceptable", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[".", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ StyleBox[ RowBox[{ StyleBox[ StyleBox[ StyleBox[ StyleBox["F", "Text", FontColor->RGBColor[0, 0, 1]], "Text", FontColor->RGBColor[0, 0, 1]], "Text", FontColor->RGBColor[0, 0, 1]], "Text", FontColor->RGBColor[0, 0, 1]], "or"}]], "Text", FontColor->RGBColor[0, 0, 1]]}], StyleBox[ StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ StyleBox[ RowBox[{ StyleBox["c", "Text", FontColor->RGBColor[0, 0, 1]], "ertain"}]], "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["magic", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["values", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["of", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["En", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["the", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], "solution", StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["will", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox["satisfy", "Text", FontColor->RGBColor[0, 0, 1]], StyleBox[ StyleBox[ RowBox[{" ", " "}]], "Text", FontColor->RGBColor[0, 0, 1]], RowBox[{"\[Psi]", "[", "\[Infinity]", "]"}]}], "=", RowBox[{"0", " ", "and", " ", "is", " ", RowBox[{"acceptable", ".", " ", "Those"}], " ", "are", " ", "the", " ", "energy", " ", "eigenvalues", " ", "of", " ", "the", " ", RowBox[{"system", ".", " "}]}]}]}]}]}], FontColor->RGBColor[0, 0, 1]]], "Input", CellChangeTimes->{{3.430861973809867*^9, 3.4308620612355795`*^9}, { 3.430862188508589*^9, 3.4308622096790304`*^9}, {3.4308623033637424`*^9, 3.4308623499807744`*^9}, {3.4308625117233486`*^9, 3.4308625179623203`*^9}, { 3.430862854816693*^9, 3.4308629070618176`*^9}, {3.430862962992242*^9, 3.4308629846233454`*^9}, {3.4308631029034243`*^9, 3.430863145684941*^9}, { 3.4308633830162067`*^9, 3.43086339087751*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"En", "="}], ";", RowBox[{"(*", " ", RowBox[{ "put", " ", "your", " ", "guess", " ", "for", " ", "En", " ", "here"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"even", "=", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", FractionBox[ SuperscriptBox["hbar", "2"], RowBox[{"2", " ", "m"}]]}], RowBox[{ RowBox[{"\[Psi]", "''"}], "[", "x", "]"}]}], "+", RowBox[{ RowBox[{"V", "[", "x", "]"}], " ", RowBox[{"\[Psi]", "[", "x", "]"}]}]}], "\[Equal]", RowBox[{"En", " ", RowBox[{"\[Psi]", "[", "x", "]"}]}]}], ",", " ", RowBox[{ RowBox[{"\[Psi]", "[", RowBox[{"-", "inf"}], "]"}], "\[Equal]", "0"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"\[Psi]", "'"}], "[", "0", "]"}], "\[Equal]", "5"}]}], "}"}], ",", " ", "\[Psi]", ",", " ", RowBox[{"{", RowBox[{"x", ",", " ", RowBox[{"-", "inf"}], ",", " ", "inf"}], "}"}]}], "]"}]}], ";", " ", RowBox[{"(*", " ", RowBox[{"this", " ", "finds", " ", "even", " ", "solutions"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"\[Psi]", "[", "x", "]"}], "/.", "even"}], "]"}], ",", " ", RowBox[{"V", "[", "x", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "inf"}], ",", " ", "inf"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]}]], "Input", CellChangeTimes->{3.4308631779413233`*^9}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"hbar", "=", "1"}], ";"}], " ", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{ "we", " ", "use", " ", "a", " ", "funny", " ", "unit", " ", "system", " ", "here", " ", "where", " ", "hbar"}], "=", "1"}], " ", "*)"}], FontColor->RGBColor[1, 0, 0]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"m", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"inf", "=", "6"}], ";", " ", StyleBox[ RowBox[{"(*", " ", RowBox[{ RowBox[{ "the", " ", "width", " ", "of", " ", "the", " ", "potential", " ", "is", " ", RowBox[{"about", " ", "~", "1"}], " ", "and", " ", "\"\\"", " ", "is", " ", "taken"}], ",", " ", RowBox[{"for", " ", "numerical", " ", "reasons"}], ",", " ", RowBox[{ "to", " ", "be", " ", "6.", " ", "Any", " ", "other", " ", "number", " ", "much", " ", "larger", " ", "than", " ", "the", " ", "width", " ", "of", " ", "the", " ", "potential", " ", "will", " ", RowBox[{"do", "."}]}]}], " ", "*)"}], FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", RowBox[{"\[Lambda]", "=", "1."}], " ", ";", RowBox[{ RowBox[{"V", "[", "x_", "]"}], ":=", RowBox[{"10", RowBox[{"(", RowBox[{"1", "-", FractionBox["2", RowBox[{"1", "+", SuperscriptBox[ RowBox[{"Tanh", "[", RowBox[{"\[Lambda]", " ", "x"}], "]"}], "2"]}]]}], ")"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"En", "="}], ";", RowBox[{"(*", " ", RowBox[{ "put", " ", "your", " ", "guess", " ", "for", " ", "En", " ", "here"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"even", "=", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", RowBox[{ RowBox[{"\[Psi]", "''"}], "[", "x", "]"}]}], "+", RowBox[{ FractionBox[ RowBox[{"2", "m"}], SuperscriptBox["hbar", "2"]], RowBox[{"V", "[", "x", "]"}], " ", RowBox[{"\[Psi]", "[", "x", "]"}]}]}], "\[Equal]", RowBox[{ FractionBox[ RowBox[{"2", "m"}], SuperscriptBox["hbar", "2"]], "En", " ", RowBox[{"\[Psi]", "[", "x", "]"}]}]}], ",", " ", RowBox[{ RowBox[{"\[Psi]", "[", RowBox[{"-", "inf"}], "]"}], "\[Equal]", "0"}], ",", " ", RowBox[{ RowBox[{"\[Psi]", "[", "0", "]"}], "\[Equal]", "5."}]}], "}"}], ",", " ", "\[Psi]", ",", " ", RowBox[{"{", RowBox[{"x", ",", " ", RowBox[{"-", "inf"}], ",", " ", "inf"}], "}"}]}], "]"}]}], ";", " ", RowBox[{"(*", " ", RowBox[{"this", " ", "finds", " ", "even", " ", "solutions"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"\[Psi]", "[", "x", "]"}], "/.", "even"}], "]"}], ",", " ", RowBox[{"V", "[", "x", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "inf"}], ",", " ", "inf"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]}]}], "Input", CellChangeTimes->{{3.4309250808032675`*^9, 3.4309251281513505`*^9}, { 3.430925169430707*^9, 3.430925169951456*^9}, {3.430925218771656*^9, 3.430925226532816*^9}, {3.43092554834556*^9, 3.4309256825785775`*^9}, { 3.430925796732723*^9, 3.43092584452144*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"En", "="}], ";", RowBox[{"(*", " ", RowBox[{ "put", " ", "your", " ", "guess", " ", "for", " ", "En", " ", "here"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"even", "=", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", RowBox[{ RowBox[{"\[Psi]", "''"}], "[", "x", "]"}]}], "+", RowBox[{ FractionBox[ RowBox[{"2", "m"}], SuperscriptBox["hbar", "2"]], RowBox[{"V", "[", "x", "]"}], " ", RowBox[{"\[Psi]", "[", "x", "]"}]}]}], "\[Equal]", RowBox[{ FractionBox[ RowBox[{"2", "m"}], SuperscriptBox["hbar", "2"]], "En", " ", RowBox[{"\[Psi]", "[", "x", "]"}]}]}], ",", " ", RowBox[{ RowBox[{"\[Psi]", "[", RowBox[{"-", "inf"}], "]"}], "\[Equal]", "0"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"\[Psi]", "'"}], "[", "0", "]"}], "\[Equal]", "10."}]}], "}"}], ",", " ", "\[Psi]", ",", " ", RowBox[{"{", RowBox[{"x", ",", " ", RowBox[{"-", "inf"}], ",", " ", "inf"}], "}"}]}], "]"}]}], ";", " ", RowBox[{"(*", " ", RowBox[{"this", " ", "finds", " ", "odd", " ", "solutions"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"\[Psi]", "[", "x", "]"}], "/.", "even"}], "]"}], ",", " ", RowBox[{"V", "[", "x", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "inf"}], ",", " ", "inf"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.430925877168384*^9, 3.4309259363134303`*^9}}] }, Open ]] }, WindowSize->{979, 773}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification->1.25, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (April 20, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 1129, 30, 131, "Section"], Cell[1722, 55, 9322, 274, 168, "Input"], Cell[11047, 331, 1752, 51, 132, "Input"], Cell[12802, 384, 3511, 96, 283, "Input"], Cell[16316, 482, 1843, 53, 129, "Input"] }, Open ]] } ] *) (* End of internal cache information *)