-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operation point solution from PowerModels.jl #118
Conversation
Adding function for dictionary creation only for the lines.
Nodes start: SlackAlgebraic, PVAlgebraic and PQAlgebraic.
Codecov Report
@@ Coverage Diff @@
## master #118 +/- ##
===========================================
- Coverage 89.59% 74.14% -15.45%
===========================================
Files 40 41 +1
Lines 903 1079 +176
===========================================
- Hits 809 800 -9
- Misses 94 279 +185
Continue to review full report at Codecov.
|
@lekic-aleksandra @luap-pik : I added a small test script so we can see how the power flow works and added PowerModelsACDC as a dependency. For me this throws a compilation error and further internal package errors for PowerModelsACDC. Can you reproduce this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI shows that the problem I described seems to hold for versions of Julia larger equal 1.4
src/operationpoint/power_flow.jl
Outdated
dict["va"] = 0 | ||
dict["base_kv"] = 1e-3 | ||
|
||
if isa(node, PQAlgebraic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we also use multi-dispatching here like calling function make_bus_ac(data :: Dict{String, Any}, node::PQAlgebraic)
and so on?
Yes, we can do that. I just did not want to make additional functions
inside models. Can somebody help me with the code organization?
…On Fri, Aug 28, 2020 at 2:05 PM SabineAuer ***@***.***> wrote:
***@***.**** commented on this pull request.
The CI shows that the problem I described seems to hold for versions of
Julia larger equal 1.4
------------------------------
In src/operationpoint/power_flow.jl
<#118 (comment)>
:
> + function make_bus_ac(data :: Dict{String, Any}, node)
+ key_e = length(data["bus"])+1
+ (data["bus"])[string(key_e)] = Dict{String, Any}()
+ dict = (data["bus"])[string(key_e)]
+ dict["source_id"] = Any["bus", key_e]
+ dict["index"] = key_e
+ dict["bus_i"] = key_e
+ dict["zone"] = 1
+ dict["area"] = 1
+ dict["vmin"] = 0.9
+ dict["vmax"] = 1.1
+ dict["vm"] = 1
+ dict["va"] = 0
+ dict["base_kv"] = 1e-3
+
+ if isa(node, PQAlgebraic)
could we also use multi-dispatching here like calling function
make_bus_ac(data :: Dict{String, Any}, node::PQAlgebraic) and so on?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#118 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDAQMUJCM7LFCJBPEUVEX3SC6MO5ANCNFSM4QNCH3VA>
.
|
Hi! Sure, I think that @SabineAuer 's suggestion above to split the if/else in separate functions with the use of multi-dispatching could be worth a try. First, however, I'm a bit worried about the failing tests for Julia 1.4 that were mentioned. |
OK, I ran the tests locally on Julia 1.5 and could not reproduce any error :-) |
Ok, I am not sure how do you update .toml file? Before I did it by running
a script. Now, I did not concentrate on that.
P.S. I need help with making it distributed in functions. I don't want to
make it "ugly".
…On Tue, Sep 1, 2020 at 12:16 PM Paul Schultz ***@***.***> wrote:
OK, I ran the tests locally on Julia 1.5 and could not reproduce any error
:-)
I added Ipopt and PowerModels to the Project.toml. I'll push this, then
maybe
the CI will pass.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#118 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDAQMUUZNS5JIKYBEAYXPDSDTCY7ANCNFSM4QNCH3VA>
.
|
In general, when you are in a local environment and do |
OK, I can make a sketch for separating it into functions :-) |
@lekic-aleksandra here is my suggestion. test = power_flow(powergrid)
ERROR: MethodError: no method matching set_optimizer(::JuMP.Model, ::Type{Ipopt.Optimizer})
Closest candidates are:
set_optimizer(::JuMP.Model, ::JuMP.OptimizerFactory; bridge_constraints) at /home/paul/.julia/packages/JuMP/iGamg/src/optimizer_interface.jl:35 Do you have an idea what's causing this? |
Direction for PowerModels is different than in PowerDynamics. Load P and Q are multiplied with -1.
I am not sure.
Power flow gives now exactly the same solution as other methods. I use
PowerModelsACDC for monitoring losses, there is a possibility to extend to
HVDC.
…On Tue, Sep 1, 2020 at 1:10 PM Paul Schultz ***@***.***> wrote:
@lekic-aleksandra <https://github.com/lekic-aleksandra> here is my
suggestion.
Now, I get the following error message from run_pf.
test = power_flow(powergrid)
ERROR: MethodError: no method matching set_optimizer(::JuMP.Model, ::Type{Ipopt.Optimizer})
Closest candidates are:
set_optimizer(::JuMP.Model, ::JuMP.OptimizerFactory; bridge_constraints) at /home/paul/.julia/packages/JuMP/iGamg/src/optimizer_interface.jl:35
Do you have an idea what's causing this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#118 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKDAQMRR2QEI3HSUWHPYZ2DSDTJBDANCNFSM4QNCH3VA>
.
|
@luap-pik : it is the same error message as in the Travis CI, see here https://travis-ci.org/github/JuliaEnergy/PowerDynamics.jl/jobs/723063577#L894 |
@luap-pik @lekic-aleksandra : The issue with PowerModelsACDC seems fixed and a new patch with the fix will be released soon. I added the master of PM ACDC locally and the compilation error disappeared. |
@SabineAuer that's great! thank's for posting the issue. Now the path to use PM ACDC is free :-) |
@luap-pik : I started the test for PowerModels based on our test_example.jl |
In the link it seems that they are not the same because the load flow solution in PowerModels does not converge, it says |
# compare branch data | ||
for (k, v) in data["branch"] | ||
@test all(keys(v) .== keys(data_2["branch"][k])) | ||
@test all(values(v) .== values(data_2["branch"][k])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SabineAuer the problem seems to be, that for the dict, the PowerModels data is not correctly created. As far as I can see, the from
and to
field are strings and not numbers, apparently this does not work with PM since there does not seem to be any other difference between data
and data_2
.
@SabineAuer some of the new tests seem to be still failing |
for PowerDynamics line dicts and node dicts we run into an error in this function of PowerModels: https://github.com/lanl-ansi/PowerModels.jl/blob/54715c6ffe6d56357831b3e9b50f6ecf57b6eace/src/core/base.jl#L31 |
Dictionary representation enabled!
No description provided.