diff --git a/dev/DCsOPF/index.html b/dev/DCsOPF/index.html index 72e760d..8b993fe 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.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
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.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
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 Monday 18 December 2023. Using Julia version 1.9.4.