(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 14083, 371] NotebookOptionsPosition[ 13008, 330] NotebookOutlinePosition[ 13613, 354] CellTagsIndexPosition[ 13570, 351] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Curve Fitting", "Section", CellFrameColor->RGBColor[ 0.6449835965514611, 0.758632791638056, 0.2516823071641108], FontColor->RGBColor[ 0.6449835965514611, 0.758632791638056, 0.2516823071641108]], Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"Fit", "[", RowBox[{"points", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"x", "^", "i"}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "m"}], "}"}]}], "]"}], ",", "x"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"500", ",", "400"}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"Axes", "\[Rule]", "False"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotLabel", "\[Rule]", RowBox[{"Fit", "[", RowBox[{"points", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"x", "^", "i"}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "m"}], "}"}]}], "]"}], ",", "x"}], "]"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"m", ",", "4", ",", "\"\\""}], "}"}], ",", "1", ",", "6", ",", "1", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"points", ",", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}], ",", "Locator", ",", RowBox[{"LocatorAutoCreate", "\[Rule]", "True"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.36004454514925*^9, 3.36004483638626*^9}, { 3.36004487242317*^9, 3.3600449497808*^9}, {3.36004500235054*^9, 3.36004504048892*^9}, {3.36004507983718*^9, 3.36004509092273*^9}, { 3.36004514142392*^9, 3.36004514326471*^9}, 3.36004529786364*^9, { 3.3600455881411*^9, 3.3600456366703*^9}, {3.36004575932423*^9, 3.36004576051383*^9}, 3.3600458213185*^9, {3.3600458752895*^9, 3.36004589544601*^9}, {3.36004670463362*^9, 3.36004674900593*^9}, { 3.3600468546113*^9, 3.36004686005592*^9}, {3.36004714851038*^9, 3.36004719471356*^9}, {3.36004785301939*^9, 3.36004785352274*^9}, 3.36004794697908*^9, {3.36004797753763*^9, 3.36004798615073*^9}, { 3.36004802571421*^9, 3.36004805128214*^9}, {3.3600480874011*^9, 3.36004809336255*^9}, {3.36004829931532*^9, 3.36004835935322*^9}, { 3.36004846313492*^9, 3.36004847788451*^9}, {3.36018162877298*^9, 3.36018163165708*^9}, {3.36022083610143*^9, 3.36022092315941*^9}, { 3.360221013623*^9, 3.36022106816271*^9}, {3.36022110992209*^9, 3.36022111043868*^9}, {3.36022115212292*^9, 3.3602211562159*^9}, { 3.36022141691513*^9, 3.36022145974527*^9}, {3.36022246208321*^9, 3.36022246249581*^9}, {3.36022251940493*^9, 3.36022252721608*^9}, { 3.36024115474248*^9, 3.36024118275582*^9}, {3.3602456250649*^9, 3.36024570069361*^9}, {3.3603286118034*^9, 3.36032866155587*^9}, { 3.36032870428059*^9, 3.36032871063756*^9}, {3.36032903019717*^9, 3.36032919647847*^9}, {3.36032923893355*^9, 3.36032925908636*^9}, { 3.36033023204993*^9, 3.36033024658738*^9}, {3.36033075361363*^9, 3.36033077201826*^9}, {3.36033081423246*^9, 3.36033081507285*^9}, { 3.36033087225201*^9, 3.36033091117494*^9}, {3.36033551244988*^9, 3.36033552252001*^9}, {3.36033555764363*^9, 3.36033557078488*^9}, { 3.36033561863717*^9, 3.36033562099331*^9}, {3.36468059435938*^9, 3.36468060565625*^9}, {3.36468076103125*^9, 3.36468080109375*^9}, { 3.374847933916232*^9, 3.374847934619357*^9}, {3.378681460828125*^9, 3.378681461515625*^9}, {3.378681557859375*^9, 3.378681694*^9}, 3.378681730203125*^9, {3.378681775703125*^9, 3.3786817798125*^9}, { 3.378681948484375*^9, 3.3786820729375*^9}, {3.37868212809375*^9, 3.378682129609375*^9}, 3.3786827414375*^9, 3.381156033484888*^9, { 3.381156082299432*^9, 3.3811562054135427`*^9}, {3.381156261724801*^9, 3.381156324024178*^9}, {3.381156412470826*^9, 3.3811564386480713`*^9}, { 3.381156503312098*^9, 3.3811565035592127`*^9}, {3.3822934700523367`*^9, 3.382293486409408*^9}}, CellID->912488623] }, Open ]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`m$$ = 2, $CellContext`points$$ = {{ 0.14530748753650324`, 0.39231122983528355`}, {0.7897674610467462, 0.6820854549830571}, {0.9088266555351048, 0.6728824569401661}, { 0.6407516839780134, 0.6327512094442276}, {0.17106115049633375`, 0.11860851036820663`}}, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`m$$], 2, "polynomial degree"}, 1, 6, 1}, {{ Hold[$CellContext`points$$], {{0.14530748753650324`, 0.39231122983528355`}, {0.7897674610467462, 0.6820854549830571}, { 0.9088266555351048, 0.6728824569401661}, {0.6407516839780134, 0.6327512094442276}, {0.17106115049633375`, 0.11860851036820663`}}}, { 0, -2}, {1, 2}}}, Typeset`size$$ = {500., {198., 202.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`m$248725$$ = 0, $CellContext`points$248726$$ = {0, 0}}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`m$$ = 2, $CellContext`points$$ = {{0.14530748753650324`, 0.39231122983528355`}, {0.7897674610467462, 0.6820854549830571}, { 0.9088266555351048, 0.6728824569401661}, {0.6407516839780134, 0.6327512094442276}, {0.17106115049633375`, 0.11860851036820663`}}}, "ControllerVariables" :> { Hold[$CellContext`m$$, $CellContext`m$248725$$, 0], Hold[$CellContext`points$$, $CellContext`points$248726$$, {0, 0}]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Plot[ Evaluate[ Fit[$CellContext`points$$, Table[$CellContext`x^$CellContext`i, {$CellContext`i, 0, $CellContext`m$$}], $CellContext`x]], {$CellContext`x, 0, 1}, ImageSize -> {500, 400}, Frame -> True, Axes -> False, PlotRange -> {{0, 1}, {-2, 2}}, PlotLabel -> Fit[$CellContext`points$$, Table[$CellContext`x^$CellContext`i, {$CellContext`i, 0, $CellContext`m$$}], $CellContext`x]], "Specifications" :> {{{$CellContext`m$$, 2, "polynomial degree"}, 1, 6, 1, Appearance -> "Labeled"}, {{$CellContext`points$$, {{0.14530748753650324`, 0.39231122983528355`}, {0.7897674610467462, 0.6820854549830571}, { 0.9088266555351048, 0.6728824569401661}, {0.6407516839780134, 0.6327512094442276}, {0.17106115049633375`, 0.11860851036820663`}}}, {0, -2}, {1, 2}, ControlType -> Locator, LocatorAutoCreate -> True}}, "Options" :> {}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{544., {241., 246.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellID->585776310], Cell[CellGroupData[{ Cell["THIS NOTEBOOK IS THE SOURCE CODE FROM", "Text", CellFrame->{{0, 0}, {0, 1}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.691905, 0.790311, 0.300252], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.691905, 0.790311, 0.300252]], Cell[TextData[{ "\"", ButtonBox["Curve Fitting", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/CurveFitting/"], None}, ButtonNote->"http://demonstrations.wolfram.com/CurveFitting/"], "\"", " from ", ButtonBox["The Wolfram Demonstrations Project", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], "\[ParagraphSeparator]\[NonBreakingSpace]", ButtonBox["http://demonstrations.wolfram.com/CurveFitting/", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/CurveFitting/"], None}, ButtonNote->"http://demonstrations.wolfram.com/CurveFitting/"] }], "Text", CellMargins->{{48, Inherited}, {0, Inherited}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.5]], Cell[" ", "Text", CellFrame->{{0, 0}, {0, 1}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.691905, 0.790311, 0.300252], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.691905, 0.790311, 0.300252]], Cell[TextData[{ "Contributed by: ", ButtonBox["Theodore Gray", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Theodore+Gray"], None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=Theodore+Gray"] }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6], CellID->1189554565], Cell[CellGroupData[{ Cell[TextData[{ "A full-function Wolfram ", StyleBox["Mathematica", FontSlant->"Italic"], " 6 system is required to edit this notebook.\n", StyleBox[ButtonBox["GET WOLFRAM MATHEMATICA 6 \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.wolfram.com/products/mathematica/"], None}, ButtonNote->"http://www.wolfram.com/products/mathematica/"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0.42, 0]] }], "Text", CellFrame->True, CellMargins->{{48, 68}, {8, 28}}, CellFrameMargins->12, CellFrameColor->RGBColor[0.865507, 0.90634, 0.680751], CellChangeTimes->{3.3750111182355957`*^9}, ParagraphSpacing->{1., 1.}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.411765], Background->RGBColor[0.986023, 0.991363, 0.969818]], Cell[TextData[{ "\[Copyright] ", StyleBox[ButtonBox["The Wolfram Demonstrations Project & Contributors", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Terms of Use", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/termsofuse.html"], None}, ButtonNote->"http://demonstrations.wolfram.com/termsofuse.html"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Make a new version of this Demonstration \ \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/participate/upload.jsp?id=\ CurveFitting"], None}, ButtonNote->None], FontColor->GrayLevel[0.6]] }], "Text", CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{48, 10}, {20, 50}}, CellFrameMargins->{{6, 0}, {6, 6}}, CellFrameColor->GrayLevel[0.6], FontFamily->"Verdana", FontSize->9, FontColor->GrayLevel[0.6]] }, Open ]] }, Open ]] }, Editable->True, Saveable->False, ScreenStyleEnvironment->"Working", WindowSize->{710, 650}, WindowMargins->{{Inherited, Inherited}, {Inherited, 0}}, WindowElements->{ "StatusArea", "MemoryMonitor", "MagnificationPopUp", "VerticalScrollBar", "MenuBar"}, WindowTitle->"Curve Fitting - Source", DockedCells->{}, CellContext->Notebook, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (February 7, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 205, 4, 70, "Section"], Cell[798, 29, 4655, 99, 70, "Input", CellID->912488623] }, Open ]], Cell[5468, 131, 3416, 65, 70, "Output", CellID->585776310], Cell[CellGroupData[{ Cell[8909, 200, 373, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[9285, 211, 850, 24, 70, "Text"], Cell[10138, 237, 337, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[10478, 248, 457, 15, 70, "Text", CellID->1189554565], Cell[CellGroupData[{ Cell[10960, 267, 829, 24, 70, "Text"], Cell[11792, 293, 1188, 33, 70, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature 0Q4mb1zhTb1IPB0DEA3rUwDJ *)