Skip to content
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

Merged
merged 45 commits into from
Apr 22, 2021
Merged

Operation point solution from PowerModels.jl #118

merged 45 commits into from
Apr 22, 2021

Conversation

SabineAuer
Copy link
Member

No description provided.

Aleksandra Lekic-Vervoort added 3 commits August 16, 2020 20:02
Adding function for dictionary creation only for the lines.
Nodes start: SlackAlgebraic, PVAlgebraic and PQAlgebraic.
@SabineAuer SabineAuer added enhancement New feature or request do not merge yet labels Aug 27, 2020
@SabineAuer SabineAuer linked an issue Aug 27, 2020 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 27, 2020

Codecov Report

Merging #118 (c37fe14) into master (53815c7) will decrease coverage by 15.44%.
The diff coverage is 0.50%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
src/PowerDynamics.jl 100.00% <ø> (ø)
src/lines/PiModelLine.jl 100.00% <ø> (ø)
src/operationpoint/power_flow.jl 0.00% <0.00%> (ø)
src/operationpoint/operationpoint.jl 88.88% <20.00%> (-7.03%) ⬇️
src/parsers/JsonParser.jl 96.22% <0.00%> (+13.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53815c7...715d38b. Read the comment docs.

@SabineAuer
Copy link
Member Author

@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?

Copy link
Member Author

@SabineAuer SabineAuer left a 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

dict["va"] = 0
dict["base_kv"] = 1e-3

if isa(node, PQAlgebraic)
Copy link
Member Author

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?

@lekic-aleksandra
Copy link

lekic-aleksandra commented Aug 30, 2020 via email

Aleksandra Lekic-Vervoort added 2 commits August 31, 2020 22:38
@luap-pik
Copy link
Contributor

luap-pik commented Sep 1, 2020

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.
Can you post the error message?

Project.toml Show resolved Hide resolved
@luap-pik
Copy link
Contributor

luap-pik commented Sep 1, 2020

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.

@lekic-aleksandra
Copy link

lekic-aleksandra commented Sep 1, 2020 via email

@luap-pik
Copy link
Contributor

luap-pik commented Sep 1, 2020

In general, when you are in a local environment and do ]add Package this adds a dependency in the Project.toml.

@luap-pik
Copy link
Contributor

luap-pik commented Sep 1, 2020

OK, I can make a sketch for separating it into functions :-)

@luap-pik
Copy link
Contributor

luap-pik commented Sep 1, 2020

@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?

Direction for PowerModels is different than in PowerDynamics. Load P and Q are multiplied with -1.
@lekic-aleksandra
Copy link

lekic-aleksandra commented Sep 1, 2020 via email

@SabineAuer
Copy link
Member Author

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.
Can you post the error message?

@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

@SabineAuer
Copy link
Member Author

@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.

@luap-pik
Copy link
Contributor

@SabineAuer that's great! thank's for posting the issue. Now the path to use PM ACDC is free :-)

@SabineAuer
Copy link
Member Author

@luap-pik : I started the test for PowerModels based on our test_example.jl
In the test, the comparison between "find_operationpoint" and the PowerModels solution delivers different results (see print statement here) for the voltage of the algebraic load node. What is your opinion on this?

@luap-pik
Copy link
Contributor

In the link it seems that they are not the same because the load flow solution in PowerModels does not converge, it says EXIT: Converged to a point of local infeasibility. Problem may be infeasible.
I will have a look at this.

# 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]))
Copy link
Contributor

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 fromand 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 dataand data_2.

@luap-pik
Copy link
Contributor

luap-pik commented Dec 7, 2020

@SabineAuer some of the new tests seem to be still failing

@SabineAuer
Copy link
Member Author

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

@SabineAuer SabineAuer merged commit d7d8d0f into master Apr 22, 2021
@SabineAuer SabineAuer deleted the alekic branch May 6, 2021 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge yet enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding classic power flow algorithm for initialisation Interface PowerModels.jl for parsing files
3 participants