Skip to content

Commit

Permalink
build based on 90a774c
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jan 8, 2024
1 parent ddf01be commit 1ee74d9
Show file tree
Hide file tree
Showing 17 changed files with 901 additions and 1,041 deletions.
12 changes: 6 additions & 6 deletions dev/DCsOPF/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
Nl, N = size(A, 1), size(A, 2)
Bbr = diagm(0 => -(2 .+ 10 * rand(Nl))) # line parameters
Ψ = [zeros(Nl) -Bbr * A[:, 2:end] * inv(A[:, 2:end]&#39; * Bbr * A[:, 2:end])] # PTDF matrix</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">5×4 Matrix{Float64}:
0.0 -0.668271 -0.37715 -0.171734
0.0 -0.123812 -0.232467 -0.105853
0.0 -0.207917 -0.390383 -0.722413
0.0 -0.331729 0.37715 0.171734
0.0 0.207917 0.390383 -0.277587</code></pre><p>Now we can continue the remaining ingredients that specify our systems:</p><pre><code class="language-julia hljs">Cp, Cd = [1 0; 0 0; 0 0; 0 1], [0 0; 1 0; 0 1; 0 0] # book-keeping
0.0 -0.439936 -0.201744 -0.132798
0.0 -0.439369 -0.62623 -0.412215
0.0 -0.120695 -0.172025 -0.454987
0.0 -0.560064 0.201744 0.132798
0.0 0.120695 0.172025 -0.545013</code></pre><p>Now we can continue the remaining ingredients that specify our systems:</p><pre><code class="language-julia hljs">Cp, Cd = [1 0; 0 0; 0 0; 0 1], [0 0; 1 0; 0 1; 0 0] # book-keeping
Ng, Nd = size(Cp, 2), size(Cd, 2)
c = 4 .+ 10 * rand(Ng) # cost function parameters
λp, λl = 1.6 * ones(Ng), 1.6 * ones(Nl) # lambdas for chance constraint reformulations
Expand Down Expand Up @@ -43,4 +43,4 @@
[1 / λl[i] * (mean(pl[1, :], mop) - plmin[i]); buildSOC(pl[i, :], mop)] in SecondOrderCone())
@objective(model, Min, sum(mean(p[i, :], mop) * c[i] for i in 1:Ng))
optimize!(model) # here we go</code></pre><p>Let&#39;s extract the numerical values of the optimal solution.</p><pre><code class="language- hljs">@assert termination_status(model)==MOI.OPTIMAL &quot;Model not solved to optimality.&quot;
psol, plsol, obj = value.(p), value.(pl), objective_value(model)</code></pre><p>Great, we&#39;ve solved the problem. How do we now make sense of the solution? For instance, we can look at the moments of the generated power:</p><pre><code class="language- hljs">p_moments = [[mean(psol[i, :], mop) var(psol[i, :], mop)] for i in 1:Ng]</code></pre><p>Similarly, we can study the moments for the branch flows:</p><pre><code class="language- hljs">pbr_moments = [[mean(plsol[i, :], mop) var(plsol[i, :], mop)] for i in 1:Nl]</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../random_ode/">« Random ODE</a><a class="docs-footer-nextpage" href="../math/">Mathematical Background »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Monday 18 December 2023 11:54">Monday 18 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
psol, plsol, obj = value.(p), value.(pl), objective_value(model)</code></pre><p>Great, we&#39;ve solved the problem. How do we now make sense of the solution? For instance, we can look at the moments of the generated power:</p><pre><code class="language- hljs">p_moments = [[mean(psol[i, :], mop) var(psol[i, :], mop)] for i in 1:Ng]</code></pre><p>Similarly, we can study the moments for the branch flows:</p><pre><code class="language- hljs">pbr_moments = [[mean(plsol[i, :], mop) var(plsol[i, :], mop)] for i in 1:Nl]</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../random_ode/">« Random ODE</a><a class="docs-footer-nextpage" href="../math/">Mathematical Background »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Monday 8 January 2024 15:41">Monday 8 January 2024</span>. Using Julia version 1.10.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 1ee74d9

Please sign in to comment.