(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 5512, 187]*) (*NotebookOutlinePosition[ 6280, 214]*) (* CellTagsIndexPosition[ 6236, 210]*) (*WindowFrame->Normal*) Notebook[{ Cell["Laplace Transforms, the Heaviside and Dirac Delta Functions", "Title"], Cell["\<\ H. Edward Donley, Indiana University of Pennsylvania, \ hedonley@iup.edu\ \>", "Subtitle"], Cell[CellGroupData[{ Cell["Laplace Transforms", "Section"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " knows the standard Laplace transform rules." }], "Text"], Cell[BoxData[{ \(Clear[t, s]\), "\[IndentingNewLine]", \(LaplaceTransform[t\^2, \ t, \ s]\)}], "Input"], Cell["And, of course, it knows the inverse Laplace transform, too.", "Text"], Cell[BoxData[{ \(Clear[t, s]\), "\[IndentingNewLine]", \(InverseLaplaceTransform[2\/s\^3, \ s, \ t]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Heaviside and Dirac Delta Functions", "Section"], Cell[TextData[{ "The unit step function, or Heaviside function is ", StyleBox["UnitStep[t]", FontFamily->"Courier"], ". Here is its graph." }], "Text"], Cell[BoxData[ \(\(Plot[UnitStep[t], {t, \(-3\), 3}];\)\)], "Input"], Cell[TextData[{ "What does ", StyleBox["UnitStep[Sin[t]]", FontFamily->"Courier"], " produce? Don't cheat! Try to figure it out before looking at the \ graph." }], "Text"], Cell[BoxData[ \(\(Plot[UnitStep[Sin[t]], {t, 0, 8 \[Pi]}, Ticks \[Rule] {{0, \[Pi], 2 \[Pi], 3 \[Pi], 4 \[Pi], 5 \[Pi], 6 \[Pi], 7 \[Pi], 8 \[Pi]}, Automatic}];\)\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " also understands the Dirac delta function, denoted by DiracDelta[t]. If \ you evaluate the Dirac delta function at any value other than zero, the \ result will be zero. DiracDelta[0] is undefined." }], "Text"], Cell[BoxData[ \(TableForm[Table[{t, DiracDelta[t]}, {t, \(-3\), 3}]]\)], "Input"], Cell["\<\ If you integrate the product of any function, f[t], and the Dirac \ delta function, over any interval including zero, you will get f[0].\ \>", \ "Text"], Cell[BoxData[{ \(Clear[f, t]\), "\[IndentingNewLine]", \(\[Integral]\_\(-2\)\%3 f[t]\ DiracDelta[ t] \[DifferentialD]t\)}], "Input"], Cell["\<\ Or, if you shift the delta function, you get the value of f at some \ other point.\ \>", "Text"], Cell[BoxData[{ \(Clear[f, t]\), "\[IndentingNewLine]", \(\[Integral]\_\(-2\)\%3 f[t]\ DiracDelta[ t - 1] \[DifferentialD]t\)}], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " knows the derivative of the unit step function." }], "Text"], Cell[BoxData[ \(\[PartialD]\_t\ UnitStep[t]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Solving Initial Value Problems", "Section"], Cell["Here is the electrical circuit problem from class.", "Text"], Cell[BoxData[{ \(Clear[q, t]\), "\n", \(diffEqn\ = \ 10\^6\ \(q'\)[t]\ + \ 10\^5\ q[t]\ == \ 3\ - \ 3\ UnitStep[t - 2]\)}], "Input"], Cell["Let's take the Laplace transform of the equation.", "Text"], Cell[BoxData[ \(transformed\ = \ LaplaceTransform[diffEqn, \ t, s]\)], "Input"], Cell["And now we need to incorporate the initial conditions.", "Text"], Cell[BoxData[ \(transformed2\ = \ transformed\ /. \ q[0]\ -> \ 0\)], "Input"], Cell["This is an algebraic equation that we can solve for Q[s].", "Text"], Cell[BoxData[{ \(\(soln\ = \ Solve[transformed2, \ LaplaceTransform[q[t], t, s]];\)\), "\n", \(Q[s_]\ = \ LaplaceTransform[q[t], t, s]\ /. \ soln[\([1]\)]\)}], "Input"], Cell["and now we can take the inverse transform", "Text"], Cell[BoxData[ \(q[t_]\ = \ InverseLaplaceTransform[Q[s], \ s, \ t]\)], "Input"], Cell["Here is its graph. Notice the abrupt change in the current.", "Text"], Cell[BoxData[ \(\(Plot[q[t], \ {t, 0, 20}];\)\)], "Input"] }, Closed]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1920}, {0, 1127}}, AutoGeneratedPackage->None, WindowSize->{1096, 904}, WindowMargins->{{4, Automatic}, {Automatic, 1}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, StyleDefinitions -> "Demo.nb" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1717, 49, 76, 0, 56, "Title"], Cell[1796, 51, 100, 3, 21, "Subtitle"], Cell[CellGroupData[{ Cell[1921, 58, 37, 0, 82, "Section"], Cell[1961, 60, 128, 4, 30, "Text"], Cell[2092, 66, 112, 2, 55, "Input"], Cell[2207, 70, 76, 0, 30, "Text"], Cell[2286, 72, 122, 2, 67, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[2445, 79, 54, 0, 51, "Section"], Cell[2502, 81, 162, 5, 30, "Text"], Cell[2667, 88, 71, 1, 34, "Input"], Cell[2741, 91, 183, 6, 30, "Text"], Cell[2927, 99, 211, 3, 34, "Input"], Cell[3141, 104, 283, 6, 30, "Text"], Cell[3427, 112, 85, 1, 34, "Input"], Cell[3515, 115, 162, 4, 30, "Text"], Cell[3680, 121, 151, 3, 67, "Input"], Cell[3834, 126, 106, 3, 30, "Text"], Cell[3943, 131, 155, 3, 67, "Input"], Cell[4101, 136, 132, 4, 30, "Text"], Cell[4236, 142, 60, 1, 34, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[4333, 148, 49, 0, 51, "Section"], Cell[4385, 150, 66, 0, 30, "Text"], Cell[4454, 152, 161, 4, 54, "Input"], Cell[4618, 158, 65, 0, 30, "Text"], Cell[4686, 160, 84, 1, 34, "Input"], Cell[4773, 163, 70, 0, 30, "Text"], Cell[4846, 165, 84, 1, 34, "Input"], Cell[4933, 168, 73, 0, 30, "Text"], Cell[5009, 170, 196, 4, 54, "Input"], Cell[5208, 176, 57, 0, 30, "Text"], Cell[5268, 178, 84, 1, 34, "Input"], Cell[5355, 181, 76, 0, 30, "Text"], Cell[5434, 183, 62, 1, 34, "Input"] }, Closed]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)