Skip to content

Commit

Permalink
more work on elliptic PDE module
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleniemeyer committed Mar 6, 2020
1 parent 7b391ea commit c73e5f7
Show file tree
Hide file tree
Showing 16 changed files with 1,312 additions and 257 deletions.
58 changes: 29 additions & 29 deletions _build/bvps/eigenvalue.html

Large diffs are not rendered by default.

142 changes: 71 additions & 71 deletions _build/bvps/finite-difference.html

Large diffs are not rendered by default.

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="s">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="n">all</span><span class="p">;</span> <span class="n">clc</span>

<span class="s">% target boundary condition</span><span class="p"></span>
<span class="c">% target boundary condition</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="s">sympy as sym</span><span class="p"></span>
<span class="n">import</span> <span class="n">sympy</span> <span class="n">as</span> <span class="n">sym</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="s">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="n">all</span><span class="p">;</span> <span class="n">clc</span>

<span class="s">target = 1.0</span><span class="p">;</span>
<span class="n">target</span> <span class="p">=</span> <span class="mf">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="s">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="n">all</span><span class="p">;</span> <span class="n">clc</span>

<span class="s">target = 1.0</span><span class="p">;</span>
<span class="n">target</span> <span class="p">=</span> <span class="mf">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="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">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="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><span class="s">&quot;f^{\prime}(\eta) = u/U_{\infty}&quot;</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">ylabel</span><span class="p">(</span><span class="s">&#39;\eta&#39;</span><span class="p">)</span>
</pre></div>

Expand Down
Binary file added _build/images/pdes/elliptic_17_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/pdes/elliptic_21_1.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/pdes/elliptic_24_1.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/pdes/elliptic_25_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c73e5f7

Please sign in to comment.