⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 romeoandjuliet-source.nb

📁 mathematica环境 展示罗密欧和朱丽叶的情感定律
💻 NB
📖 第 1 页 / 共 3 页
字号:
   "\[IndentingNewLine]", "\"\<Romeo's love for Juliet\>\"", ",", 
   "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"b", ",", " ", 
       RowBox[{"-", "0.4"}], ",", " ", "\"\<\>\""}], "}"}], ",", 
     RowBox[{"-", "1"}], ",", " ", "1", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", "\"\<Juliet's own feeling\>\"", ",", 
   "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"c", ",", " ", "0.775", ",", " ", "\"\<\>\""}], "}"}], ",", 
     RowBox[{"-", "1"}], ",", " ", "1", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", "\"\<Juliet's love for Romeo\>\"", ",", 
   "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"d", ",", " ", 
       RowBox[{"-", "0.125"}], ",", " ", "\"\<\>\""}], "}"}], ",", 
     RowBox[{"-", "1"}], ",", " ", "1", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", "Delimiter", ",", "\[IndentingNewLine]", 
   "\"\<initial love\>\"", ",", "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"R0", ",", " ", "0.2", ",", " ", "\"\<Romeo's for Juliet\>\""}],
       "}"}], ",", " ", 
     RowBox[{"-", "1"}], ",", " ", "1", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"J0", ",", " ", "0.2", ",", " ", "\"\<Juliet's for Romeo\>\""}],
       "}"}], ",", " ", 
     RowBox[{"-", "1"}], ",", " ", "1", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", "Delimiter", ",", "\[IndentingNewLine]", 
   "\"\<length of love affair\>\"", ",", "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"T", ",", " ", "20", ",", " ", "\"\<\>\""}], "}"}], ",", " ", 
     "0.1", ",", " ", "100", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", "Delimiter", ",", "\[IndentingNewLine]", 
   "\"\<include negative effect of too much love\>\"", ",", 
   "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "includeNonlinearTerms", ",", " ", "False", ",", " ", "\"\<\>\""}], 
      "}"}], ",", " ", 
     RowBox[{"{", 
      RowBox[{"True", ",", " ", "False"}], "}"}]}], "}"}], ",", 
   "\[IndentingNewLine]", 
   RowBox[{"Dynamic", "[", 
    RowBox[{"Style", "[", " ", 
     RowBox[{
     "\"\<Juliet's love for Romeo\\nbecomes counterproductive.\>\"", ",", " ",
       
      RowBox[{"If", "[", 
       RowBox[{"includeNonlinearTerms", ",", " ", "Black", ",", " ", "Gray"}],
        "]"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"JM", ",", " ", "0.3", ",", "\"\<\>\""}], "}"}], ",", " ", "0", 
     ",", " ", "5", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", 
   RowBox[{"Dynamic", "[", 
    RowBox[{"Style", "[", 
     RowBox[{
     "\"\<Romeo's love for Juliet\\nbecomes counterproductive.\>\"", ",", " ",
       
      RowBox[{"If", "[", 
       RowBox[{"includeNonlinearTerms", ",", " ", "Black", ",", " ", "Gray"}],
        "]"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"RM", ",", " ", "0.6", ",", " ", "\"\<\>\""}], "}"}], ",", " ", 
     "0", ",", " ", "5", ",", " ", 
     RowBox[{"ImageSize", " ", "\[Rule]", " ", "Small"}]}], "}"}], ",", 
   "\[IndentingNewLine]", 
   RowBox[{"ControlPlacement", " ", "\[Rule]", " ", "Left"}], ",", 
   RowBox[{"AutorunSequencing", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"1", ",", "3", ",", "5", ",", "7"}], "}"}]}], ",", 
   RowBox[{"SynchronousUpdating", "\[Rule]", "False"}]}], "]"}]], "Input",
 CellChangeTimes->{
  3.35696210375764*^9, 3.4016450983859215`*^9, {3.40164515142642*^9, 
   3.4016451921882844`*^9}, {3.401645424781289*^9, 3.401645431030774*^9}, {
   3.401645471201741*^9, 3.401645492433965*^9}, 3.4016457547020073`*^9, {
   3.401645794742777*^9, 3.401645798398325*^9}, {3.4016458312081203`*^9, 
   3.401645869636443*^9}, {3.401647354467187*^9, 3.401647396639062*^9}, {
   3.401647447326562*^9, 3.401647490029687*^9}, {3.401647542060937*^9, 
   3.401647576451562*^9}, {3.401647621107812*^9, 3.401647684123437*^9}, {
   3.401647769889062*^9, 3.401647844107812*^9}, {3.401647922123437*^9, 
   3.401647969967187*^9}, {3.401648003826562*^9, 3.401648020764062*^9}, {
   3.4016497867417727`*^9, 3.4016500040408783`*^9}, {3.401650164688064*^9, 
   3.401650190593343*^9}, {3.40165197277372*^9, 3.401651991595009*^9}, {
   3.4017051949417667`*^9, 3.4017052035511417`*^9}, {3.4017901084417553`*^9, 
   3.401790153571954*^9}, {3.4017901895917273`*^9, 3.4017901906856036`*^9}, {
   3.4017995822673893`*^9, 3.401799602035291*^9}, {3.4017996378050365`*^9, 
   3.4017996651831903`*^9}, 3.4017996996090307`*^9, {3.401803015647244*^9, 
   3.4018030361496058`*^9}, {3.402138117828125*^9, 3.402138159359375*^9}, {
   3.402138278890625*^9, 3.402138299953125*^9}, {3.40213878009375*^9, 
   3.402138830890625*^9}, {3.402139298859375*^9, 3.40213930209375*^9}}]
}, Open  ]],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`a$$ = 
    0.51, $CellContext`b$$ = -0.4, $CellContext`c$$ = 
    0.775, $CellContext`d$$ = -0.125, $CellContext`includeNonlinearTerms$$ = 
    False, $CellContext`J0$$ = 0.2, $CellContext`JM$$ = 
    0.3, $CellContext`R0$$ = 0.2, $CellContext`RM$$ = 0.6, $CellContext`T$$ = 
    20, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, 
    Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 
    1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{
      Hold["Romeo's own feeling"], Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`a$$], 0.51, ""}, -1, 1}, {
      Hold["Romeo's love for Juliet"], Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`b$$], -0.4, ""}, -1, 1}, {
      Hold["Juliet's own feeling"], Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`c$$], 0.775, ""}, -1, 1}, {
      Hold["Juliet's love for Romeo"], Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`d$$], -0.125, ""}, -1, 1}, {
      Hold["initial love"], Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`R0$$], 0.2, "Romeo's for Juliet"}, -1, 1}, {{
       Hold[$CellContext`J0$$], 0.2, "Juliet's for Romeo"}, -1, 1}, {
      Hold["length of love affair"], Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`T$$], 20, ""}, 0.1, 100}, {
      Hold["include negative effect of too much love"], 
      Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`includeNonlinearTerms$$], False, ""}, {
      True, False}}, {
      Hold[
       Dynamic[
        Style["Juliet's love for Romeo\nbecomes counterproductive.", 
         If[$CellContext`includeNonlinearTerms$$, Black, Gray]]]], 
      Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`JM$$], 0.3, ""}, 0, 5}, {
      Hold[
       Dynamic[
        Style["Romeo's love for Juliet\nbecomes counterproductive.", 
         If[$CellContext`includeNonlinearTerms$$, Black, Gray]]]], 
      Manipulate`Dump`ThisIsNotAControl}, {{
       Hold[$CellContext`RM$$], 0.6, ""}, 0, 5}}, Typeset`size$$ = {
    402., {212.5, 217.5}}, Typeset`update$$ = 0, Typeset`initDone$$, 
    Typeset`skipInitDone$$ = True, $CellContext`a$7714$$ = 
    0, $CellContext`b$7715$$ = 0, $CellContext`c$7716$$ = 
    0, $CellContext`d$7717$$ = 0, $CellContext`R0$7718$$ = 
    0, $CellContext`J0$7719$$ = 0, $CellContext`T$7720$$ = 
    0, $CellContext`includeNonlinearTerms$7721$$ = 
    "Button 6", $CellContext`JM$7722$$ = 0, $CellContext`RM$7723$$ = 0}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`a$$ = 
        0.51, $CellContext`b$$ = -0.4, $CellContext`c$$ = 
        0.775, $CellContext`d$$ = -0.125, \
$CellContext`includeNonlinearTerms$$ = False, $CellContext`J0$$ = 
        0.2, $CellContext`JM$$ = 0.3, $CellContext`R0$$ = 
        0.2, $CellContext`RM$$ = 0.6, $CellContext`T$$ = 20}, 
      "ControllerVariables" :> {
        Hold[$CellContext`a$$, $CellContext`a$7714$$, 0], 
        Hold[$CellContext`b$$, $CellContext`b$7715$$, 0], 
        Hold[$CellContext`c$$, $CellContext`c$7716$$, 0], 
        Hold[$CellContext`d$$, $CellContext`d$7717$$, 0], 
        Hold[$CellContext`R0$$, $CellContext`R0$7718$$, 0], 
        Hold[$CellContext`J0$$, $CellContext`J0$7719$$, 0], 
        Hold[$CellContext`T$$, $CellContext`T$7720$$, 0], 
        Hold[$CellContext`includeNonlinearTerms$$, \
$CellContext`includeNonlinearTerms$7721$$, False], 
        Hold[$CellContext`JM$$, $CellContext`JM$7722$$, 0], 
        Hold[$CellContext`RM$$, $CellContext`RM$7723$$, 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" :> 
      Module[{$CellContext`R$, $CellContext`J$, $CellContext`nds$}, \
$CellContext`nds$ = Quiet[
           
           NDSolve[{
            Derivative[
              1][$CellContext`R$][$CellContext`t] == $CellContext`a$$ \
$CellContext`R$[$CellContext`t] + ($CellContext`b$$ \
$CellContext`J$[$CellContext`t]) 
               If[$CellContext`includeNonlinearTerms$$, $CellContext`JM$$ - 
                 Abs[
                  $CellContext`J$[$CellContext`t]], 1], 
             Derivative[
              1][$CellContext`J$][$CellContext`t] == ($CellContext`c$$ \
$CellContext`R$[$CellContext`t]) 
               If[$CellContext`includeNonlinearTerms$$, $CellContext`RM$$ - 
                 Abs[
                  $CellContext`R$[$CellContext`t]], 
                 1] + $CellContext`d$$ $CellContext`J$[$CellContext`t], \
$CellContext`R$[0] == $CellContext`R0$$, $CellContext`J$[
              0] == $CellContext`J0$$}, {$CellContext`R$, $CellContext`J$}, \
{$CellContext`t, 0, $CellContext`T$$}, PrecisionGoal -> 3]]; Column[{
           Text[
            Which[
             And[$CellContext`a$$ == 0, $CellContext`b$$ == 0], 
             "Romeo is apathetic with respect to his own feelings \nand \
Juliet is not influencing him.", 
             And[$CellContext`a$$ == 0, $CellContext`b$$ < 0], 
             "Romeo is apathetic with respect to his own feelings \nand \
Juliet discourages him.", 
             And[$CellContext`a$$ == 0, $CellContext`b$$ > 0], 
             "Romeo is apathetic with respect to his own feelings \nand \
Juliet encourages him.", 
             And[$CellContext`a$$ > 0, $CellContext`b$$ == 0], 
             "Romeo is attracted to Juliet \nand Juliet is not influencing \
him.", 
             And[$CellContext`a$$ > 0, $CellContext`b$$ < 0], 
             "Romeo is attracted to Juliet \nand Juliet discourages him (he \
is a narcissistic nerd).", 
             And[$CellContext`a$$ > 0, $CellContext`b$$ > 0], 
             "Romeo is attracted to Juliet \nand Juliet encourages him (he is \
an eager beaver).", 
             And[$CellContext`a$$ < 0, $CellContext`b$$ == 0], 
             "Romeo retreats from his feelings toward Juliet \nand Juliet is \
not influencing him.", 
             And[$CellContext`a$$ < 0, $CellContext`b$$ < 0], 
             "Romeo retreats from his feelings toward Juliet \nand Juliet \
discourages him (he is a hermit).", 
             And[$CellContext`a$$ < 0, $CellContext`b$$ > 0], 
             "Romeo retreats from his feelings toward Juliet \nand Juliet \
encourages him (he is a cautious lover)."]], 
           Text[
            Which[
             And[$CellContext`c$$ == 0, $CellContext`d$$ == 0], 
             "Juliet is apathetic with respect to her own feelings \nand \
Romeo is not influencing her.", 
             And[$CellContext`c$$ == 0, $CellContext`d$$ < 0], 
             "Juliet is apathetic with respect to her own feelings \nand \
Romeo discourages her.", 
             And[$CellContext`c$$ == 0, $CellContext`d$$ > 0], 
             "Juliet is apathetic with respect to her own feelings \nand \
Romeo encourages her.", 
             And[$CellContext`c$$ > 0, $CellContext`d$$ == 0], 
             "Juliet is attracted to Romeo \nand Romeo is not influencing \
her.", 
             And[$CellContext`c$$ > 0, $CellContext`d$$ < 0], 
             "Juliet is attracted to Romeo \nand Romeo discourages her (she \
is a narcissistic nerd).", 
             And[$CellContext`c$$ > 0, $CellContext`d$$ > 0], 
             "Juliet is attracted to Romeo \nand Romeo encourages her (she is \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -