Skip to content

Commit

Permalink
build based on 08fffac
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Aug 18, 2024
1 parent dddbb36 commit 2b664af
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-18T09:18:34","documenter_version":"1.5.0"}}
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-18T09:37:51","documenter_version":"1.5.0"}}
2 changes: 1 addition & 1 deletion dev/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@
end
@named sys = ODESystem(eqs, t; continuous_events = cb)</code></pre><h2 id="Segmented-tether-with-aerodynamic-drag"><a class="docs-heading-anchor" href="#Segmented-tether-with-aerodynamic-drag">Segmented tether with aerodynamic drag</a><a id="Segmented-tether-with-aerodynamic-drag-1"></a><a class="docs-heading-anchor-permalink" href="#Segmented-tether-with-aerodynamic-drag" title="Permalink"></a></h2><p>In the script <a href="https://github.com/ufechner7/Tethers.jl/blob/main/src/Tether_07.jl">Tether_07.jl</a>, the tether drag has been added.</p><p>The following lines calculate the tether drag and add half of the drag force to the two particles at the end of each segment:</p><pre><code class="language-julia hljs"> v_app_perp[:, i] ~ v_apparent[:, i] - (v_apparent[:, i] ⋅ unit_vector[:, i]) .* unit_vector[:, i],
norm_v_app[i] ~ norm(v_app_perp[:, i]),
half_drag_force[:, i] .~ 0.25 * se.rho * se.cd_tether * norm_v_app[i] * (norm1[i]*se.d_tether/1000.0)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../theory/">« Theory</a><a class="docs-footer-nextpage" href="../vscode/">VSCode IDE »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Sunday 18 August 2024 09:18">Sunday 18 August 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
half_drag_force[:, i] .~ 0.25 * se.rho * se.cd_tether * norm_v_app[i] * (norm1[i]*se.d_tether/1000.0)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../theory/">« Theory</a><a class="docs-footer-nextpage" href="../vscode/">VSCode IDE »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Sunday 18 August 2024 09:37">Sunday 18 August 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
git clone https://github.com/ufechner7/Tethers.jl</code></pre><p>Build the system image:</p><pre><code class="language-bash hljs">cd repos/Tethers.jl
cd bin
./create_sys_image</code></pre><h2 id="Basic-example"><a class="docs-heading-anchor" href="#Basic-example">Basic example</a><a id="Basic-example-1"></a><a class="docs-heading-anchor-permalink" href="#Basic-example" title="Permalink"></a></h2><p>Use the provided script to start Julia from the <code>Tethers.jl</code> folder:</p><pre><code class="language-bash hljs">cd repos/Tethers.jl
./bin/run_julia</code></pre><p>From the Julia prompt, run the simulation:</p><pre><code class="language-julia hljs">include(&quot;src/Tether_01.jl&quot;)</code></pre><p>You should see a plot similar to:</p><p><img src="docs/images/FallingMass.png" alt="Falling mass"/></p><p>This example shows a mass that is thrown upwards, slows down and then falls.</p><p><strong>HINT</strong> You get a menu from which you can run any of the examples by typing</p><pre><code class="language-julia hljs">menu()</code></pre><p>at the Julia prompt.</p><p><strong>Julia code:</strong> <a href="https://github.com/ufechner7/Tethers.jl/blob/main/src/Tether_01.jl">Tether_01.jl</a></p><h2 id="Python-version-as-comparison"><a class="docs-heading-anchor" href="#Python-version-as-comparison">Python version as comparison</a><a id="Python-version-as-comparison-1"></a><a class="docs-heading-anchor-permalink" href="#Python-version-as-comparison" title="Permalink"></a></h2><p>From the Julia prompt execute:</p><pre><code class="nohighlight hljs">include(&quot;src/RunTether.jl&quot;)</code></pre><p>This will install Python, Matplotlib and Assimulo and execute the script <code>Tether_01.py</code>.</p><p><strong>Python code:</strong> <a href="https://github.com/ufechner7/Tethers.jl/blob/main/src/Tether_01.py">Tether_01.py</a></p><p>If you compare the Python and the Julia scripts you can see that:</p><ul><li>the Julia script is shorter and easier to read</li><li>Julia is about 16 times faster when running the simulation</li></ul><p>Have a look at the <a href="https://ufechner7.github.io/Tethers.jl/dev/examples/">Examples</a> that teach you how to construct a full tether model step by step.</p><h2 id="Overall-comparison"><a class="docs-heading-anchor" href="#Overall-comparison">Overall comparison</a><a id="Overall-comparison-1"></a><a class="docs-heading-anchor-permalink" href="#Overall-comparison" title="Permalink"></a></h2><p>Execution time for a simulation of 10s duration with logging the state every 20ms. Relative and absolute tolerance: <span>$1.0^{-6}$</span>. CPU: Ryzen 9 7950X.</p><table><tr><th style="text-align: left">Test-case</th><th style="text-align: center">Lines of code (LOC) Julia</th><th style="text-align: center">LOC Python</th><th style="text-align: center">Time Julia [ms]</th><th style="text-align: center">Time Python [ms]</th></tr><tr><td style="text-align: left">Falling mass (1)</td><td style="text-align: center">35</td><td style="text-align: center">56</td><td style="text-align: center">0.17</td><td style="text-align: center">2.6</td></tr><tr><td style="text-align: left">Non-linear Spring damper (3)</td><td style="text-align: center">49</td><td style="text-align: center">83</td><td style="text-align: center">0.64</td><td style="text-align: center">20</td></tr><tr><td style="text-align: left">dito with callbacks (3b, 3c)</td><td style="text-align: center">57</td><td style="text-align: center">103</td><td style="text-align: center">0.8</td><td style="text-align: center">31</td></tr><tr><td style="text-align: left">swinging tether, 5 segments</td><td style="text-align: center">109</td><td style="text-align: center">150</td><td style="text-align: center">2.9</td><td style="text-align: center">47</td></tr><tr><td style="text-align: left">Dyneema tether, reeling out</td><td style="text-align: center">125</td><td style="text-align: center">160</td><td style="text-align: center">4.3</td><td style="text-align: center">9300</td></tr><tr><td style="text-align: left">dito with callbacks</td><td style="text-align: center">156</td><td style="text-align: center"></td><td style="text-align: center">4.3</td><td style="text-align: center"></td></tr><tr><td style="text-align: left">Dyneema, reeling out with drag</td><td style="text-align: center">169</td><td style="text-align: center"></td><td style="text-align: center">3.3</td><td style="text-align: center"></td></tr></table><p><strong>Tradeoff Julia vs Python:</strong> In Julia, the code is compiled before it is executed, which can cause about one to 10 seconds delay when running a simulation the first time, but speeds up the execution a lot afterward. In addition, Julia can run fully multithreaded, Python cannot make use of multiple CPU cores with multithreading because of the global interpreter lock. </p><p>Furthermore, the IDA solver is hardly capable of handling a simulation with the very stiff Dyneema tether. It achieves only 0.044% of the performance of the Julia solvers.</p><p>See also: <a href="https://ufechner7.github.io/2022/08/13/why-julia.html">Why Julia?</a> and read the <a href="https://ufechner7.github.io/Tethers.jl/dev/">documentation</a>.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="theory/">Theory »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Sunday 18 August 2024 09:18">Sunday 18 August 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
./bin/run_julia</code></pre><p>From the Julia prompt, run the simulation:</p><pre><code class="language-julia hljs">include(&quot;src/Tether_01.jl&quot;)</code></pre><p>You should see a plot similar to:</p><p><img src="docs/images/FallingMass.png" alt="Falling mass"/></p><p>This example shows a mass that is thrown upwards, slows down and then falls.</p><p><strong>HINT</strong> You get a menu from which you can run any of the examples by typing</p><pre><code class="language-julia hljs">menu()</code></pre><p>at the Julia prompt.</p><p><strong>Julia code:</strong> <a href="https://github.com/ufechner7/Tethers.jl/blob/main/src/Tether_01.jl">Tether_01.jl</a></p><h2 id="Python-version-as-comparison"><a class="docs-heading-anchor" href="#Python-version-as-comparison">Python version as comparison</a><a id="Python-version-as-comparison-1"></a><a class="docs-heading-anchor-permalink" href="#Python-version-as-comparison" title="Permalink"></a></h2><p>From the Julia prompt execute:</p><pre><code class="nohighlight hljs">include(&quot;src/RunTether.jl&quot;)</code></pre><p>This will install Python, Matplotlib and Assimulo and execute the script <code>Tether_01.py</code>.</p><p><strong>Python code:</strong> <a href="https://github.com/ufechner7/Tethers.jl/blob/main/src/Tether_01.py">Tether_01.py</a></p><p>If you compare the Python and the Julia scripts you can see that:</p><ul><li>the Julia script is shorter and easier to read</li><li>Julia is about 16 times faster when running the simulation</li></ul><p>Have a look at the <a href="https://ufechner7.github.io/Tethers.jl/dev/examples/">Examples</a> that teach you how to construct a full tether model step by step.</p><h2 id="Overall-comparison"><a class="docs-heading-anchor" href="#Overall-comparison">Overall comparison</a><a id="Overall-comparison-1"></a><a class="docs-heading-anchor-permalink" href="#Overall-comparison" title="Permalink"></a></h2><p>Execution time for a simulation of 10s duration with logging the state every 20ms. Relative and absolute tolerance: <span>$1.0^{-6}$</span>. CPU: Ryzen 9 7950X.</p><table><tr><th style="text-align: left">Test-case</th><th style="text-align: center">Lines of code (LOC) Julia</th><th style="text-align: center">LOC Python</th><th style="text-align: center">Time Julia [ms]</th><th style="text-align: center">Time Python [ms]</th></tr><tr><td style="text-align: left">Falling mass (1)</td><td style="text-align: center">35</td><td style="text-align: center">56</td><td style="text-align: center">0.17</td><td style="text-align: center">2.6</td></tr><tr><td style="text-align: left">Non-linear Spring damper (3)</td><td style="text-align: center">49</td><td style="text-align: center">83</td><td style="text-align: center">0.64</td><td style="text-align: center">20</td></tr><tr><td style="text-align: left">dito with callbacks (3b, 3c)</td><td style="text-align: center">57</td><td style="text-align: center">103</td><td style="text-align: center">0.8</td><td style="text-align: center">31</td></tr><tr><td style="text-align: left">swinging tether, 5 segments</td><td style="text-align: center">109</td><td style="text-align: center">150</td><td style="text-align: center">2.9</td><td style="text-align: center">47</td></tr><tr><td style="text-align: left">Dyneema tether, reeling out</td><td style="text-align: center">125</td><td style="text-align: center">160</td><td style="text-align: center">4.3</td><td style="text-align: center">9300</td></tr><tr><td style="text-align: left">dito with callbacks</td><td style="text-align: center">156</td><td style="text-align: center"></td><td style="text-align: center">4.3</td><td style="text-align: center"></td></tr><tr><td style="text-align: left">Dyneema, reeling out with drag</td><td style="text-align: center">169</td><td style="text-align: center"></td><td style="text-align: center">3.3</td><td style="text-align: center"></td></tr></table><p><strong>Tradeoff Julia vs Python:</strong> In Julia, the code is compiled before it is executed, which can cause about one to 10 seconds delay when running a simulation the first time, but speeds up the execution a lot afterward. In addition, Julia can run fully multithreaded, Python cannot make use of multiple CPU cores with multithreading because of the global interpreter lock. </p><p>Furthermore, the IDA solver is hardly capable of handling a simulation with the very stiff Dyneema tether. It achieves only 0.044% of the performance of the Julia solvers.</p><p>See also: <a href="https://ufechner7.github.io/2022/08/13/why-julia.html">Why Julia?</a> and read the <a href="https://ufechner7.github.io/Tethers.jl/dev/">documentation</a>.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="theory/">Theory »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Sunday 18 August 2024 09:37">Sunday 18 August 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 2b664af

Please sign in to comment.