(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 9.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 6626, 202] NotebookOptionsPosition[ 6382, 189] NotebookOutlinePosition[ 6726, 204] CellTagsIndexPosition[ 6683, 201] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{ "Si", " ", "tengo", " ", "un", " ", "sistema", " ", "en", " ", "forma", " ", "matricial"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", GridBox[{ {"1", "5"}, {"2", "1"} }], ")"}], ".", RowBox[{"(", GridBox[{ {"x"}, {"y"} }], ")"}]}], "=", RowBox[{"(", GridBox[{ {"a"}, {"b"} }], ")"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"m", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1"}], "}"}]}], "}"}]}], ";", RowBox[{"c", "=", RowBox[{"{", RowBox[{"a", ",", "b"}], "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"sol", "=", RowBox[{"LinearSolve", "[", RowBox[{"m", ",", "c"}], "]"}]}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "El", " ", "valor", " ", "de", " ", "x", " ", "que", " ", "satisface", " ", "el", " ", "sistema", " ", "es", " ", "el", " ", "primer", " ", "elemento", " ", "de", " ", "sol"}], ",", StyleBox[ RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], FontWeight->"Bold"], ",", RowBox[{ "mientras", " ", "que", " ", "el", " ", "de", " ", "y", " ", "es", " ", "el", " ", "segundo"}], ",", StyleBox[ RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], FontWeight->"Bold"]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], "\[IndentingNewLine]", RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{"sistema", " ", RowBox[{"ejemplo", ":", " ", "\[IndentingNewLine]", RowBox[{"A", ".", "x"}]}]}], "=", "b"}], ",", RowBox[{ RowBox[{"siendo", " ", "A"}], "=", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"4", RowBox[{"-", "1"}], "1"}, {"4", RowBox[{"-", "8"}], "1"}, { RowBox[{"-", "2"}], RowBox[{"-", "1"}], "5"} }], "\[NoBreak]", ")"}], MatrixForm[#]& ]}], ",", RowBox[{ RowBox[{"y", " ", "b"}], "=", RowBox[{ RowBox[{ RowBox[{"(", "\[NoBreak]", GridBox[{ {"7"}, { RowBox[{"-", "21"}]}, {"15"} }], "\[NoBreak]", ")"}], " ", "x0"}], "=", InterpretationBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"2"}, {"2"} }], "\[NoBreak]", ")"}], MatrixForm[{1, 2, 2}]]}]}]}], "\[IndentingNewLine]", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"para", " ", "calcular", " ", "la", " ", "Tj"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Tj", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"i", "\[Equal]", "j"}], ",", "0", ",", RowBox[{"-", FractionBox[ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "i"}], "]"}], "]"}]]}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "Tj", "]"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"y", " ", "el", " ", "radio", " ", "espectral"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Max", "[", RowBox[{"Abs", "[", RowBox[{"Eigenvalues", "[", "Tj", "]"}], "]"}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"para", " ", "calcular", " ", "la", " ", "Tg"}], " ", "=", " ", RowBox[{"-", RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{"D", "+", "L"}], ")"}], RowBox[{"-", "1"}]], ".", "U"}]}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"diag", "=", RowBox[{"DiagonalMatrix", "[", RowBox[{"Diagonal", "[", "A", "]"}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"L", "=", RowBox[{ RowBox[{"LowerTriangularize", "[", "A", "]"}], "-", "diag"}]}], ";", RowBox[{"MatrixForm", "[", "L", "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"U", "=", RowBox[{ RowBox[{"UpperTriangularize", "[", "A", "]"}], "-", "diag"}]}], ";", RowBox[{"MatrixForm", "[", "U", "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Tg", "=", RowBox[{"-", RowBox[{ RowBox[{"Inverse", "[", RowBox[{"diag", "+", "L"}], "]"}], ".", "U"}]}]}], ";", RowBox[{"MatrixForm", "[", "Tg", "]"}]}], "\[IndentingNewLine]", RowBox[{"Max", "[", RowBox[{"Abs", "[", RowBox[{"Eigenvalues", "[", "Tg", "]"}], "]"}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.6560955957690325`*^9, 3.6560956477765856`*^9}, { 3.656095730703879*^9, 3.65609580819189*^9}, 3.656095907205562*^9, { 3.656096121757863*^9, 3.6560961781455584`*^9}, {3.656096211632863*^9, 3.656096259802785*^9}, {3.656096301441457*^9, 3.656096316247121*^9}, { 3.656096349221242*^9, 3.656096380806134*^9}, {3.656096437590314*^9, 3.6560964689369936`*^9}, {3.6560965126069155`*^9, 3.656096582333478*^9}, 3.656096925183508*^9}] }, WindowSize->{759, 521}, WindowMargins->{{49, Automatic}, {16, Automatic}}, FrontEndVersion->"9.0 for Microsoft Windows (32-bit) (January 25, 2013)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[557, 20, 5821, 167, 675, "Input"] } ] *) (* End of internal cache information *)