Skip to content

Commit

Permalink
more eigenvalue content
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleniemeyer committed Feb 27, 2020
1 parent 4260fc3 commit ba3c620
Show file tree
Hide file tree
Showing 12 changed files with 804 additions and 65 deletions.
457 changes: 447 additions & 10 deletions _build/bvps/eigenvalue.html

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions _build/bvps/finite-difference.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
next_page:
url: /bvps/eigenvalue.html
suffix: .ipynb
search: x y delta f t prime equation frac begin end right align boundary left b derivative dx infty m difference xi fin solve equations yi l finite c conditions where solution n heat transfer lets our ac point system condition nonlinear text k p ti differences mathcal o example ode points linear matlab h exact using order second consider gives domain through formula term q dt theta well rightarrow approx into above recursion get bmatrix hand guess temperature d value also accurate five set mathbf implement fixed octave because e control volume method approximations derivatives function approximate forward backward taylor
search: x y delta f prime equation t frac begin end align right boundary left b derivative dx difference xi fin solve equations yi l infty finite c conditions where solution n heat transfer m lets our ac point system condition text k p differences mathcal o example ode points linear matlab nonlinear h exact using order second consider gives domain through formula term q dt theta well rightarrow approx into above recursion get bmatrix guess temperature d value also accurate five set mathbf implement hand fixed octave because e control volume method approximations derivatives function approximate forward backward taylor series

comment: "***PROGRAMMATICALLY GENERATED, DO NOT EDIT. SEE ORIGINAL FILES IN /content***"
---
Expand Down Expand Up @@ -699,12 +699,7 @@ <h3 id="Heat-transfer-with-radiation">Heat transfer with radiation<a class="anch
\begin{equation}
\frac{d^2 T}{dx^2} - \frac{h P}{k A_c} \left(T - T_{\infty}\right) - \frac{\sigma \epsilon P}{h A_c} \left(T^4 - T_{\infty}^4 \right) = 0
\end{equation}</p>
<p>This is a bit trickier to solve because of the nonlinear term involving $T^4$. But, we can handle it via the iterative solution method discussed above, moving the nonlinear parts to the right-hand side:
\begin{align}
\frac{T_{i-1} - 2T_i + T_{i+1}}{\Delta x^2} - m^2 \left( T_i - T_{\infty} \right) - M^2 \left( T_i^4 - T_{\infty}^4 \right) &amp;= 0 \\
\frac{T_{i-1} - 2T_i + T_{i+1}}{\Delta x^2} - m^2 T_i &amp;= M^2 \left( T_i^4 - T_{\infty}^4 \right) - m^2 T_{\infty} \\
T_{i-1} + T_i (-2 - \Delta x^2 m^2
\end{align}</p>
<p>This is a bit trickier to solve because of the nonlinear term involving $T^4$. But, we can handle it via the iterative solution method discussed above.</p>

</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions _build/bvps/masses.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function dxdt = masses(t, x)
% this is a function file to calculate the derivatives associated with the system

m1 = 40;
m2 = 40;
Expand Down
22 changes: 11 additions & 11 deletions _build/bvps/shooting-method.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ <h2 id="Example:-linear-ODE">Example: linear ODE<a class="anchor-link" href="#Ex

<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">clear</span> <span class="n">all</span><span class="p">;</span> <span class="n">clc</span>
<div class=" highlight hl-matlab"><pre><span></span><span class="n">clear </span><span class="s">all</span><span class="p">;</span><span class="n"> clc</span>

<span class="c">% target boundary condition</span>
<span class="s">% target boundary condition</span><span class="p"></span>
<span class="n">target</span> <span class="p">=</span> <span class="mi">8</span><span class="p">;</span>

<span class="c">% Pick a guess for y&#39;(0) of 1</span>
Expand Down Expand Up @@ -234,7 +234,7 @@ <h2 id="Example:-nonlinear-ODE">Example: nonlinear ODE<a class="anchor-link" hre
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="c">%%python</span>
<span class="n">import</span> <span class="n">sympy</span> <span class="n">as</span> <span class="n">sym</span>
<span class="n">import </span><span class="s">sympy as sym</span><span class="p"></span>
<span class="n">sym</span><span class="p">.</span><span class="n">init_printing</span><span class="p">()</span>
<span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">u</span><span class="p">,</span> <span class="n">v</span> <span class="p">=</span> <span class="n">sym</span><span class="p">.</span><span class="n">symbols</span><span class="p">(</span><span class="s">&#39;x y u v&#39;</span><span class="p">)</span>

Expand Down Expand Up @@ -364,9 +364,9 @@ <h2 id="Example:-nonlinear-ODE">Example: nonlinear ODE<a class="anchor-link" hre

<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">clear</span> <span class="n">all</span><span class="p">;</span> <span class="n">clc</span>
<div class=" highlight hl-matlab"><pre><span></span><span class="n">clear </span><span class="s">all</span><span class="p">;</span><span class="n"> clc</span>

<span class="n">target</span> <span class="p">=</span> <span class="mf">1.0</span><span class="p">;</span>
<span class="s">target = 1.0</span><span class="p">;</span>

<span class="n">guesses</span> <span class="p">=</span> <span class="nb">zeros</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
<span class="n">solutions</span> <span class="p">=</span> <span class="nb">zeros</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
Expand Down Expand Up @@ -443,9 +443,9 @@ <h2 id="Example:-nonlinear-ODE">Example: nonlinear ODE<a class="anchor-link" hre

<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="n">clear</span> <span class="n">all</span><span class="p">;</span> <span class="n">clc</span>
<div class=" highlight hl-matlab"><pre><span></span><span class="n">clear </span><span class="s">all</span><span class="p">;</span><span class="n"> clc</span>

<span class="n">target</span> <span class="p">=</span> <span class="mf">1.0</span><span class="p">;</span>
<span class="s">target = 1.0</span><span class="p">;</span>

<span class="c">% get these arrays of stored values started.</span>
<span class="c">% note: I&#39;m only doing this to make it easier to show a table of values</span>
Expand Down Expand Up @@ -474,9 +474,9 @@ <h2 id="Example:-nonlinear-ODE">Example: nonlinear ODE<a class="anchor-link" hre

<span class="c">% we should probably set a maximum number of iterations, just to prevent</span>
<span class="c">% an infinite while loop in case something goes wrong</span>
<span class="k">if</span> <span class="n">num</span> <span class="o">&gt;</span><span class="p">=</span> <span class="mf">1e4</span>
<span class="k">break</span>
<span class="k">end</span>
<span class="n"> if </span><span class="s">num &gt;= 1e4</span><span class="p"></span>
<span class="n"> break</span>
<span class="n"> </span><span class="s">end</span><span class="p"></span>
<span class="k">end</span>

<span class="n">table</span><span class="p">(</span><span class="n">tries</span><span class="p">,</span> <span class="n">guesses</span><span class="p">,</span> <span class="n">solutions</span><span class="p">)</span>
Expand Down Expand Up @@ -529,7 +529,7 @@ <h2 id="Example:-nonlinear-ODE">Example: nonlinear ODE<a class="anchor-link" hre
<div class="input_area">
<div class=" highlight hl-matlab"><pre><span></span><span class="c">%plot -r 200</span>
<span class="n">plot</span><span class="p">(</span><span class="n">F</span><span class="p">(:,</span> <span class="mi">2</span><span class="p">),</span> <span class="n">eta</span><span class="p">);</span> <span class="n">ylim</span><span class="p">([</span><span class="mi">0</span> <span class="mi">5</span><span class="p">])</span>
<span class="n">xlabel</span><span class="p">(</span>&quot;<span class="n">f</span>^<span class="p">{</span><span class="o">\</span><span class="n">prime</span><span class="p">}(</span><span class="o">\</span><span class="n">eta</span><span class="p">)</span> <span class="p">=</span> <span class="n">u</span><span class="o">/</span><span class="n">U_</span><span class="p">{</span><span class="o">\</span><span class="n">infty</span><span class="p">}</span>&quot;<span class="p">)</span>
<span class="n">xlabel</span><span class="p">(</span><span class="s">&quot;f^{\prime}(\eta) = u/U_{\infty}&quot;</span><span class="p">)</span>
<span class="n">ylabel</span><span class="p">(</span><span class="s">&#39;\eta&#39;</span><span class="p">)</span>
</pre></div>

Expand Down
Binary file modified _build/images/bvps/eigenvalue_14_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _build/images/bvps/eigenvalue_16_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _build/images/bvps/shooting-method_13_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _build/images/bvps/shooting-method_3_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
342 changes: 333 additions & 9 deletions content/bvps/eigenvalue.ipynb

Large diffs are not rendered by default.

14 changes: 1 addition & 13 deletions content/bvps/finite-difference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -631,20 +631,8 @@
"\\frac{d^2 T}{dx^2} - \\frac{h P}{k A_c} \\left(T - T_{\\infty}\\right) - \\frac{\\sigma \\epsilon P}{h A_c} \\left(T^4 - T_{\\infty}^4 \\right) = 0\n",
"\\end{equation}\n",
"\n",
"This is a bit trickier to solve because of the nonlinear term involving $T^4$. But, we can handle it via the iterative solution method discussed above, moving the nonlinear parts to the right-hand side:\n",
"\\begin{align}\n",
"\\frac{T_{i-1} - 2T_i + T_{i+1}}{\\Delta x^2} - m^2 \\left( T_i - T_{\\infty} \\right) - M^2 \\left( T_i^4 - T_{\\infty}^4 \\right) &= 0 \\\\\n",
"\\frac{T_{i-1} - 2T_i + T_{i+1}}{\\Delta x^2} - m^2 T_i &= M^2 \\left( T_i^4 - T_{\\infty}^4 \\right) - m^2 T_{\\infty} \\\\\n",
"T_{i-1} + T_i (-2 - \\Delta x^2 m^2\n",
"\\end{align}"
"This is a bit trickier to solve because of the nonlinear term involving $T^4$. But, we can handle it via the iterative solution method discussed above."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
1 change: 1 addition & 0 deletions content/bvps/masses.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function dxdt = masses(t, x)
% this is a function file to calculate the derivatives associated with the system

m1 = 40;
m2 = 40;
Expand Down
Loading

0 comments on commit ba3c620

Please sign in to comment.