(* 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[ 832472, 41540] NotebookOptionsPosition[ 824495, 41322] NotebookOutlinePosition[ 825053, 41343] CellTagsIndexPosition[ 825010, 41340] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Solving Partial Differential Equations using Integral Transforms\ \>", "Title"], Cell["\<\ Up to this point, we have employed the method of separation of variables to \ solve partial differential equations. Now let's look at applying integral \ transforms, specifically Foruier transforms and Laplace transforms. As usual, \ our goal in applying transform methods is to reduce the problem to one that \ is easier to solve and then to apply the inverse transform to the solution of \ the easier problem to obtain the desired solution to the original problem. \ When dealing with ODEs, we typically applied a transform to obtain an \ algebraic equation to solve. Here we will see that the transform will produce \ a problem where the number of independent variables has again been reduced by \ one, so that we obtain an ODE to solve for the transform of the desired \ solution.\ \>", "Text"], Cell[TextData[{ "To be concrete, let us consider a particular example problem of unsteady \ heat conduction in a thin, infinitely long rod that is insulated along its \ length. Assuming that there is no significant temperature variation across a \ transverse section of the rod, the temperature ", Cell[BoxData[ FormBox[ RowBox[{"u", "(", RowBox[{"x", ",", "t"}], ")"}], TraditionalForm]]], " is governed by the one-dimensional heat equation:" }], "Text"], Cell[TextData[{ "\n", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["u", "t"], "=", RowBox[{ SuperscriptBox["c", "2"], SubscriptBox["u", "xx"]}]}], " ", ",", " ", RowBox[{ RowBox[{"u", "(", RowBox[{"x", ",", "0"}], ")"}], " ", "=", " ", RowBox[{"f", "(", "x", ")"}]}], " ", ",", " ", RowBox[{ RowBox[{"-", "\[Infinity]"}], "<", "x", "<", "\[Infinity]"}], " ", ",", " ", RowBox[{"0", "\[LessEqual]", "t", "<", "\[Infinity]", " "}]}], TraditionalForm]]], "." }], "Text"], Cell["Let's consider various approaches to solving this problem.", "Text"], Cell[CellGroupData[{ Cell["Separation of variables", "Section"], Cell[TextData[{ "Note that if we apply separation of variables and look for a solution of \ the form ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"u", "(", RowBox[{"x", ",", "t"}], ")"}], "=", RowBox[{ RowBox[{"X", "(", "x", ")"}], " ", RowBox[{"T", "(", "t", ")"}]}]}], TraditionalForm]]], ", everything would go smoothly and we would obtain the following separated \ equations:" }], "Text"], Cell[TextData[{ Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ RowBox[{"T", "'"}], " ", "+", " ", RowBox[{ SuperscriptBox["c", "2"], SuperscriptBox["k", "2"], "T"}]}], " ", "=", " ", "0"}], " ", ",", " ", RowBox[{ RowBox[{ RowBox[{"X", "''"}], " ", "+", " ", RowBox[{ SuperscriptBox["k", "2"], "X"}]}], " ", "=", " ", "0"}]}], TraditionalForm]]], "\n\nwhere ", Cell[BoxData[ FormBox[ SuperscriptBox["k", "2"], TraditionalForm]]], " is the separation constant.These equations should look familiar and lead \ to solutions of the form" }], "Text"], Cell[TextData[{ Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["u", "n"], "(", RowBox[{"x", ",", "t"}], ")"}], "=", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ SubscriptBox["A", "n"], RowBox[{"Cos", "(", "kx", ")"}]}], " ", "+", " ", RowBox[{ SubscriptBox["B", "n"], " ", RowBox[{"Sin", "(", "kx", ")"}]}]}], ")"}], " ", RowBox[{"Exp", "(", RowBox[{ RowBox[{"-", SuperscriptBox["c", "2"]}], SuperscriptBox["k", "2"], " ", "t"}], ")"}]}]}], TraditionalForm]]], "." }], "Text"], Cell[TextData[{ "This is when we would normally apply boundary conditions to detemine \ allowed values of ", Cell[BoxData[ FormBox["k", TraditionalForm]]], ". However, we do not have such boundary conditions to apply in this \ problem. Instead of a discrete spectrum of allowed frequencies (or periods) \ for the eigenfunctions, we now have a continuous spectrum, and we should \ expect our solution to be in the form of an integral rather than a summation. \ This is exactly the same situation we ran into when we looked at ODEs with \ periodic inputs (described by Fourier series) and let the period become \ unbounded to arrive at the Fourier integral and Fourier transform. (Note that \ there are also finite Fourier transforms for handling problems on a finite \ domain, but we will not need them here.)" }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Fourier Transform", "Section"], Cell[TextData[{ "Let's take that as a hint to now apply the Fourier transform to our PDE. \ The first issue to deal with is to determine which of the two independent \ variables we should apply the transform to. Recall that the Fourier transform \ involves a doubly infinite domain (i.e., ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"-", "\[Infinity]"}], "<", "x", "<", "\[Infinity]"}], TraditionalForm]]], "), so let's apply the Fourier transform to the spatial variable. Recall the \ Fourier transform pair:" }], "Text"], Cell[TextData[{ Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[ScriptCapitalF]", RowBox[{"{", RowBox[{"u", "(", RowBox[{"x", ",", "t"}], ")"}], "}"}]}], " ", "=", RowBox[{ RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], RowBox[{ SubsuperscriptBox["\[Integral]", RowBox[{"-", "\[Infinity]"}], "\[Infinity]"], RowBox[{ RowBox[{"u", "(", RowBox[{"x", ",", "t"}], ")"}], SuperscriptBox["e", RowBox[{"-", "i\[Omega]x"}]], RowBox[{"\[DifferentialD]", "x"}]}]}]}], "=", RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], " "}]}], TraditionalForm]]], "\n\n", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ";", "t"}], ")"}], "=", RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], RowBox[{ SubsuperscriptBox["\[Integral]", RowBox[{"-", "\[Infinity]"}], "\[Infinity]"], RowBox[{ RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], SuperscriptBox["e", "i\[Omega]x"], RowBox[{ RowBox[{"\[DifferentialD]", "\[Omega]"}], " "}]}]}]}]}], TraditionalForm]]] }], "Text"], Cell[TextData[{ " and the operational property of how the transform works on derivatives \ with respect to the variable being transformed. Each derivative produces a \ factor of ", Cell[BoxData[ FormBox["i\[Omega]", TraditionalForm]]], ", so" }], "Text"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[ScriptCapitalF]", RowBox[{"{", RowBox[{ SubscriptBox["u", "xx"], "(", RowBox[{"x", ",", "t"}], ")"}], "}"}]}], " ", "=", RowBox[{ RowBox[{"-", SuperscriptBox["\[Omega]", "2"]}], " ", RowBox[{ RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], "."}]}]}], TraditionalForm]], "Text"], Cell["\<\ When transforming the time derivative, the derivative can be pulled outside \ the integral:\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[ScriptCapitalF]", RowBox[{"{", RowBox[{ SubscriptBox["u", "t"], "(", RowBox[{"x", ",", "t"}], ")"}], "}"}]}], " ", "=", RowBox[{ RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], RowBox[{ SubsuperscriptBox["\[Integral]", RowBox[{"-", "\[Infinity]"}], "\[Infinity]"], RowBox[{ RowBox[{ SubscriptBox["u", "t"], "(", RowBox[{"x", ",", "t"}], ")"}], SuperscriptBox["e", RowBox[{"-", "i\[Omega]x"}]], RowBox[{"\[DifferentialD]", "x"}]}]}]}], "=", " ", RowBox[{ FractionBox["\[PartialD]", RowBox[{"\[PartialD]", "t"}]], " ", RowBox[{ RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], "."}]}]}]}], TraditionalForm]], "Text"], Cell["\<\ Applying the Fourier transform to the PDE then produces an ODE for the \ Fourier transform of the solution with respect to the spatial variable:\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ FractionBox["\[PartialD]", RowBox[{"\[PartialD]", "t"}]], " ", RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}]}], "+", RowBox[{ SuperscriptBox["\[Omega]", "2"], SuperscriptBox["c", "2"], " ", RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}]}]}], " ", "=", " ", "0."}], TraditionalForm]], "Text"], Cell["\<\ If we just consider \[Omega] as a parameter, this is a familiar (linear, \ first order, constant coefficient) ODE that we know how to solve:\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{" ", RowBox[{ RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], " ", "=", " ", RowBox[{ RowBox[{"C", "(", "\[Omega]", ")"}], " ", RowBox[{ SuperscriptBox["e", RowBox[{ RowBox[{"-", SuperscriptBox["c", "2"]}], SuperscriptBox["\[Omega]", "2"], "t"}]], "."}]}]}]}], TraditionalForm]], "Text"], Cell[TextData[{ "Evaluating at ", Cell[BoxData[ FormBox[ RowBox[{"t", "=", "0"}], TraditionalForm]]], ", ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"C", "(", "\[Omega]", ")"}], " ", "=", " ", RowBox[{ RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "0"}], ")"}], " ", "=", " ", RowBox[{ OverscriptBox["f", "^"], "(", "\[Omega]", ")"}]}]}], TraditionalForm]]], "; i.e. the arbitrary \"constant\" in the solution (which is really a \ function of the parameter \[Omega]) corresponds to the Fourier transform of \ the initial temperature distribution." }], "Text"], Cell["\<\ We can now write a formal solution by applying the inverse Fourier transform:\ \ \>", "Text"], Cell[TextData[{ "u(x,t) = ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], RowBox[{ SubsuperscriptBox["\[Integral]", RowBox[{"-", "\[Infinity]"}], "\[Infinity]"], RowBox[{ RowBox[{ OverscriptBox["u", "^"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], " ", SuperscriptBox["e", "i\[Omega]x"], " ", RowBox[{"\[DifferentialD]", "\[Omega]"}]}]}]}], "=", " ", RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], RowBox[{ SubsuperscriptBox["\[Integral]", RowBox[{"-", "\[Infinity]"}], "\[Infinity]"], RowBox[{ RowBox[{ OverscriptBox["f", "^"], "(", "\[Omega]", ")"}], " ", SuperscriptBox["e", RowBox[{ RowBox[{"-", SuperscriptBox["c", "2"]}], SuperscriptBox["\[Omega]", "2"], "t"}]], " ", SuperscriptBox["e", "i\[Omega]x"], " ", RowBox[{"\[DifferentialD]", "\[Omega]"}]}]}]}]}], TraditionalForm]]], "." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Concrete example: ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "(", "x", ")"}], " ", "=", " ", RowBox[{"\[Delta]", "(", "x", ")"}]}], TraditionalForm]]] }], "Section"], Cell["\<\ To make things more specific (and so that we can plot our results), let's \ consider a specific initial temperature distribution. In particular, let's \ put a \"unit of heat\" at the origin so that the initial temperature \ distribution is a delta function. (This may not seem like an intuitive \ choice, but we will see that it is useful.)\ \>", "Text"], Cell["\<\ Recalling how the \[Delta] function operates inside an integral (it extracts \ the value of the remaining part of the integrand where the argument of the \ \[Delta] function is zero) the transform of this initial distribution \ evaluates to:\ \>", "Text"], Cell[TextData[Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox[ OverscriptBox["f", "^"], "\[Delta]"], "(", "\[Omega]", ")"}], " ", "=", " ", RowBox[{ RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], RowBox[{ SubsuperscriptBox["\[Integral]", RowBox[{"-", "\[Infinity]"}], "\[Infinity]"], RowBox[{ RowBox[{"\[Delta]", "(", "x", ")"}], " ", SuperscriptBox["e", RowBox[{"-", "i\[Omega]x"}]], RowBox[{"\[DifferentialD]", "x"}]}]}]}], " ", "=", " ", FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], " "}]}], TraditionalForm]]]], "Text"], Cell["and the transform of the corresponding solution is:", "Text"], Cell[TextData[Cell[BoxData[ FormBox[ RowBox[{" ", RowBox[{ RowBox[{ SubscriptBox[ OverscriptBox["u", "^"], "\[Delta]"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], " ", "=", " ", RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "\[Pi]"}]]], " ", SuperscriptBox["e", RowBox[{ RowBox[{"-", SuperscriptBox["c", "2"]}], SuperscriptBox["\[Omega]", "2"], "t"}]]}]}]}], TraditionalForm]]]], "Text"], Cell["\<\ and a function of this form is conveniently located as formula #9 in the \ table of Fourier transforms on p. 578 in the text which states that:\ \>", "Text"], Cell[TextData[{ Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[ScriptCapitalF]", RowBox[{"{", SuperscriptBox["e", RowBox[{"-", SuperscriptBox["ax", "2"]}]], "}"}]}], " ", "=", RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "a"}]]], SuperscriptBox["e", RowBox[{ RowBox[{ RowBox[{"-", SuperscriptBox["\[Omega]", "2"]}], "/", "4"}], "a"}]], " "}]}], TraditionalForm]]], " provided that ", Cell[BoxData[ FormBox[ RowBox[{"a", ">", "0"}], TraditionalForm]]], "." }], "Text"], Cell[TextData[{ "So if we identify ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SuperscriptBox["c", "2"], "t"}], "=", RowBox[{ RowBox[{"1", "/", "4"}], "a"}]}], TraditionalForm]]], " (and, accordingly, ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"2", "a"}]]], "=", SqrtBox[ RowBox[{"2", SuperscriptBox["c", "2"], "t"}]]}], TraditionalForm]]], "), we now have" }], "Text"], Cell[TextData[{ " ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox[ OverscriptBox["u", "^"], "\[Delta]"], "(", RowBox[{"\[Omega]", ",", "t"}], ")"}], " ", "=", " ", RowBox[{ RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"4", "\[Pi]", " ", SuperscriptBox["c", "2"], "t"}]]], " ", SuperscriptBox["e", RowBox[{ RowBox[{ RowBox[{"-", SuperscriptBox["\[Omega]", "2"]}], "/", "4"}], SuperscriptBox["c", "2"], "t"}]]}], "=", " ", RowBox[{ FractionBox["1", SqrtBox[ RowBox[{"4", "\[Pi]", " ", SuperscriptBox["c", "2"], "t"}]]], "\[ScriptCapitalF]", RowBox[{"{", SuperscriptBox["e", RowBox[{ RowBox[{"-", RowBox[{"(", RowBox[{ RowBox[{"1", "/", "4"}], SuperscriptBox["c", "2"], "t"}], ")"}]}], SuperscriptBox["x", "2"]}]], "}"}]}]}]}], TraditionalForm]]], "." }], "Text"], Cell["\<\ So the solution for the how the temperature evolves over space and time is \ given by:\ \>", "Text"], Cell[TextData[{ " ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["u", "\[Delta]"], "(", RowBox[{"x", ",", "t"}], ")"}], " ", "=", " "}], TraditionalForm]]], Cell[BoxData[ FormBox[ FractionBox["1", SqrtBox[ RowBox[{"4", "\[Pi]", " ", SuperscriptBox["c", "2"], "t"}]]], TraditionalForm]]], Cell[BoxData[ FormBox[ SuperscriptBox["e", RowBox[{ RowBox[{"-", SuperscriptBox["x", "2"]}], "/", RowBox[{"(", RowBox[{"4", SuperscriptBox["c", "2"], "t"}], ")"}]}]], TraditionalForm]]], "." }], "Text"], Cell[CellGroupData[{ Cell["Visualize the results.", "Subsection"], Cell["\<\ We can now make some plots so show how the temperature distribution evolves. \ Let's begin by creating a function corresponding to the solution and plotting \ the spatial distribution at particular values of time.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"solution", "[", RowBox[{"x_", ",", " ", "t_", ",", " ", "c_"}], "]"}], " ", ":=", " ", RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "/", RowBox[{"(", RowBox[{"4", "*", RowBox[{"c", "^", "2"}], "*", "t"}], ")"}]}], "]"}], "/", RowBox[{"Sqrt", "[", RowBox[{"4", "*", "Pi", "*", RowBox[{"c", "^", "2"}], "*", "t"}], "]"}]}]}]], "Input"], Cell["\<\ Note that plotting the function exactly at t=0 will be problematic, so let's \ start at some small positive time (t=0.00025) and look at the distribution at \ intervals of 1/2 time unit.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"solution", "[", RowBox[{"x", ",", RowBox[{"0.00025", "+", "t"}], ",", " ", "1"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", " ", RowBox[{"PlotRange", " ", "\[Rule]", " ", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"Frame", " ", "\[Rule]", " ", "True"}], ",", "\[IndentingNewLine]", RowBox[{"FrameLabel", " ", "\[Rule]", " ", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", RowBox[{"\"\