Skip to content

Commit

Permalink
build based on 172e956
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 19, 2024
1 parent 497f748 commit bb57d90
Show file tree
Hide file tree
Showing 23 changed files with 671 additions and 671 deletions.
2 changes: 1 addition & 1 deletion previews/PR144/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-19T07:41:17","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-19T15:01:44","documenter_version":"1.7.0"}}
22 changes: 11 additions & 11 deletions previews/PR144/Library/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 0 additions & 48 deletions previews/PR144/generated/StochasticSystem/c3cd3b7b.svg

This file was deleted.

48 changes: 48 additions & 0 deletions previews/PR144/generated/StochasticSystem/db4f9e02.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions previews/PR144/generated/StochasticSystem/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
ode_prob = ODEProblem(nd, uflat(u0), (0.0, 500.0), pflat(p))
ode_sol = solve(ode_prob, Tsit5())

plot(ode_sol; idxs=vidxs(nd,:,:ω), ylims=(-1.0, 1.0), ylabel=L&quot;\omega&quot;, legend=false, fmt=:png)</code></pre><img src="0665ba92.svg" alt="Example block output"/><p>We see that this is in fact a fixpoint solution. We will later use this as an initial condition for the numerical integration of the SDE system.</p><h2 id="Adding-a-Stochastic-Layer"><a class="docs-heading-anchor" href="#Adding-a-Stochastic-Layer">Adding a Stochastic Layer</a><a id="Adding-a-Stochastic-Layer-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-a-Stochastic-Layer" title="Permalink"></a></h2><p>For adding the stochastic part of the dynamics we have to define a second graph layer. In our example, the fluctuations at different nodes are independent of each other. Therefore, we define a second graph with the same number of vertices but without any edges.</p><pre><code class="language-julia hljs">h = SimpleGraph(4, 0)</code></pre><p>The dynamics at the nodes has to have the same dimension as in the deterministic case. In our example we only have fluctuations in the second variable.</p><pre><code class="language-julia hljs">function fluctuation!(dx, x, edges, p, t)
plot(ode_sol; idxs=vidxs(nd,:,:ω), ylims=(-1.0, 1.0), ylabel=L&quot;\omega&quot;, legend=false, fmt=:png)</code></pre><img src="aa24c923.svg" alt="Example block output"/><p>We see that this is in fact a fixpoint solution. We will later use this as an initial condition for the numerical integration of the SDE system.</p><h2 id="Adding-a-Stochastic-Layer"><a class="docs-heading-anchor" href="#Adding-a-Stochastic-Layer">Adding a Stochastic Layer</a><a id="Adding-a-Stochastic-Layer-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-a-Stochastic-Layer" title="Permalink"></a></h2><p>For adding the stochastic part of the dynamics we have to define a second graph layer. In our example, the fluctuations at different nodes are independent of each other. Therefore, we define a second graph with the same number of vertices but without any edges.</p><pre><code class="language-julia hljs">h = SimpleGraph(4, 0)</code></pre><p>The dynamics at the nodes has to have the same dimension as in the deterministic case. In our example we only have fluctuations in the second variable.</p><pre><code class="language-julia hljs">function fluctuation!(dx, x, edges, p, t)
dx[1] = 0.0
dx[2] = 0.05
end</code></pre><p>Now we can construct the dynamics of the second layer by using <code>network_dynamics()</code>. Since the graph structure of the stochastic layer has no edges we can take the edge function of the deterministic case as a placeholder.</p><pre><code class="language-julia hljs">fluctuation_vertex = ODEVertex(fluctuation!; dim=2)
nd_noise = Network(h, fluctuation_vertex, NetworkDynamics.EdgeFunction[])</code></pre><h2 id="Simulating-the-SDE"><a class="docs-heading-anchor" href="#Simulating-the-SDE">Simulating the SDE</a><a id="Simulating-the-SDE-1"></a><a class="docs-heading-anchor-permalink" href="#Simulating-the-SDE" title="Permalink"></a></h2><p>Finally, we can create an <code>SDEProblem</code> and solve it with <code>DifferentialEquations</code>.</p><pre><code class="language-julia hljs">sde_prob = SDEProblem(nd, nd_noise, uflat(u0), (0.0, 500.0), pflat(p))
sde_sol = solve(sde_prob, SOSRA())
plot(sde_sol; idxs=vidxs(nd,:,:ω), ylims=(-1.0, 1.0), ylabel=L&quot;\omega&quot;, legend=false, fmt=:png)</code></pre><img src="c3cd3b7b.svg" alt="Example block output"/><p>More details on SDE problems, e.g. how to include correlations or how to define an <code>EnsembleProblem</code>, can be found in the <a href="https://diffeq.sciml.ai/stable/types/sde_types/">documentation</a> of <code>DifferentialEquations</code>.</p><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../heterogeneous_system/">« Heterogeneous systems</a><a class="docs-footer-nextpage" href="../cascading_failure/">Cascading failure »</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.7.0 on <span class="colophon-date" title="Thursday 19 September 2024 07:41">Thursday 19 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
plot(sde_sol; idxs=vidxs(nd,:,:ω), ylims=(-1.0, 1.0), ylabel=L&quot;\omega&quot;, legend=false, fmt=:png)</code></pre><img src="db4f9e02.svg" alt="Example block output"/><p>More details on SDE problems, e.g. how to include correlations or how to define an <code>EnsembleProblem</code>, can be found in the <a href="https://diffeq.sciml.ai/stable/types/sde_types/">documentation</a> of <code>DifferentialEquations</code>.</p><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../heterogeneous_system/">« Heterogeneous systems</a><a class="docs-footer-nextpage" href="../cascading_failure/">Cascading failure »</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.7.0 on <span class="colophon-date" title="Thursday 19 September 2024 15:01">Thursday 19 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion previews/PR144/generated/cascading_failure/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
Line 4 tripped at t=2.5025231922343427
Line 1 tripped at t=3.1947647115091087
Line 3 tripped at t=3.3380530127480017
Line 2 tripped at t=3.4042696241611816</code></pre><p>Through the magic of symbolic indexing we can plot the power flows on all lines:</p><pre><code class="language-julia hljs">plot(sol; idxs=eidxs(sol,:,:P))</code></pre><img src="8e884ba6.svg" alt="Example block output"/><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../StochasticSystem/">« Stochastic differential equations</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.7.0 on <span class="colophon-date" title="Thursday 19 September 2024 07:40">Thursday 19 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Line 2 tripped at t=3.4042696241611816</code></pre><p>Through the magic of symbolic indexing we can plot the power flows on all lines:</p><pre><code class="language-julia hljs">plot(sol; idxs=eidxs(sol,:,:P))</code></pre><img src="c5a9ca2f.svg" alt="Example block output"/><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../StochasticSystem/">« Stochastic differential equations</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.7.0 on <span class="colophon-date" title="Thursday 19 September 2024 15:00">Thursday 19 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit bb57d90

Please sign in to comment.