(* 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[ 7723, 235] NotebookOptionsPosition[ 7097, 211] NotebookOutlinePosition[ 7548, 229] CellTagsIndexPosition[ 7505, 226] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Modelo Depredador-Presa ", StyleBox["por Juan Jos\[EAcute] Moreno Balc\[AAcute]zar", FontSize->12, FontColor->RGBColor[1, 0, 0]] }], "Title", CellChangeTimes->{{3.41614356928125*^9, 3.416143569859375*^9}}, FontColor->RGBColor[1, 0, 0], Background->RGBColor[1., 1., 0.7568627450980392]], Cell[TextData[StyleBox["Caso Lince - Conejo", FontColor->RGBColor[1, 0, 0]]], "Subtitle", CellChangeTimes->{{3.4153837135*^9, 3.4153837266875*^9}, { 3.416143513828125*^9, 3.41614356584375*^9}}, Background->RGBColor[1., 1., 0.7333333333333333]], Cell[BoxData[{ RowBox[{ RowBox[{"a", "=", RowBox[{ "Input", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"b", "=", RowBox[{ "Input", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", RowBox[{ "Input", "[", "\"\\"", "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.41537460971875*^9, 3.4153746110625*^9}, { 3.415383675015625*^9, 3.415383694609375*^9}, {3.415383813578125*^9, 3.41538381421875*^9}}, Background->RGBColor[1., 1., 0.7568627450980392]], Cell[BoxData[ RowBox[{ RowBox[{"sol", "=", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"y", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"0.6", "*", RowBox[{"y", "[", "t", "]"}]}], "-", RowBox[{"0.018", "*", RowBox[{"y", "[", "t", "]"}], "*", RowBox[{"z", "[", "t", "]"}]}]}]}], ",", RowBox[{ RowBox[{ RowBox[{"z", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{ RowBox[{"-", "0.7"}], "*", RowBox[{"z", "[", "t", "]"}]}], "+", RowBox[{"0.012", "*", RowBox[{"y", "[", "t", "]"}], "*", RowBox[{"z", "[", "t", "]"}]}]}]}], ",", " ", RowBox[{ RowBox[{"y", "[", "0", "]"}], "\[Equal]", "a"}], ",", RowBox[{ RowBox[{"z", "[", "0", "]"}], "\[Equal]", "b"}]}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", "z"}], "}"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "n"}], "}"}]}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.4153748714375*^9, 3.41537489821875*^9}, { 3.415379073734375*^9, 3.415379074109375*^9}, {3.4153791371875*^9, 3.4153791378125*^9}, {3.41537917634375*^9, 3.41537917690625*^9}, 3.415379212296875*^9, {3.415382621265625*^9, 3.415382621453125*^9}, { 3.415382687546875*^9, 3.415382689640625*^9}, 3.415382722*^9, { 3.41538276975*^9, 3.41538277709375*^9}, {3.4153830605*^9, 3.415383070015625*^9}, {3.415383400234375*^9, 3.415383401296875*^9}, { 3.415383472078125*^9, 3.41538347403125*^9}, {3.415383531765625*^9, 3.41538353490625*^9}, {3.4153839199375*^9, 3.4153839225625*^9}, 3.416249726859375*^9, 3.416249787765625*^9, {3.4162498571875*^9, 3.416249858890625*^9}, 3.4162502916875*^9, {3.416250341765625*^9, 3.416250343125*^9}}, Background->RGBColor[1., 1., 0.7568627450980392]], Cell[BoxData[{ RowBox[{ RowBox[{"lista", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"i", "*", "0.001"}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", RowBox[{"Floor", "[", FractionBox["n", "0.001"], "]"}]}], "}"}]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"y1", "=", RowBox[{"Flatten", "[", RowBox[{ RowBox[{"y", "[", "lista", "]"}], "/.", "sol"}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"p1", "=", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"lista", ",", "y1"}], "}"}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"z1", "=", RowBox[{"Flatten", "[", RowBox[{ RowBox[{"z", "[", "lista", "]"}], "/.", "sol"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"p2", "=", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"lista", ",", "z1"}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"dib", "[", "1", "]"}], "=", RowBox[{"ListPlot", "[", RowBox[{"p1", ",", " ", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"dib", "[", "2", "]"}], "=", RowBox[{"ListPlot", "[", RowBox[{"p2", ",", " ", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "1", ",", "0"}], "]"}], "}"}]}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{ RowBox[{"dib", "[", "1", "]"}], ",", RowBox[{"dib", "[", "2", "]"}], ",", RowBox[{"DisplayFunction", "\[Rule]", "$DisplayFunction"}]}], "]"}]}], "Input", PageWidth->PaperWidth, CellChangeTimes->{{3.41537801028125*^9, 3.41537801484375*^9}}, Background->RGBColor[1., 1., 0.7568627450980392]], Cell[TextData[{ "La ", StyleBox["curva azul", FontColor->RGBColor[0, 0, 1]], " representa la poblaci\[OAcute]n de conejos y ", StyleBox["la verde", FontColor->RGBColor[0, 1, 0]], " la de linces, ambas en funci\[OAcute]n del tiempo." }], "Text", CellDingbat->"\[FilledDiamond]", CellChangeTimes->{ 3.41537841003125*^9, {3.4153785213125*^9, 3.415378575109375*^9}}, FontSize->18, FontColor->RGBColor[0.5, 0, 0.5], Background->RGBColor[1., 1., 0.7568627450980392]], Cell[BoxData[{ RowBox[{ RowBox[{"puntos", "=", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"y1", ",", "z1"}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"ListPlot", "[", RowBox[{"puntos", ",", " ", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}], "}"}]}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"Conejos", ",", " ", "Linces"}], "}"}]}]}], "]"}]}], "Input", CellChangeTimes->{ 3.41537499746875*^9, {3.41537543040625*^9, 3.415375459484375*^9}, { 3.415377761140625*^9, 3.415377788171875*^9}, {3.415377952734375*^9, 3.415377970296875*^9}, {3.4153828740625*^9, 3.415383030140625*^9}}, Background->RGBColor[1., 1., 0.7568627450980392]] }, Open ]] }, WindowSize->{1016, 639}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, DockedCells->(FrontEndExecute[{ FrontEnd`NotebookApply[ FrontEnd`InputNotebook[], #, Placeholder]}]& ), FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 311, 8, 99, "Title"], Cell[904, 33, 248, 4, 65, "Subtitle"], Cell[1155, 39, 677, 19, 88, "Input"], Cell[1835, 60, 1942, 46, 47, "Input"], Cell[3780, 108, 2015, 62, 240, "Input"], Cell[5798, 172, 476, 14, 50, "Text"], Cell[6277, 188, 804, 20, 68, "Input"] }, Open ]] } ] *) (* End of internal cache information *)