Skip to content

Commit

Permalink
build based on c2a3368
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 2, 2023
1 parent 0c748d6 commit dcf6ca0
Show file tree
Hide file tree
Showing 19 changed files with 1,020 additions and 1,156 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.441173 -0.10916 -0.0565592
0.0 -0.329036 -0.524526 -0.271774
0.0 -0.22979 -0.366315 -0.671667
0.0 -0.558827 0.10916 0.0565592
0.0 0.22979 0.366315 -0.328333</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.558172 -0.238942 -0.137026
0.0 -0.138155 -0.237974 -0.136471
0.0 -0.303674 -0.523084 -0.726503
0.0 -0.441828 0.238942 0.137026
0.0 0.303674 0.523084 -0.273497</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="Sunday 29 October 2023 02:22">Sunday 29 October 2023</span>. Using Julia version 1.9.3.</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="Saturday 2 December 2023 15:00">Saturday 2 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/TypeHierarchy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"meas::Measure\n",
"```\n",
"The purpose of `name` is obvious.\n",
"The integer `deg` stands for the maxium degree of the polynomials.\n",
"The integer `deg` stands for the maximum degree of the polynomials.\n",
"Rather than storing the polynomials $\\phi_i$ themselves we store the recurrence coefficients `α`, `β` that characterize the system of orthogonal polynomials.\n",
"These recurrence coefficients are the single most important piece of information for the orthogonal polynomials.\n",
"For several common measures, there exist analytic formulae.\n",
Expand Down
4 changes: 2 additions & 2 deletions dev/TypeHierarchy_new.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"\n",
"\n",
"The purpose of `name` is obvious.\n",
"The integer `deg` stands for the maxium degree of the polynomials.\n",
"The integer `deg` stands for the maximum degree of the polynomials.\n",
"Rather than storing the polynomials $\\phi_i$ themselves we store the recurrence coefficients `α`, `β` that characterize the system of orthogonal polynomials.\n",
"These recurrence coefficients are the single most important piece of information for the orthogonal polynomials.\n",
"For several common measures, there exist analytic formulae.\n",
Expand Down Expand Up @@ -155,7 +155,7 @@
"| `w_uni::Vector{Function}` | Weight functions of underlying univariate measures |\n",
"| `dom::Vector{Tuple{Float64,Float64}}` | Domain |\n",
"| `symmetric::Vector{Bool}` | Symmetry properties |\n",
"| `pars::Vector{Dict}` | Additioanl parameters |\n",
"| `pars::Vector{Dict}` | Additional parameters |\n",
"\n",
"All fields from `Measure` appear in vectorized versions (except for the weight $w$, which is the weight of the product measure)\n",
"The only *new* field is `w_uni`, which stacks the univariate weight functions.\n",
Expand Down
Loading

0 comments on commit dcf6ca0

Please sign in to comment.