SetDirectory[$HomeDirectory<>"/Documents/handouts/math467/LaplacePoisson"]

Laplace’s and Poisson’s Equations

5-Point Formula

Graphics[{PointSize[Medium],Point[{{4,1},{3,2},{4,2},{5,2},{4,3}}],Dashed,Line[{{3,2},{5,2}}],Line[{{4,1},{4,3}}],(*Text["1",{3.5,2.25}],Text["1",{4.25,2.5}],Text["1",{4.5,2.25}],Text["1",{4.25,1.5},Background->White],*)Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
StyleBox["i", "TI"], 
RowBox[{
StyleBox["j", "TI"], "-", "1"}]], TraditionalForm], "errors" -> {}, "input" -> "u_{i}^{j-1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{4,1},{0,1.5}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
RowBox[{
StyleBox["i", "TI"], "-", "1"}], 
StyleBox["j", "TI"]], TraditionalForm], "errors" -> {}, "input" -> "u_{i-1}^{j}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{3,2},{1.5,0}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
StyleBox["i", "TI"], 
StyleBox["j", "TI"]], TraditionalForm], "errors" -> {}, "input" -> "u_{i}^{j}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{4,2},{1.5,1.25}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
RowBox[{
StyleBox["i", "TI"], "+", "1"}], 
StyleBox["j", "TI"]], TraditionalForm], "errors" -> {}, "input" -> "u_{i+1}^{j}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{5,2},{-1.5,0}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
StyleBox["i", "TI"], 
RowBox[{
StyleBox["j", "TI"], "+", "1"}]], TraditionalForm], "errors" -> {}, "input" -> "u_{i}^{j+1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{4,3},{0,-1.25}]},Axes->True,AxesLabel->{"\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
StyleBox["x", "TI"], TraditionalForm], "errors" -> {}, "input" -> "x", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)","\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
StyleBox["y", "TI"], TraditionalForm], "errors" -> {}, "input" -> "y", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)"},Ticks->{{{3,"\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
RowBox[{"(", 
RowBox[{
StyleBox["i", "TI"], "-", "1"}], ")"}], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "(i - 1) h", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},{4,"\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
RowBox[{
StyleBox["i", "TI"], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "ih", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)"},{5,"\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
RowBox[{"(", 
RowBox[{
StyleBox["i", "TI"], "+", "1"}], ")"}], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "(i + 1) h", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"}},{{1,"\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
RowBox[{"(", 
RowBox[{
StyleBox["j", "TI"], "-", "1"}], ")"}], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "(j - 1) h", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},{2,"\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
RowBox[{
StyleBox["j", "TI"], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "jh", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)"},{3,"\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
RowBox[{"(", 
RowBox[{
StyleBox["j", "TI"], "+", "1"}], ")"}], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "(j + 1) h", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"}}},PlotRange->{{0,8},{0,4}},BaseStyle->FontSize->12]

Export["laplace5pt.pdf",%,"PDF"]

Export["laplace5pt.eps",%%,"EPS"]

Graphics[{EdgeForm[Black],FaceForm[White],Rectangle[{0,0},{3,2}],PointSize[Medium],Table[Point[{x,y}],{x,0,3,1/4},{y,0,2,1/4}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "1", "1"], TraditionalForm], "errors" -> {}, "input" -> "u_{1}^{1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{1,1}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "2", "1"], TraditionalForm], "errors" -> {}, "input" -> "u_{2}^{1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{2,1}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "3", "1"], TraditionalForm], "errors" -> {}, "input" -> "u_{3}^{1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{3,1}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
RowBox[{
StyleBox["N", "TI"], "-", "1"}], "1"], TraditionalForm], "errors" -> {}, "input" -> "u_{N-1}^{1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{11,1}/4,{-1,1.25}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "1", "2"], TraditionalForm], "errors" -> {}, "input" -> "u_{1}^{2}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{1,2}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "2", "2"], TraditionalForm], "errors" -> {}, "input" -> "u_{2}^{2}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{2,2}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "3", "2"], TraditionalForm], "errors" -> {}, "input" -> "u_{3}^{2}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{3,2}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
RowBox[{
StyleBox["N", "TI"], "-", "1"}], "2"], TraditionalForm], "errors" -> {}, "input" -> "u_{N-1}^{2}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{11,2}/4,{-1,1.25}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "1", "3"], TraditionalForm], "errors" -> {}, "input" -> "u_{1}^{3}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{1,3}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "2", "3"], TraditionalForm], "errors" -> {}, "input" -> "u_{2}^{3}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{2,3}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "3", "3"], TraditionalForm], "errors" -> {}, "input" -> "u_{3}^{3}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{3,3}/4,1.25{1,1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
RowBox[{
StyleBox["N", "TI"], "-", "1"}], "3"], TraditionalForm], "errors" -> {}, "input" -> "u_{N-1}^{3}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{11,3}/4,{-1,1.25}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "1", 
RowBox[{
StyleBox["M", "TI"], "-", "1"}]], TraditionalForm], "errors" -> {}, "input" -> "u_{1}^{M-1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{1,7}/4,1.25{0,-1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "2", 
RowBox[{
StyleBox["M", "TI"], "-", "1"}]], TraditionalForm], "errors" -> {}, "input" -> "u_{2}^{M-1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{2,7}/4,1.25{0,-1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], "3", 
RowBox[{
StyleBox["M", "TI"], "-", "1"}]], TraditionalForm], "errors" -> {}, "input" -> "u_{3}^{M-1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{3,7}/4,1.25{0,-1}],Text["\!\(\*TemplateBox[<|"boxes" -> FormBox[
SubsuperscriptBox[
StyleBox["u", "TI"], 
RowBox[{
StyleBox["N", "TI"], "-", "1"}], 
RowBox[{
StyleBox["M", "TI"], "-", "1"}]], TraditionalForm], "errors" -> {}, "input" -> "u_{N-1}^{M-1}", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)",{11,7}/4,{-1,-1.25}]},Axes->True,AxesLabel->{"x","y"},AxesOrigin->{-1,-1}/4,Ticks->{Join[Table[{x,4x"\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
StyleBox["h", "TI"], TraditionalForm], "errors" -> {}, "input" -> "h", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)"},{x,{0,1,2,3}/4}],{{11/4,"\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
RowBox[{"(", 
RowBox[{
StyleBox["N", "TI"], "-", "1"}], ")"}], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "(N - 1) h", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},{3,"\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
RowBox[{
StyleBox["N", "TI"], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "Nh", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)"}}],Join[Table[{y,4y"\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
StyleBox["h", "TI"], TraditionalForm], "errors" -> {}, "input" -> "h", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)"},{y,{0,1,2,3}/4}],{{7/4,"\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
RowBox[{"(", 
RowBox[{
StyleBox["M", "TI"], "-", "1"}], ")"}], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "(M - 1) h", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},{2,"\!\(\*StyleBox[TemplateBox[<|"boxes" -> FormBox[
RowBox[{
StyleBox["M", "TI"], 
StyleBox["h", "TI"]}], TraditionalForm], "errors" -> {}, "input" -> "Mh", "state" -> "Boxes"|>,"TeXAssistantTemplate"],FontSlant->"Italic"]\)"}}]}]

Export["LaplaceRect.pdf",%,"PDF"]

Export["LaplaceRect.eps",%%,"EPS"]