Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Oct 3, 2024
1 parent 34428f1 commit b27d7cf
Show file tree
Hide file tree
Showing 43 changed files with 778 additions and 775 deletions.
7 changes: 4 additions & 3 deletions _modules/dymos/phase/phase.html
Original file line number Diff line number Diff line change
Expand Up @@ -3662,9 +3662,10 @@ <h1>Source code for dymos.phase.phase</h1><div class="highlight"><pre>
<span class="n">duplicate_idxs</span> <span class="o">=</span> <span class="n">all_flat_idxs</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">flat_idxs</span><span class="p">)</span>
<span class="k">if</span> <span class="n">duplicate_idxs</span><span class="p">:</span>
<span class="n">s</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;initial&#39;</span><span class="p">:</span> <span class="s1">&#39;initial boundary&#39;</span><span class="p">,</span> <span class="s1">&#39;final&#39;</span><span class="p">:</span> <span class="s1">&#39;final boundary&#39;</span><span class="p">,</span> <span class="s1">&#39;path&#39;</span><span class="p">:</span> <span class="s1">&#39;path&#39;</span><span class="p">}</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Duplicate constraint in phase </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">pathname</span><span class="si">}</span><span class="s1">. &#39;</span>
<span class="sa">f</span><span class="s1">&#39;The following indices of `</span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s1">` are used in &#39;</span>
<span class="sa">f</span><span class="s1">&#39;multiple </span><span class="si">{</span><span class="n">s</span><span class="p">[</span><span class="n">loc</span><span class="p">]</span><span class="si">}</span><span class="s1"> constraints:</span><span class="se">\n</span><span class="si">{</span><span class="n">duplicate_idxs</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">with</span> <span class="n">np</span><span class="o">.</span><span class="n">printoptions</span><span class="p">(</span><span class="n">legacy</span><span class="o">=</span><span class="s1">&#39;1.13&#39;</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Duplicate constraint in phase </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">pathname</span><span class="si">}</span><span class="s1">. &#39;</span>
<span class="sa">f</span><span class="s1">&#39;The following indices of `</span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s1">` are used in &#39;</span>
<span class="sa">f</span><span class="s1">&#39;multiple </span><span class="si">{</span><span class="n">s</span><span class="p">[</span><span class="n">loc</span><span class="p">]</span><span class="si">}</span><span class="s1"> constraints:</span><span class="se">\n</span><span class="si">{</span><span class="n">duplicate_idxs</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>

<span class="n">all_flat_idxs</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">flat_idxs</span><span class="p">)</span>

Expand Down
16 changes: 8 additions & 8 deletions contributing/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -1055,21 +1055,21 @@ <h2>Notebook Creation<a class="headerlink" href="#notebook-creation" title="Perm
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| of &#39;&lt;variable&gt;&#39; | wrt &#39;&lt;variable&gt;&#39; | calc mag. | check mag. | a(cal-chk) | r(cal-chk) | error desc |
+=================+==================+=============+=============+=============+=============+============+
| &#39;check&#39; | &#39;theta&#39; | 6.1838e+01 | 6.1838e+01 | 1.4356e-14 | 2.3215e-16 | |
| &#39;check&#39; | &#39;theta&#39; | 4.1690e+02 | 4.1690e+02 | 1.1370e-13 | 2.7274e-16 | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| &#39;check&#39; | &#39;v&#39; | 3.6416e+00 | 3.6416e+00 | 2.2204e-16 | 6.0975e-17 | |
| &#39;check&#39; | &#39;v&#39; | 1.5528e+01 | 1.5528e+01 | 1.9860e-15 | 1.2790e-16 | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| &#39;vdot&#39; | &#39;theta&#39; | 1.6000e+01 | 1.6000e+01 | 9.9301e-16 | 6.2063e-17 | |
| &#39;vdot&#39; | &#39;theta&#39; | 1.4011e+01 | 1.4011e+01 | 9.9301e-16 | 7.0873e-17 | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| &#39;vdot&#39; | &#39;v&#39; | 0.0000e+00 | 0.0000e+00 | 0.0000e+00 | nan | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| &#39;xdot&#39; | &#39;theta&#39; | 1.1834e+01 | 1.1834e+01 | 9.1551e-16 | 7.7366e-17 | |
| &#39;xdot&#39; | &#39;theta&#39; | 7.0488e+00 | 7.0488e+00 | 2.2888e-16 | 3.2471e-17 | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| &#39;xdot&#39; | &#39;v&#39; | 1.6316e+00 | 1.6316e+00 | 0.0000e+00 | 0.0000e+00 | |
| &#39;xdot&#39; | &#39;v&#39; | 1.4287e+00 | 1.4287e+00 | 1.5701e-16 | 1.0989e-16 | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| &#39;ydot&#39; | &#39;theta&#39; | 1.0850e+01 | 1.0850e+01 | 4.4409e-16 | 4.0929e-17 | |
| &#39;ydot&#39; | &#39;theta&#39; | 8.0089e+00 | 8.0089e+00 | 8.8829e-16 | 1.1091e-16 | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+
| &#39;ydot&#39; | &#39;v&#39; | 1.5290e+00 | 1.5290e+00 | 1.1102e-16 | 7.2609e-17 | |
| &#39;ydot&#39; | &#39;v&#39; | 1.7201e+00 | 1.7201e+00 | 1.1189e-16 | 6.5047e-17 | |
+-----------------+------------------+-------------+-------------+-------------+-------------+------------+

##################################################################
Expand All @@ -1078,7 +1078,7 @@ <h2>Notebook Creation<a class="headerlink" href="#notebook-creation" title="Perm
+-----------------+------------------+-------------+-------------+-------------+-------------+
| of &#39;&lt;variable&gt;&#39; | wrt &#39;&lt;variable&gt;&#39; | calc mag. | check mag. | a(cal-chk) | r(cal-chk) |
+=================+==================+=============+=============+=============+=============+
| &#39;check&#39; | &#39;theta&#39; | 6.1838e+01 | 6.1838e+01 | 1.4356e-14 | 2.3215e-16 |
| &#39;check&#39; | &#39;theta&#39; | 4.1690e+02 | 4.1690e+02 | 1.1370e-13 | 2.7274e-16 |
+-----------------+------------------+-------------+-------------+-------------+-------------+
</pre></div>
</div>
Expand Down
67 changes: 34 additions & 33 deletions examples/balanced_field/balanced_field.html
Original file line number Diff line number Diff line change
Expand Up @@ -941,13 +941,13 @@ <h2>The ODE System<a class="headerlink" href="#the-ode-system" title="Permalink
<h3>The Aerodynamic Model<a class="headerlink" href="#the-aerodynamic-model" title="Permalink to this heading">#</a></h3>
<p>Both sets of equations of motion have common aerodynamic models.</p>
<p>First, the lift coefficient is computed using a model which assumes linearity in lift wrt the angle of attack.</p>
<div class="amsmath math notranslate nohighlight" id="equation-e6cd12b9-8d0e-4bc2-b92a-ea9c65fcb27b">
<span class="eqno">(21)<a class="headerlink" href="#equation-e6cd12b9-8d0e-4bc2-b92a-ea9c65fcb27b" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-c9be2ce0-fbc5-4153-bca9-eed94ef5f33d">
<span class="eqno">(21)<a class="headerlink" href="#equation-c9be2ce0-fbc5-4153-bca9-eed94ef5f33d" title="Permalink to this equation">#</a></span>\[\begin{align}
C_L &amp;= C_{L0} + \frac{\alpha}{\alpha_{max}} \left(C_{L-max} - C_{L0}\right)
\end{align}\]</div>
<p>Next, the drag-due-to-lift factor is computed (Equations 12.48 and 12.61 in Raymer[&#64;raymer2012aircraft]).</p>
<div class="amsmath math notranslate nohighlight" id="equation-1be75e03-6b2b-40c8-8601-b8a9b8ca74b4">
<span class="eqno">(22)<a class="headerlink" href="#equation-1be75e03-6b2b-40c8-8601-b8a9b8ca74b4" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-c286ac95-f552-448c-87ff-fc8643681f13">
<span class="eqno">(22)<a class="headerlink" href="#equation-c286ac95-f552-448c-87ff-fc8643681f13" title="Permalink to this equation">#</a></span>\[\begin{align}
K_{nom} &amp;= \frac{1}{ \pi AR e} \\
b &amp;= \frac{span}{2} \\
K &amp;= 33 K_{nom} \frac{ \left(\frac{h + h_w}{b} \right) ^{\frac{3}{2}}}{1.0 + 33 \left( \frac{h + h_w}{b}\right) ^{\frac{3}{2}}}
Expand All @@ -956,8 +956,8 @@ <h3>The Aerodynamic Model<a class="headerlink" href="#the-aerodynamic-model" tit
This causes this problem to be difficult to solve using a shooting method.
If the optimizer proposes a combination of initial states and a control history that results in altitude dropping significantly below zero, the propagation will fail.</p>
<p>Finally, the lift and drag are computed after computing the dynamic pressure.</p>
<div class="amsmath math notranslate nohighlight" id="equation-793fc9c2-35a1-47c8-8295-71d402f75cd3">
<span class="eqno">(23)<a class="headerlink" href="#equation-793fc9c2-35a1-47c8-8295-71d402f75cd3" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-303fa138-367d-407d-b24d-47c338cd1714">
<span class="eqno">(23)<a class="headerlink" href="#equation-303fa138-367d-407d-b24d-47c338cd1714" title="Permalink to this equation">#</a></span>\[\begin{align}
q &amp;= 0.5 \rho v^2 \\
L &amp;= q S C_L \\
D &amp;= q S \left( C_{D0} + K C_{L}^2 \right)
Expand All @@ -968,17 +968,17 @@ <h3>Stall Speed<a class="headerlink" href="#stall-speed" title="Permalink to thi
<p>This model relies on the ratio of the current true airspeed to stall speed (<span class="math notranslate nohighlight">\(\frac{v}{v_{stall}}\)</span>).
This constraint is used to trigger the beginning of rotation and is used as a boundary constraint at the end of the initial climb.
Stall speed is given by Equation 5.6 in Raymer[&#64;raymer2012aircraft].</p>
<div class="amsmath math notranslate nohighlight" id="equation-5d847da5-f29b-476f-8a3d-0836e066b811">
<span class="eqno">(24)<a class="headerlink" href="#equation-5d847da5-f29b-476f-8a3d-0836e066b811" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-5c9dff03-6150-4eb3-9fe3-b5da065085fd">
<span class="eqno">(24)<a class="headerlink" href="#equation-5c9dff03-6150-4eb3-9fe3-b5da065085fd" title="Permalink to this equation">#</a></span>\[\begin{align}
W &amp;= m g \\
v_{stall} &amp;= \sqrt{\frac{2 * W}{\rho S C_{L-max}}}
\end{align}\]</div>
</section>
<section id="runway-equations-of-motion">
<h3>Runway Equations of Motion<a class="headerlink" href="#runway-equations-of-motion" title="Permalink to this heading">#</a></h3>
<p>The runway equations of motion are used to integrate range and speed as the vehicle rolls along the runway.</p>
<div class="amsmath math notranslate nohighlight" id="equation-815ebb0d-c820-4ca8-b008-a17084ce3b43">
<span class="eqno">(25)<a class="headerlink" href="#equation-815ebb0d-c820-4ca8-b008-a17084ce3b43" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-34279cec-d064-47b1-957b-4de760fe2b01">
<span class="eqno">(25)<a class="headerlink" href="#equation-34279cec-d064-47b1-957b-4de760fe2b01" title="Permalink to this equation">#</a></span>\[\begin{align}
F_r &amp;= mg - L \cos \alpha - T \sin \alpha \\
\dot{v} &amp;= \frac{T \cos \alpha - D - F_r \mu_r}{m} \\
\dot{r} &amp;= v
Expand All @@ -1005,8 +1005,8 @@ <h3>Runway Equations of Motion<a class="headerlink" href="#runway-equations-of-m
<section id="flight-equations-of-motion">
<h3>Flight Equations of Motion<a class="headerlink" href="#flight-equations-of-motion" title="Permalink to this heading">#</a></h3>
<p>The flight equations of motion include two additional state variables: the flight-path angle (<span class="math notranslate nohighlight">\(\gamma\)</span>) and altitude (<span class="math notranslate nohighlight">\(h\)</span>).</p>
<div class="amsmath math notranslate nohighlight" id="equation-c3efcf43-0306-46eb-bc91-990179679755">
<span class="eqno">(26)<a class="headerlink" href="#equation-c3efcf43-0306-46eb-bc91-990179679755" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-06afafcb-abe5-408c-8ec6-784bd621715e">
<span class="eqno">(26)<a class="headerlink" href="#equation-06afafcb-abe5-408c-8ec6-784bd621715e" title="Permalink to this equation">#</a></span>\[\begin{align}
\dot{v} &amp;= \frac{T}{m} \cos \alpha - \frac{D}{m} - g \sin \gamma \\
\dot{\gamma} &amp;= \frac{T}{m v} \sin \alpha + \frac{L}{m v} - \frac{g \cos \gamma}{v} \\
\dot{h} &amp;= v \sin \gamma \\
Expand Down Expand Up @@ -1531,7 +1531,7 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;dymos.phase.phase.Phase at 0x7fe3ee917c10&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;dymos.phase.phase.Phase at 0x7f9340073cd0&gt;
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -1721,15 +1721,16 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Coloring for &#39;traj.phases.br_to_v1.rhs_all&#39; (class BalancedFieldODEComp)

Jacobian shape: (132, 60) (10.13% nonzero)
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Jacobian shape: (132, 60) (10.13% nonzero)
FWD solves: 16 REV solves: 0
Total colors vs. total size: 16 vs 60 (73.33% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity: 0.0158 sec
Time to compute coloring: 0.0108 sec
Memory to compute coloring: 0.3750 MB
Time to compute sparsity: 0.0163 sec
Time to compute coloring: 0.0105 sec
Memory to compute coloring: 0.2500 MB
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Coloring for &#39;traj.phases.rto.rhs_all&#39; (class BalancedFieldODEComp)
Expand All @@ -1739,8 +1740,8 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
Total colors vs. total size: 16 vs 60 (73.33% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity: 0.0166 sec
Time to compute coloring: 0.0099 sec
Time to compute sparsity: 0.0162 sec
Time to compute coloring: 0.0100 sec
Memory to compute coloring: 0.0000 MB

Coloring for &#39;traj.phases.v1_to_vr.rhs_all&#39; (class BalancedFieldODEComp)
Expand All @@ -1750,8 +1751,8 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
Total colors vs. total size: 16 vs 60 (73.33% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity: 0.0155 sec
Time to compute coloring: 0.0097 sec
Time to compute sparsity: 0.0160 sec
Time to compute coloring: 0.0100 sec
Memory to compute coloring: 0.0000 MB

Coloring for &#39;traj.phases.rotate.rhs_all&#39; (class BalancedFieldODEComp)
Expand All @@ -1761,8 +1762,8 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
Total colors vs. total size: 16 vs 60 (73.33% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity: 0.0157 sec
Time to compute coloring: 0.0098 sec
Time to compute sparsity: 0.0161 sec
Time to compute coloring: 0.0100 sec
Memory to compute coloring: 0.0000 MB

Coloring for &#39;traj.phases.climb.rhs_all&#39; (class BalancedFieldODEComp)
Expand All @@ -1772,12 +1773,12 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
Total colors vs. total size: 16 vs 111 (85.59% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity: 0.0329 sec
Time to compute coloring: 0.0185 sec
Time to compute sparsity: 0.0350 sec
Time to compute coloring: 0.0188 sec
Memory to compute coloring: 0.2500 MB
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Full total jacobian for problem &#39;problem&#39; was computed 3 times, taking 0.9941494999999918 seconds.
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Full total jacobian for problem &#39;problem&#39; was computed 3 times, taking 1.0516241050000303 seconds.
Total jacobian shape: (178, 166)


Expand All @@ -1786,10 +1787,10 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
Total colors vs. total size: 14 vs 166 (91.57% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity: 0.9941 sec
Time to compute coloring: 0.0681 sec
Time to compute sparsity: 1.0516 sec
Time to compute coloring: 0.0690 sec
Memory to compute coloring: 0.0000 MB
Coloring created on: 2024-10-02 21:59:50
Coloring created on: 2024-10-03 12:24:32
</pre></div>
</div>
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/usr/share/miniconda/envs/test/lib/python3.11/site-packages/openmdao/core/total_jac.py:1652: DerivativesWarning:Constraints or objectives [(&#39;traj.phases.climb-&gt;path_constraint-&gt;gam&#39;, inds=[(0, 0)])] cannot be impacted by the design variables of the problem.
Expand All @@ -1810,11 +1811,11 @@ <h2>Building and running the problem<a class="headerlink" href="#building-and-ru
Driver: pyOptSparseDriver
success : True
iterations : 25
runtime : 2.9994E+00 s
runtime : 3.1256E+00 s
model_evals : 25
model_time : 6.9279E-02 s
model_time : 7.3203E-02 s
deriv_evals : 24
deriv_time : 1.1516E+00 s
deriv_time : 1.1985E+00 s
exit_status : SUCCESS
</pre></div>
</div>
Expand Down
Loading

0 comments on commit b27d7cf

Please sign in to comment.