(*********************************************************************** 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[ 114024, 3258]*) (*NotebookOutlinePosition[ 148514, 4429]*) (* CellTagsIndexPosition[ 147050, 4390]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Local Approximation of Global Differential Schemes", "Chapter", CounterAssignments->{{"Chapter", 4}}, CellTags->"CHA finite approx"], Cell[TextData[{ "To evaluate a particular cell, simply hit \"Shift+Enter\" with the cursor \ positioned in that cell. If ", StyleBox["Mathematica", FontSlant->"Italic"], " asks to evaluate initialization cell, click \"Yes\". See the ", StyleBox["Mathematica ", FontSlant->"Italic"], "Help browser or wolfram.com for more information on using ", StyleBox["Mathematica", FontSlant->"Italic"], "." }], "Text"], Cell["\<\ This notebook and those for the other seven chapters use a common stylesheet \ that has been imported into the notebook. This style sheet supports \ chapters, section, subsections, numbered equations, numbered figures and \ citations. A separate copy of the stylesheet can be download from the same \ page where this notebook was downloaded. \ \>", "Text"], Cell[TextData[{ StyleBox["COPYRIGHT ISSUES:", FontWeight->"Bold"], " The authors reserve all copyrights associated with this work. Any of \ the material appearing in these notebooks (such as the polyhedral meshes in \ chapter 7) can be used and modified without restriction as long as the use is \ non\[Hyphen]commercial. We simply ask that you acknowledge the authors when \ using material from these notebooks. For those readers interested in \ commercial use of the material in these notebooks, please contact \ jwarren@cs.rice.edu." }], "Text"], Cell[CellGroupData[{ Cell["Helper functions associated with previous chapters", "Subsubsection"], Cell[BoxData[ \(makeGenFun[coeff_, a_, x_] := Sum[coeff\[LeftDoubleBracket]i\[RightDoubleBracket] x\^\(i - 1 + a\), {i, 1, Length[coeff]}]\)], "Input", InitializationCell->True], Cell[BoxData[ \(makeCoeff[genFun_, {min_, max_}, k_, x_] := With[{expFun = Together[genFun]}, \n\t Table[Coefficient[expFun, x, i], {i, \(2\^k\) min, \(2\^k\) max}]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(subdivide[s_, p_, k_] := If[k \[Equal] 0, p, subdivide[s, s*\((p /. {x \[Rule] x\^2})\), k - 1]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(makeGenFun[coeff_, {a_, b_}, x_, y_] := Sum[coeff\[LeftDoubleBracket]i, j\[RightDoubleBracket] \(x\^\(i - 1 + a\)\) y\^\(j - 1 + b\), {i, \(Dimensions[ coeff]\)\[LeftDoubleBracket]1\[RightDoubleBracket]}, {j, \ \(Dimensions[coeff]\)\[LeftDoubleBracket]2\[RightDoubleBracket]}]\)], "Input",\ InitializationCell->True], Cell[BoxData[ \(makeCoeff[genFun_, {{minX_, maxX_}, {minY_, maxY_}}, k_, x_, y_] := With[{expFun = Expand[genFun]}, \n\t Table[With[{rowY = Table[Coefficient[expFun, y, j], {j, \(2\^k\) minY, \(2\^k\) maxY}]}, \n\t\t\t\tTable[ Coefficient[rowY, x, i], {i, \(2\^k\) minX, \(2\^k\) maxX}]]]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(subdivide2D[s_, p_, k_] := If[k \[Equal] 0, p, subdivide2D[s, s*\((p /. {x \[Rule] x\^2, y \[Rule] y\^2})\), k - 1]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(norm[t_, k_] := With[{coeff = Transpose[ Partition[ CoefficientList[t], {2\^k, 2\^k}, {2\^k, 2\^k}, {1, 1}, 0], {3, 4, 1, 2}]}, \[IndentingNewLine]Max[ Apply[Plus, Abs[coeff], {2, 4}]]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(plotGen2D[genFun_, {{minX_, maxX_}, {minY_, maxY_}}, k_, x_, y_, opts___] := Module[{expFun = Expand[genFun], rowY}, \[IndentingNewLine]plotCoeff3D[ Table[rowY = Coefficient[expFun, y, j]; \[IndentingNewLine]Table[{i\/2\^k, j\/2\^k, Coefficient[rowY, x, i]}, {i, \(2\^k\) minX, \(2\^k\) maxX}], {j, \(2\^k\) minY, \(2\^k\) maxY}], opts]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(plotCoeff3D[p_, plotArgs___] := Show[Graphics3D[\[IndentingNewLine]Table[ Polygon[{p\[LeftDoubleBracket]i, j\[RightDoubleBracket], p\[LeftDoubleBracket]i + 1, j\[RightDoubleBracket], p\[LeftDoubleBracket]i + 1, j + 1\[RightDoubleBracket], p\[LeftDoubleBracket]i, j + 1\[RightDoubleBracket]}], {i, \(Dimensions[ p]\)\[LeftDoubleBracket]1\[RightDoubleBracket] - 1}, {j, \(Dimensions[ p]\)\[LeftDoubleBracket]2\[RightDoubleBracket] - 1}]], Join[{plotArgs}, {Axes \[Rule] True}]]\)], "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell["Subdivision for polyharmonic splines", "Section"], Cell[CellGroupData[{ Cell["The radial basis for polyharmonic splines", "Subsection"], Cell["\<\ General definition of radial basis functions for polyharmonic splines\ \>", "Text"], Cell[BoxData[ \(\[ScriptC][ m_, \[ScriptX]_, \[ScriptY]_] := \(\(\((\[ScriptX]\^2 + \ \[ScriptY]\^2)\)\^\(m - 1\)\) Log[\[ScriptX]\^2 + \ \[ScriptY]\^2]\)\/\(\(2\^\(2 m\)\) \(\((\(\((m - 1)\)!\))\)\^2\) \[Pi]\)\)], \ "Input", InitializationCell->True, CellTags->"def polyharm radial"], Cell[TextData[{ "Observe that for ", Cell[BoxData[ \(\[ScriptC][1, 0, 0]\)]], " is unbounded. Note that for ", Cell[BoxData[ \(m > 1\)]], ", the limit of ", Cell[BoxData[ \(\[ScriptC][m, \[ScriptX], \[ScriptY]]\)]], "as ", Cell[BoxData[ \(\[ScriptX], \[ScriptY] \[Rule] \[Infinity]\)]], " is zero." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\[ScriptC][1, 0, 0]\), "\n", \(Limit[\[ScriptC][2, a\ \[ScriptZ], b\ \[ScriptZ]], \[ScriptZ] \[Rule] 0]\)}], "Input"], Cell[BoxData[ InterpretationBox[\(-\[Infinity]\), DirectedInfinity[ -1]]], "Output"], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell["Plot some low order functions", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[ Table[Plot3D[\[ScriptC][ m, \[ScriptX], \[ScriptY]], {\[ScriptX], \(-2\), 2}, {\[ScriptY], \(-2\), 2}], {m, 1, 3}]]]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["Scattered data interpolant", "Subsubsection"], Cell[TextData[{ "Radial basis functions for ", Cell[BoxData[ \(m \[Equal] 2\)]], "; build data interpolant out of linear combinations" }], "Text"], Cell[BoxData[ \(Unprotect[Power]; Power[0, 0] = 1; Protect[Power];\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\[ScriptC][\[ScriptX]_, \[ScriptY]_] := If[\[ScriptX] \[Equal] 0 && \[ScriptY] \[Equal] 0, 0, N[\(\((\[ScriptX]\^2 + \[ScriptY]\^2)\)\ Log[\[ScriptX]\^2 + \ \[ScriptY]\^2]\)\/\(16\ \[Pi]\)]]\)\)\)], "Input", InitializationCell->True], Cell[TextData[{ Cell[BoxData[ \(makeInterp\)]], " takes a set of points ", Cell[BoxData[ \(pts\)]], " and associated values ", Cell[BoxData[ \(vals\)]], " and return a thin\[Hyphen]plate interpolant with polynomial precision of \ order ", Cell[BoxData[ \(d\)]], ". ", Cell[BoxData[ \(eq1\)]], " forces interpolation conditions; ", Cell[BoxData[ \(eq2\)]], " forces polynomial precision." }], "Text"], Cell[BoxData[ \(\(\(makeInterp[pts_, vals_, d_] := \[IndentingNewLine]Module[{\[Alpha], \[Beta], \[ScriptP], n = Length[pts]}, \[IndentingNewLine]\[ScriptP][x_, y_] := \[Sum]\+\(i = 1\)\%n \[Alpha][i] \[ScriptC][ x - pts\[LeftDoubleBracket]i, 1\[RightDoubleBracket], y - pts\[LeftDoubleBracket]i, 2\[RightDoubleBracket]] + \[Sum]\+\(j = \ 0\)\%d\(\[Sum]\+\(k = 0\)\%\(d - j\)\[Beta][j, k] \(x\^j\) y\^k\); \[IndentingNewLine]eq1 = Table[\[ScriptP][pts\[LeftDoubleBracket]i, 1\[RightDoubleBracket], pts\[LeftDoubleBracket]i, 2\[RightDoubleBracket]] \[Equal] vals\[LeftDoubleBracket]i\[RightDoubleBracket], {i, 1, n}]; \[IndentingNewLine]eq2 = Table[\[Sum]\+\(i = 1\)\%n \[Alpha][ i] \(pts\[LeftDoubleBracket]i, 1\[RightDoubleBracket]\^j\) pts\[LeftDoubleBracket]i, 2\[RightDoubleBracket]\^k \ \[Equal] 0, {j, 0, d}, {k, 0, d - j}]; \[IndentingNewLine]ans = \(Solve[ Flatten[{eq1, eq2}]]\)\[LeftDoubleBracket]1\[RightDoubleBracket]; \ \[IndentingNewLine]\[ScriptP][x_, y_] = \[ScriptP][x, y] /. ans // Simplify; \[IndentingNewLine]\[ScriptP]]\)\(\[IndentingNewLine]\)\ \)\)], "Input", InitializationCell->True], Cell["Example of scattered data interpolant on uniform grid", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "=", RowBox[{"(", GridBox[{ {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"} }], ")"}]}], ",", "\[ScriptP]"}], "}"}], ",", "\[IndentingNewLine]", \(\(\[ScriptP] = makeInterp[\[IndentingNewLine]{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}, \[IndentingNewLine]{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}, {7, 1}, \[IndentingNewLine]{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}, {7, 2}, \[IndentingNewLine]{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}, {7, 3}, \[IndentingNewLine]{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {6, 4}, {7, 4}, \[IndentingNewLine]{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}, {7, 5}, \[IndentingNewLine]{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}, {7, 6}, \[IndentingNewLine]{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}, {7, 7}}, \[IndentingNewLine]Flatten[ p], \(-1\)];\)\[IndentingNewLine] Show[ GraphicsArray[{\[IndentingNewLine]plotGen2D[ makeGenFun[p, {0, 0}, x, y], {{0, 7}, {0, 7}}, 0, x, y, BoxRatios \[Rule] {1, 1, 1\/2}], \[IndentingNewLine]Plot3D[\[ScriptP][\[ScriptX], \ \[ScriptY]], {\[ScriptX], 0, 7}, {\[ScriptY], 0, 7}, PlotPoints \[Rule] 31, PlotRange \[Rule] All]}]]\)}], "]"}]], "Input", CellTags->"FIG interpolating thin plate"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["A bell\[Hyphen]shaped basis for polyharmonic splines", "Subsection"], Cell["Define generating functions for various difference masks", "Text"], Cell[BoxData[ \(l[x_, y_] := \((1 - x)\)\^2\/x + \((1 - y)\)\^2\/y\)], "Input", InitializationCell->True], Cell[BoxData[ \(d[k_, m_, x_, y_] := \((\(4\^k\) l[x, y])\)\^m\)], "Input", InitializationCell->True], Cell[TextData[{ "Construct bell\[Hyphen]shaped basis function ", Cell[BoxData[ \(\[ScriptN]\)]], " using radial basis functions ", Cell[BoxData[ \(\[ScriptC]\)]], " and difference mask ", Cell[BoxData[ \(d\)]], "." }], "Text"], Cell[BoxData[ \(\[ScriptN][m_, \[ScriptX]_, \[ScriptY]_] := Module[{dd = makeCoeff[d[0, m, x, y], {{\(-m\), m}, {\(-m\), m}}, 0, x, y]}, \[IndentingNewLine]\[Sum]\+\(i = \(-m\)\)\%m\(\[Sum]\+\(j \ = \(-m\)\)\%m dd\[LeftDoubleBracket]i + m + 1, j + m + 1\[RightDoubleBracket] \[ScriptC][ m, \[ScriptX] - i, \[ScriptY] - j]\)]\)], "Input", InitializationCell->True, CellTags->"EQN bell-shaped basis"], Cell["Plot there bell\[Hyphen]shaped basis functions", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[{\[IndentingNewLine]Plot3D[\[ScriptN][ 1, \[ScriptX], \[ScriptY]], {\[ScriptX], \(-3.001\), 2.999}, {\[ScriptY], \(-3.001\), 2.999}, PlotPoints \[Rule] 33, PlotRange \[Rule] {\(-0.1\), 2}], \[IndentingNewLine]Plot3D[\[ScriptN][ 2, \[ScriptX], \[ScriptY]], {\[ScriptX], \(-3.001\), 2.999}, {\[ScriptY], \(-3.001\), 2.999}, PlotPoints \[Rule] 33, PlotRange \[Rule] All], \[IndentingNewLine]Plot3D[\[ScriptN][ 3, \[ScriptX], \[ScriptY]], {\[ScriptX], \(-3.001\), 2.999}, {\[ScriptY], \(-3.001\), 2.999}, PlotPoints \[Rule] 33, PlotRange \[Rule] All]}]]\)], "Input", CellTags->"FIG bell-shaped basis"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Convert bell\[Hyphen]shaped basis function from Cartesian to polar \ coordinates\ \>", "Subsubsection"], Cell[TextData[{ "Construct a closed form expression for the bell\[Hyphen]shaped basis \ function with ", Cell[BoxData[ \(m \[Equal] 1\)]], " in polar coordinates." }], "Text"], Cell[TextData[{ "Convert radial basis function ", Cell[BoxData[ \(\[ScriptC]\)]], " to polar coordinates, observe that it depends only on ", Cell[BoxData[ \(\[ScriptR]\)]] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\[ScriptC][ 1, \[ScriptX], \[ScriptY]]\ /. \ {\[ScriptX] \[Rule] \[ScriptR]* Cos[\[Theta]], \[ScriptY] \[Rule] \[ScriptR]*Sin[\[Theta]]} // Simplify\)], "Input"], Cell[BoxData[ \(Log[\[ScriptR]\^2]\/\(4\ \[Pi]\)\)], "Output"] }, Open ]], Cell["Convert bell\[Hyphen]shaped basis function to polar coordinates", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ans = \[ScriptN][ 1, \[ScriptX], \[ScriptY]]\ /. \ {\[ScriptX] \[Rule] \[ScriptR]* Cos[\[Theta]], \[ScriptY] \[Rule] \[ScriptR]*Sin[\[Theta]]} // Simplify\)], "Input"], Cell[BoxData[ \(\(1\/\(4\ \[Pi]\)\) \((\(-4\)\ Log[\[ScriptR]\^2] + Log[1 + \[ScriptR]\^2 - 2\ \[ScriptR]\ Cos[\[Theta]]] + Log[1 + \[ScriptR]\^2 + 2\ \[ScriptR]\ Cos[\[Theta]]] + Log[1 + \[ScriptR]\^2 - 2\ \[ScriptR]\ Sin[\[Theta]]] + Log[1 + \[ScriptR]\^2 + 2\ \[ScriptR]\ Sin[\[Theta]]])\)\)], "Output"] }, Open ]], Cell[TextData[{ "Simplify using ", Cell[BoxData[ \(Log\)]], " rules" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ans\ //. \ {a_*Log[b_] -> Log[b\^a], Log[a_] + Log[b_] -> Log[a*b]} // Simplify\)], "Input", CellTags->"bell basis radial coord"], Cell[BoxData[ \(Log[\((1 + 1\/\[ScriptR]\^8 - \(2\ Cos[4\ \[Theta]]\)\/\[ScriptR]\^4)\)\ \^\(1\/\(4\ \[Pi]\)\)]\)], "Output"] }, Open ]], Cell[TextData[{ "Apply one final ", Cell[BoxData[ \(Log\)]], " reduction to reach ", Cell[BoxData[ \(\[ScriptN][1, \[ScriptX], \[ScriptY]] = \(1\/\(4 \[Pi]\)\) Log[1 + 1\/\[ScriptR]\^8 - \(2\ Cos[4\ \ \[Theta]]\)\/\[ScriptR]\^4]\)]], ". Observe that ", Cell[BoxData[ \(Log[1 + 1\/\[ScriptR]\^4]\)]], " decreases at a rate of ", Cell[BoxData[ \(O[1\/\[ScriptR]\^4]\)]], " as ", Cell[BoxData[ \(\[ScriptR] \[Rule] \[Infinity]\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Limit[\(\[ScriptR]\^4\) Log[1 + 1\/\[ScriptR]\^4], {\[ScriptR] \[Rule] \[Infinity]}]\)], \ "Input"], Cell[BoxData[ \({1}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Example of spline in bell\[Hyphen]shaped basis", "Subsubsection"], Cell["Simplify symbolically before evaluating.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "=", RowBox[{"(", GridBox[{ {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "1", "1", "1", "1", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"} }], ")"}]}], ",", "\[ScriptP]1", ",", "\[ScriptP]2"}], "}"}], ",", \(\(\[ScriptP]1[\[ScriptX]_, \[ScriptY]_] = \[Sum]\+\(i \ = 1\)\%\(Length[p]\)\(\[Sum]\+\(j = 1\)\%\(Length[p]\)p\[LeftDoubleBracket]i, j\[RightDoubleBracket] \[ScriptN][ 1, \[ScriptX] - i + 1, \[ScriptY] - j + 1]\) // Simplify;\)\[IndentingNewLine] \(\[ScriptP]2[\[ScriptX]_, \[ScriptY]_] = \[Sum]\+\(i = \ 1\)\%\(Length[p]\)\(\[Sum]\+\(j = 1\)\%\(Length[p]\)p\[LeftDoubleBracket]i, j\[RightDoubleBracket] \[ScriptN][ 2, \[ScriptX] - i + 1, \[ScriptY] - j + 1]\) // Simplify;\)\[IndentingNewLine] Show[ GraphicsArray[{\[IndentingNewLine]Plot3D[\[ScriptP]1[\[ScriptX], \ \[ScriptY]], {\[ScriptX], 0, 7}, {\[ScriptY], 0, 7}, PlotPoints \[Rule] 36, PlotRange \[Rule] {\(-0.3\), 2}], \[IndentingNewLine]Plot3D[\[ScriptP]2[\[ScriptX], \ \[ScriptY]], {\[ScriptX], 0, 7}, {\[ScriptY], 0, 7}, PlotPoints \[Rule] 37]}]]\)}], "]"}]], "Input", CellTags->"FIG approximating polyharmonic example"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Test function for bounded harmonic example", "Subsubsection"], Cell[TextData[{ "This example was deleted from the final book. It shows the effect of \ choosing the initial coefficients ", Cell[BoxData[ \(p\)]], " to lie on a surfaces that satisfies the harmonic equation. The test \ surface is" }], "Text"], Cell[BoxData[ \(\[ScriptP][\[ScriptX]_, \[ScriptY]_] := \(1\/25\) \((\(-\[ScriptX]\^2\) \ - \[ScriptX]\^3\/3 + 2\ \[ScriptX]\ \[ScriptY] + 9\ \[ScriptX]\^2\ \[ScriptY] + \[ScriptY]\^2 + \[ScriptX]\ \ \[ScriptY]\^2 - 3\ \[ScriptY]\^3)\)\)], "Input"], Cell[TextData[{ "Observe that it satisfies the equation ", Cell[BoxData[ \(\[ScriptCapitalL][\[ScriptX], \[ScriptY]] \[ScriptP][\[ScriptX], \ \[ScriptY]] \[Equal] 0\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(D[\[ScriptP][\[ScriptX], \[ScriptY]], \[ScriptX], \[ScriptX]] + D[\[ScriptP][\[ScriptX], \[ScriptY]], \[ScriptY], \[ScriptY]] // Simplify\)], "Input"], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell["Plot of the test surfaces", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Plot3D[\[ScriptP][\[ScriptX], \[ScriptY]], {\[ScriptX], \(-2\), 2}, {\[ScriptY], \(-2\), 2}, PlotPoints \[Rule] 33]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] SurfaceGraphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[TextData[{ "Choose the coefficient vector ", Cell[BoxData[ \(p\)]], " to be samples of ", Cell[BoxData[ \(\[ScriptP][\[ScriptX], \[ScriptY]]\)]], " on a finite portion of ", Cell[BoxData[ \(\[DoubleStruckCapitalZ]\^2\)]], "." }], "Text"], Cell[BoxData[ \(Module[{p = Table[\[ScriptP][\[ScriptX], \[ScriptY]], {\[ScriptX], \(-2\), 2}, {\[ScriptY], \(-2\), 2}]}, \[IndentingNewLine]\(\[ScriptP]1[\[ScriptX]_, \ \[ScriptY]_] = Sum[p\[LeftDoubleBracket]i + 3, j + 3\[RightDoubleBracket] \[ScriptN][ 1, \[ScriptX] - i, \[ScriptY] - j], {i, \(-2\), 2}, {j, \(-2\), 2}] // Simplify;\)]\)], "Input", CellTags->"FIG approximating polyharmonic example"], Cell[TextData[{ "Observe that resulting harmonic spline approximates ", Cell[BoxData[ \(\[ScriptP][\[ScriptX], \[ScriptY]]\)]], " on interior of domain. If ", Cell[BoxData[ \(p\)]], " were sampled over all of ", Cell[BoxData[ \(\[DoubleStruckCapitalZ]\^2\)]], ", ", Cell[BoxData[ \(\[ScriptP][\[ScriptX], \[ScriptY]]\)]], " would be exactly reproduced." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Plot3D[\[ScriptP]1[\[ScriptX], \[ScriptY]], {\[ScriptX], \(-2.01\), 2.01}, {\[ScriptY], \(-2.01\), 2.01}, PlotPoints \[Rule] 33]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] SurfaceGraphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Open ]] }, Closed]], Cell["\<\ A subdivision scheme for polyharmonic splines in the bell\[Hyphen]shaped \ basis\ \>", "Subsection", CellTags->"SUBSEC subdivision scheme poly harm"] }, Open ]], Cell[CellGroupData[{ Cell["Local approximations to polyharmonic splines", "Section"], Cell[CellGroupData[{ Cell["The exact scheme via Laurent series", "Subsection"], Cell[CellGroupData[{ Cell["Univariate Laurent series computation", "Subsubsection"], Cell[TextData[{ Cell[BoxData[ \(laurent[s, i]\)]], " computes the coefficient ", Cell[BoxData[ \(s\[LeftDoubleBracket]i\[RightDoubleBracket]\)]], " of the Laurent series expansion of ", Cell[BoxData[ \(s[x]\)]], ". ", Cell[BoxData[ \(laurent\)]], " converts the complex integral given in the text into an equivalent real \ integral." }], "Text"], Cell[BoxData[ \(laurent[s_, i_] := With[{ps = Simplify[\(s\ /. \ {x \[Rule] Cos[\[CapitalTheta]] + \ \[ImaginaryI]\ Sin[\[CapitalTheta]]}\)\/\((Cos[\[CapitalTheta]] + \ \[ImaginaryI]\ Sin[\[CapitalTheta]])\)\^i]}, \[IndentingNewLine]\(1\/\(2 \ \[Pi]\)\) Integrate[ps, {\[CapitalTheta], 0, 2 \[Pi]}]]\)], "Input", InitializationCell->True, CellTags->"laurent"], Cell[TextData[{ "An example of an expansion from ", Cell[BoxData[ \(s\[LeftDoubleBracket]\(-4\)\[RightDoubleBracket]\)]], " to ", Cell[BoxData[ \(s\[LeftDoubleBracket]4\[RightDoubleBracket]\)]] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ans = \(Table[laurent[x\/\(1 - 3 x + x\^2\), i], {i, \(-4\), 4}] // N\) // Chop\)], "Input", CellTags->"laurent coeffs"], Cell[BoxData[ \({\(-0.009519494249011572`\), \(-0.02492235949962145`\), \ \(-0.06524758424985277`\), \(-0.1708203932499369`\), \ \(-0.4472135954999579`\), \(-0.170820393249937`\), \(-0.06524758424985301`\), \ \(-0.024922359499621866`\), \(-0.009519494249011974`\)}\)], "Output"] }, Open ]], Cell["\<\ Check and see if the result is correct; observe that error occurs at the \ truncated point on series\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(makeCoeff[ makeGenFun[ans, \(-4\), x]*\((\(1 - 3 x + x\^2\)\/x)\), {\(-6\), 6}, 0, x] // Chop\)], "Input"], Cell[BoxData[ \({0, \(-0.009519494249011572`\), 0.003636123247413265`, 0, 0, 0, 0.9999999999999999`, 0, 0, 0, 0.003636123247414056`, \(-0.009519494249011974`\), 0}\)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Computational proof that the intersection of ", Cell[BoxData[ \(l[x, y] \[Equal] 0\)]], " and annuli ", Cell[BoxData[ \(\[LeftBracketingBar]x\[RightBracketingBar] \[Equal] 1\)]], " and ", Cell[BoxData[ \(\[LeftBracketingBar]y\[RightBracketingBar] \[Equal] 1\)]], " is exactly ", Cell[BoxData[ \(x \[Equal] 1 && y \[Equal] 1\)]], ". " }], "Subsubsection", CellTags->"proof"], Cell[TextData[{ "Our goal here is to show that the complex integral of equation 5.7 can be \ successfully evaulated on the circles ", Cell[BoxData[ \(\[LeftBracketingBar]x\[RightBracketingBar] \[Equal] 1\)]], " and ", Cell[BoxData[ \(\[LeftBracketingBar]y\[RightBracketingBar] \[Equal] 1\)]], "." }], "Text"], Cell[TextData[{ "Start by converting the discrete Laplacian mask ", Cell[BoxData[ \(l[x, y]\)]], " to a polynomial" }], "Text"], Cell[BoxData[ \(ll[x_, y_] := y \((1 - x)\)\^2 + x \((1 - y)\)\^2\)], "Input"], Cell[TextData[{ "Express the mask ", Cell[BoxData[ \(l[x, y]\)]], " as real and complex parts." }], "Text"], Cell[BoxData[ \(ll\_r[xr_, xc_, yr_, yc_] := xr + 4\ xc\ yc - 2\ xc\ xr\ yc - xr\ yc\^2 + yr - xc\^2\ yr - 4\ xr\ yr + xr\^2\ yr - 2\ xc\ yc\ yr + xr\ yr\^2\)], "Input"], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(ll\_c[xr_, xc_, yr_, yc_] := xc + yc - xc\^2\ yc - 4\ xr\ yc + xr\^2\ yc - xc\ yc\^2 - 4\ xc\ yr + 2\ xc\ xr\ yr + 2\ xr\ yc\ yr + xc\ yr\^2\)\)\)], "Input"], Cell["Verify that decomposition is correct.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ll\_r[xr, xc, yr, yc] + ll\_c[xr, xc, yr, yc] \[ImaginaryI] \[Equal] ll[xr + xc\ \[ImaginaryI], yr + yc\ \[ImaginaryI]] // Simplify\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[TextData[{ "Use ", StyleBox["Mathematica", FontSlant->"Italic"], "'s ", Cell[BoxData[ \(CylindricalAlgebraicDecompostion\)]], " to show that sole intersection point of the curve ", Cell[BoxData[ \(ll[x, y] \[Equal] 0\)]], " with annuli ", Cell[BoxData[ \(\[LeftBracketingBar]x\[RightBracketingBar] \[Equal] 1\)]], " and ", Cell[BoxData[ \(\[LeftBracketingBar]y\[RightBracketingBar] \[Equal] 1\)]], " is at the point ", Cell[BoxData[ \({1 + 0 \[ImaginaryI], 1 + 0 \[ImaginaryI]}\)]], " in real space. Please be patient, computing a cylindrical algebraic \ deomposition takes time." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox["Experimental`CylindricalAlgebraicDecomposition", "MR"], "[", "\[IndentingNewLine]", \({xr\^2 + xc\^2 \[Equal] 1, yr\^2 + yc\^2 \[Equal] 1, ll\_r[xr, xc, yr, yc] \[Equal] 0, ll\_c[xr, xc, yr, yc] \[Equal] 0}, {xr, xc, yr, yc}\), "]"}]], "Input"], Cell[BoxData[ \($Aborted\)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Existence of Laurent series for harmonic splines", "Subsubsection"], Cell[TextData[{ "Given that ", Cell[BoxData[ \(l[x, y] \[Equal] 0\)]], " has it's only pole at ", Cell[BoxData[ \({x, y} \[Equal] {1, 1}\)]], ", we next observe that the limit of ", Cell[BoxData[ \(s[x, y] = l[x\^2, y\^2]\/l[x, y]\)]], " at ", Cell[BoxData[ \({1, 1}\)]], " is ", Cell[BoxData[ \(4\)]], " for any direction ", Cell[BoxData[ \({a, b}\)]], " in which ", Cell[BoxData[ \({1, 1}\)]], " is approached. This allows the integral of equation 5.7 to be finite." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Limit[ l[\((1 + a\ z)\)\^2, \((1 + b\ z)\)\^2]\/l[1 + a\ z\ , 1 + b\ z], {z \ \[Rule] 0}]\)], "Input"], Cell[BoxData[ \({4}\)], "Output"] }, Open ]], Cell[TextData[{ "Here is a plot of ", Cell[BoxData[ \(s[x, y]\)]], " in the neighborhood of ", Cell[BoxData[ \({1, 1}\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Plot3D[l[x\^2, y\^2]\/l[x, y], {x, 0.9, 1.1}, {y, 0.9, 1.1}]\)], "Input",\ CellTags->"FIG Plot of harmonic mask"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] SurfaceGraphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Bivariate Laurent series", "Subsubsection"], Cell[TextData[{ "Our goal here is to compute the Laurent series for harmonic subdivision \ mask ", Cell[BoxData[ \(s[x, y] \[Equal] l[x\^2, y\^2]\/l[x, y]\)]], ". The ", Cell[BoxData[ \(ij\)]], "th Laurent coefficient is the complex integral" }], "Text"], Cell[BoxData[ \(s\[LeftDoubleBracket]i, j\[RightDoubleBracket] = \(\(-1\)\/\(4 \[Pi]\^2\)\) \ \(\[Integral]\_\(\(|\)\(x\)\(|\)\(\(\[Equal]\)\(1\)\)\)\+\(\(|\)\(y\)\(|\)\(\(\ \[Equal]\)\(1\)\)\)\(s[x, y]\/\(\(x\^\(i + 1\)\) y\^\(j + 1\)\)\) \[DifferentialD]x \ \(\(\[DifferentialD]y\)\(.\)\)\)\)], "Equation"], Cell[TextData[{ "The complex circles ", Cell[BoxData[ \(\[LeftBracketingBar]x\[RightBracketingBar] \[Equal] 1\)]], " and ", Cell[BoxData[ \(\[LeftBracketingBar]y\[RightBracketingBar] \[Equal] 1\)]], " can be parameterized via ", Cell[BoxData[ \(x = Cos[\[Alpha]] + \[ImaginaryI]\ Sin[\[Alpha]], y = Cos[\[Beta]] + \[ImaginaryI]\ Sin[\[Beta]]\)]], ". Under this reparameterization, ", Cell[BoxData[ \(s[x, y]\)]], " reduces to" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(l[x\^2, y\^2]\/l[x, y] /. {x -> Cos[\[Alpha]] + \[ImaginaryI]\ Sin[\[Alpha]], y -> Cos[\[Beta]] + \[ImaginaryI]\ Sin[\[Beta]]} // FullSimplify\)], "Input", CellTags->"comp s"], Cell[BoxData[ \(\(\(-2\) + Cos[2\ \[Alpha]] + Cos[2\ \[Beta]]\)\/\(\(-2\) + \ Cos[\[Alpha]] + Cos[\[Beta]]\)\)], "Output"] }, Open ]], Cell[TextData[{ " Converting ", Cell[BoxData[ \(1\/\(\(x\^\(i + 1\)\) y\^\(j + 1\)\)\)]], " via this transformation yields a ", Cell[BoxData[ \(Cos[\(-i\)\ \[Alpha] - j\ \[Beta]]\)]], " term" }], "Text"], Cell[BoxData[ \(s\[LeftDoubleBracket]i, j\[RightDoubleBracket] = \ \[Integral]\_0\%\(2 \ \[Pi]\)\(\[Integral]\_0\%\(2 \[Pi]\)Cos[\(-i\)\ \[Alpha] - j\ \[Beta]] \((\(\(-2\) + Cos[2\ \[Alpha]] + Cos[2\ \ \[Beta]]\)\/\(\(-2\) + Cos[\[Alpha]] + Cos[\[Beta]]\))\) \[DifferentialD]\ \[Alpha] \(\(\[DifferentialD]\[Beta]\)\(.\)\)\)\)], "Equation"], Cell[TextData[{ "This integral is very time consuming to compute in ", StyleBox["Mathematica", FontSlant->"Italic"], ". Instead, after some tricky hand simplication via ", StyleBox["Mathematica,", FontSlant->"Italic"], " we can arrive at the formula for ", Cell[BoxData[ \(s\[LeftDoubleBracket]i, 0\[RightDoubleBracket]\)]], ". " }], "Text"], Cell[BoxData[ \(s\[LeftDoubleBracket]i, 0\[RightDoubleBracket] = \(\(-1\)\/\[Pi]\) \(\[Integral]\_0\%\(2 \ \[Pi]\)Cos[i\ \[Alpha]]\ \((\(-2\) + Cos[\[Alpha]] + 4\ \@2\ \@\(1\/\(3 - Cos[\[Alpha]]\)\)\ \ Sin[\[Alpha]\/2]\^3)\) \[DifferentialD]\[Alpha]\)\)], "Equation"], Cell[TextData[{ "The following function ", Cell[BoxData[ \(ss[i, j]\)]], " returns the coefficient ", Cell[BoxData[ \(s\[LeftDoubleBracket]i, 0\[RightDoubleBracket]\)]], " for various values of ", Cell[BoxData[ \(i\)]], ". Note that this functions memoizes the values of ", Cell[BoxData[ \(ss\)]], "." }], "Text"], Cell[BoxData[ \(ss[i_, 0] := \(ss[i, 0] = \(ss[\(-i\), 0] = \[IndentingNewLine]\(1\/\[Pi]\) NIntegrate[\(-Cos[i\ \[Alpha]]\)\ \((\(-2\) + Cos[\[Alpha]] + 4\ \@2\ \@\(1\/\(3 - Cos[\[Alpha]]\)\)\ \ Sin[\[Alpha]\/2]\^3)\), {\[Alpha], 0, 2 \[Pi]}] // FullSimplify\)\)\)], "Input", InitializationCell->True, CellTags->"comp mask"], Cell[TextData[{ "Given values for ", Cell[BoxData[ \(ss[i, 0]\)]], ", compute remaining values via difference equation ", Cell[BoxData[ \(l[x, y] s[x, y] \[Equal] l[x\^2, y\^2]\)]], "." }], "Text"], Cell[BoxData[ \(ss[ii_, jj_] := Module[{i = Abs[ii], j = Abs[jj], ll}, \[IndentingNewLine]ll[0, 0] = \(-4\); ll[2, 0] = 1; ll[\(-2\), 0] = 1; ll[0, 2] = 1; ll[0, \(-2\)] = 1; ll[_, _] = 0; \[IndentingNewLine]ss[i, j] = \(ss[\(-i\), j] = \(ss[i, \(-j\)] = \(ss[\(-i\), \(-j\)] = If[j \[Equal] 1, \[IndentingNewLine]\(1\/2\) \((4 ss[i, j - 1] - ss[i - 1, j - 1] - ss[i + 1, j - 1] + ll[i, j - 1])\), \[IndentingNewLine]4 ss[i, j - 1] - ss[i - 1, j - 1] - ss[i + 1, j - 1] - ss[i, j - 2] + ll[i, j - 1]] // Simplify\)\)\)]\)], "Input", InitializationCell->True], Cell[TextData[{ "Construct the mask ", Cell[BoxData[ \(s[x, y]\)]], " of size ", Cell[BoxData[ \(2 n + 1\)]], " by ", Cell[BoxData[ \(2 n + 1\)]] }], "Text"], Cell[BoxData[ \(s[n_] := \[Sum]\+\(i = \(-n\)\)\%n\(\[Sum]\+\(j = \(-n\)\)\%n ss[i, j] \(x\^i\) y\^j\)\)], "Input", InitializationCell->True], Cell["Print out table of mask entries", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Round[10000*CoefficientList[\(x\^4\) \(y\^4\) s[4], {x, y}]]*0.0001 // MatrixForm\)], "Input", CellTags->"bivar laurent mask"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0.0016`", "0.0023`", "0.0019`", \(-0.0022`\), \(-0.0106`\), \(-0.0022`\), "0.0019`", "0.0023`", "0.0016`"}, {"0.0023`", "0.0048000000000000004`", "0.0073`", "0.0015`", \(-0.033800000000000004`\), "0.0015`", "0.0073`", "0.0048000000000000004`", "0.0023`"}, {"0.0019`", "0.0073`", "0.021`", "0.0347`", \(-0.1277`\), "0.0347`", "0.021`", "0.0073`", "0.0019`"}, {\(-0.0022`\), "0.0015`", "0.0347`", "0.2441`", "0.4535`", "0.2441`", "0.0347`", "0.0015`", \(-0.0022`\)}, {\(-0.0106`\), \(-0.033800000000000004`\), \(-0.1277`\), "0.4535`", "1.4535`", "0.4535`", \(-0.1277`\), \(-0.033800000000000004`\), \(-0.0106`\ \)}, {\(-0.0022`\), "0.0015`", "0.0347`", "0.2441`", "0.4535`", "0.2441`", "0.0347`", "0.0015`", \(-0.0022`\)}, {"0.0019`", "0.0073`", "0.021`", "0.0347`", \(-0.1277`\), "0.0347`", "0.021`", "0.0073`", "0.0019`"}, {"0.0023`", "0.0048000000000000004`", "0.0073`", "0.0015`", \(-0.033800000000000004`\), "0.0015`", "0.0073`", "0.0048000000000000004`", "0.0023`"}, {"0.0016`", "0.0023`", "0.0019`", \(-0.0022`\), \(-0.0106`\), \(-0.0022`\), "0.0019`", "0.0023`", "0.0016`"} }], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Plot result of subdividing truncated Laurent series ", "Subsubsection"], Cell["\<\ Use helper functions from chapter two to plot the two examples of subdivision \ using the truncated Laurent series.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[{\[IndentingNewLine]plotGen2D[ subdivide2D[s[4], 1, 0], {{\(-2\), 2}, {\(-2\), 2}}, 0, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ subdivide2D[s[4], 1, 1], {{\(-2\), 2}, {\(-2\), 2}}, 1, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ subdivide2D[s[4], 1, 2], {{\(-2\), 2}, {\(-2\), 2}}, 2, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ subdivide2D[s[4], 1, 3], {{\(-2\), 2}, {\(-2\), 2}}, 3, x, y, PlotRange \[Rule] All]}]]\)], "Input", CellTags->"FIg laurent basis"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"plotGen2D", "[", RowBox[{ RowBox[{"subdivide2D", "[", RowBox[{\(s[4]\), ",", RowBox[{"makeGenFun", "[", RowBox[{ RowBox[{"(", GridBox[{ {"1", "1", "1", "1"}, {"1", "1", "1", "1"}, {"1", "1", "1", "1"}, {"1", "1", "1", "1"} }], ")"}], ",", \({2, 2}\), ",", "x", ",", "y"}], "]"}], ",", "3"}], "]"}], ",", \({{0, 7}, {0, 7}}\), ",", "3", ",", "x", ",", "y", ",", \(BoxRatios \[Rule] {1, 1, 3\/8}\)}], "]"}]], "Input",\ CellTags->"FIG laurent example"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics3D \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Local approximations via the Jacobi iteration", "Subsection"], Cell[CellGroupData[{ Cell["Subdivision for harmonic spline via Jacoby iteration", "Subsubsection"], Cell[TextData[{ "Construct Jacoby iteration that solves for ", Cell[BoxData[ \(p\_k\)]], " given ", Cell[BoxData[ \(p\_\(k - 1\)\)]], " in the expression ", Cell[BoxData[ \(l[x, y] p\_k[x, y] = l[x\^2, y\^2] p\_\(k - 1\)[x\^2, y\^2]\)]], ". The function ", Cell[BoxData[ \(harmSub\)]], " used the righthand side ", Cell[BoxData[ \(l[x\^2, y\^2] p\_\(k - 1\)[x\^2, y\^2]\)]], " as the correction term. Note that this correction terms is only an \ approximation to the correction term from the exact multi\[Hyphen]level \ equations." }], "Text"], Cell[BoxData[ \(harmSub[p_, n_] := \[IndentingNewLine]With[{\[Omega] = N[2\/3], pp = \((p /. {x \[Rule] x\^2, y \[Rule] y\^2})\)}, \[IndentingNewLine]If[ n \[Equal] 0, \(\((1 + x)\)\^2\/\(2 x\)\) \(\((1 + y)\)\^2\/\(2 y\)\) pp, \[IndentingNewLine]Expand[\((\(\[Omega]\/4\) l[x, y] + 1)\) harmSub[p, n - 1] - \(\[Omega]\/4\) l[x\^2, y\^2] pp]]]\)], "Input", InitializationCell->True], Cell[TextData[{ "The function ", Cell[BoxData[ \(harmSub1\)]], " uses the exact correction term ", Cell[BoxData[ \(l[x\^\(2\^k\), y\^\(2\^k\)] p\_0[x\^\(2\^k\), y\^\(2\^k\)]\)]], " for the Jacoby iteration at level ", Cell[BoxData[ \(k\)]], ". In practice, this correction terms leads to smoother solutions. (This \ fact to hard to see in the ", StyleBox["Mathematica", FontSlant->"Italic"], " plots due to their coarseness.)" }], "Text"], Cell[BoxData[ \(harmSub1[ p_, {n_, p0_, k_}] := \[IndentingNewLine]With[{\[Omega] = N[2\/3], pp = \((p /. {x \[Rule] x\^2, y \[Rule] y\^2})\)}, \[IndentingNewLine]If[ n \[Equal] 0, \(\((1 + x)\)\^2\/\(2 x\)\) \(\((1 + y)\)\^2\/\(2 y\)\) pp, \[IndentingNewLine]Expand[\((\(\[Omega]\/4\) l[x, y] + 1)\) harmSub[p, n - 1, p0, k] - \(\[Omega]\/4\) l[x\^\(2\^k\), y\^\(2\^k\)] \((p0 /. {x \[Rule] x\^\(2\^k\), y \[Rule] y\^\(2\^k\)})\)]]]\)], "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell["Examples", "Subsubsection"], Cell["\<\ Apply three rounds of harmonic subdivision with 10 rounds of smoothing each \ time.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[{\[IndentingNewLine]plotGen2D[ Fold[harmSub, 1, {}], {{\(-2\), 2}, {\(-2\), 2}}, 0, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ Fold[harmSub, 1, {3}], {{\(-2\), 2}, {\(-2\), 2}}, 1, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ Fold[harmSub, 1, {3, 3}], {{\(-2\), 2}, {\(-2\), 2}}, 2, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ Fold[harmSub, 1, {3, 3, 3}], {{\(-2\), 2}, {\(-2\), 2}}, 3, x, y, PlotRange \[Rule] All]}]]\)], "Input", CellTags->"FIG harm JOR"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["Another example of a harmonic spline", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"plotGen2D", "[", RowBox[{ RowBox[{"Fold", "[", RowBox[{"harmSub", ",", RowBox[{"makeGenFun", "[", RowBox[{ RowBox[{"(", GridBox[{ {"1", "1", "1", "1"}, {"1", "1", "1", "1"}, {"1", "1", "1", "1"}, {"1", "1", "1", "1"} }], ")"}], ",", \({2, 2}\), ",", "x", ",", "y"}], "]"}], ",", \({3, 3, 3}\)}], "]"}], ",", \({{0, 7}, {0, 7}}\), ",", "3", ",", "x", ",", "y", ",", "\[IndentingNewLine]", \(BoxRatios \[Rule] {1, 1, 3\/8}\)}], "]"}]], "Input", CellTags->"FIG jacobi example"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics3D \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Local optimal approximation via linear programming", "Subsection", CellTags->"SUBSEC local optimized"], Cell[CellGroupData[{ Cell["\<\ Compute of local, approximate subdivision mask for harminic splines\ \>", "Subsubsection"], Cell[TextData[{ "Construct a helper function ", Cell[BoxData[ \(minNorm\)]], " that given a matrix ", Cell[BoxData[ \(r\)]], " of linear expressions and a set of auxiliary equation ", Cell[BoxData[ \(aux\)]], ", returns assignements to the unknowns in ", Cell[BoxData[ \(r\)]], " that minimizes its ", Cell[BoxData[ \(\[Infinity]\)]], "-norm" }], "Text"], Cell[BoxData[ \(\(\(minNorm[r_, aux_]\)\(:=\)\(Module[{obj, rPos, rNeg}, \[IndentingNewLine]ConstrainedMin[\[IndentingNewLine]obj, \ \[IndentingNewLine]Join[\[IndentingNewLine]aux, \[IndentingNewLine]Flatten[ Table[Table[ rPos[i, j] - rNeg[i, j] \[Equal] r\[LeftDoubleBracket]i, j\[RightDoubleBracket], {j, Length[r\[LeftDoubleBracket] i\[RightDoubleBracket]]}], {i, Length[r]}]], \[IndentingNewLine]Table[ obj \[GreaterEqual] Sum[rPos[i, j] + rNeg[i, j], {j, Length[r\[LeftDoubleBracket] i\[RightDoubleBracket]]}], {i, Length[r]}]], Join[{obj}, Variables[r], Flatten[Table[ Table[{rPos[i, j], rNeg[i, j]}, {j, Length[r\[LeftDoubleBracket] i\[RightDoubleBracket]]}], {i, Length[r]}]]]]]\)\(\t\)\)\)], "Input", InitializationCell->True], Cell[TextData[{ "The function ", Cell[BoxData[ \(s\&^\)]], " computes the ", Cell[BoxData[ \(\((2 n + 1)\)\[Times]\((2 n + 1)\)\)]], " subdivision mask ", Cell[BoxData[ \(s\&^[x, y]\)]], " that minimizes the norm of ", Cell[BoxData[ \(l[x, y] s\&^[x, y] - l[x\^2, y\^2]\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(s\&^[n_] := \(s\&^[n] = Module[{sPos, sNeg, s, resid, ans}, \[IndentingNewLine]s = Sum[\((Apply[sPos, Sort[Abs[{i, j}]]] - Apply[sNeg, Sort[Abs[{i, j}]]])\) \(x\^i\) y\^j, {i, \(-n\), n}, {j, \(-n\), n}]; \[IndentingNewLine]resid = makeCoeff[\((l[x, y] s - l[x\^2, y\^2])\), {{\(-n\) - 2, n + 2}, {\(-n\) - 2, n + 2}}, 0, x, y]; \[IndentingNewLine]ans = minNorm[Map[Flatten, Flatten[Transpose[Partition[resid, {2, 2}], {3, 4, 1, 2}], 1]], {}]; \[IndentingNewLine]Print["\", ans\[LeftDoubleBracket]1\[RightDoubleBracket]]; \ \[IndentingNewLine]s /. ans\[LeftDoubleBracket]2\[RightDoubleBracket]]\)\)], "Input", InitializationCell->True], Cell[BoxData[ \(General::"spell1" \(\(:\)\(\ \)\) "Possible spelling error: new symbol name \"\!\(sPos\)\" is similar to \ existing symbol \"\!\(rPos\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \(\(:\)\(\ \)\) "Possible spelling error: new symbol name \"\!\(sNeg\)\" is similar to \ existing symbol \"\!\(rNeg\)\"."\)], "Message"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(s\&^[3]\)], "Input", CellTags->"s2"], Cell[BoxData[ InterpretationBox[\("The residual is "\[InvisibleSpace]8\/75\), SequenceForm[ "The residual is ", Rational[ 8, 75]], Editable->False]], "Print"], Cell[BoxData[ \(109\/75 - 2\/\(75\ x\^3\) - 19\/\(150\ x\^2\) + 34\/\(75\ x\) + \(34\ x\)\/75 - \(19\ x\^2\)\/150 - \(2\ x\^3\)\/75 - 2\/\(75\ y\^3\) - 1\/\(300\ x\^3\ y\^3\) - x\^3\/\(300\ y\^3\) - 19\/\(150\ y\^2\) + 1\/\(60\ x\^2\ y\^2\) + 1\/\(30\ x\ y\^2\) + x\/\(30\ y\^2\) + x\^2\/\(60\ y\^2\) + 34\/\(75\ y\) + 1\/\(30\ x\^2\ y\) + 73\/\(300\ x\ y\) + \(73\ x\)\/\(300\ y\) + x\^2\/\(30\ y\) + \(34\ y\)\/75 + y\/\(30\ x\^2\) + \(73\ y\)\/\(300\ x\) + \(73\ x\ y\)\/300 + \(x\^2\ y\ \)\/30 - \(19\ y\^2\)\/150 + y\^2\/\(60\ x\^2\) + y\^2\/\(30\ x\) + \(x\ y\^2\)\/30 + \(x\^2\ y\^2\)\/60 - \(2\ \ y\^3\)\/75 - y\^3\/\(300\ x\^3\) - \(x\^3\ y\^3\)\/300\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(CoefficientList[\(x\^4\) \(y\^4\) N[s\&^[4]], {x, y}] // MatrixForm\)], "Input"], Cell[BoxData[ InterpretationBox[\("The residual is "\[InvisibleSpace]536\/22725\), SequenceForm[ "The residual is ", Rational[ 536, 22725]], Editable->False]], "Print"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0.0014081408140814082`", "0.0014081408140814082`", \(-0.0014081408140814082`\), \ \(-0.008976897689768977`\), \(-0.0014081408140814082`\), "0.0014081408140814082`", "0.0014081408140814082`", "0"}, {"0.0014081408140814082`", "0.004224422442244224`", "0.007172717271727172`", "0.0019361936193619362`", \(-0.03309130913091309`\), "0.0019361936193619362`", "0.007172717271727172`", "0.004224422442244224`", "0.0014081408140814082`"}, {"0.0014081408140814082`", "0.007172717271727172`", "0.021122112211221122`", "0.035071507150715074`", \(-0.12726072607260727`\), "0.035071507150715074`", "0.021122112211221122`", "0.007172717271727172`", "0.0014081408140814082`"}, {\(-0.0014081408140814082`\), "0.0019361936193619362`", "0.035071507150715074`", "0.2444884488448845`", "0.45390539053905393`", "0.2444884488448845`", "0.035071507150715074`", "0.0019361936193619362`", \(-0.0014081408140814082`\)}, {\(-0.008976897689768977`\), \(-0.03309130913091309`\), \ \(-0.12726072607260727`\), "0.45390539053905393`", "1.453905390539054`", "0.45390539053905393`", \(-0.12726072607260727`\), \ \(-0.03309130913091309`\), \(-0.008976897689768977`\)}, {\(-0.0014081408140814082`\), "0.0019361936193619362`", "0.035071507150715074`", "0.2444884488448845`", "0.45390539053905393`", "0.2444884488448845`", "0.035071507150715074`", "0.0019361936193619362`", \(-0.0014081408140814082`\)}, {"0.0014081408140814082`", "0.007172717271727172`", "0.021122112211221122`", "0.035071507150715074`", \(-0.12726072607260727`\), "0.035071507150715074`", "0.021122112211221122`", "0.007172717271727172`", "0.0014081408140814082`"}, {"0.0014081408140814082`", "0.004224422442244224`", "0.007172717271727172`", "0.0019361936193619362`", \(-0.03309130913091309`\), "0.0019361936193619362`", "0.007172717271727172`", "0.004224422442244224`", "0.0014081408140814082`"}, {"0", "0.0014081408140814082`", "0.0014081408140814082`", \(-0.0014081408140814082`\), \ \(-0.008976897689768977`\), \(-0.0014081408140814082`\), "0.0014081408140814082`", "0.0014081408140814082`", "0"} }], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Examples", "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ \(\(s\&^[4];\)\)], "Input"], Cell[BoxData[ InterpretationBox[\("The residual is "\[InvisibleSpace]536\/22725\), SequenceForm[ "The residual is ", Rational[ 536, 22725]], Editable->False]], "Print"] }, Open ]], Cell["Figure of basis function being subdivided", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[{\[IndentingNewLine]plotGen2D[ subdivide2D[s\&^[4], 1, 0], {{\(-2\), 2}, {\(-2\), 2}}, 0, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ subdivide2D[s\&^[4], 1, 1], {{\(-2\), 2}, {\(-2\), 2}}, 1, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ subdivide2D[s\&^[4], 1, 2], {{\(-2\), 2}, {\(-2\), 2}}, 2, x, y, PlotRange \[Rule] All], \[IndentingNewLine]plotGen2D[ subdivide2D[s\&^[4], 1, 3], {{\(-2\), 2}, {\(-2\), 2}}, 3, x, y, PlotRange \[Rule] All]}]]\)], "Input", CellTags->"FIG lp basis"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"plotGen2D", "[", RowBox[{ RowBox[{"subdivide2D", "[", RowBox[{\(s\&^[4]\), ",", RowBox[{"makeGenFun", "[", RowBox[{ RowBox[{"(", GridBox[{ {"1", "1", "1", "1"}, {"1", "1", "1", "1"}, {"1", "1", "1", "1"}, {"1", "1", "1", "1"} }], ")"}], ",", \({2, 2}\), ",", "x", ",", "y"}], "]"}], ",", "3"}], "]"}], ",", \({{0, 7}, {0, 7}}\), ",", "3", ",", "x", ",", "y", ",", "\[IndentingNewLine]", \(BoxRatios \[Rule] {1, 1, 3\/8}\)}], "]"}]], "Input", CellTags->"FIG lp example"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics3D \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["A comparison of the three approaches", "Subsection", CellTags->"SEC comparison"], Cell[CellGroupData[{ Cell["Implementation using discrete convolution", "Subsubsection", CellTags->"SUBSEC convolution"], Cell[TextData[{ "To construct the figures comparing the three methods, the following \ functions implement subdivision for generating functions using discrete \ convolution. This implementation is significantly faster than standard \ polynomial multiplication in ", StyleBox["Mathematica", FontSlant->"Italic"], "." }], "Text"], Cell["Upsampling for 2D grids", "Text"], Cell[BoxData[ \(upsample[ p_] := \[IndentingNewLine]Table[\[IndentingNewLine]If[ OddQ[i] && OddQ[j], \[IndentingNewLine]p\[LeftDoubleBracket]\(i + 1\)\/2, \ \(j + 1\)\/2\[RightDoubleBracket], 0], \[IndentingNewLine]{i, 1, 2 \( Dimensions[p]\)\[LeftDoubleBracket]1\[RightDoubleBracket] - 1}, \[IndentingNewLine]{j, 1, 2 \( Dimensions[p]\)\[LeftDoubleBracket]2\[RightDoubleBracket] - 1}]\)], "Input", InitializationCell->True], Cell["Subdivision with arbitrary mask", "Text"], Cell[BoxData[ \(subdivide[m_, p_, n_] := \[IndentingNewLine]If[n \[Equal] 0, p, \[IndentingNewLine]subdivide[m, ListConvolve[m, upsample[p], {1, \(-1\)}, 0], n - 1]]\)], "Input", InitializationCell->True], Cell["Compute norm of mask", "Text"], Cell[BoxData[ \(norm[m_, k_] := With[{coeff = Transpose[ Partition[m, {2\^k, 2\^k}, {2\^k, 2\^k}, {1, 1}, 0], {3, 4, 1, 2}]}, \[IndentingNewLine]Max[ Apply[Plus, Abs[coeff], {2, 4}]]]\)], "Input", InitializationCell->True], Cell[TextData[{ "Given a subdivision mask ", Cell[BoxData[ \(m\)]], ", compute residual after ", Cell[BoxData[ \(n\)]], " rounds of subdivision" }], "Text"], Cell[BoxData[ RowBox[{\(residual[m_, n_]\), ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"q", "=", RowBox[{"ListConvolve", "[", RowBox[{ RowBox[{"(", GridBox[{ {"0", "1", "0"}, {"1", \(-4\), "1"}, {"0", "1", "0"} }], ")"}], ",", \(subdivide[m, {{1}}, n]\), ",", \({1, \(-1\)}\), ",", "0"}], "]"}]}], ",", "s"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{\(s = \(Dimensions[q] + 1\)\/2\), ";", "\[IndentingNewLine]", RowBox[{\(q\[LeftDoubleBracket] Range[s\[LeftDoubleBracket]1\[RightDoubleBracket] - 2\^n, s\[LeftDoubleBracket]1\[RightDoubleBracket] + 2\^n], Range[s\[LeftDoubleBracket]2\[RightDoubleBracket] - 2\^n, s\[LeftDoubleBracket]2\[RightDoubleBracket] + 2\^n]\[RightDoubleBracket]\), "-=", RowBox[{"Nest", "[", RowBox[{"upsample", ",", RowBox[{"(", GridBox[{ {"0", "1", "0"}, {"1", \(-4\), "1"}, {"0", "1", "0"} }], ")"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", \(norm[q, n]\)}]}], "]"}]}]], "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell["Compute residuals for Laurent", "Subsubsection"], Cell["Compute masks of various size and compare residuals", "Text"], Cell[BoxData[ \(<< Graphics`\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(laurentRes = Table[{2 n + 1, residual[Table[ss[i, j], {i, \(-n\), n}, {j, \(-n\), n}], 1]}, {n, 1, 8}]\)], "Input"], Cell[BoxData[ \({{3, 2.185916357881341`}, {5, 0.345561673346233`}, {7, 0.19381302299991612`}, {9, 0.04625481648811049`}, {11, 0.02528295717000901`}, {13, 0.015056796943677436`}, {15, 0.009400989736241325`}, {17, 0.005831278057258855`}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(laurentRes = {{3, 2.185916357881341`}, {5, 0.345561673346233`}, {7, 0.19381302299991612`}, {9, 0.04625481648811049`}, {11, 0.02528295717000901`}, {13, 0.015056796943677436`}, {15, 0.009400989736241325`}, {17, 0.005831278057258855`}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(laurResPlot = LogListPlot[\[IndentingNewLine]laurentRes, PlotJoined \[Rule] True, PlotRange \[Rule] All, Ticks \[Rule] {{3, 5, 7, 9, 11, 13, 15, 17}, Automatic}]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(laurentRes2 = Table[{n, residual[Table[ss[i, j], {i, \(-8\), 8}, {j, \(-8\), 8}], n]}, {n, 1, 5}]\)], "Input"], Cell[BoxData[ \({{1, 0.005831278057258855`}, {2, 0.009874401834630144`}, {3, 0.015154113411387306`}, {4, 0.01528827127386155`}, {5, 0.015925360070563613`}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(laurentRes2 = {{1, 0.005831278057258855`}, {2, 0.009874401834630144`}, {3, 0.015154113411387306`}, {4, 0.01528827127386155`}, {5, 0.015925360070563613`}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(laurResPlot2 = LogListPlot[\[IndentingNewLine]laurentRes2, PlotJoined \[Rule] True, PlotRange \[Rule] All, Ticks \[Rule] {{1, 2, 3, 4, 5}, Automatic}]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Compute residual for Jacoby iteration", "Subsubsection"], Cell["\<\ Compute subdivision mask for linear subdivision plus Jacobi smoothing \ \>", "Text"], Cell[BoxData[ RowBox[{\(jacobiMask[n_]\), ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{\(\[Omega] = N[2\/3]\), ",", RowBox[{"q", "=", RowBox[{"(", GridBox[{ {"0.25", "0.5", "0.25"}, {"0.5", "1.0", "0.5"}, {"0.25", "0.5", "0.25"} }], ")"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"q", "=", RowBox[{"ListConvolve", "[", RowBox[{ RowBox[{"(", GridBox[{ {"0", \(\[Omega]\/4\), "0"}, {\(\[Omega]\/4\), \(\(-\[Omega]\) + 1\), \(\[Omega]\/4\)}, {"0", \(\[Omega]\/4\), "0"} }], ")"}], ",", "q", ",", \({1, \(-1\)}\), ",", "0"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{\(q\[LeftDoubleBracket]Range[i, i + 4], Range[i, i + 4]\[RightDoubleBracket]\), "-=", RowBox[{"(", GridBox[{ {"0", "0", \(\[Omega]\/4\), "0", "0"}, {"0", "0", "0", "0", "0"}, {\(\[Omega]\/4\), "0", \(-\[Omega]\), "0", \(\[Omega]\/4\)}, {"0", "0", "0", "0", "0"}, {"0", "0", \(\[Omega]\/4\), "0", "0"} }], ")"}]}]}], ",", \({i, 1, n}\)}], "]"}], ";", "\[IndentingNewLine]", "q"}]}], "]"}]}]], "Input", InitializationCell->True], Cell[TextData[{ "Use ", Cell[BoxData[ \(norm2D\)]], " from chapter three to compute residual" }], "Text"], Cell[BoxData[ \(<< Graphics`\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(jacobiRes = Table[{2 i + 3, residual[jacobiMask[i], 1]}, {i, 0, 7}]\)], "Input"], Cell[BoxData[ \({{3, 4.`}, {5, 1.333333333333334`}, {7, 0.5555555555555549`}, {9, 0.2962962962962953`}, {11, 0.16666666666666616`}, {13, 0.10493827160493926`}, {15, 0.07681755829904063`}, {17, 0.06382887517146785`}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(jacobiRes = {{3, 4.`}, {5, 1.333333333333334`}, {7, 0.5555555555555549`}, {9, 0.2962962962962953`}, {11, 0.16666666666666616`}, {13, 0.10493827160493926`}, {15, 0.07681755829904063`}, {17, 0.06382887517146785`}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(jResPlot = LogListPlot[jacobiRes, PlotJoined \[Rule] True, PlotRange \[Rule] All, Ticks \[Rule] {{3, 5, 7, 9, 11, 13, 15, 17}, Automatic}]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(jacobiRes2 = Table[{n, residual[jacobiMask[7], n]}, {n, 1, 5}]\)], "Input"], Cell[BoxData[ \({{1, 0.06382887517146785`}, {2, 0.10803301618363738`}, {3, 0.13749445251629722`}, {4, 0.16301748185872378`}, {5, 0.18815950071407267`}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(jacobiRes2 = {{1, 0.06382887517146785`}, {2, 0.10803301618363738`}, {3, 0.13749445251629722`}, {4, 0.16301748185872378`}, {5, 0.18815950071407267`}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(jResPlot2 = LogListPlot[jacobiRes2, PlotJoined \[Rule] True, PlotRange \[Rule] All]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Compute residual for linear programming", "Subsubsection"], Cell[TextData[{ "Below is the precomputed ", Cell[BoxData[ \(17\[Times]17\)]], " mask for ", Cell[BoxData[ \(s\&^[x, y]\)]], "." }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"lps8", "=", RowBox[{ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", \(117585821723\/12956894169040087\), \ \(508862948127\/25913788338080174\), \(9486160736\/12956894169040087\), \ \(-\(1373728693952\/12956894169040087\)\), \ \(-\(3172493051640\/12956894169040087\)\), \ \(-\(4105816645212\/12956894169040087\)\), \ \(-\(3172493051640\/12956894169040087\)\), \ \(-\(1373728693952\/12956894169040087\)\), \(9486160736\/12956894169040087\), \ \(508862948127\/25913788338080174\), \(117585821723\/12956894169040087\), "0", "0", "0"}, { "0", \(811867855252\/12956894169040087\), \ \(1623735710504\/12956894169040087\), \(2322105535153\/12956894169040087\), \ \(2448897415667\/12956894169040087\), \(2314483725665\/25913788338080174\), \ \(-\(2331907884904\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(10078280477568\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(2331907884904\/12956894169040087\)\), \(2314483725665\/25913788338080174\ \), \(2448897415667\/12956894169040087\), \ \(2322105535153\/12956894169040087\), \(1623735710504\/12956894169040087\), \ \(811867855252\/12956894169040087\), "0"}, { "0", \(1623735710504\/12956894169040087\), \ \(3360969451611\/12956894169040087\), \(5098203192718\/12956894169040087\), \ \(6061810790619\/12956894169040087\), \(4502491759831\/12956894169040087\), \ \(-\(3801435682201\/25913788338080174\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(21786451530268\/12956894169040087\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(3801435682201\/25913788338080174\)\), \(4502491759831\/12956894169040087\ \), \(6061810790619\/12956894169040087\), \ \(5098203192718\/12956894169040087\), \(3360969451611\/12956894169040087\), \ \(1623735710504\/12956894169040087\), "0"}, {\(117585821723\/12956894169040087\), \ \(2322105535153\/12956894169040087\), \(5098203192718\/12956894169040087\), \ \(1235418141927\/1850984881291441\), \(12197650794260\/12956894169040087\), \ \(1813090318139\/1850984881291441\), \(3485570816143\/12956894169040087\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(-\(50549473532560\/12956894169040087\)\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(3485570816143\/12956894169040087\), \(1813090318139\/1850984881291441\), \ \(12197650794260\/12956894169040087\), \(1235418141927\/1850984881291441\), \ \(5098203192718\/12956894169040087\), \(2322105535153\/12956894169040087\), \ \(117585821723\/12956894169040087\)}, {\(508862948127\/25913788338080174\), \ \(2448897415667\/12956894169040087\), \(6061810790619\/12956894169040087\), \ \(12197650794260\/12956894169040087\), \(21389233165959\/12956894169040087\), \ \(30580815537658\/12956894169040087\), \(3612839551689\/1850984881291441\), \ \(-\(28231103160605\/12956894169040087\)\), \ \(-\(136134426633725\/12956894169040087\)\), \ \(-\(28231103160605\/12956894169040087\)\), \(3612839551689\/1850984881291441\ \), \(30580815537658\/12956894169040087\), \ \(21389233165959\/12956894169040087\), \(12197650794260\/12956894169040087\), \ \(6061810790619\/12956894169040087\), \(2448897415667\/12956894169040087\), \ \(508862948127\/25913788338080174\)}, {\(9486160736\/12956894169040087\), \ \(2314483725665\/25913788338080174\), \(4502491759831\/12956894169040087\), \ \(1813090318139\/1850984881291441\), \(30580815537658\/12956894169040087\), \ \(62952519895877\/12956894169040087\), \(95324224254096\/12956894169040087\), \ \(40117290225211\/25913788338080174\), \ \(-\(437526026681130\/12956894169040087\)\), \ \(40117290225211\/25913788338080174\), \(95324224254096\/12956894169040087\), \ \(62952519895877\/12956894169040087\), \(30580815537658\/12956894169040087\), \ \(1813090318139\/1850984881291441\), \(4502491759831\/12956894169040087\), \ \(2314483725665\/25913788338080174\), \(9486160736\/12956894169040087\)}, {\(-\(1373728693952\/12956894169040087\)\), \ \(-\(2331907884904\/12956894169040087\)\), \ \(-\(3801435682201\/25913788338080174\)\), \(3485570816143\/12956894169040087\ \), \(3612839551689\/1850984881291441\), \ \(95324224254096\/12956894169040087\), \ \(545991710292157\/25913788338080174\), \ \(450667486038061\/12956894169040087\), \ \(-\(1654086970316006\/12956894169040087\)\), \ \(450667486038061\/12956894169040087\), \ \(545991710292157\/25913788338080174\), \ \(95324224254096\/12956894169040087\), \(3612839551689\/1850984881291441\), \ \(3485570816143\/12956894169040087\), \(-\(3801435682201\/25913788338080174\)\ \), \(-\(2331907884904\/12956894169040087\)\), \ \(-\(1373728693952\/12956894169040087\)\)}, {\(-\(3172493051640\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(-\(28231103160605\/12956894169040087\)\), \ \(40117290225211\/25913788338080174\), \ \(450667486038061\/12956894169040087\), \(3163702414209566\/12956894169040087\ \), \(5876737342381071\/12956894169040087\), \ \(3163702414209566\/12956894169040087\), \(450667486038061\/12956894169040087\ \), \(40117290225211\/25913788338080174\), \ \(-\(28231103160605\/12956894169040087\)\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(3172493051640\/12956894169040087\)\)}, {\(-\(4105816645212\/12956894169040087\)\), \ \(-\(10078280477568\/12956894169040087\)\), \ \(-\(21786451530268\/12956894169040087\)\), \ \(-\(50549473532560\/12956894169040087\)\), \ \(-\(136134426633725\/12956894169040087\)\), \ \(-\(437526026681130\/12956894169040087\)\), \ \(-\(1654086970316006\/12956894169040087\)\), \ \(5876737342381071\/12956894169040087\), \ \(18833631511421158\/12956894169040087\), \ \(5876737342381071\/12956894169040087\), \ \(-\(1654086970316006\/12956894169040087\)\), \ \(-\(437526026681130\/12956894169040087\)\), \ \(-\(136134426633725\/12956894169040087\)\), \ \(-\(50549473532560\/12956894169040087\)\), \ \(-\(21786451530268\/12956894169040087\)\), \ \(-\(10078280477568\/12956894169040087\)\), \ \(-\(4105816645212\/12956894169040087\)\)}, {\(-\(3172493051640\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(-\(28231103160605\/12956894169040087\)\), \ \(40117290225211\/25913788338080174\), \ \(450667486038061\/12956894169040087\), \(3163702414209566\/12956894169040087\ \), \(5876737342381071\/12956894169040087\), \ \(3163702414209566\/12956894169040087\), \(450667486038061\/12956894169040087\ \), \(40117290225211\/25913788338080174\), \ \(-\(28231103160605\/12956894169040087\)\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(3172493051640\/12956894169040087\)\)}, {\(-\(1373728693952\/12956894169040087\)\), \ \(-\(2331907884904\/12956894169040087\)\), \ \(-\(3801435682201\/25913788338080174\)\), \(3485570816143\/12956894169040087\ \), \(3612839551689\/1850984881291441\), \ \(95324224254096\/12956894169040087\), \ \(545991710292157\/25913788338080174\), \ \(450667486038061\/12956894169040087\), \ \(-\(1654086970316006\/12956894169040087\)\), \ \(450667486038061\/12956894169040087\), \ \(545991710292157\/25913788338080174\), \ \(95324224254096\/12956894169040087\), \(3612839551689\/1850984881291441\), \ \(3485570816143\/12956894169040087\), \(-\(3801435682201\/25913788338080174\)\ \), \(-\(2331907884904\/12956894169040087\)\), \ \(-\(1373728693952\/12956894169040087\)\)}, {\(9486160736\/12956894169040087\), \ \(2314483725665\/25913788338080174\), \(4502491759831\/12956894169040087\), \ \(1813090318139\/1850984881291441\), \(30580815537658\/12956894169040087\), \ \(62952519895877\/12956894169040087\), \(95324224254096\/12956894169040087\), \ \(40117290225211\/25913788338080174\), \ \(-\(437526026681130\/12956894169040087\)\), \ \(40117290225211\/25913788338080174\), \(95324224254096\/12956894169040087\), \ \(62952519895877\/12956894169040087\), \(30580815537658\/12956894169040087\), \ \(1813090318139\/1850984881291441\), \(4502491759831\/12956894169040087\), \ \(2314483725665\/25913788338080174\), \(9486160736\/12956894169040087\)}, {\(508862948127\/25913788338080174\), \ \(2448897415667\/12956894169040087\), \(6061810790619\/12956894169040087\), \ \(12197650794260\/12956894169040087\), \(21389233165959\/12956894169040087\), \ \(30580815537658\/12956894169040087\), \(3612839551689\/1850984881291441\), \ \(-\(28231103160605\/12956894169040087\)\), \ \(-\(136134426633725\/12956894169040087\)\), \ \(-\(28231103160605\/12956894169040087\)\), \(3612839551689\/1850984881291441\ \), \(30580815537658\/12956894169040087\), \ \(21389233165959\/12956894169040087\), \(12197650794260\/12956894169040087\), \ \(6061810790619\/12956894169040087\), \(2448897415667\/12956894169040087\), \ \(508862948127\/25913788338080174\)}, {\(117585821723\/12956894169040087\), \ \(2322105535153\/12956894169040087\), \(5098203192718\/12956894169040087\), \ \(1235418141927\/1850984881291441\), \(12197650794260\/12956894169040087\), \ \(1813090318139\/1850984881291441\), \(3485570816143\/12956894169040087\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(-\(50549473532560\/12956894169040087\)\), \ \(-\(44277015966247\/25913788338080174\)\), \ \(3485570816143\/12956894169040087\), \(1813090318139\/1850984881291441\), \ \(12197650794260\/12956894169040087\), \(1235418141927\/1850984881291441\), \ \(5098203192718\/12956894169040087\), \(2322105535153\/12956894169040087\), \ \(117585821723\/12956894169040087\)}, { "0", \(1623735710504\/12956894169040087\), \ \(3360969451611\/12956894169040087\), \(5098203192718\/12956894169040087\), \ \(6061810790619\/12956894169040087\), \(4502491759831\/12956894169040087\), \ \(-\(3801435682201\/25913788338080174\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(21786451530268\/12956894169040087\)\), \ \(-\(13259026055472\/12956894169040087\)\), \ \(-\(3801435682201\/25913788338080174\)\), \(4502491759831\/12956894169040087\ \), \(6061810790619\/12956894169040087\), \ \(5098203192718\/12956894169040087\), \(3360969451611\/12956894169040087\), \ \(1623735710504\/12956894169040087\), "0"}, { "0", \(811867855252\/12956894169040087\), \ \(1623735710504\/12956894169040087\), \(2322105535153\/12956894169040087\), \ \(2448897415667\/12956894169040087\), \(2314483725665\/25913788338080174\), \ \(-\(2331907884904\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(10078280477568\/12956894169040087\)\), \ \(-\(7210426867396\/12956894169040087\)\), \ \(-\(2331907884904\/12956894169040087\)\), \(2314483725665\/25913788338080174\ \), \(2448897415667\/12956894169040087\), \ \(2322105535153\/12956894169040087\), \(1623735710504\/12956894169040087\), \ \(811867855252\/12956894169040087\), "0"}, {"0", "0", "0", \(117585821723\/12956894169040087\), \ \(508862948127\/25913788338080174\), \(9486160736\/12956894169040087\), \ \(-\(1373728693952\/12956894169040087\)\), \ \(-\(3172493051640\/12956894169040087\)\), \ \(-\(4105816645212\/12956894169040087\)\), \ \(-\(3172493051640\/12956894169040087\)\), \ \(-\(1373728693952\/12956894169040087\)\), \(9486160736\/12956894169040087\), \ \(508862948127\/25913788338080174\), \(117585821723\/12956894169040087\), "0", "0", "0"} }], "\[NoBreak]", ")"}], "//", "N"}]}], ";"}]], "Input"], Cell[BoxData[ \(\(lpRes = {{1, 2.`}, {5, 0.24242424242424251`}, {9, 0.023586358635863586`}, {13, 0.006105570056652506`}, {17, 0.002037256762956542`}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(lpResPlot = LogListPlot[lpRes, PlotRange \[Rule] All, PlotJoined \[Rule] True, Ticks \[Rule] {{1, 5, 9, 13, 17, 21}, Automatic}]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(residual[lps8, 5];\) // Timing\)], "Input"], Cell[BoxData[ \({20.649999999999636`\ Second, Null}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lpRes2 = Table[{n, residual[lps8, n]}, {n, 5}]\)], "Input"], Cell[BoxData[ \({{1, 0.002037256762961546`}, {2, 0.004741641534074511`}, {3, 0.006425525472689369`}, {4, 0.00860644114168996`}, {5, 0.010828219506932626`}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(lpRes2 = {{1, 0.002037256762961546`}, {2, 0.004741641534074511`}, {3, 0.006425525472689369`}, {4, 0.00860644114168996`}, {5, 0.010828219506932626`}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(lpResPlot2 = LogListPlot[lpRes2, PlotJoined \[Rule] True]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ Plot residual for all three methods as a function of mask size.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[lpResPlot, laurResPlot, jResPlot]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[TextData[{ "Plot residual for ", Cell[BoxData[ \(17\[Times]17\)]], " for various number of rounds of subdivision." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[lpResPlot2, laurResPlot2, jResPlot2, PlotRange \[Rule] All]\)], "Input"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Subdivision for linear flow", "Section"], Cell[CellGroupData[{ Cell["Introduction to physical model", "Subsection"], Cell["See text", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Primal versus dual subdivision", "Subsection"], Cell[CellGroupData[{ Cell[TextData[{ "Dual subdivision using generating function with integral powers of ", Cell[BoxData[ \(x\)]] }], "Subsubsection", CellTags->"SEC dual subdivision"], Cell[TextData[{ "Given a subdivision mask ", Cell[BoxData[ \(s[x]\)]], " with terms of the form ", Cell[BoxData[ \(s\[LeftDoubleBracket]i\[RightDoubleBracket] x\^\(i + 1\/2\)\)]], ", the basic idea is to represent mask as the integral generating function \ ", Cell[BoxData[ \(\(x\^\(-\(1\/2\)\)\) s[x]\)]], ". For example, the subdivision for quadratic B\[Hyphen]splines has the \ form" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(s[x_] = \(1\/4\) x\^\(-2\) + \(3\/4\) x\^\(-1\) + 3\/4 + \(1\/4\) x\)], "Input"], Cell[BoxData[ \(3\/4 + 1\/\(4\ x\^2\) + 3\/\(4\ x\) + x\/4\)], "Output"] }, Open ]], Cell[TextData[{ "Likewise, given a generating ", Cell[BoxData[ \(p\_0[x]\)]], " with terms of the ", Cell[BoxData[ \(p\_0\[LeftDoubleBracket]i\[RightDoubleBracket] x\^\(i + 1\/2\)\)]], ", we again store the function as ", Cell[BoxData[ \(\(x\^\(1\/2\)\) p\_0[x]\)]], ". For example, " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(p0[x_] = 1\/x + 1\)], "Input"], Cell[BoxData[ \(1 + 1\/x\)], "Output"] }, Open ]], Cell[TextData[{ "If ", Cell[BoxData[ \(p\_1[x]\)]], " is computed as ", Cell[BoxData[ \(x\ s[x]\ p\_0[x\^2]\)]], ", then ", Cell[BoxData[ \(p\_1[x]\)]], " also has the extra factor of ", Cell[BoxData[ \(x\^\(1\/2\)\)]], " ." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(p1[x_] = Expand[x\ *s[x]*p0\ [x\^2]]\)], "Input"], Cell[BoxData[ \(1 + 1\/\(4\ x\^3\) + 3\/\(4\ x\^2\) + 1\/x + \(3\ x\)\/4 + x\^2\/4\)], "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["A finite difference scheme for perfect flow", "Subsection"], Cell["See text for discussion", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["A subdivision scheme for perfect flow", "Subsection"], Cell[CellGroupData[{ Cell["Computation of finite subdivision masks", "Subsubsection"], Cell["Compute matrix of approximate masks that satisfy", "Text"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"(", GridBox[{ {\(d\_k[x]\), \(d\_k[y]\)}, {\(d\_k[y]\), \(-d\_k[x]\)} }], ")"}], ".", RowBox[{"(", GridBox[{ {\(s\&^\_11[x, y]\), \(s\&^\_12[x, y]\)}, {\(s\&^\_21[x, y]\), \(s\&^\_22[x, y]\)} }], ")"}]}], "\[TildeEqual]", RowBox[{"4", RowBox[{"(", GridBox[{ {"0", "0"}, {\(d\_\(k - 1\)[y\^2]\), \(-d\_k[x\^2]\)} }], ")"}]}]}]], "Equation"], Cell[TextData[{ "Observe due to symmetry that ", Cell[BoxData[ \(s\&^\_11[x, y] == s\&^\_22[y, x]\)]], " and ", Cell[BoxData[ \(s\&^\_21[x, y] == s\&^\_12[y, x]\)]], ". Thus, we solve for mask ", Cell[BoxData[ \(s\&^\_11[x, y]\)]], " and ", Cell[BoxData[ \(s\&^\_21[x, y]\)]], " that are irrotational, i.e." }], "Text"], Cell[BoxData[ \(d\_k[y] s\&^\_11[x, y] - d\_k[x] s\&^\_21[x, y] == 4 \(\( d\_\(k - 1\)[y\^2]\)\(.\)\)\)], "Equation"], Cell[TextData[{ "while minimizing the ", Cell[BoxData[ \(\[Infinity]\)]], "\[Hyphen]norm of the residual expression" }], "Text"], Cell[BoxData[ \(d\_k[1\/x] s\&^\_11[x, y] + d\_k[1\/y] s\&^\_21[x, y]\)], "Equation"], Cell[TextData[{ "Note that ", Cell[BoxData[ \(s\&^\_11[x, y]\)]], " is primal in ", Cell[BoxData[ \(x\)]], " and dual in ", Cell[BoxData[ \(y\)]], ". ", Cell[BoxData[ \(s\&^\_21[x, y]\)]], " is dual in ", Cell[BoxData[ \(x\)]], " and primal in ", Cell[BoxData[ \(y\)]], ". The factor ", Cell[BoxData[ \(d[1\/x]\)]], " and ", Cell[BoxData[ \(d[1\/y]\)]], " arise from the dual centering convention above and keep the computation \ centered. Finally, the coefficientss of ", Cell[BoxData[ \(s\&^\_11[x, y]\)]], " are symmetric in ", Cell[BoxData[ \(x\)]], " and ", Cell[BoxData[ \(y\)]], ". The coefficients of ", Cell[BoxData[ \(s\&^\_21[x, y]\)]], " are anti\[Hyphen]symmetric in ", Cell[BoxData[ \(x\)]], " and ", Cell[BoxData[ \(y\)]], ". We also force the scheme to have constant precision with the four \ constraints " }], "Text"], Cell[BoxData[{ \(s\&^\_11[1, 1] \[Equal] 4\), "\[IndentingNewLine]", \(s\&^\_11[\(-1\), 1] \[Equal] 0\), "\[IndentingNewLine]", \(s\&^\_11[1, \(-1\)] \[Equal] 0\), "\[IndentingNewLine]", \(s\&^\_11[\(-1\), \(-1\)] \[Equal] 0\)}], "Equation"], Cell[TextData[{ "Note that anti\[Hyphen]symmetric forces ", Cell[BoxData[ \(s\&^\_21[\(\[PlusMinus]1\), \(\[PlusMinus]1\)] \[Equal] 0\)]], "." }], "Text"], Cell[TextData[{ "The function ", Cell[BoxData[ \(pf\)]], " compute the ", Cell[BoxData[ \(2\[Times]2\)]], " matrix of finite subdivision masks (of size ", Cell[BoxData[ \(\((2 n + 1)\)\[Times]\((2 n + 1)\)\)]], " for perfect flow." }], "Text"], Cell[BoxData[ \(pf[n_] := \(pf[n] = Module[{d, s11, s21, c11Pos, c11Neg, c21Pos, c21Neg, sys1, sys2, ans}, \[IndentingNewLine]d[x_] := 1 - x; \[IndentingNewLine]s11[x_, y_] := Sum[\((c11Pos[Abs[2 i], Abs[2 j + 1]] - c11Neg[Abs[2 i], Abs[2 j + 1]])\) \(x\^i\) y\^j, {i, \(-n\), n}, {j, \(-n\) - 1, n}]; \[IndentingNewLine]s21[x_, y_] := Sum[Sign[\((2 i + 1)\)*j] \((c21Pos[Abs[2 i + 1], Abs[2 j]] - c21Neg[Abs[2 i + 1], Abs[2 j]])\) \(x\^i\) y\^j, {i, \(-n\) - 1, n}, {j, \(-n\), n}]; \[IndentingNewLine]sys1 = makeCoeff[ d[1\/x] s11[x, y] + d[1\/y]*s21[x, y], {{\(-n\) - 1, n}, {\(-n\) - 1, n}}, 0, x, y]; \[IndentingNewLine]sys2 = makeCoeff[ d[y] s11[x, y] - d[x]*s21[x, y] - \(2\/y\) d[y\^2], {{\(-n\) - 1, n + 1}, {\(-n\) - 1, n + 1}}, 0, x, y]; \[IndentingNewLine]ans = minNorm[Map[Flatten, Flatten[Transpose[Partition[sys1, {2, 2}], {3, 4, 1, 2}], 1]], \[IndentingNewLine]Join[\[IndentingNewLine]{s11[1, 1] \[Equal] 4, s11[\(-1\), 1] \[Equal] 0, s11[1, \(-1\)] \[Equal] 0, s11[\(-1\), \(-1\)] \[Equal] 0}, \[IndentingNewLine]Flatten[ Table[sys2\[LeftDoubleBracket]i, j\[RightDoubleBracket] \[Equal] 0, {i, \(Dimensions[ sys1]\)\[LeftDoubleBracket]1\[RightDoubleBracket]}, \ {j, \(Dimensions[ sys1]\)\[LeftDoubleBracket]2\[RightDoubleBracket]}]]\ ]]; \[IndentingNewLine]Print[ N[ans\[LeftDoubleBracket]1\[RightDoubleBracket]]]; \ \[IndentingNewLine]{{s11[x, y] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket], s21[y, x] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket]}, {s21[x, y] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket], s11[y, x] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket]}} // N]\)\)], "Input", InitializationCell->True], Cell[TextData[{ "The function ", Cell[BoxData[ \(sf\)]], " compute the ", Cell[BoxData[ \(2\[Times]2\)]], " matrix of finite subdivision masks (of size ", Cell[BoxData[ \(\((2 n + 1)\)\[Times]\((2 n + 1)\)\)]], " for slow flow." }], "Text"], Cell[BoxData[ \(sf[n_] := \(sf[n] = Module[{d, \[ScriptCapitalL], s11, s21, c11Pos, c11Neg, c21Pos, c21Neg, sys1, sys2, ans}, \[IndentingNewLine]d[x_] := 1 - x; \[IndentingNewLine]L[x_, y_] := \((1 - x)\)\^2\/x + \((1 - y)\)\^2\/y; \ \[IndentingNewLine]s11[x_, y_] := Sum[\((c11Pos[Abs[2 i], Abs[2 j + 1]] - c11Neg[Abs[2 i], Abs[2 j + 1]])\) \(x\^i\) y\^j, {i, \(-n\), n}, {j, \(-n\) - 1, n}]; \[IndentingNewLine]s21[x_, y_] := Sum[Sign[\((2 i + 1)\)*j] \((c21Pos[Abs[2 i + 1], Abs[2 j]] - c21Neg[Abs[2 i + 1], Abs[2 j]])\) \(x\^i\) y\^j, {i, \(-n\) - 1, n}, {j, \(-n\), n}]; \[IndentingNewLine]sys1 = makeCoeff[ d[1\/x] s11[x, y] + d[1\/y]*s21[x, y], {{\(-n\) - 1, n}, {\(-n\) - 1, n}}, 0, x, y]; \[IndentingNewLine]sys2 = makeCoeff[ 4 L[x, y] \((d[y] s11[x, y] - d[x]*s21[x, y])\) - 2 L[x\^2, y\^2] d[y\^2]\/y, {{\(-n\) - 2, n + 2}, {\(-n\) - 2, n + 2}}, 0, x, y]; \[IndentingNewLine]ans = minNorm[Join[\[IndentingNewLine]Map[Flatten, Flatten[Transpose[Partition[sys1, {2, 2}], {3, 4, 1, 2}], 1]], \[IndentingNewLine]Map[Flatten, Flatten[Transpose[Partition[sys2, {2, 2}], {3, 4, 1, 2}], 1]]], \[IndentingNewLine]{s11[1, 1] \[Equal] 4, s11[\(-1\), 1] \[Equal] 0, s11[1, \(-1\)] \[Equal] 0, s11[\(-1\), \(-1\)] \[Equal] 0}]; \[IndentingNewLine]Print[ N[ans\[LeftDoubleBracket]1\[RightDoubleBracket]]]; \ \[IndentingNewLine]{{s11[x, y] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket], s21[y, x] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket]}, {s21[x, y] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket], s11[y, x] /. ans\[LeftDoubleBracket]2\[RightDoubleBracket]}} // N]\)\)], "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell["Dual plotting functions for linear flows", "Subsubsection"], Cell["<True, CellTags->"S5.38.1"], Cell[TextData[{ "The function ", Cell[BoxData[ \(dualPlotFlow\)]], " plots a perfect (and slow) flow as a collection of horizontal and \ vertical vectors placed at the location where the components act." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(dualPlotFlow[{u_, v_}, {{minX_, maxX_}, {minY_, maxY_}}, k_, x_, y_] := \[IndentingNewLine]Module[{\[IndentingNewLine]uCoeff = makeCoeff[Expand[u], {{minX, maxX}, {minY, maxY}}, k, x, y], \[IndentingNewLine]vCoeff = makeCoeff[Expand[v], {{minX, maxX}, {minY, maxY}}, k, x, y], g0}, \[IndentingNewLine]g0 = ListPlotVectorField[ Flatten[Join[\[IndentingNewLine]Table[{{i, j + 1\/2}, {uCoeff\[LeftDoubleBracket]i, j\[RightDoubleBracket], 0}}, {i, \(Dimensions[ uCoeff]\)\[LeftDoubleBracket]1\[RightDoubleBracket]}, \ {j, \(Dimensions[uCoeff]\)\[LeftDoubleBracket]2\[RightDoubleBracket] - 1}], \[IndentingNewLine]Table[{{i + 1\/2, j}, {0, vCoeff\[LeftDoubleBracket]i, j\[RightDoubleBracket]}}, {i, \(Dimensions[ vCoeff]\)\[LeftDoubleBracket]1\[RightDoubleBracket] \ - 1}, {j, \(Dimensions[ vCoeff]\)\[LeftDoubleBracket]2\[RightDoubleBracket]}]]\ , 1], \[IndentingNewLine]Frame -> True, FrameTicks -> False, HeadWidth -> 0.50, DisplayFunction \[Rule] Identity]; \[IndentingNewLine]Show[g0, Graphics[{\[IndentingNewLine]Table[ Line[{{1, i}, {\(Dimensions[ uCoeff]\)\[LeftDoubleBracket]1\[RightDoubleBracket],\ i}}], {i, \(Dimensions[ vCoeff]\)\[LeftDoubleBracket]2\[RightDoubleBracket]}], \ \[IndentingNewLine]Table[ Line[{{i, 1}, {i, \(Dimensions[ vCoeff]\)\[LeftDoubleBracket]2\[RightDoubleBracket]}\ }], {i, \(Dimensions[ uCoeff]\)\[LeftDoubleBracket]1\[RightDoubleBracket]}]}],\ \[IndentingNewLine]Frame \[Rule] False, DisplayFunction \[Rule] $DisplayFunction]]\)\(\[IndentingNewLine]\)\ \)\)], "Input", InitializationCell->True], Cell[BoxData[ \(General::"spell1" \(\(:\)\(\ \)\) "Possible spelling error: new symbol name \"\!\(vCoeff\)\" is similar \ to existing symbol \"\!\(uCoeff\)\"."\)], "Message"] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"field", "=", RowBox[{"{", RowBox[{ RowBox[{"makeGenFun", "[", RowBox[{ RowBox[{"2", RowBox[{"(", GridBox[{ {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)} }], ")"}]}], ",", \({0, 0}\), ",", "x", ",", "y"}], "]"}], ",", RowBox[{"makeGenFun", "[", RowBox[{ RowBox[{"(", GridBox[{ {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"} }], ")"}], ",", \({0, 0}\), ",", "x", ",", "y"}], "]"}]}], "}"}]}], ";"}]], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(dualPlotFlow[ subdivideVectorField[pf[2], \(1\/4\) field, 0], {{3, 6}, {3, 6}}, 0, x, y]\)], "Input", CellTags->"FIG primal/dual structure"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Primal plotting function for vector fields from flows", "Subsubsection"], Cell[TextData[{ "Observe that ", Cell[BoxData[ \(u\_k\)]], " is primal in ", Cell[BoxData[ \(x\)]], " and dual in ", Cell[BoxData[ \(y\)]], ". ", Cell[BoxData[ \(v\_k\)]], " is dual in ", Cell[BoxData[ \(x\)]], " and primal in ", Cell[BoxData[ \(y\)]], ". \t" }], "Text"], Cell[TextData[{ Cell[BoxData[ \(makeVectorCoeff\)]], " averages ", Cell[BoxData[ \(u\)]], " in ", Cell[BoxData[ \(y\)]], " direction and ", Cell[BoxData[ \(v\)]], " in ", Cell[BoxData[ \(x\)]], " direction so that resulting vector field is primal. Use ", Cell[BoxData[ \(makeCoeff\)]], " from chapter two." }], "Text"], Cell[BoxData[ \(makeVectorCoeff[{u_, v_}, {{minX_, maxX_}, {minY_, maxY_}}, k_, x_, y_] := With[{\[IndentingNewLine]uCoeff = makeCoeff[Expand[u \((1 + y)\)\/2], {{minX, maxX}, {minY, maxY}}, k, x, y], \[IndentingNewLine]vCoeff = makeCoeff[Expand[v \((1 + x)\)\/2], {{minX, maxX}, {minY, maxY}}, k, x, y]}, \[IndentingNewLine]Transpose[{uCoeff, vCoeff}, {3, 1, 2}]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(plotVectorArray[vec_] := \[IndentingNewLine]ListPlotVectorField[ Flatten[Table[{{i, j}, vec\[LeftDoubleBracket]i, j\[RightDoubleBracket]}, {i, \(Dimensions[ vec]\)\[LeftDoubleBracket]1\[RightDoubleBracket]}, {j, \ \(Dimensions[vec]\)\[LeftDoubleBracket]2\[RightDoubleBracket]}], 1], Frame -> True, FrameTicks -> False, HeadWidth -> 0.50]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(Show[ GraphicsArray[{\[IndentingNewLine]plotVectorArray[\[IndentingNewLine]\ makeVectorCoeff[ subdivideVectorField[sf[3], field, 1], {{7\/2, 11\/2}, {7\/2, 11\/2}}, 1, x, y]], \[IndentingNewLine]plotVectorArray[\[IndentingNewLine]\ makeVectorCoeff[ subdivideVectorField[sf[3], field, 2], {{7\/2, 11\/2}, {7\/2, 11\/2}}, 2, x, y]], \[IndentingNewLine]plotVectorArray[ makeVectorCoeff[ subdivideVectorField[sf[3], field, 3], {{7\/2, 11\/2}, {7\/2, 11\/2}}, 3, x, y]]}]]\)\(\[IndentingNewLine]\)\)\)], "Input", CellTags->"FIG flow example"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Application of finite subdivision masks", "Subsubsection"], Cell[TextData[{ "Given an approximate subdivision mask for perfect flow, ", Cell[BoxData[ \(subdivideVecField\)]], " computes increasing dense fields using the scheme. Note that we use dual \ subdivision rules appropriately to keep things centered." }], "Text"], Cell[BoxData[ \(subdivideVectorField[{{s11_, s12_}, {s21_, s22_}}, {u_, v_}, k_] := \[IndentingNewLine]If[k \[Equal] 0, {u, v}, With[{uu = u /. {x \[Rule] x\^2, y \[Rule] y\^2}, vv = v /. {x \[Rule] x\^2, y \[Rule] y\^2}}, \[IndentingNewLine]subdivideVectorField[{{s11, s12}, {s21, s22}}, Expand[{\[IndentingNewLine]y*s11*uu + x*s12*vv, \[IndentingNewLine]y*s21*uu + x*s22*vv}], \[IndentingNewLine]k - 1]]]\)], "Input", InitializationCell->True], Cell["Perfect flow basis function", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[{\[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[pf[3], {1, 0}, 0], {{\(-1\), 1}, {\(-1\), 2}}, 0, x, y] // plotVectorArray, \[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[pf[3], {1, 0}, 1], {{\(-1\), 1}, {\(-1\), 2}}, 1, x, y] // plotVectorArray, \[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[pf[3], {1, 0}, 2], {{\(-1\), 1}, {\(-1\), 2}}, 2, x, y] // plotVectorArray, \[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[pf[3], {1, 0}, 3], {{\(-1\), 1}, {\(-1\), 2}}, 3, x, y] // plotVectorArray}]]\)], "Input", CellTags->"FIG perfect flow basis via subdivision"], Cell[BoxData[ \(0.38836104513064135`\)], "Print"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["Subdivision for slow flow basis function", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(Show[ GraphicsArray[{\[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[sf[3], {1, 0}, 0], {{\(-1\), 1}, {\(-1\), 2}}, 0, x, y] // plotVectorArray, \[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[sf[3], {1, 0}, 1], {{\(-1\), 1}, {\(-1\), 2}}, 1, x, y] // plotVectorArray, \[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[sf[3], {1, 0}, 2], {{\(-1\), 1}, {\(-1\), 2}}, 2, x, y] // plotVectorArray, \[IndentingNewLine]makeVectorCoeff[ subdivideVectorField[sf[3], {1, 0}, 3], {{\(-1\), 1}, {\(-1\), 2}}, 3, x, y] // plotVectorArray}]]\)\)\)], "Input", CellTags->"FIG slow flow basis via subdivision"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Analytic bases for linear flow", "Subsection"], Cell["<True, CellTags->"S5.38.1"], Cell[CellGroupData[{ Cell["Analytic bases for perfect flow", "Subsubsection"], Cell[TextData[{ "Construction analytic basis for perfect flow via radial basis functions ", Cell[BoxData[ \(\[ScriptC][\[ScriptX], \[ScriptY]]\)]], " satisfying differential equation ", Cell[BoxData[ \(\[ScriptCapitalL][\[ScriptX], \[ScriptY]] \[ScriptC][\[ScriptX], \ \[ScriptY]] \[Equal] \[Delta][\[ScriptX], \[ScriptY]]\)]], "." }], "Text"], Cell[TextData[{ "Observe that the multiscale finite difference relation leads to discrete \ approximation ", Cell[BoxData[ \(n\_k[x, y]\)]], "that converge to a pair of continuous vector basis ", Cell[BoxData[ \({\[ScriptN]\_\[ScriptX][\[ScriptX], \[ScriptY]], \[ScriptN]\_\ \[ScriptY][\[ScriptX], \[ScriptY]]\)]], " in ", Cell[BoxData[ \(\[ScriptX]\)]], " and ", Cell[BoxData[ \(\[ScriptY]\)]], " directions, respectively" }], "Text"], Cell[BoxData[ RowBox[{\(n\_k[x, y]\), "=", RowBox[{\(4\^k\/l\_k[x, y]\), RowBox[{ RowBox[{"(", GridBox[{ {\(d\_k[y]\)}, {\(-d\_k[x]\)} }], ")"}], ".", RowBox[{"(", GridBox[{ {\(d\_0[y]\), \(-d\_0[x]\)} }], ")"}]}]}]}]], "Equation"], Cell["Now note that continuous analog of this expression ", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"(", GridBox[{ {\(\[ScriptN]\_\[ScriptX][\[ScriptX], \[ScriptY]]\), \(\[ScriptN]\ \_\[ScriptY][\[ScriptX], \[ScriptY]]\)} }], ")"}], "=", RowBox[{"(", GridBox[{ {\(\[ScriptG][\[ScriptX], \[ScriptY]] - \[ScriptG][\[ScriptX], \ \[ScriptY] - 1]\), \(\[ScriptG][\[ScriptX] - 1, \[ScriptY]] - \[ScriptG][\[ScriptX], \[ScriptY]]\)} }], ")"}]}]], "Equation"], Cell["where ", "Text"], Cell[BoxData[ RowBox[{\(\[ScriptG][\[ScriptX], \[ScriptY]]\), "=", RowBox[{"(", GridBox[{ {\(\[ScriptCapitalD][\[ScriptY]] \[ScriptC][\[ScriptX], \ \[ScriptY]]\)}, {\(\(-\[ScriptCapitalD][\[ScriptX]]\) \[ScriptC][\[ScriptX], \ \[ScriptY]]\)} }], ")"}]}]], "Equation"], Cell["is a source of pure rotational flow.", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\[ScriptC][\[ScriptX]_, \[ScriptY]_] := Log[\[ScriptX]\^2 + \[ScriptY]\^2]\/\(4 \[Pi]\)\n\), "\ \[IndentingNewLine]", \(\(\[ScriptG][\[ScriptX]_, \[ScriptY]_] = {D[\[ScriptC][\[ScriptX], \ \[ScriptY]], \[ScriptY]], \(-D[\[ScriptC][\[ScriptX], \[ScriptY]], \ \[ScriptX]]\)};\)\n\), "\[IndentingNewLine]", \(\(\[ScriptN]\[ScriptX][\[ScriptX]_, \[ScriptY]_] = \ \[ScriptG][\[ScriptX], \[ScriptY] + 1\/2] - \[ScriptG][\[ScriptX], \[ScriptY] - 1\/2];\)\), "\n", \(\(\[ScriptN]\[ScriptY][\[ScriptX]_, \[ScriptY]_] = \ \[ScriptG][\[ScriptX] - 1\/2, \[ScriptY]] - \[ScriptG][\[ScriptX] + 1\/2, \[ScriptY]];\)\)}], "Input"], Cell[BoxData[ \(General::"spell1" \(\(:\)\(\ \)\) "Possible spelling error: new symbol name \ \"\!\(\[ScriptN]\[ScriptY]\)\" is similar to existing symbol \"\!\(\[ScriptN]\ \[ScriptX]\)\"."\)], "Message"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[{PlotVectorField[\[ScriptG][\[ScriptX], \[ScriptY]], {\ \[ScriptX], \(-1\), 1}, {\[ScriptY], \(-1\), 1}, Frame -> True, FrameTicks \[Rule] False, HeadWidth -> 0.25, PlotPoints \[Rule] 17], \[IndentingNewLine]PlotVectorField[\[ScriptN]\[ScriptX][\ \[ScriptX], \[ScriptY]], {\[ScriptX], \(-1\), 1}, {\[ScriptY], \(-1.5\), 1.5}, Frame -> True, FrameTicks \[Rule] False, HeadWidth -> 0.5, PlotPoints \[Rule] {17, 25}]}]]\)], "Input", CellTags->"FIG rotational/basis vector functions"], Cell[BoxData[ \(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0\) encountered."\)], "Message"], Cell[BoxData[ RowBox[{\(\[Infinity]::"indet"\), \(\(:\)\(\ \)\), "\<\"Indeterminate \ expression \\!\\(\\(0\\\\ \\*InterpretationBox[\\\"ComplexInfinity\\\", \ DirectedInfinity[]]\\)\\/\[Pi]\\) encountered.\"\>"}]], "Message"], Cell[BoxData[ \(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0\) encountered."\)], "Message"], Cell[BoxData[ RowBox[{\(\[Infinity]::"indet"\), \(\(:\)\(\ \)\), "\<\"Indeterminate \ expression \\!\\(\\(0\\\\ \\*InterpretationBox[\\\"ComplexInfinity\\\", \ DirectedInfinity[]]\\)\\/\[Pi]\\) encountered.\"\>"}]], "Message"], Cell[BoxData[ \(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0.`\) encountered."\)], "Message"], Cell[BoxData[ \(General::"stop" \(\(:\)\(\ \)\) "Further output of \!\(Power :: \"infy\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ RowBox[{\(\[Infinity]::"indet"\), \(\(:\)\(\ \)\), "\<\"Indeterminate \ expression \\!\\(\\(0.`\\\\ \\*InterpretationBox[\\\"ComplexInfinity\\\", \ DirectedInfinity[]]\\)\\/\[Pi]\\) encountered.\"\>"}]], "Message"], Cell[BoxData[ \(General::"stop" \(\(:\)\(\ \)\) "Further output of \!\(\[Infinity] :: \"indet\"\) will be suppressed \ during this calculation."\)], "Message"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Analytic bases for slow flow", "Subsubsection"], Cell[BoxData[{ \(\[ScriptC][\[ScriptX]_, \[ScriptY]_] := \(\((\[ScriptX]\^2 + \[ScriptY]\ \^2)\) Log[\[ScriptX]\^2 + \[ScriptY]\^2]\)\/\(16 \[Pi]\)\n\), "\ \[IndentingNewLine]", \(\(\[ScriptG][\[ScriptX]_, \[ScriptY]_] = {\[IndentingNewLine]D[\(-4\) \ \[ScriptC][\[ScriptX], \[ScriptY]] + \[ScriptC][\[ScriptX] - 1, \[ScriptY]] + \[ScriptC][\[ScriptX] + 1, \[ScriptY]] + \[ScriptC][\[ScriptX], \[ScriptY] - 1] + \[ScriptC][\[ScriptX], \[ScriptY] + 1], \[ScriptY]], \[IndentingNewLine]\(-D[\(-4\) \[ScriptC][\ \[ScriptX], \[ScriptY]] + \[ScriptC][\[ScriptX] - 1, \[ScriptY]] + \[ScriptC][\[ScriptX] + 1, \[ScriptY]] + \[ScriptC][\[ScriptX], \[ScriptY] - 1] + \[ScriptC][\[ScriptX], \[ScriptY] + 1], \[ScriptX]]\)};\)\[IndentingNewLine]\), "\n", \(\(\[ScriptN]\[ScriptX][\[ScriptX]_, \[ScriptY]_] = \ \[ScriptG][\[ScriptX], \[ScriptY] + 1\/2] - \[ScriptG][\[ScriptX], \[ScriptY] - 1\/2];\)\), "\n", \(\(\[ScriptN]\[ScriptY][\[ScriptX]_, \[ScriptY]_] = \ \[ScriptG][\[ScriptX] - 1\/2, \[ScriptY]] - \[ScriptG][\[ScriptX] + 1\/2, \[ScriptY]];\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[ GraphicsArray[{PlotVectorField[\[ScriptG][\[ScriptX], \[ScriptY]], {\ \[ScriptX], \(-1\), 1}, {\[ScriptY], \(-1\), 1}, Frame -> True, FrameTicks \[Rule] False, HeadWidth -> 0.25, PlotPoints \[Rule] 17], \[IndentingNewLine]PlotVectorField[\[ScriptN]\[ScriptX][\ \[ScriptX], \[ScriptY]], {\[ScriptX], \(-1\), 1}, {\[ScriptY], \(-1.5\), 1.5}, Frame -> True, FrameTicks \[Rule] False, HeadWidth -> 0.5, PlotPoints \[Rule] {17, 25}]}]]\)], "Input", CellTags->"FIG slow rotational/basis vector functions"], Cell[BoxData[ \(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0\) encountered."\)], "Message"], Cell[BoxData[ RowBox[{\(\[Infinity]::"indet"\), \(\(:\)\(\ \)\), "\<\"Indeterminate \ expression \\!\\(\\(0\\\\ \\*InterpretationBox[\\\"ComplexInfinity\\\", \ DirectedInfinity[]]\\)\\/\[Pi]\\) encountered.\"\>"}]], "Message"], Cell[BoxData[ \(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0\) encountered."\)], "Message"], Cell[BoxData[ RowBox[{\(\[Infinity]::"indet"\), \(\(:\)\(\ \)\), "\<\"Indeterminate \ expression \\!\\(\\(0\\\\ \\*InterpretationBox[\\\"ComplexInfinity\\\", \ DirectedInfinity[]]\\)\\/\[Pi]\\) encountered.\"\>"}]], "Message"], Cell[BoxData[ \(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0.`\) encountered."\)], "Message"], Cell[BoxData[ \(General::"stop" \(\(:\)\(\ \)\) "Further output of \!\(Power :: \"infy\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ RowBox[{\(\[Infinity]::"indet"\), \(\(:\)\(\ \)\), "\<\"Indeterminate \ expression \\!\\(\\(0.`\\\\ \\*InterpretationBox[\\\"ComplexInfinity\\\", \ DirectedInfinity[]]\\)\\/\[Pi]\\) encountered.\"\>"}]], "Message"], Cell[BoxData[ \(General::"stop" \(\(:\)\(\ \)\) "Further output of \!\(\[Infinity] :: \"indet\"\) will be suppressed \ during this calculation."\)], "Message"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] GraphicsArray \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Construction of figure 5.18", "Subsubsection"], Cell[TextData[{ "For this final example, we will build an analytic representation for the \ flow of figure 5.18. The trick to rendering this flow in a reasonable amount \ of time is to simplify the analytic representation for the flow treating ", Cell[BoxData[ \(\[ScriptN]\[ScriptX]\)]], " and ", Cell[BoxData[ \(\[ScriptN]\[ScriptY]\)]], " as being defined in terms of the symbols ", Cell[BoxData[ \(\[ScriptC]\)]], " and ", Cell[BoxData[ \(\[ScriptG]\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(Clear[\[ScriptC], \[ScriptG]]\), "\n", \(\(\[ScriptN]\[ScriptX][\[ScriptX]_, \[ScriptY]_] = \ \[ScriptG][\[ScriptX], \[ScriptY] + 1\/2] - \[ScriptG][\[ScriptX], \[ScriptY] - 1\/2];\)\), "\n", \(\(\[ScriptN]\[ScriptY][\[ScriptX]_, \[ScriptY]_] = \ \[ScriptG][\[ScriptX] - 1\/2, \[ScriptY]] - \[ScriptG][\[ScriptX] + 1\/2, \[ScriptY]];\)\)}], "Input"], Cell[BoxData[ \(General::"spell1" \(\(:\)\(\ \)\) "Possible spelling error: new symbol name \ \"\!\(\[ScriptN]\[ScriptY]\)\" is similar to existing symbol \"\!\(\[ScriptN]\ \[ScriptX]\)\"."\)], "Message"] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"\[ScriptF]", "=", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", GridBox[{ {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)} }], ")"}], "\[LeftDoubleBracket]", \(i, j\), "\[RightDoubleBracket]"}], \(\[ScriptN]\[ScriptX][\ \[ScriptX] - i + 1\/2, \[ScriptY] - j + 1\/2]\)}], ",", \({i, 10}\), ",", \({j, 10}\)}], "]"}], "+", "\[IndentingNewLine]", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", GridBox[{ {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "1", "1"} }], ")"}], "\[LeftDoubleBracket]", \(i, j\), "\[RightDoubleBracket]"}], \(\[ScriptN]\[ScriptY][\ \[ScriptX] - i + 1\/2, \[ScriptY] - j + 1\/2]\)}], ",", \({i, 10}\), ",", \({j, 10}\)}], "]"}]}], "//", "Simplify"}]}], ";"}]], "Input"], Cell[TextData[{ "Now, add definitions for ", Cell[BoxData[ \(\[ScriptC]\)]], " and ", Cell[BoxData[ \(\[ScriptG]\)]], "." }], "Text"], Cell[BoxData[{ \(\[ScriptC][\[ScriptX]_, \[ScriptY]_] := \(\((\[ScriptX]\^2 + \[ScriptY]\ \^2)\) Log[\[ScriptX]\^2 + \[ScriptY]\^2]\)\/\(16 \[Pi]\)\n\), "\ \[IndentingNewLine]", \(\(\[ScriptG][\[ScriptX]_, \[ScriptY]_] = {\[IndentingNewLine]D[\(-4\) \ \[ScriptC][\[ScriptX], \[ScriptY]] + \[ScriptC][\[ScriptX] - 1, \[ScriptY]] + \[ScriptC][\[ScriptX] + 1, \[ScriptY]] + \[ScriptC][\[ScriptX], \[ScriptY] - 1] + \[ScriptC][\[ScriptX], \[ScriptY] + 1], \[ScriptY]], \[IndentingNewLine]\(-D[\(-4\) \[ScriptC][\ \[ScriptX], \[ScriptY]] + \[ScriptC][\[ScriptX] - 1, \[ScriptY]] + \[ScriptC][\[ScriptX] + 1, \[ScriptY]] + \[ScriptC][\[ScriptX], \[ScriptY] - 1] + \[ScriptC][\[ScriptX], \[ScriptY] + 1], \[ScriptX]]\)};\)\)}], "Input"], Cell["Plot example", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(PlotVectorField[\[ScriptF], {\[ScriptX], 3.51, 5.51}, {\[ScriptY], 3.51, 5.51}, Frame -> True, FrameTicks -> False, HeadWidth -> 0.25, PlotPoints \[Rule] 17]\)], "Input", CellTags->"FIG last example"], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Closed]] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1280}, {0, 951}}, AutoGeneratedPackage->None, WindowSize->{1014, 668}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification->1.25, StyleDefinitions -> Notebook[{ Cell[CellGroupData[{ Cell["Style Definitions", "Subtitle"], Cell["\<\ Modify the definitions below to change the default appearance of all cells in \ a given style. Make modifications to any definition using commands in the \ Format menu.\ \>", "Text"], Cell[CellGroupData[{ Cell["Style Environment Names", "Section"], Cell[StyleData[All, "Working"], PageWidth->WindowWidth, ScriptMinSize->9], Cell[StyleData[All, "Presentation"], PageWidth->WindowWidth, ScriptMinSize->12, FontSize->16], Cell[StyleData[All, "Condensed"], PageWidth->WindowWidth, CellBracketOptions->{"Margins"->{1, 1}, "Widths"->{0, 5}}, ScriptMinSize->8, FontSize->11], Cell[StyleData[All, "Printout"], PageWidth->PaperWidth, ScriptMinSize->7, FontSize->10, PrivateFontOptions->{"FontType"->"Outline"}] }, Open ]], Cell[CellGroupData[{ Cell["Notebook Options", "Section"], Cell["\<\ The options defined for the style below will be used at the Notebook level.\ \>", "Text"], Cell[StyleData["Notebook"], PageHeaders->{{Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"], Cell[ TextData[ { ValueBox[ "DateLong"]}], "Header"], Cell[ TextData[ {"Chapter ", CounterBox[ "Chapter"]}], "Header"]}, {Cell[ TextData[ {"Chapter ", CounterBox[ "Chapter"]}], "Header"], Cell[ TextData[ { ValueBox[ "DateLong"]}], "Header"], Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"]}}, PageHeaderLines->{True, True}, PrintingOptions->{"PrintingMargins"->{{108, 72}, {72, 72}}, "FirstPageHeader"->False, "FacingPages"->True}, CellFrameLabelMargins->6, TextJustification->1, LineSpacing->{2, 0}, StyleMenuListing->None, FontSize->12] }, Open ]], Cell[CellGroupData[{ Cell["Styles for Headings", "Section"], Cell[CellGroupData[{ Cell[StyleData["Title"], ShowCellBracket->False, CellMargins->{{0, 0}, {0, 0}}, PageBreakBelow->False, TextAlignment->Center, CounterIncrements->"Title", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Subtitle", 0}, {"Chapter", 0}}, FontSize->34, FontColor->GrayLevel[1], Background->RGBColor[0.571389, 0.19675, 0.570504]], Cell[StyleData["Title", "Presentation"], CellMargins->{{0, 0}, {0, 0}}, FontSize->44], Cell[StyleData["Title", "Condensed"], CellMargins->{{0, 0}, {0, 0}}, FontSize->20], Cell[StyleData["Title", "Printout"], CellMargins->{{0, 0}, {0, 0}}, FontSize->24, FontTracking->"Plain", Background->GrayLevel[0]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subtitle"], ShowCellBracket->False, CellMargins->{{0, 0}, {0, 0}}, PageBreakBelow->False, TextAlignment->Center, ParagraphIndent->-96, CounterIncrements->"Subtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Chapter", 0}}, FontFamily->"Helvetica", FontSize->18, FontColor->GrayLevel[1], Background->RGBColor[0.2, 0.700008, 0.700008]], Cell[StyleData["Subtitle", "Presentation"], CellMargins->{{0, 0}, {0, 0}}, ParagraphIndent->-157, FontSize->30], Cell[StyleData["Subtitle", "Condensed"], CellMargins->{{0, 0}, {0, 0}}, ParagraphIndent->-78, FontSize->14], Cell[StyleData["Subtitle", "Printout"], CellMargins->{{0, 0}, {0, 0}}, ParagraphIndent->-85, FontSize->16, Background->GrayLevel[0.6]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Chapter"], CellFrame->False, ShowCellBracket->True, ShowGroupOpenCloseIcon->False, ShowShortBoxForm->False, CellMargins->{{10, 4}, {50, 150}}, CellGroupingRules->{"SectionGrouping", 20}, PageBreakBelow->False, CellFrameLabels->{{Cell[ TextData[ {"Chapter ", CounterBox[ "Chapter"], ": "}]], None}, {None, None}}, CounterIncrements->"Chapter", CounterAssignments->{{"Section", 0}, {"NumberedEquation", 0}, { "NumberedFigure", 0}, {"NumberedTable", 0}, {"Theorem", 0}}, FontFamily->"Helvetica", FontSize->24, FontSlant->"Italic", Background->GrayLevel[1]], Cell[StyleData["Chapter", "Presentation"], CellMargins->{{8, 10}, {40, 20}}, FontSize->24], Cell[StyleData["Chapter", "Condensed"], CellMargins->{{8, 10}, {12, 8}}, FontSize->12], Cell[StyleData["Chapter", "Printout"], CellMargins->{{9, 10}, {50, 10}}, FontSize->14] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Section"], CellFrame->False, CellDingbat->None, CellMargins->{{12, Inherited}, {4, 24}}, CellGroupingRules->{"SectionGrouping", 30}, PageBreakBelow->False, CellFrameMargins->6, CellFrameLabels->{{Cell[ TextData[ { CounterBox[ "Chapter"], ".", CounterBox[ "Section"], " "}]], None}, {None, None}}, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, FontFamily->"Helvetica", FontSize->18, FontWeight->"Bold", FontColor->GrayLevel[0]], Cell[StyleData["Section", "Presentation"], CellMargins->{{10, 10}, {8, 32}}, FontSize->24, FontTracking->"Condensed"], Cell[StyleData["Section", "Condensed"], CellMargins->{{8, Inherited}, {2, 12}}, FontSize->12], Cell[StyleData["Section", "Printout"], CellMargins->{{9, 0}, {2, 50}}, FontSize->14, FontTracking->"Plain", FontColor->GrayLevel[0]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subsection"], CellMargins->{{12, Inherited}, {8, 20}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CellFrameLabels->{{Cell[ TextData[ { CounterBox[ "Chapter"], ".", CounterBox[ "Section"], ".", CounterBox[ "Subsection"], " "}]], None}, {None, None}}, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, FontFamily->"Helvetica", FontSize->13, FontWeight->"Bold"], Cell[StyleData["Subsection", "Presentation"], CellMargins->{{11, 10}, {8, 32}}, FontSize->22], Cell[StyleData["Subsection", "Condensed"], CellMargins->{{8, Inherited}, {2, 12}}, FontSize->12], Cell[StyleData["Subsection", "Printout"], CellMargins->{{9, 0}, {4, 40}}, FontSize->12] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subsubsection"], CellDingbat->"\[FilledSquare]", CellMargins->{{25, Inherited}, {8, 12}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsubsection", FontFamily->"Times", FontSize->12, FontWeight->"Bold"], Cell[StyleData["Subsubsection", "Presentation"], CellMargins->{{29, 10}, {8, 26}}, FontSize->18], Cell[StyleData["Subsubsection", "Condensed"], CellMargins->{{22, Inherited}, {2, 12}}, FontSize->10], Cell[StyleData["Subsubsection", "Printout"], CellMargins->{{21, 0}, {4, 20}}, FontSize->11] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Styles for Body Text", "Section"], Cell[CellGroupData[{ Cell[StyleData["Text"], CellMargins->{{12, 10}, {5, 5}}, PageBreakWithin->True, TextJustification->1, Hyphenation->True, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 12}, CounterIncrements->"Text", FontFamily->"Times"], Cell[StyleData["Text", "Presentation"], CellMargins->{{13, 10}, {8, 8}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 12}], Cell[StyleData["Text", "Condensed"], CellMargins->{{8, 10}, {4, 4}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 4}], Cell[StyleData["Text", "Printout"], CellMargins->{{9, 0}, {4, 4}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 6}] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Itemize"], CellDingbat->"\[FilledSmallCircle]", CellMargins->{{36, 10}, {5, 5}}, TextJustification->1, Hyphenation->True, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 12}, CounterIncrements->"Text", FontFamily->"Times"], Cell[StyleData["Itemize", "Presentation"], CellDingbat->"\[FilledSmallCircle]", CellMargins->{{36, 10}, {8, 8}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 12}], Cell[StyleData["Itemize", "Condensed"], CellDingbat->"\[FilledSmallCircle]", CellMargins->{{36, 10}, {4, 4}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 4}], Cell[StyleData["Itemize", "Printout"], CellDingbat->"\[FilledSmallCircle]", CellMargins->{{36, 0}, {4, 4}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 6}] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["ItemizeFollow"], CellMargins->{{36, 10}, {0, 0}}, TextJustification->1, Hyphenation->True, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 12}, CounterIncrements->"Text", FontFamily->"Times"], Cell[StyleData["ItemizeFollow", "Presentation"], CellMargins->{{36, 10}, {0, 0}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 12}], Cell[StyleData["ItemizeFollow", "Condensed"], CellMargins->{{36, 10}, {0, 0}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 4}], Cell[StyleData["ItemizeFollow", "Printout"], CellMargins->{{36, 0}, {0, 0}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 6}] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["SmallText"], CellMargins->{{12, 10}, {5, 5}}, TextJustification->1, Hyphenation->True, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, ParagraphSpacing->{0, 6}, CounterIncrements->"SmallText", FontFamily->"Helvetica", FontSize->9], Cell[StyleData["SmallText", "Presentation"], CellMargins->{{13, 10}, {8, 8}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, FontSize->12], Cell[StyleData["SmallText", "Condensed"], CellMargins->{{8, 10}, {2, 2}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, FontSize->9], Cell[StyleData["SmallText", "Printout"], CellMargins->{{9, 0}, {4, 4}}, TextJustification->1, HyphenationOptions->{"HyphenationCharacter"->"\[Hyphen]"}, FontSize->7] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Styles for Input/Output", "Section"], Cell["\<\ The cells in this section define styles used for input and output to the \ kernel. Be careful when modifying, renaming, or removing these styles, \ because the front end associates special meanings with these style names.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Input"], CellMargins->{{52, 10}, {8, 8}}, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelMargins->{{5, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultInputFormatType, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontWeight->"Bold", FontColor->GrayLevel[0], Background->RGBColor[0.500008, 1, 0.500008]], Cell[StyleData["Input", "Presentation"], CellMargins->{{62, Inherited}, {10, 10}}], Cell[StyleData["Input", "Condensed"], CellMargins->{{40, 10}, {4, 4}}], Cell[StyleData["Input", "Printout"], CellFrame->True, CellMargins->{{44, 0}, {6, 6}}, Background->None] }, Open ]], Cell[StyleData["InlineInput"], CellFrame->True, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, Fo