(* 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[ 35644, 1243] NotebookOptionsPosition[ 31305, 1110] NotebookOutlinePosition[ 31697, 1127] CellTagsIndexPosition[ 31654, 1124] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Bernard Thermal Instability: Marginal Mode Analysis", "Title"], Cell["\<\ APPH 4200 Physics of Fluids Columbia University November, 2007\ \>", "Subsubtitle"], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell["\<\ This notebook solves for the marginal instability threshold for Bernard \ thermal instability. See Chapter 12, Section 3 of Kundu and Cohen's textbook.\ \ \>", "Text"], Cell[TextData[{ "Four steps are required. First, from the linearized equations for the fluid \ dynamics, a cubic equation is solved for the vertical variation of the \ vertical velocity. Second, these three solutions are used to satisfy three \ boundary conditions at the constant-temperature walls. This leads to a \ condition between Ra (the Rayleigh number) and ", Cell[BoxData[ FormBox[ SuperscriptBox["k", "2"], TraditionalForm]]], "for marginal instability. Finally, we plot this condition and examine the \ modes." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Vertical Velocity Equation", "Section"], Cell["The equation for vertical velocity takes the form", "Text"], Cell[BoxData[ RowBox[{"eqVert", " ", "=", " ", RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{ SuperscriptBox["q", "2"], " ", "+", " ", SuperscriptBox["k", "2"]}], ")"}], "3"], " ", "\[Equal]", " ", RowBox[{ SuperscriptBox["k", "2"], "Ra"}]}]}]], "Input", CellLabel->"In[1]:="], Cell[TextData[{ "when the vertical velocity has the form, ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["U", "z"], " ", "~", " ", RowBox[{"Cos", "[", RowBox[{"q", " ", "z"}], "]"}]}], TraditionalForm]]], "." }], "Text"], Cell[BoxData[ RowBox[{"qSol", " ", "=", " ", RowBox[{"Solve", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"eqVert", " ", "/.", " ", RowBox[{ SuperscriptBox["q", "2"], " ", "\[Rule]", " ", "q2"}]}], " ", "/.", " ", RowBox[{ SuperscriptBox["k", "2"], " ", "\[Rule]", " ", "k2"}]}], ")"}], ",", " ", "q2"}], "]"}]}]], "Input", CellLabel->"In[2]:="], Cell[CellGroupData[{ Cell["Cos[z] is Even", "Subsection"], Cell[TextData[{ "First, we'll look for ", StyleBox["even", FontSlant->"Italic"], " modes... " }], "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Cos", "[", "z", "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", FractionBox["\[Pi]", "2"]}], ",", FractionBox["\[Pi]", "2"]}], "}"}]}], "]"}]], "Input", CellLabel->"In[3]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Re", "[", "#1", "]"}], ",", RowBox[{"Im", "[", "#1", "]"}]}], "}"}], "&"}], ")"}], "[", RowBox[{"Cos", "[", RowBox[{"z", " ", RowBox[{"(", RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}]}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", FractionBox["\[Pi]", "2"]}], ",", FractionBox["\[Pi]", "2"]}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Blue", ",", "Red"}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[4]:="], Cell[TextData[{ "An similiar analysis can be performed for the ", StyleBox["odd", FontSlant->"Italic"], " modes, but these modes have a higher critical Ra number." }], "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Satisfy Boundary Conditions", "Section"], Cell[BoxData[ RowBox[{ RowBox[{"uz", "[", "z_", "]"}], " ", "=", " ", RowBox[{ RowBox[{"a", " ", RowBox[{"(", RowBox[{ RowBox[{"Cos", "[", RowBox[{ RowBox[{"Sqrt", "[", "q2", "]"}], " ", "z"}], "]"}], "/.", RowBox[{ "qSol", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ")"}]}], " ", "+", " ", RowBox[{"b", " ", RowBox[{"(", RowBox[{ RowBox[{"Cos", "[", RowBox[{ RowBox[{"Sqrt", "[", "q2", "]"}], " ", "z"}], "]"}], "/.", RowBox[{ "qSol", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ")"}]}], "+", " ", RowBox[{"c", " ", RowBox[{"(", RowBox[{ RowBox[{"Cos", "[", RowBox[{ RowBox[{"Sqrt", "[", "q2", "]"}], " ", "z"}], "]"}], "/.", RowBox[{ "qSol", "\[LeftDoubleBracket]", "3", "\[RightDoubleBracket]"}]}], ")"}]}]}]}]], "Input", CellLabel->"In[5]:="], Cell[BoxData[ RowBox[{"eq1", " ", "=", " ", RowBox[{ RowBox[{"uz", "[", RowBox[{"1", "/", "2"}], "]"}], " ", "\[Equal]", " ", "0"}]}]], "Input", CellLabel->"In[6]:="], Cell[BoxData[ RowBox[{"eq2", " ", "=", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"uz", "[", "z", "]"}], ",", "z"}], "]"}], " ", "\[Equal]", " ", "0"}], " ", "/.", " ", RowBox[{"z", " ", "\[Rule]", " ", RowBox[{"1", "/", "2"}]}]}], ")"}]}]], "Input", CellLabel->"In[7]:="], Cell[BoxData[ RowBox[{"eq3", " ", "=", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Collect", "[", RowBox[{ RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"uz", "[", "z", "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "4"}], "}"}]}], "]"}], " ", "-", " ", RowBox[{"2", " ", "k2", " ", RowBox[{"D", "[", RowBox[{ RowBox[{"uz", "[", "z", "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "2"}], "}"}]}], "]"}]}], " ", "+", " ", RowBox[{ SuperscriptBox["k2", "2"], " ", RowBox[{"uz", "[", "z", "]"}]}]}], ",", " ", RowBox[{"{", RowBox[{"a", ",", "b", ",", "c"}], "}"}], ",", " ", "Simplify"}], "]"}], "\[Equal]", " ", "0"}], " ", "/.", " ", RowBox[{"z", " ", "\[Rule]", " ", RowBox[{"1", "/", "2"}]}]}], ")"}]}]], "Input", CellLabel->"In[8]:="], Cell[TextData[{ "These three equations can be satisfied simultaneous ", StyleBox["only if ", FontSlant->"Italic"], " the determinant of a characteristic matrix vanishes. This defines the \ marginal condition between ", Cell[BoxData[ FormBox[ SuperscriptBox["k", "2"], TraditionalForm]]], "and Ra." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Marginal Instability Condition", "Section"], Cell["\<\ The marginal instability criterion is found by simultaneously solving three \ boundary conditions. This possible when the determinant of a characteristic \ matrix vanishes.\ \>", "Text"], Cell[BoxData[ RowBox[{"First", "[", "eq1", "]"}]], "Input", CellLabel->"In[9]:="], Cell[BoxData[ RowBox[{"row1", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq1", "]"}], ",", " ", "a"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq1", "]"}], ",", " ", "b"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq1", "]"}], ",", " ", "c"}], "]"}]}], "}"}]}]], "Input", CellLabel->"In[10]:="], Cell[BoxData[ RowBox[{"row2", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq2", "]"}], ",", " ", "a"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq2", "]"}], ",", " ", "b"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq2", "]"}], ",", " ", "c"}], "]"}]}], "}"}]}]], "Input", CellLabel->"In[11]:="], Cell[BoxData[ RowBox[{"row3", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq3", "]"}], ",", " ", "a"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq3", "]"}], ",", " ", "b"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq3", "]"}], ",", " ", "c"}], "]"}]}], "}"}]}]], "Input", CellLabel->"In[12]:="], Cell[BoxData[ RowBox[{ RowBox[{"Det", "[", RowBox[{"{", RowBox[{"row1", ",", "row2", ",", "row3"}], "}"}], "]"}], " ", "//", " ", "Simplify"}]], "Input", CellLabel->"In[13]:="], Cell[BoxData[ RowBox[{ RowBox[{"marginal", "[", RowBox[{"k2_", ",", "Ra_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Det", "[", RowBox[{"{", RowBox[{"row1", ",", "row2", ",", "row3"}], "}"}], "]"}], "/", SuperscriptBox["k2", RowBox[{"2", "/", "3"}]]}], "/", SuperscriptBox["Ra", RowBox[{"2", "/", "3"}]]}], ")"}], " ", "//", " ", "Simplify"}]}]], "Input", CellLabel->"In[14]:="], Cell[BoxData[ RowBox[{"marginal", "[", RowBox[{"2.0", ",", "4000.0"}], "]"}]], "Input", CellLabel->"In[15]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Re", "[", "#1", "]"}], ",", RowBox[{"Im", "[", "#1", "]"}]}], "}"}], "&"}], ")"}], "[", RowBox[{"marginal", "[", RowBox[{"k2", ",", "4000.`"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"k2", ",", "0", ",", "50"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\<\\!\\(\\*SuperscriptBox[\\(k\\), \\(2\\)]\\)\>\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[16]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Re", "[", "#1", "]"}], ",", RowBox[{"Im", "[", "#1", "]"}]}], "}"}], "&"}], ")"}], "[", RowBox[{"marginal", "[", RowBox[{"1.`", ",", "Ra"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"Ra", ",", "0", ",", "5000"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[17]:="], Cell[BoxData[ RowBox[{ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"1.0", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "2000.0"}], "}"}]}], "]"}], " ", "//", " ", "Chop"}]], "Input", CellLabel->"In[18]:="], Cell[BoxData[ RowBox[{ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"5.0", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "2000.0"}], "}"}]}], "]"}], " ", "//", " ", "Chop"}]], "Input", CellLabel->"In[19]:="], Cell[BoxData[ RowBox[{ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"50.0", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "2000.0"}], "}"}]}], "]"}], " ", "//", " ", "Chop"}]], "Input", CellLabel->"In[20]:="], Cell[BoxData[ RowBox[{ RowBox[{"marginalRa", "[", "k2_", "]"}], " ", ":=", " ", RowBox[{"Ra", " ", "/.", " ", RowBox[{"Chop", "[", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"k2", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "2000.0"}], "}"}]}], "]"}], "]"}]}]}]], "Input",\ CellLabel->"In[21]:="], Cell[BoxData[ RowBox[{"marginalRa", "[", "2.0", "]"}]], "Input", CellLabel->"In[22]:="], Cell[BoxData[ RowBox[{ RowBox[{"marginalBoundary", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"marginalRa", "[", "k2", "]"}], ",", RowBox[{"Sqrt", "[", "k2", "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"k2", ",", " ", "1.0", ",", " ", "50.0", ",", "1.0"}], "}"}]}], "]"}]}], ";"}]], "Input", CellLabel->"In[23]:="], Cell[BoxData[ RowBox[{"evenMarginalPlt", "=", RowBox[{"ListPlot", "[", RowBox[{"marginalBoundary", ",", RowBox[{"Joined", "\[Rule]", "True"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "9000"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "9"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotLabel", "\[Rule]", "\"\\""}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]}]], "Input", CellLabel->"In[24]:="] }, Closed]], Cell[CellGroupData[{ Cell["Critical Mode", "Section"], Cell["\<\ The critical mode and Rayleigh number were given in the textbook.\ \>", "Text"], Cell[BoxData[ RowBox[{"critRa", " ", "=", " ", RowBox[{"Min", "[", RowBox[{"First", "[", RowBox[{"Transpose", "[", "marginalBoundary", "]"}], "]"}], "]"}]}]], "Input", CellLabel->"In[25]:="], Cell[BoxData[ RowBox[{"critk", " ", "=", " ", RowBox[{ RowBox[{"Select", "[", RowBox[{"marginalBoundary", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"First", "[", "#", "]"}], " ", "\[Equal]", " ", "critRa"}], ")"}], "&"}]}], "]"}], "\[LeftDoubleBracket]", RowBox[{"1", ",", "2"}], "\[RightDoubleBracket]"}]}]], "Input", CellLabel->"In[26]:="], Cell[BoxData[ RowBox[{"eq1Crit", " ", "=", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"eq1", " ", "/.", " ", RowBox[{"k2", " ", "\[Rule]", " ", SuperscriptBox["critk", "2"]}]}], " ", "/.", " ", RowBox[{"Ra", " ", "\[Rule]", " ", "critRa"}]}], " ", "/.", " ", RowBox[{"a", " ", "\[Rule]", " ", "1"}]}], "//", " ", "Simplify"}]}]], "Input", CellLabel->"In[27]:="], Cell[BoxData[ RowBox[{"eq2Crit", " ", "=", RowBox[{ RowBox[{ RowBox[{ RowBox[{"eq2", " ", "/.", " ", RowBox[{"k2", " ", "\[Rule]", " ", SuperscriptBox["critk", "2"]}]}], " ", "/.", " ", RowBox[{"Ra", " ", "\[Rule]", " ", "critRa"}]}], " ", "/.", " ", RowBox[{"a", " ", "\[Rule]", " ", "1"}]}], " ", "//", " ", "Simplify"}]}]], "Input", CellLabel->"In[28]:="], Cell[BoxData[ RowBox[{"modeCrit", " ", "=", " ", RowBox[{"First", "[", RowBox[{"Solve", "[", RowBox[{ RowBox[{"{", RowBox[{"eq1Crit", ",", "eq2Crit"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"b", ",", " ", "c"}], "}"}]}], "]"}], "]"}]}]], "Input", CellLabel->"In[29]:="], Cell[BoxData[ RowBox[{ RowBox[{"uzCrit", "[", "z_", "]"}], " ", "=", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"uz", "[", "z", "]"}], " ", "/.", " ", RowBox[{"a", " ", "\[Rule]", " ", "1"}]}], "/.", " ", "modeCrit"}], "/.", " ", RowBox[{"k2", " ", "\[Rule]", " ", SuperscriptBox["critk", "2"]}]}], " ", "/.", " ", RowBox[{"Ra", " ", "\[Rule]", " ", "critRa", " "}]}]}]], "Input", CellLabel->"In[30]:="], Cell[BoxData[ RowBox[{"uzCrit", "[", "0.0", "]"}]], "Input", CellLabel->"In[31]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"Chop", "[", RowBox[{"uzCrit", "[", "z", "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "0.499`"}], ",", "0.499`"}], "}"}], ",", RowBox[{"PlotLabel", "\[Rule]", "\"\\""}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<\>\""}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[32]:="] }, Closed]], Cell[CellGroupData[{ Cell["Odd Mode (?)", "Section"], Cell[CellGroupData[{ Cell["Sin[z] is Even", "Subsection"], Cell[TextData[{ "First, we'll look for ", StyleBox["even", FontSlant->"Italic"], " modes... " }], "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Sin", "[", "z", "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "\[Pi]"}], ",", "\[Pi]"}], "}"}]}], "]"}]], "Input", CellLabel->"In[33]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Re", "[", "#1", "]"}], ",", RowBox[{"Im", "[", "#1", "]"}]}], "}"}], "&"}], ")"}], "[", RowBox[{"Sin", "[", RowBox[{"z", " ", RowBox[{"(", RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}]}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "\[Pi]"}], ",", "\[Pi]"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Blue", ",", "Red"}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[34]:="], Cell[TextData[{ "An similiar analysis can be performed for the ", StyleBox["odd", FontSlant->"Italic"], " modes, but these modes have a higher critical Ra number." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Satisfy Boundary Conditions", "Subsection"], Cell[BoxData[ RowBox[{ RowBox[{"uz", "[", "z_", "]"}], " ", "=", " ", RowBox[{ RowBox[{"a", " ", RowBox[{"(", RowBox[{ RowBox[{"Sin", "[", RowBox[{ RowBox[{"Sqrt", "[", "q2", "]"}], " ", "z"}], "]"}], "/.", RowBox[{ "qSol", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ")"}]}], " ", "+", " ", RowBox[{"b", " ", RowBox[{"(", RowBox[{ RowBox[{"Sin", "[", RowBox[{ RowBox[{"Sqrt", "[", "q2", "]"}], " ", "z"}], "]"}], "/.", RowBox[{ "qSol", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ")"}]}], "+", " ", RowBox[{"c", " ", RowBox[{"(", RowBox[{ RowBox[{"Sin", "[", RowBox[{ RowBox[{"Sqrt", "[", "q2", "]"}], " ", "z"}], "]"}], "/.", RowBox[{ "qSol", "\[LeftDoubleBracket]", "3", "\[RightDoubleBracket]"}]}], ")"}]}]}]}]], "Input", CellLabel->"In[35]:="], Cell[BoxData[ RowBox[{"eq1", " ", "=", " ", RowBox[{ RowBox[{"uz", "[", RowBox[{"1", "/", "2"}], "]"}], " ", "\[Equal]", " ", "0"}]}]], "Input", CellLabel->"In[36]:="], Cell[BoxData[ RowBox[{"eq2", " ", "=", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"uz", "[", "z", "]"}], ",", "z"}], "]"}], " ", "\[Equal]", " ", "0"}], " ", "/.", " ", RowBox[{"z", " ", "\[Rule]", " ", RowBox[{"1", "/", "2"}]}]}], ")"}]}]], "Input", CellLabel->"In[37]:="], Cell[BoxData[ RowBox[{"eq3", " ", "=", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Collect", "[", RowBox[{ RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"uz", "[", "z", "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "4"}], "}"}]}], "]"}], " ", "-", " ", RowBox[{"2", " ", "k2", " ", RowBox[{"D", "[", RowBox[{ RowBox[{"uz", "[", "z", "]"}], ",", RowBox[{"{", RowBox[{"z", ",", "2"}], "}"}]}], "]"}]}], " ", "+", " ", RowBox[{ SuperscriptBox["k2", "2"], " ", RowBox[{"uz", "[", "z", "]"}]}]}], ",", " ", RowBox[{"{", RowBox[{"a", ",", "b", ",", "c"}], "}"}], ",", " ", "Simplify"}], "]"}], "\[Equal]", " ", "0"}], " ", "/.", " ", RowBox[{"z", " ", "\[Rule]", " ", RowBox[{"1", "/", "2"}]}]}], ")"}]}]], "Input", CellLabel->"In[38]:="], Cell[TextData[{ "These three equations can be satisfied simultaneous ", StyleBox["only if ", FontSlant->"Italic"], " the determinant of a characteristic matrix vanishes. This defines the \ marginal condition between ", Cell[BoxData[ FormBox[ SuperscriptBox["k", "2"], TraditionalForm]]], "and Ra." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Marginal Instability Condition", "Subsection"], Cell["\<\ The marginal instability criterion is found by simultaneously solving three \ boundary conditions. This possible when the determinant of a characteristic \ matrix vanishes.\ \>", "Text"], Cell[BoxData[ RowBox[{"First", "[", "eq1", "]"}]], "Input", CellLabel->"In[39]:="], Cell[BoxData[ RowBox[{"row1", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq1", "]"}], ",", " ", "a"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq1", "]"}], ",", " ", "b"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq1", "]"}], ",", " ", "c"}], "]"}]}], "}"}]}]], "Input", CellLabel->"In[40]:="], Cell[BoxData[ RowBox[{"row2", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq2", "]"}], ",", " ", "a"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq2", "]"}], ",", " ", "b"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq2", "]"}], ",", " ", "c"}], "]"}]}], "}"}]}]], "Input", CellLabel->"In[41]:="], Cell[BoxData[ RowBox[{"row3", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq3", "]"}], ",", " ", "a"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq3", "]"}], ",", " ", "b"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{ RowBox[{"First", "[", "eq3", "]"}], ",", " ", "c"}], "]"}]}], "}"}]}]], "Input", CellLabel->"In[42]:="], Cell[BoxData[ RowBox[{ RowBox[{"Det", "[", RowBox[{"{", RowBox[{"row1", ",", "row2", ",", "row3"}], "}"}], "]"}], " ", "//", " ", "Simplify"}]], "Input", CellLabel->"In[43]:="], Cell[BoxData[ RowBox[{ RowBox[{"marginal", "[", RowBox[{"k2_", ",", "Ra_"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"Det", "[", RowBox[{"{", RowBox[{"row1", ",", "row2", ",", "row3"}], "}"}], "]"}], "/", SuperscriptBox["k2", RowBox[{"2", "/", "3"}]]}], "/", SuperscriptBox["Ra", RowBox[{"2", "/", "3"}]]}], ")"}], " ", "//", " ", "Simplify"}]}]], "Input", CellLabel->"In[44]:="], Cell[BoxData[{ RowBox[{"marginal", "[", RowBox[{"50.0", ",", "4000.0"}], "]"}], "\[IndentingNewLine]", RowBox[{"marginal", "[", RowBox[{"50.0", ",", "1000.0"}], "]"}]}], "Input", CellLabel->"In[45]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Re", "[", "#1", "]"}], ",", RowBox[{"Im", "[", "#1", "]"}]}], "}"}], "&"}], ")"}], "[", RowBox[{"marginal", "[", RowBox[{"k2", ",", "4000.`"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"k2", ",", "0", ",", "70"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\<\\!\\(\\*SuperscriptBox[\\(k\\), \\(2\\)]\\)\>\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[47]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Re", "[", "#1", "]"}], ",", RowBox[{"Im", "[", "#1", "]"}]}], "}"}], "&"}], ")"}], "[", RowBox[{"marginal", "[", RowBox[{"50.`", ",", "Ra"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"Ra", ",", "0", ",", "5000"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[48]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Re", "[", "#1", "]"}], ",", RowBox[{"Im", "[", "#1", "]"}]}], "}"}], "&"}], ")"}], "[", RowBox[{"marginal", "[", RowBox[{"25.`", ",", "Ra"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"Ra", ",", "0", ",", "5000"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[49]:="], Cell[BoxData[ RowBox[{ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"25.0", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "3000.0"}], "}"}]}], "]"}], " ", "//", " ", "Chop"}]], "Input", CellLabel->"In[50]:="], Cell[BoxData[ RowBox[{ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"50.0", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "3000.0"}], "}"}]}], "]"}], " ", "//", " ", "Chop"}]], "Input", CellLabel->"In[51]:="], Cell[BoxData[ RowBox[{ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"100.0", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "3000.0"}], "}"}]}], "]"}], " ", "//", " ", "Chop"}]], "Input", CellLabel->"In[52]:="], Cell[BoxData[ RowBox[{ RowBox[{"marginalRa", "[", RowBox[{"k2_", ",", RowBox[{"start_:", "3000.0"}]}], "]"}], " ", ":=", " ", RowBox[{"Ra", " ", "/.", " ", RowBox[{"Chop", "[", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{"marginal", "[", RowBox[{"k2", ",", "Ra"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"Ra", ",", " ", "start"}], "}"}]}], "]"}], "]"}]}]}]], "Input",\ CellLabel->"In[53]:="], Cell[BoxData[ RowBox[{"globalStart", " ", "=", " ", RowBox[{"marginalRa", "[", RowBox[{"25.0", ",", "500.0"}], "]"}]}]], "Input", CellLabel->"In[54]:="], Cell[BoxData[ RowBox[{ RowBox[{"marginalBoundary", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"globalStart", "=", RowBox[{"marginalRa", "[", RowBox[{"k2", ",", "globalStart"}], "]"}]}], ",", RowBox[{"Sqrt", "[", "k2", "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"k2", ",", " ", "25.0", ",", " ", "100.0", ",", "2.0"}], "}"}]}], "]"}]}], ";"}]], "Input", CellLabel->"In[55]:="], Cell[BoxData[ RowBox[{"oddMarginalPlt", "=", RowBox[{"ListPlot", "[", RowBox[{"marginalBoundary", ",", RowBox[{"Joined", "\[Rule]", "True"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "9000"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "9"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotLabel", "\[Rule]", "\"\\""}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]}]], "Input", CellLabel->"In[56]:="], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"evenMarginalPlt", ",", "oddMarginalPlt"}], "]"}]], "Input", CellLabel->"In[57]:="] }, Closed]], Cell[CellGroupData[{ Cell["Critical Mode", "Subsection"], Cell["\<\ The critical mode and Rayleigh number were given in the textbook.\ \>", "Text"], Cell[BoxData[ RowBox[{"critRa", " ", "=", " ", RowBox[{"Min", "[", RowBox[{"First", "[", RowBox[{"Transpose", "[", "marginalBoundary", "]"}], "]"}], "]"}]}]], "Input", CellLabel->"In[58]:="], Cell[BoxData[ RowBox[{"critk", " ", "=", " ", RowBox[{ RowBox[{"Select", "[", RowBox[{"marginalBoundary", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"First", "[", "#", "]"}], " ", "\[Equal]", " ", "critRa"}], ")"}], "&"}]}], "]"}], "\[LeftDoubleBracket]", RowBox[{"1", ",", "2"}], "\[RightDoubleBracket]"}]}]], "Input", CellLabel->"In[59]:="], Cell[BoxData[ RowBox[{"eq1Crit", " ", "=", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"eq1", " ", "/.", " ", RowBox[{"k2", " ", "\[Rule]", " ", SuperscriptBox["critk", "2"]}]}], " ", "/.", " ", RowBox[{"Ra", " ", "\[Rule]", " ", "critRa"}]}], " ", "/.", " ", RowBox[{"a", " ", "\[Rule]", " ", "1"}]}], "//", " ", "Simplify"}]}]], "Input", CellLabel->"In[60]:="], Cell[BoxData[ RowBox[{"eq2Crit", " ", "=", RowBox[{ RowBox[{ RowBox[{ RowBox[{"eq2", " ", "/.", " ", RowBox[{"k2", " ", "\[Rule]", " ", SuperscriptBox["critk", "2"]}]}], " ", "/.", " ", RowBox[{"Ra", " ", "\[Rule]", " ", "critRa"}]}], " ", "/.", " ", RowBox[{"a", " ", "\[Rule]", " ", "1"}]}], " ", "//", " ", "Simplify"}]}]], "Input", CellLabel->"In[61]:="], Cell[BoxData[ RowBox[{"modeCrit", " ", "=", " ", RowBox[{"First", "[", RowBox[{"Solve", "[", RowBox[{ RowBox[{"{", RowBox[{"eq1Crit", ",", "eq2Crit"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"b", ",", " ", "c"}], "}"}]}], "]"}], "]"}]}]], "Input", CellLabel->"In[62]:="], Cell[BoxData[ RowBox[{ RowBox[{"uzCrit", "[", "z_", "]"}], " ", "=", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"uz", "[", "z", "]"}], " ", "/.", " ", RowBox[{"a", " ", "\[Rule]", " ", "1"}]}], "/.", " ", "modeCrit"}], "/.", " ", RowBox[{"k2", " ", "\[Rule]", " ", SuperscriptBox["critk", "2"]}]}], " ", "/.", " ", RowBox[{"Ra", " ", "\[Rule]", " ", "critRa", " "}]}]}]], "Input", CellLabel->"In[63]:="], Cell[BoxData[ RowBox[{"uzCrit", "[", "0.0", "]"}]], "Input", CellLabel->"In[64]:="], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"{", RowBox[{ RowBox[{"Re", "[", RowBox[{"uzCrit", "[", "z", "]"}], "]"}], ",", RowBox[{"Im", "[", RowBox[{"uzCrit", "[", "z", "]"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "0.499`"}], ",", "0.499`"}], "}"}], ",", RowBox[{"PlotLabel", "\[Rule]", "\"\\""}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<\>\""}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Blue", ",", "Red"}], "}"}]}]}], "]"}]], "Input", CellLabel->"In[65]:="] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Summary", "Section"], Cell["\<\ The linearized fluid dynamics equations were solved to find the marginal \ instability boundary for Bernard thermal instability.\ \>", "Text"] }, Closed]] }, Open ]] }, WindowSize->{599, 765}, WindowMargins->{{4, Automatic}, {Automatic, 4}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (May 21, 2008)", StyleDefinitions->"TutorialBook.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 68, 0, 97, "Title"], Cell[661, 25, 93, 4, 55, "Subsubtitle"], Cell[CellGroupData[{ Cell[779, 33, 31, 0, 86, "Section"], Cell[813, 35, 177, 4, 41, "Text"], Cell[993, 41, 541, 11, 95, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[1571, 57, 45, 0, 54, "Section"], Cell[1619, 59, 65, 0, 23, "Text"], Cell[1687, 61, 316, 10, 36, "Input"], Cell[2006, 73, 244, 9, 25, "Text"], Cell[2253, 84, 412, 13, 34, "Input"], Cell[CellGroupData[{ Cell[2690, 101, 36, 0, 34, "Subsection"], Cell[2729, 103, 110, 5, 23, "Text"], Cell[2842, 110, 271, 9, 44, "Input"], Cell[3116, 121, 768, 25, 114, "Input"], Cell[3887, 148, 180, 5, 41, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[4116, 159, 46, 0, 54, "Section"], Cell[4165, 161, 949, 31, 64, "Input"], Cell[5117, 194, 179, 5, 26, "Input"], Cell[5299, 201, 344, 11, 26, "Input"], Cell[5646, 214, 939, 27, 102, "Input"], Cell[6588, 243, 321, 10, 41, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[6946, 258, 49, 0, 54, "Section"], Cell[6998, 260, 196, 4, 41, "Text"], Cell[7197, 266, 83, 2, 26, "Input"], Cell[7283, 270, 474, 14, 63, "Input"], Cell[7760, 286, 474, 14, 63, "Input"], Cell[8237, 302, 474, 14, 63, "Input"], Cell[8714, 318, 192, 6, 26, "Input"], Cell[8909, 326, 488, 16, 54, "Input"], Cell[9400, 344, 115, 3, 26, "Input"], Cell[9518, 349, 704, 21, 112, "Input"], Cell[10225, 372, 648, 19, 77, "Input"], Cell[10876, 393, 282, 9, 44, "Input"], Cell[11161, 404, 282, 9, 44, "Input"], Cell[11446, 415, 283, 9, 44, "Input"], Cell[11732, 426, 395, 12, 64, "Input"], Cell[12130, 440, 89, 2, 26, "Input"], Cell[12222, 444, 408, 12, 62, "Input"], Cell[12633, 458, 614, 16, 97, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13284, 479, 32, 0, 54, "Section"], Cell[13319, 481, 89, 2, 23, "Text"], Cell[13411, 485, 208, 6, 26, "Input"], Cell[13622, 493, 396, 11, 62, "Input"], Cell[14021, 506, 406, 11, 66, "Input"], Cell[14430, 519, 405, 11, 66, "Input"], Cell[14838, 532, 308, 9, 26, "Input"], Cell[15149, 543, 461, 13, 67, "Input"], Cell[15613, 558, 85, 2, 26, "Input"], Cell[15701, 562, 482, 13, 62, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[16220, 580, 31, 0, 54, "Section"], Cell[CellGroupData[{ Cell[16276, 584, 36, 0, 34, "Subsection"], Cell[16315, 586, 110, 5, 23, "Text"], Cell[16428, 593, 223, 7, 26, "Input"], Cell[16654, 602, 720, 23, 110, "Input"], Cell[17377, 627, 180, 5, 41, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[17594, 637, 49, 0, 34, "Subsection"], Cell[17646, 639, 950, 31, 64, "Input"], Cell[18599, 672, 180, 5, 26, "Input"], Cell[18782, 679, 345, 11, 26, "Input"], Cell[19130, 692, 940, 27, 102, "Input"], Cell[20073, 721, 321, 10, 41, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[20431, 736, 52, 0, 34, "Subsection"], Cell[20486, 738, 196, 4, 41, "Text"], Cell[20685, 744, 84, 2, 26, "Input"], Cell[20772, 748, 474, 14, 63, "Input"], Cell[21249, 764, 474, 14, 63, "Input"], Cell[21726, 780, 474, 14, 63, "Input"], Cell[22203, 796, 192, 6, 26, "Input"], Cell[22398, 804, 488, 16, 54, "Input"], Cell[22889, 822, 211, 5, 45, "Input"], Cell[23103, 829, 704, 21, 112, "Input"], Cell[23810, 852, 649, 19, 77, "Input"], Cell[24462, 873, 649, 19, 77, "Input"], Cell[25114, 894, 283, 9, 44, "Input"], Cell[25400, 905, 283, 9, 44, "Input"], Cell[25686, 916, 284, 9, 44, "Input"], Cell[25973, 927, 449, 14, 64, "Input"], Cell[26425, 943, 161, 4, 26, "Input"], Cell[26589, 949, 491, 14, 62, "Input"], Cell[27083, 965, 613, 16, 97, "Input"], Cell[27699, 983, 131, 3, 26, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27867, 991, 35, 0, 34, "Subsection"], Cell[27905, 993, 89, 2, 23, "Text"], Cell[27997, 997, 208, 6, 26, "Input"], Cell[28208, 1005, 396, 11, 62, "Input"], Cell[28607, 1018, 406, 11, 66, "Input"], Cell[29016, 1031, 405, 11, 66, "Input"], Cell[29424, 1044, 308, 9, 45, "Input"], Cell[29735, 1055, 461, 13, 67, "Input"], Cell[30199, 1070, 85, 2, 26, "Input"], Cell[30287, 1074, 760, 21, 79, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[31096, 1101, 26, 0, 54, "Section"], Cell[31125, 1103, 152, 3, 41, "Text"] }, Closed]] }, Open ]] } ] *) (* End of internal cache information *)