(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. 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[ 27879, 747]*) (*NotebookOutlinePosition[ 28541, 770]*) (* CellTagsIndexPosition[ 28497, 766]*) (*WindowFrame->Normal*) Notebook[{ Cell[BoxData[ StyleBox[\(\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Numerik\ - \ Aufgabe\ 4\ \ A\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ SS\ \ 2005\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)\(\ \)\), "Subtitle", FontColor->RGBColor[1, 0, 0]]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ RowBox[{ RowBox[{ StyleBox["(*", "Section", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", "Section", FontColor->RGBColor[1, 0, 0]], StyleBox[\(\(Interpolation\)\(:\)\), "Section", FontColor->RGBColor[1, 0, 0]], StyleBox[ RowBox[{ StyleBox[" ", "Section"], StyleBox[ " \ ", "Section", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", "Section"]}]], StyleBox["*)", "Section", FontColor->RGBColor[1, 0, 0]]}], "\n", StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1. \ Klassische\ Interpolation\ \((Newton)\)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), "Section", FontColor->RGBColor[1, 0, 0]], "\n", StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2. Nat\[UDoubleDot]rliche\ Kubische\ Spline - Interpolation\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), "Section", FontColor->RGBColor[1, 0, 0]]}]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ \(\(\(\(\(Off[General::spell]\)\(\ \)\) \)\(;\)\(\ \ \ \ \ \ \)\(Off[ General::spell1]\)\(\ \)\)\)], "Input"], Cell[BoxData[ RowBox[{\(lauf = 1\), ";", " ", StyleBox[\( (*\ \ Lauf\ mit\ der\ Nummer\ lauf\ \ , \ alle\ vorhergehenden\ L\[ADoubleDot]ufe\ bleiben\ \(erhalten\ !\)\ *) \ \), "Subsubtitle", FontColor->RGBColor[1, 0, 0]]}]], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ Vorgeben\ \(("\")\)\ der\ m + 1\ St\[UDoubleDot]tzpunkte\ , \[IndentingNewLine]\ \ \ \ \ \ \ L\ \[ODoubleDot]schen\ \(("\< L \>")\)\ , \ \ Einf\[UDoubleDot]gen\ \(("\< E \ \>")\)\ \ oder\ \ \[CapitalADoubleDot]ndern\ \(("\< K\>")\)\ eines\ Punktes\ \ \ ?\ \ \ \ \ nichts\ \[CapitalADoubleDot]ndern\ \ \(("\< N \>")\)\ \ \ \ \ \ *) \ \), "Subsubtitle", FontColor->RGBColor[1, 0, 0]]}]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ RowBox[{" ", RowBox[{\(sch = \ "\"\), ";", StyleBox[ RowBox[{" ", StyleBox[" ", FontSize->16, FontColor->RGBColor[1, 0, 1]]}]], StyleBox[\( (*\ \ \ \ \ \ Erster\ Lauf\ mit\ vorgegebenen\ \(Werten\ \ !\)\ \ \ \ *) \), FontSize->16, FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], "\[IndentingNewLine]", StyleBox[" ", FontSize->14, FontColor->RGBColor[1, 0, 0]], StyleBox[\( (*\ Hier\ \[CapitalADoubleDot]nderungen\ \((L, E, K)\)\ eingeben\ und\ direkt\ ausf\[UDoubleDot]hren\ \ \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ oder\ N\ f\[UDoubleDot]r\ nicht\ \ \[ADoubleDot]ndern\ bei\ einem\ neuen\ Lauf\ *) \), FontSize->16, FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontSize->16, FontColor->RGBColor[1, 0, 0]]}]}]], "Input"], Cell[BoxData[ \(If[sch \[Equal] "\", If[index \[GreaterEqual] 0\ And\ index \[LessEqual] m\ \ , \ \ \ \[IndentingNewLine]TableForm[ Table[{ind = PaddedForm[i, 2], "\< xp[\>", ind, "\<] = \>", PaddedForm[xp[i], {3, 2}], \[IndentingNewLine]"\< yp[\>", ind, "\<] = \>", PaddedForm[yp[i], {3, 2}]}, {i, 0, m}], TableSpacing \[Rule] {1, 0}]]]\)], "Input"], Cell[BoxData[ RowBox[{ StyleBox["(*", FontColor->RGBColor[1, 0, 1]], StyleBox[ RowBox[{ StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", "Subsection", FontColor->RGBColor[1, 0, 1]]}]], StyleBox[\(St\[UDoubleDot]tzpunkte\ 0, .. , m\ \ eingeben\), "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[ RowBox[{ StyleBox[" ", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]]}]], StyleBox["*)", FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(\(If[\ sch == "\", {\ \ m = 10, \[IndentingNewLine]\ xp[0] = \(-4. \); \ \ \ yp[0] = 0. ; \ \ \ xp[1] = \(-3.95\); \ \ \ \ \ yp[1] = 0.5; \ \ \ \ \ \ xp[2] = \(-3.5\); \ \ \ \ \ \ yp[2] = 1.5; \ \ \ \ \ \ \ xp[3] = \(-3. \); \ \ \ yp[3] = 2. ; \ \ \ xp[4] = \ \(-2\); \ \ \ \ \ \ \ \ \ \ yp[4] = 2.6; \ \ \ \ \ \ xp[5] = \ \(-1\); \ \ \ \ \ \ \ \ \ yp[5] = 2.9; \ \ \ \ \ \ \ \ \ xp[6] = \ \ \ 0. ; \ \ \ yp[6] = 3. ; \ \ xp[7] = \ \ \ 2; \ \ \ \ \ \ \ \ \ \ \ yp[7] = 2.6; \ \ \ \ \ \ \ xp[8] = \(+3. \); \ \ \ \ \ \ \ \ yp[8] = 2. ; \n\ \ \ \ \ \ \ \ xp[9] = \ 3.75; \ yp[9] = 1; \ \ \ \ xp[10] = \(+4. \); \ \ \ \ \ \ yp[10] = 0. ;\ \ \ }\ \ \ \ ];\)\)], "Input"], Cell[BoxData[ RowBox[{ StyleBox["(*", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[\(Vorgegebene\ St\[UDoubleDot]tzpunkte\ 0, .. , m\), "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox["*)", FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(If[sch == "\", TableForm[ Table[{ind = PaddedForm[i, 2], "\< xp[\>", ind, "\<] = \>", PaddedForm[xp[i], {3, 2}], "\< yp[\>", ind, "\<] = \>", PaddedForm[yp[i], {3, 2}]}, {i, 0, m}], TableSpacing \[Rule] {1, 0}]]\)], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ L\[ODoubleDot]schen\ \ eines\ \ Punktes\ \ mit\ \ der\ \ Nummer\ \ index\ \ \ \ *) \), "Subsubtitle", FontColor->RGBColor[1, 0, 0]]}]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ RowBox[{" ", RowBox[{\(index\ = \ 1\), " ", ";", " ", StyleBox[\( (*\ Nummer\ des\ zu\ entfernenden\ Punktes\ \((\ index\ )\)\ eingeben\ *) \), FontColor->RGBColor[1, 0, 0]], " ", "\n", " ", \(If[sch \[Equal] "\", If[index \[GreaterEqual] 0\ And\ index \[LessEqual] m\ , {m = m - 1; \n\ \ \ \ \ \ \ \ \ Do[{\ xp[j] = xp[j + 1], yp[j] = yp[j + 1]}, {j, index, m}]}]]\), ";", " "}]}]], "Input"], Cell[BoxData[ RowBox[{ StyleBox["(*", FontColor->RGBColor[1, 0, 1]], StyleBox[ RowBox[{ StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", "Subsection", FontColor->RGBColor[1, 0, 1]]}]], RowBox[{ StyleBox[\(St\[UDoubleDot]tzpunkte\ \ \ 0\), "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[",", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox["..", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[",", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox["m", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[",", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[\(nach\ dem\ Entfernen\ von\ Punkten\), FontColor->RGBColor[1, 0, 1]]}], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox["*)", FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(If[sch \[Equal] "\", If[index \[GreaterEqual] 0\ And\ index \[LessEqual] m\ \ , \ \ \ \[IndentingNewLine]TableForm[ Table[{ind = PaddedForm[i, 2], "\< xp[\>", ind, "\<] = \>", PaddedForm[xp[i], {3, 2}], \[IndentingNewLine]"\< yp[\>", ind, "\<] = \>", PaddedForm[yp[i], {3, 2}]}, {i, 0, m}], TableSpacing \[Rule] {1, 0}]]]\)], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ \ \ \ Einf\[UDoubleDot]gen\ \ eins\ \ Punktes\ \ mit\ \ der\ \ Nummer\ i\ ndex\ \ \ \ \ \ *) \), "Subsubtitle", FontColor->RGBColor[1, 0, 0]]}]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ RowBox[{" ", RowBox[{\(index\ = \ 2\), " ", ";", " ", StyleBox[\( (*\ Nummer\ des\ einzuf\[UDoubleDot]genden\ Punktes\ \((\ index\ )\)\ eingeben\ *) \), FontColor->RGBColor[1, 0, 0]], " ", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{\(sch \[Equal] "\"\), ",", RowBox[{"If", "[", RowBox[{\(index \[GreaterEqual] 0\ And\ index \[LessEqual] m\), ",", RowBox[{"{", RowBox[{\(m = m + 1\), ";", \(Do[{xp[j], yp[j]}, {j, 0, index - 1}]\), ";", "\[IndentingNewLine]", " ", \(Do[{xp[j] = xp[j - 1], yp[j] = yp[j - 1]}, {j, m, index + 1, \(-1\)}]\), ";", "\[IndentingNewLine]", " ", \(xp[index] = \ \ 3.75\), " ", StyleBox[\( (*\ xp[i]\ eingeben\ *) \), FontColor->RGBColor[1, 0, 0]], StyleBox[";", FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", " ", \(yp[index] = \ \ \ 1.0\)}], StyleBox[ RowBox[{" ", StyleBox[" ", FontColor->RGBColor[1, 0, 0]]}]], StyleBox[\( (*\ yp[i]\ eingeben\ *) \), FontColor->RGBColor[1, 0, 0]], StyleBox["}", FontColor->RGBColor[1, 0, 0]]}]}], StyleBox["]", FontColor->RGBColor[1, 0, 0]]}]}], StyleBox["]", FontColor->RGBColor[1, 0, 0]]}], StyleBox[";", FontColor->RGBColor[1, 0, 0]]}]}]], "Input"], Cell[BoxData[ RowBox[{ StyleBox["(*", FontColor->RGBColor[1, 0, 1]], StyleBox[ RowBox[{ StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", "Subsection", FontColor->RGBColor[1, 0, 1]]}]], RowBox[{ StyleBox[\(St\[UDoubleDot]tzpunkte\ \ \ 0\), "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[",", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox["..", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[",", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox["m", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[",", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[\(nach\ dem\ Einf\[UDoubleDot]gen\ von\ Punkten\), FontColor->RGBColor[1, 0, 1]]}], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox["*)", FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(If[sch \[Equal] "\", If[index \[GreaterEqual] 0\ And\ index \[LessEqual] m, \ \ \ \[IndentingNewLine]TableForm[ Table[{ind = PaddedForm[i, 2], "\< xp[\>", ind, "\<] = \>", PaddedForm[xp[i], {3, 2}], \[IndentingNewLine]"\< yp[\>", ind, "\<] = \>", PaddedForm[yp[i], {3, 2}]}, {i, 0, m}], TableSpacing \[Rule] {1, 0}]]]\)], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ \ \[CapitalADoubleDot]ndern\ des\ Punktes\ mit\ \ der\ Nummer\ index\ \ \ \ \ \ *) \), "Subsubtitle", FontColor->RGBColor[1, 0, 0]]}]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ RowBox[{" ", RowBox[{\(index\ = \ \ 2\), ";", " ", StyleBox[\( (*\ Nummer\ des\ zu\ \[ADoubleDot]ndernden\ Punktes\ \((\ index\ )\)\ eingeben\ *) \), FontColor->RGBColor[1, 0, 0]], " ", "\n", " ", RowBox[{"If", "[", RowBox[{\(sch \[Equal] "\"\), ",", RowBox[{"If", "[", RowBox[{\(index \[GreaterEqual] 0\ And\ index \[LessEqual] m\), ",", RowBox[{"{", " ", RowBox[{\(xp[index] = \ \ \ \(-3.75\)\), " ", StyleBox[\( (*\ xp[i]\ eingeben\ *) \), FontColor->RGBColor[1, 0, 0]], StyleBox[";", FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", " ", \(yp[index] = \ \ \ 1.0\)}], StyleBox[ RowBox[{" ", StyleBox[" ", FontColor->RGBColor[1, 0, 0]]}]], StyleBox[\( (*\ yp[i]\ eingeben\ *) \), FontColor->RGBColor[1, 0, 0]], StyleBox["}", FontColor->RGBColor[1, 0, 0]]}]}], StyleBox["]", FontColor->RGBColor[1, 0, 0]]}]}], StyleBox["]", FontColor->RGBColor[1, 0, 0]]}], StyleBox[";", FontColor->RGBColor[1, 0, 0]]}]}]], "Input"], Cell[BoxData[ RowBox[{ StyleBox["(*", FontColor->RGBColor[1, 0, 1]], StyleBox[ RowBox[{ StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", "Subsection", FontColor->RGBColor[1, 0, 1]]}]], RowBox[{ StyleBox[\(St\[UDoubleDot]tzpunkte\ \ \ 0\), "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[",", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox["..", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[",", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox["m", "Subsection", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[",", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox[\(nach\ dem\ Einf\[UDoubleDot]gen\ von\ Punkten\), FontColor->RGBColor[1, 0, 1]]}], StyleBox[" ", FontColor->RGBColor[1, 0, 1]], StyleBox["*)", FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(If[sch \[Equal] "\", If[index \[GreaterEqual] 0\ And\ index \[LessEqual] m, \ \ \ \[IndentingNewLine]TableForm[ Table[{ind = PaddedForm[i, 2], "\< xp[\>", ind, "\<] = \>", PaddedForm[xp[i], {3, 2}], \[IndentingNewLine]"\< yp[\>", ind, "\<] = \>", PaddedForm[yp[i], {3, 2}]}, {i, 0, m}], TableSpacing \[Rule] {1, 0}]]]\)], "Input"], Cell[BoxData[ \(\(nummer[lauf] = m;\)\)], "Input"], Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{" ", StyleBox[" ", FontColor->RGBColor[1, 0, 1]]}]], StyleBox[\( (*\ \ \ \ \ \ \ \ St\[UDoubleDot]tzstellen\ f\[UDoubleDot]r\ \ den\ Graph\ der\ Ellipse\ \ \ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(\(nd = 400;\)\)], "Input"], Cell[BoxData[ \(Do[{xel[j] = xp[0] + j*\((xp[m] - xp[0])\)/nd, yel[j] = 3/4*Sqrt[16 - xel[j]^2]}, {j, 0, nd}]\)], "Input"], Cell[BoxData[ \(<< Graphics`Colors`\)], "Input"], Cell[BoxData[ \(\(liste1 = {Red, HotPink, Green, Apricot, Brown, DarkGreen, Cobalt, Brick, Orange, Magenta, IndianRed, ForestGreen};\)\)], "Input"], Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{" ", StyleBox[" ", FontColor->RGBColor[1, 0, 1]]}]], StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ \ \ Plotten\ der\ Ellipse\ \ x\^2\/16\ \ + \ y\^2\/9 = \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(ellipsplot = ListPlot[Table[{xel[j], yel[j]}, {j, 0, nd}], PlotJoined\ -> \ True, \n\t PlotRange -> {{\(-5\), 5}, {\(-1\), 4}}, \tPlotStyle -> Brown, AspectRatio -> 0.5, AxesLabel -> {"\<> x\>", "\< ^ y\>"}]\)], "Input"], Cell[BoxData[ \(linienplot = ListPlot[Table[{xp[k], yp[k]}, {k, 0, m}], PlotJoined\ -> \ True, \t PlotRange -> {{\(-5\), 5}, {\(-1\), 4}}, \n\tPlotStyle -> Blue, AspectRatio -> 0.5, AxesLabel -> {"\<> x\>", "\< ^ y\>"}]\)], "Input"], Cell[BoxData[ \(punktplot = ListPlot[Table[{xp[k], yp[k]}, {k, 0, m}], PlotJoined\ -> \ False, \t PlotRange -> {{\(-5\), 5}, {\(-1\), 4}}, \n\tPlotStyle -> Blue, Prolog\ -> \ AbsolutePointSize[5], AspectRatio -> 0.5, AxesLabel -> {"\<> x\>", "\< ^ y\>"}]\)], "Input"], Cell[BoxData[ \(Show[ellipsplot, linienplot, punktplot, Prolog\ -> \ AbsolutePointSize[5]]\)], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Newton\ - \ Interpolation\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), "Section", FontColor->RGBColor[1, 0, 0]]}]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ Dividierte\ Differenzen\ f\ \[UDoubleDot]r\ die\ Newton - Interpolation\ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), "Subsubtitle", FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(Do[DivDiff[k, 1] = \((yp[k + 1] - yp[k])\)/\((xp[k + 1] - xp[k])\), {k, 0, m - 1}]\)], "Input"], Cell[BoxData[ \(Do[Do[ DivDiff[k, j] = \((DivDiff[k + 1, j - 1] - DivDiff[k, j - 1])\)/\((xp[k + j] - xp[k])\), {k, 0, m - j}], {j, 2, m}]\)], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ St\[UDoubleDot]tzstellen\ f\[UDoubleDot]r\ den\ \ Graph\ der\ Newton - Interpolation\ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(Do[{xnew[j] = xel[j], ynew[j] = yp[0], pro = xel[j] - xp[0], \n\t\tDo[{ynew[j] = ynew[j] + pro*DivDiff[0, i], pro = pro*\((xnew[j] - xp[i])\)}, {i, 1, m}]}, {j, 0, nd}]\)], "Input"], Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{" ", StyleBox[" ", FontColor->RGBColor[1, 0, 1]]}]], StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ Graph\ der\ Newton - Interpolation\ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(newtonplot = ListPlot[Table[{xnew[j], ynew[j]}, {j, 0, nd}], PlotJoined\ -> \ True, \n\t PlotRange -> {{\(-5\), 5}, {\(-1\), 4}}, \tPlotStyle -> Red, AspectRatio -> 0.5, AxesLabel -> {"\<> x\>", "\< ^ y\>"}]\)], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ \ \ Nat\[UDoubleDot]rliche\ Spline - Interpolation\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \ \), "Section", FontColor->RGBColor[1, 0, 0]]}]], "Input", Background->RGBColor[0, 1, 0]], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Erstellen\ \ der\ Tridiagonalmatrix\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), "Subsubtitle", FontColor->RGBColor[1, 0, 1]], "\n", " ", StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ \ \ \((\ Haupt - \ und\ Nebendiagonale\ )\)\ \ \ \ \ \ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[{ \(\(Du[0] = xp[1] - xp[0];\)\), "\n", \(Do[{Du[k] = xp[k + 1] - xp[k], Dh[k] = 2 \((Du[k - 1] + Du[k])\)}, {k, 1, m - 1}]\)}], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ Cholesky - Zerlegung\ der\ Tridiagonalmatrix\ \ \ \ \ \ \ \ \ \ \ *) \), "Subsubtitle", FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[{ \(\(Ch[1] = Sqrt[Dh[1]];\)\), "\n", \(Do[{Cn[k - 1] = Du[k - 1]/Ch[k - 1], Ch[k] = Sqrt[Dh[k] - Cn[k - 1]^2]}, {k, 2, m - 1}]\)}], "Input"], Cell[BoxData[ StyleBox[\(\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Vorw\ \[ADoubleDot]rtsrechnung\ "\"\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)\(\n\)\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tund\ \ Erstellen\ der\ rechten\ Seite\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)\), FontColor->RGBColor[1, 0, 1]]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[{ \(Dv[0] = yp[1] - yp[0]; \ \ \ \ \ \ \ Dv[1] = yp[2] - yp[1];\), "\n", \(\(Dr[1] = 3 \((Dv[1]/Du[1] - Dv[0]/Du[0])\);\)\), "\n", \(\(Z[1] = Dr[1]/Ch[1];\)\), "\n", \(Do[{Dv[k] = yp[k + 1] - yp[k], \n\t\tDr[k] = 3 \((Dv[k]/Du[k] - Dv[k - 1]/Du[k - 1])\), \n\t\tZ[ k] = \((Dr[k] - Z[k - 1]*Cn[k - 1])\)/Ch[k]}, \n{k, 2, m - 1}]\)}], "Input"], Cell[BoxData[ StyleBox[\(\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ R\[UDoubleDot]ckw\[ADoubleDot]rtsrechnung\ "\"\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)\(\n\)\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tBerechnung\ der\ Koeffizienten\ B\_k\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)\), FontColor->RGBColor[1, 0, 1]]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[{ \(B[m] = 0; \ \ B[m - 1] = Z[m - 1]/Ch[m - 1];\), "\n", \(Do[B[k] = \((Z[k] - B[k + 1]*Cn[k])\)/Ch[k], {k, m - 2, 1, \(-1\)}]; \ B[0] = 0;\)}], "Input"], Cell[BoxData[ StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tBerechnung\ der\ \ Koeffizienten\ A\_\(\(k\)\(\ \)\), \ C\_k\ , \ D\_k\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(Do[{A[ k] = \((B[k + 1] - B[k])\)/\((3 Du[k])\), \n\t\t\ \ \ \ \ \ \ \ \ \ \ \ \ Cc[k] = Dv[k]/Du[k] - Du[k]*\((B[k + 1] + 2 B[k])\)/3, \ Dc[k] = yp[k]}, {k, 0, m - 1}]\)], "Input"], Cell[BoxData[ RowBox[{" ", StyleBox[\( (*\ \ \ \ St\[UDoubleDot]tzstellen\ f\[UDoubleDot]r\ den\ \ Graph\ der\ Spline - Interpolation\ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(Do[{xnat[j] = xel[j], xint = xp[0], \n\t\tDo[{Dnt[k] = xp[k + 1] - xp[k], If[\((xnat[j] >= xint\ )\)\ \[And] \ \ \((xnat[j] <= xint + Dnt[k]\ )\), {knt = k, Break[]}\ , xint = xint + Dnt[k]]}, {k, 0, m - 1}], \n\t\tDntmj = xnat[j] - xp[knt], \n\t\t\t\t\t\tynat[j] = A[knt]*Dntmj^3 + B[knt]*Dntmj^2 + Cc[knt]*Dntmj + Dc[knt]\ }, \n\t{j, 0, nd}]\)], "Input"], Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{" ", StyleBox[" ", FontColor->RGBColor[1, 0, 1]]}]], StyleBox[\( (*\ \ \ \ \ \ \ \ \ \ Graph\ der\ nat . \ Spline - Funktion\ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \), FontColor->RGBColor[1, 0, 1]]}]], "Input", Background->RGBColor[1, 1, 0]], Cell[BoxData[ \(natsplplot = ListPlot[Table[{xnat[j], ynat[j]}, {j, 0, nd}], PlotJoined\ -> \ True, \n\t PlotRange -> {{\(-5\), 5}, {\(-1\), 4}}, \tPlotStyle -> Green, AspectRatio -> 0.5, AxesLabel -> {"\<> x\>", "\< ^ y\>"}]\)], "Input"], Cell[BoxData[ \(graf[lauf] = Show[natsplplot, newtonplot, ellipsplot, linienplot, punktplot, Prolog\ -> \ AbsolutePointSize[5]]\)], "Input"], Cell[BoxData[ \(Do[{Print["\< Lauf Nummer \>", l\ , "\< mit \>", nummer[l], "\< St\[UDoubleDot]tzpunkten \>"\ ], Show[graf[l]]}, {l, 1, lauf}]\)], "Input"] }, FrontEndVersion->"5.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 685}}, WindowSize->{1016, 651}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification->1 ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 324, 6, 59, "Input"], Cell[2081, 59, 1439, 38, 97, "Input"], Cell[3523, 99, 133, 2, 30, "Input"], Cell[3659, 103, 294, 6, 30, "Input"], Cell[3956, 111, 518, 10, 69, "Input"], Cell[4477, 123, 1032, 26, 70, "Input"], Cell[5512, 151, 434, 7, 70, "Input"], Cell[5949, 160, 724, 23, 46, "Input"], Cell[6676, 185, 851, 14, 110, "Input"], Cell[7530, 201, 450, 13, 46, "Input"], Cell[7983, 216, 305, 6, 70, "Input"], Cell[8291, 224, 292, 7, 46, "Input"], Cell[8586, 233, 567, 12, 70, "Input"], Cell[9156, 247, 1235, 39, 46, "Input"], Cell[10394, 288, 434, 7, 70, "Input"], Cell[10831, 297, 300, 7, 46, "Input"], Cell[11134, 306, 1927, 41, 110, "Input"], Cell[13064, 349, 1246, 39, 46, "Input"], Cell[14313, 390, 430, 7, 70, "Input"], Cell[14746, 399, 292, 6, 49, "Input"], Cell[15041, 407, 1607, 35, 70, "Input"], Cell[16651, 444, 1246, 39, 46, "Input"], Cell[17900, 485, 430, 7, 70, "Input"], Cell[18333, 494, 54, 1, 30, "Input"], Cell[18390, 497, 362, 9, 46, "Input"], Cell[18755, 508, 46, 1, 30, "Input"], Cell[18804, 511, 135, 2, 30, "Input"], Cell[18942, 515, 52, 1, 30, "Input"], Cell[18997, 518, 162, 2, 30, "Input"], Cell[19162, 522, 374, 9, 54, "Input"], Cell[19539, 533, 275, 5, 50, "Input"], Cell[19817, 540, 262, 4, 50, "Input"], Cell[20082, 546, 307, 5, 50, "Input"], Cell[20392, 553, 115, 2, 30, "Input"], Cell[20510, 557, 337, 7, 49, "Input"], Cell[20850, 566, 317, 6, 46, "Input"], Cell[21170, 574, 124, 2, 30, "Input"], Cell[21297, 578, 204, 5, 30, "Input"], Cell[21504, 585, 272, 5, 46, "Input"], Cell[21779, 592, 245, 5, 50, "Input"], Cell[22027, 599, 371, 9, 46, "Input"], Cell[22401, 610, 275, 5, 50, "Input"], Cell[22679, 617, 323, 7, 49, "Input"], Cell[23005, 626, 538, 10, 66, "Input"], Cell[23546, 638, 168, 3, 50, "Input"], Cell[23717, 643, 309, 6, 46, "Input"], Cell[24029, 651, 172, 3, 50, "Input"], Cell[24204, 656, 402, 7, 66, "Input"], Cell[24609, 665, 405, 7, 150, "Input"], Cell[25017, 674, 416, 7, 66, "Input"], Cell[25436, 683, 181, 3, 50, "Input"], Cell[25620, 688, 267, 5, 46, "Input"], Cell[25890, 695, 252, 5, 50, "Input"], Cell[26145, 702, 272, 5, 46, "Input"], Cell[26420, 709, 470, 8, 130, "Input"], Cell[26893, 719, 350, 9, 46, "Input"], Cell[27246, 730, 277, 5, 50, "Input"], Cell[27526, 737, 161, 3, 30, "Input"], Cell[27690, 742, 185, 3, 30, "Input"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)