diff --git a/dev/DCsOPF/index.html b/dev/DCsOPF/index.html index affb251..7a31aa2 100644 --- a/dev/DCsOPF/index.html +++ b/dev/DCsOPF/index.html @@ -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]' * Bbr * A[:, 2:end])] # PTDF matrix
5×4 Matrix{Float64}:
- 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
Now we can continue the remaining ingredients that specify our systems:
Cp, Cd = [1 0; 0 0; 0 0; 0 1], [0 0; 1 0; 0 1; 0 0] # book-keeping
+ 0.0 -0.780549 -0.291588 -0.143533
+ 0.0 -0.0948995 -0.306346 -0.150798
+ 0.0 -0.124552 -0.402066 -0.705668
+ 0.0 -0.219451 0.291588 0.143533
+ 0.0 0.124552 0.402066 -0.294332
Now we can continue the remaining ingredients that specify our systems:
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
@@ -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
Let's extract the numerical values of the optimal solution.
@assert termination_status(model)==MOI.OPTIMAL "Model not solved to optimality."
-psol, plsol, obj = value.(p), value.(pl), objective_value(model)
Great, we'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_moments = [[mean(psol[i, :], mop) var(psol[i, :], mop)] for i in 1:Ng]
Similarly, we can study the moments for the branch flows:
pbr_moments = [[mean(plsol[i, :], mop) var(plsol[i, :], mop)] for i in 1:Nl]
Settings
This document was generated with Documenter.jl version 0.27.25 on Saturday 2 December 2023. Using Julia version 1.9.4.