(* 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[ 15015, 390] NotebookOptionsPosition[ 13673, 343] NotebookOutlinePosition[ 14091, 359] CellTagsIndexPosition[ 14048, 356] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ StyleBox[ RowBox[{"Meta", "-", RowBox[{"grammar", " ", ":", " ", RowBox[{"arrow", " ", "reversal", " "}]}]}], "Title"]], "Input", Evaluatable->False, InitializationCell->True, CellChangeTimes->{{3.4521125582422733`*^9, 3.45211257012901*^9}, { 3.4521194496110506`*^9, 3.452119472082691*^9}, {3.452267721126402*^9, 3.4522677365581303`*^9}, {3.452268081123283*^9, 3.452268090346269*^9}, { 3.4522686242179685`*^9, 3.45226863042671*^9}, {3.452269026244027*^9, 3.452269032833305*^9}, {3.452562361300199*^9, 3.4525623764014616`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"\[Copyright]", " ", "Copyright", " ", "2005"}], "-", RowBox[{"2009", " ", "Plenum", " ", RowBox[{"software", ".", " ", "Guy"}], " ", "Yosiphon", " ", "and", " ", "Eric", " ", RowBox[{"Mjolsness", ".", " ", "All"}], " ", "rights", " ", RowBox[{"reserved", "."}]}]}]], "Input", Evaluatable->False, InitializationCell->True, CellChangeTimes->{{3.4521125582422733`*^9, 3.45211257012901*^9}}], Cell[CellGroupData[{ Cell["Prerequisite: load the package:", "Section", CellChangeTimes->{3.4521193824665103`*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"<<", "Plenum.m"}], ";"}]], "Input"], Cell[BoxData["\<\"Plenum: version 23\"\>"], "Print", CellChangeTimes->{3.4521137977975855`*^9, 3.452119392941259*^9, 3.4521196643634253`*^9, 3.452268105888152*^9, 3.452602808590578*^9, 3.4526030790814333`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"obspkg\"\>"}], RowBox[{ ":", " "}], "\<\"\\!\\(\\\"Statistics`ContinuousDistributions`\\\"\\) is \ now obsolete. The legacy version being loaded may conflict with current \ Mathematica functionality. See the Compatibility Guide for updating \ information. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \ ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:Compatibility/Tutorials/Statistics/\ ContinuousDistributions\\\", ButtonNote -> \ \\\"General::obspkg\\\"]\\)\"\>"}]], "Message", "MSG", CellChangeTimes->{3.4521137981881356`*^9, 3.452119393111499*^9, 3.4521196645136366`*^9, 3.4522681099138203`*^9, 3.4526028123959365`*^9, 3.452603080934042*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"obspkg\"\>"}], RowBox[{ ":", " "}], "\<\"\\!\\(\\\"Statistics`DiscreteDistributions`\\\"\\) is now \ obsolete. The legacy version being loaded may conflict with current \ Mathematica functionality. See the Compatibility Guide for updating \ information. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \ ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:Compatibility/Tutorials/Statistics/\ DiscreteDistributions\\\", ButtonNote -> \\\"General::obspkg\\\"]\\)\"\>"}]], \ "Message", "MSG", CellChangeTimes->{3.4521137981881356`*^9, 3.452119393111499*^9, 3.4521196645136366`*^9, 3.4522681099138203`*^9, 3.4526028123959365`*^9, 3.4526030811944084`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"obspkg\"\>"}], RowBox[{ ":", " "}], "\<\"\\!\\(\\\"Graphics`Graphics3D`\\\"\\) is now obsolete. The \ legacy version being loaded may conflict with current Mathematica \ functionality. See the Compatibility Guide for updating information. \ \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, \ ButtonData:>\\\"paclet:Compatibility/Tutorials/Graphics/Graphics3D\\\", \ ButtonNote -> \\\"General::obspkg\\\"]\\)\"\>"}]], "Message", "MSG", CellChangeTimes->{3.4521137981881356`*^9, 3.452119393111499*^9, 3.4521196645136366`*^9, 3.4522681099138203`*^9, 3.4526028123959365`*^9, 3.452603081324592*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"stop\"\>"}], RowBox[{ ":", " "}], "\<\"Further output of \\!\\(General :: \\\"obspkg\\\"\\) will \ be suppressed during this calculation. \ \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \ ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG", CellChangeTimes->{3.4521137981881356`*^9, 3.452119393111499*^9, 3.4521196645136366`*^9, 3.4522681099138203`*^9, 3.4526028123959365`*^9, 3.4526030814147186`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"ListSurfacePlot3D", "::", "\<\"shdw\"\>"}], RowBox[{ ":", " "}], "\<\"Symbol \\!\\(\\\"ListSurfacePlot3D\\\"\\) appears in \ multiple contexts \\!\\({\\\"Graphics`Graphics3D`\\\", \\\"System`\\\"}\\); \ definitions in context \\!\\(\\\"Graphics`Graphics3D`\\\"\\) may shadow or be \ shadowed by other definitions. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \ ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:ref/message/General/shdw\\\", ButtonNote -> \ \\\"Graphics`Graphics3D`ListSurfacePlot3D::shdw\\\"]\\)\"\>"}]], "Message", \ "MSG", CellChangeTimes->{3.4521137981881356`*^9, 3.452119393111499*^9, 3.4521196645136366`*^9, 3.4522681099138203`*^9, 3.4526028123959365`*^9, 3.452603081715142*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"newpkg\"\>"}], RowBox[{ ":", " "}], "\<\"\\!\\(\\\"Statistics`MultinormalDistribution`\\\"\\) is \ now available as the \\!\\(\\\"Multivariate Statistics Package\\\"\\). See \ the Compatibility Guide for updating information. \\!\\(\\*ButtonBox[\\\"\ \[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:Compatibility/Tutorials/Statistics/\ MultinormalDistribution\\\", ButtonNote -> \ \\\"General::newpkg\\\"]\\)\"\>"}]], "Message", "MSG", CellChangeTimes->{3.4521137981881356`*^9, 3.452119393111499*^9, 3.4521196645136366`*^9, 3.4522681099138203`*^9, 3.4526028123959365`*^9, 3.452603081935452*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"newpkg\"\>"}], RowBox[{ ":", " "}], "\<\"\\!\\(\\\"Statistics`MultinormalDistribution`\\\"\\) is \ now available as the \\!\\(\\\"Multivariate Statistics Package\\\"\\). See \ the Compatibility Guide for updating information. \\!\\(\\*ButtonBox[\\\"\ \[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:Compatibility/Tutorials/Statistics/\ MultinormalDistribution\\\", ButtonNote -> \ \\\"General::newpkg\\\"]\\)\"\>"}]], "Message", "MSG", CellChangeTimes->{3.4521137981881356`*^9, 3.452119393111499*^9, 3.4521196645136366`*^9, 3.4522681099138203`*^9, 3.4526028123959365`*^9, 3.4526030825463123`*^9}] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Arrow reversal grammar", "Section", CellChangeTimes->{ 3.4521193824665103`*^9, {3.4522686938860617`*^9, 3.452268701827243*^9}, 3.4522687345433083`*^9, {3.452269044770112*^9, 3.452269052511011*^9}, { 3.452562459828929*^9, 3.452562462963342*^9}}], Cell[BoxData[ RowBox[{"(*", RowBox[{ RowBox[{ "this", " ", "grammar", " ", "reverses", " ", "the", " ", "arrow", " ", "direction", " ", "in", " ", "an", " ", "input", " ", RowBox[{"grammar", ".", " ", "The"}], " ", "input", " ", "grammar", " ", "is", " ", "declared", " ", "as", " ", "a", " ", "set", " ", "of", " ", RowBox[{"elements", ":", " ", "tLhsRule"}]}], ",", " ", RowBox[{ "tRhsRule", " ", "for", " ", "each", " ", "rule", " ", "and", " ", "tDervValue", " ", "for", " ", "each", " ", "value", " ", "in", " ", "a", " ", "continuous", " ", "rule"}]}], "*)"}]], "Input", CellChangeTimes->{{3.4525630721110315`*^9, 3.452563154977709*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"gReverseRulesGrammar", " ", "=", " ", RowBox[{"Grammar", "[", RowBox[{"rules", "\[Rule]", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"tLhsRule", "[", RowBox[{"pLhsID", ",", "pRuleID"}], "]"}], ",", RowBox[{"tRhsRule", "[", RowBox[{"pRhsID", ",", "pRuleID"}], "]"}], ",", RowBox[{"tRuleDir", "[", RowBox[{"pRuleID", ",", "1"}], "]"}]}], "}"}], "\[Rule]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"tRhsRule", "[", RowBox[{"pLhsID", ",", "pRuleID"}], "]"}], ",", RowBox[{"tLhsRule", "[", RowBox[{"pRhsID", ",", "pRuleID"}], "]"}], ",", RowBox[{"tRuleDir", "[", RowBox[{"pRuleID", ",", RowBox[{"-", "1"}]}], "]"}]}], "}"}]}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"tDervValue", "[", RowBox[{"pRuleID", ",", "pDervInd", ",", "pDervVal"}], "]"}], ",", RowBox[{"tDervDir", "[", RowBox[{"pRuleID", ",", "pDervInd", ",", "1"}], "]"}]}], "}"}], " ", "\[Rule]", " ", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"tDervValue", "[", RowBox[{"pRuleID", ",", "pDervInd", ",", RowBox[{"-", "pDervVal"}]}], "]"}], ",", RowBox[{"tDervReversed", "[", RowBox[{"pRuleID", ",", "pDervInd", ",", RowBox[{"-", "1"}]}], "]"}]}], "}"}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "}"}]}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.4526030168938723`*^9, 3.452603075085808*^9}, { 3.452603199611141*^9, 3.4526032090344095`*^9}, {3.452603247368384*^9, 3.4526033065216727`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["run simulation ", "Section", CellChangeTimes->{ 3.4521193824665103`*^9, {3.4522686938860617`*^9, 3.452268701827243*^9}, 3.4522687345433083`*^9, {3.452269044770112*^9, 3.452269052511011*^9}, { 3.452269674566875*^9, 3.4522696764294977`*^9}, {3.4522697543091536`*^9, 3.4522697607181773`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"executeGrammar", "[", RowBox[{"gReverseRulesGrammar", ",", RowBox[{"{", RowBox[{ RowBox[{"tLhsRule", "[", RowBox[{"1", ",", "1"}], "]"}], ",", RowBox[{"tRhsRule", "[", RowBox[{"2", ",", "1"}], "]"}], ",", RowBox[{"tLhsRule", "[", RowBox[{"3", ",", "2"}], "]"}], ",", RowBox[{"tRhsRule", "[", RowBox[{"4", ",", "2"}], "]"}], ",", RowBox[{"tDervValue", "[", RowBox[{"2", ",", "1", ",", "7.1"}], "]"}], ",", RowBox[{"tDervValue", "[", RowBox[{"2", ",", "2", ",", "3.3"}], "]"}], ",", RowBox[{"tElement", "[", RowBox[{"1", ",", "1"}], "]"}], ",", RowBox[{"tElement", "[", RowBox[{"2", ",", "1"}], "]"}], ",", RowBox[{"tRuleDir", "[", RowBox[{"1", ",", "1"}], "]"}], ",", RowBox[{"tRuleDir", "[", RowBox[{"2", ",", "1"}], "]"}], ",", RowBox[{"tDervDir", "[", RowBox[{"2", ",", "1", ",", "1"}], "]"}], ",", RowBox[{"tDervDir", "[", RowBox[{"2", ",", "2", ",", "1"}], "]"}]}], "}"}], ",", "20", ",", "False"}], "]"}], ";"}]], "Input", CellChangeTimes->{{3.4525625114416003`*^9, 3.452562558477828*^9}, { 3.452562649295701*^9, 3.452562704893984*^9}, 3.4526025865679674`*^9, { 3.4526027206467524`*^9, 3.4526028011901584`*^9}, {3.452603098108224*^9, 3.4526030981683083`*^9}, {3.4526033160550957`*^9, 3.452603347319116*^9}, { 3.4526034090159864`*^9, 3.4526034231258535`*^9}, {3.452603454740367*^9, 3.452603456963497*^9}, {3.4526035204028206`*^9, 3.4526035232668533`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"simStrcut", " ", "=", " ", RowBox[{"getSimulationStruct", "[", "]"}]}], ";"}]], "Input", CellChangeTimes->{ 3.452602876956839*^9, {3.4526034830201855`*^9, 3.4526034839615107`*^9}}], Cell[CellGroupData[{ Cell[BoxData["simStrcut"], "Input", CellChangeTimes->{3.4526034866252613`*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"1.4658073534252`", ",", RowBox[{"{", RowBox[{ RowBox[{"tElement", "[", RowBox[{"1.`", ",", "1.`"}], "]"}], ",", RowBox[{"tElement", "[", RowBox[{"2.`", ",", "1.`"}], "]"}], ",", RowBox[{"tDervValue", "[", RowBox[{"2.`", ",", "1.`", ",", RowBox[{"-", "7.1`"}]}], "]"}], ",", RowBox[{"tRhsRule", "[", RowBox[{"3.`", ",", "2.`"}], "]"}], ",", RowBox[{"tLhsRule", "[", RowBox[{"4.`", ",", "2.`"}], "]"}], ",", RowBox[{"tDervValue", "[", RowBox[{"2.`", ",", "2.`", ",", RowBox[{"-", "3.3`"}]}], "]"}], ",", RowBox[{"tRhsRule", "[", RowBox[{"1.`", ",", "1.`"}], "]"}], ",", RowBox[{"tLhsRule", "[", RowBox[{"2.`", ",", "1.`"}], "]"}], ",", RowBox[{"tDervReversed", "[", RowBox[{"2.`", ",", "1.`", ",", RowBox[{"-", "1.`"}]}], "]"}], ",", RowBox[{"tRuleDir", "[", RowBox[{"2.`", ",", RowBox[{"-", "1.`"}]}], "]"}], ",", RowBox[{"tDervReversed", "[", RowBox[{"2.`", ",", "2.`", ",", RowBox[{"-", "1.`"}]}], "]"}], ",", RowBox[{"tRuleDir", "[", RowBox[{"1.`", ",", RowBox[{"-", "1.`"}]}], "]"}]}], "}"}], ",", RowBox[{"{", "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.452603442763503*^9, 3.452603489208899*^9}, 3.452603527032155*^9}] }, Open ]] }, Open ]] }, WindowSize->{1272, 683}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (March 13, 2008)", StyleDefinitions->FrontEnd`FileName[{"Report"}, "StandardReport.nb", CharacterEncoding -> "WindowsANSI"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[568, 21, 565, 11, 67, "Input", Evaluatable->False, InitializationCell->True], Cell[1136, 34, 446, 10, 40, "Input", Evaluatable->False, InitializationCell->True], Cell[CellGroupData[{ Cell[1607, 48, 94, 1, 73, "Section"], Cell[CellGroupData[{ Cell[1726, 53, 70, 2, 40, "Input"], Cell[1799, 57, 216, 3, 70, "Print"], Cell[2018, 62, 737, 14, 70, "Message"], Cell[2758, 78, 735, 14, 70, "Message"], Cell[3496, 94, 705, 13, 70, "Message"], Cell[4204, 109, 583, 11, 70, "Message"], Cell[4790, 122, 768, 14, 70, "Message"], Cell[5561, 138, 707, 13, 70, "Message"], Cell[6271, 153, 709, 13, 70, "Message"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[7029, 172, 260, 4, 43, "Section"], Cell[7292, 178, 691, 13, 61, "Input"], Cell[7986, 193, 1979, 47, 221, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[10002, 245, 309, 5, 73, "Section"], Cell[10314, 252, 1611, 36, 61, "Input"], Cell[11928, 290, 222, 5, 40, "Input"], Cell[CellGroupData[{ Cell[12175, 299, 79, 1, 40, "Input"], Cell[12257, 302, 1388, 37, 59, "Output"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)