Skip to content

Commit

Permalink
build based on 5b6beac
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 16, 2023
1 parent 8d8de3f commit 033e0ff
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 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.9.4","generation_timestamp":"2023-12-15T22:46:34","documenter_version":"1.2.1"}}
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-16T11:40:36","documenter_version":"1.2.1"}}
2 changes: 1 addition & 1 deletion dev/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
else
eqs2 = vcat(eqs2, total_force[:, i] ~ spring_force[:, i]- spring_force[:, i+1])
eqs2 = vcat(eqs2, acc[:, i+1] .~ G_EARTH + total_force[:, i] / m_tether_particle)
end</code></pre><p><strong>Julia code:</strong> <a href="https://github.com/ufechner7/Tethers.jl/blob/main/src/Tether_06.jl">Tether_06.jl</a></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Readme</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 15 December 2023 22:46">Friday 15 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><p><strong>Julia code:</strong> <a href="https://github.com/ufechner7/Tethers.jl/blob/main/src/Tether_06.jl">Tether_06.jl</a></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Readme</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Saturday 16 December 2023 11:40">Saturday 16 December 2023</span>. Using Julia version 1.9.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 @@ -16,4 +16,4 @@
ts = 0:dt:duration</code></pre><p>The time step <span>$dt$</span> is the interval in which the solution shall be stored, NOT the time step of the integrator. The integrator uses a variable time step which can be much smaller or much larger as determined by the required tolerance, in this example set to <span>$tol=10^{-6}$</span>. The variable <span>$ts$</span> is a range object defining the sampling times for the result.</p><p>Then we define the initial condition <span>$u0$</span>. We use a dictionary of variable =&gt; value pairs to do this. In the next line, we define the ODE problem and finally, we solve it using the Rodas5 solver with the given parameters.</p><pre><code class="language-julia hljs">u0 = Dict(vel=&gt;[0, 0, 50.0])

prob = ODEProblem(simple_sys, u0, tspan)
@time sol = solve(prob, Rodas5(), dt=dt, abstol=tol, reltol=tol, saveat=ts)</code></pre><p>The macro <code>@time</code> measures the compilation and execution time of calling the function <code>solve()</code>. It is compiled only when called the first time. </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</td><td style="text-align: center">42</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</td><td style="text-align: center">61</td><td style="text-align: center">83</td><td style="text-align: center">0.61</td><td style="text-align: center">20</td></tr><tr><td style="text-align: left">dito with callbacks</td><td style="text-align: center">68</td><td style="text-align: center">103</td><td style="text-align: center">0.74</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">122</td><td style="text-align: center">150</td><td style="text-align: center">3.50</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">136</td><td style="text-align: center"></td><td style="text-align: center">20</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>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="examples/">Examples »</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 15 December 2023 22:46">Friday 15 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
@time sol = solve(prob, Rodas5(), dt=dt, abstol=tol, reltol=tol, saveat=ts)</code></pre><p>The macro <code>@time</code> measures the compilation and execution time of calling the function <code>solve()</code>. It is compiled only when called the first time. </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</td><td style="text-align: center">42</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</td><td style="text-align: center">61</td><td style="text-align: center">83</td><td style="text-align: center">0.61</td><td style="text-align: center">20</td></tr><tr><td style="text-align: left">dito with callbacks</td><td style="text-align: center">68</td><td style="text-align: center">103</td><td style="text-align: center">0.74</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">122</td><td style="text-align: center">150</td><td style="text-align: center">3.50</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">136</td><td style="text-align: center"></td><td style="text-align: center">20</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>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="examples/">Examples »</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Saturday 16 December 2023 11:40">Saturday 16 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/python/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
help # will show you all available commands; try for example
conda add ipython # this will add ipython</code></pre><p>Press \&lt;DEL\&gt; to leave the package manager mode. In the Julia REPL, type:</p><pre><code class="nohighlight hljs">CondaPkg.withenv() do
run(`ipython`)
end</code></pre><p>You should now get an interactive Python prompt and can program in Python.</p><h2 id="Further-reading"><a class="docs-heading-anchor" href="#Further-reading">Further reading</a><a id="Further-reading-1"></a><a class="docs-heading-anchor-permalink" href="#Further-reading" title="Permalink"></a></h2><ul><li><a href="https://docs.julialang.org/en/v1/manual/noteworthy-differences/#Noteworthy-differences-from-Python">Noteworthy differences Julia/Python</a> Good to know.</li><li><a href="https://juliapy.github.io/PythonCall.jl/stable/">PythonCall.jl</a> New library to call Python from Julia or Julia from Python.</li><li><a href="https://github.com/JuliaPy/PyCall.jl">PyCall</a> Old library to call Python from Julia.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../vscode/">« VSCode IDE</a><a class="docs-footer-nextpage" href="../references/">References »</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Friday 15 December 2023 22:46">Friday 15 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><p>You should now get an interactive Python prompt and can program in Python.</p><h2 id="Further-reading"><a class="docs-heading-anchor" href="#Further-reading">Further reading</a><a id="Further-reading-1"></a><a class="docs-heading-anchor-permalink" href="#Further-reading" title="Permalink"></a></h2><ul><li><a href="https://docs.julialang.org/en/v1/manual/noteworthy-differences/#Noteworthy-differences-from-Python">Noteworthy differences Julia/Python</a> Good to know.</li><li><a href="https://juliapy.github.io/PythonCall.jl/stable/">PythonCall.jl</a> New library to call Python from Julia or Julia from Python.</li><li><a href="https://github.com/JuliaPy/PyCall.jl">PyCall</a> Old library to call Python from Julia.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../vscode/">« VSCode IDE</a><a class="docs-footer-nextpage" href="../references/">References »</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Saturday 16 December 2023 11:40">Saturday 16 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 033e0ff

Please sign in to comment.