Skip to content

Conversation

@jbarberia
Copy link
Contributor

What do you think of having a support to export HVDC lines in this way?

I compare side by side the results in PSSE doing this process: original_raw -> parse_file -> export_file -> new_raw and its works pretty decent.

The only drawback is that it would work correctly if import_all = true in the parse_file function.
For the moment I did not check if it could export to PSSE a file coming from MATPOWER.

@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #791 (bb6d5da) into master (9269f70) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #791      +/-   ##
==========================================
+ Coverage   93.98%   94.00%   +0.02%     
==========================================
  Files          42       42              
  Lines        9757     9794      +37     
==========================================
+ Hits         9170     9207      +37     
  Misses        587      587              
Impacted Files Coverage Δ
src/io/psse.jl 97.29% <100.00%> (ø)
src/io/pti.jl 90.98% <100.00%> (+0.49%) ⬆️

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 9269f70...bb6d5da. Read the comment docs.

@ccoffrin
Copy link
Member

I did a quick skim and this is how I would approach it as well. If the user does import_all then the export feature can recover more data than is available in the current PowerModels spec. I would strive to for the goal that original_raw -> parse_file (import_all) -> export_file -> new_raw yields the exact same DC line record in the exported PSSE file (for the two terminal case). This may not always be possible if information is lost in translation to the power models data fields.

Note

  • We should have a test for original_raw -> parse_file (not import_all) -> export_file -> new_raw, to make sure this does not crash and produces a reasonable output.
  • We should have a test for matpower (with DC line) -> parse_file -> export_file -> new_raw, to make sure this does not crash and produces a reasonable output.

@jbarberia
Copy link
Contributor Author

I agree with you to add this types of tests. In the next days I will try to produce a useful output without the import_all option.

@jbarberia
Copy link
Contributor Author

@ccoffrin, I would like to know what you think about the power flows that I ran for case5_dc.m.

  • First, I solved it in matpower runpf(loadcase("case5_dc.m")).
  • Then in PowerModels run_pf("case5_dc.m", ACPPowerModel, Ipopt.Optimizer) .
  • Lastly, I used the export_pti function and ran a powerflow with default options in PSSE-33.

The results are in the following tables:

Voltage Magnitude [p.u.] PowerModels Matpower PSSE-33
1 1.064 1.076 1.078
2 1.080 1.083 1.084
3 1.100 1.099 1.100
4 1.064 1.064 1.064
5 1.053 1.066 1.069
Voltage Angle [degree] PowerModels Matpower PSSE-33
1 2.910 2.808 2.830
2 -0.768 -0.683 -0.750
3 -0.622 -0.486 -0.600
4 0.000 0.000 0.000
5 3.734 3.585 3.630

Let me know what things would be necessary (more tests or another side by side comparision) to perform the merge.

@jbarberia jbarberia marked this pull request as ready for review October 19, 2021 20:38
@ccoffrin
Copy link
Member

@jbarberia, this is a good observation! When implementing this model I strived to match Matpower's specification, but I did not to a lot of testing, so possibly I got a detail incorrect here or there. I usually only test OPF as well and not PF when porting a feature from another solver. I am surly open to considering changes in the PF specification for DC lines to make them more consistent with Matpower. I would suspect there a variation in how the bus type semantics are handled (i.e., should HVDC buses be PQ or PV? I set them up as PV based on the bus vm value and it looks like Matpower is doing something different maybe following the generator's vm target?). I suspect, if to load the case into PowerModels and then re-export it to Matpower you will find the results to be more consistent as PowerModels' data cleaning will be reflected in the new Matpower file.

It would also be convenient if the results were also consistent with PSSE. However, this may not be possible as there may be no encoding of Matpower's semantics into PSSE (DC line losses are one point that comes to mind). So we may have to accept some deviations in this case.

I am open to merging this as-is, as I find these convention deviations acceptable. However, would you prefer to make changes to that the models are more consistent?

@jbarberia
Copy link
Contributor Author

@ccoffrin, I prefer to merge this PR and then work on #540 to make all the necessary corrections there.

@ccoffrin
Copy link
Member

I just did a code review with the hope of merging soon. Looks reasonable to me. I did wonder if we need both two-terminal-hvdc_test_2.raw and two-terminal-hvdc_test.raw, do they serve two different purposes or can be merge them to cover all of the situations you want to cover.

@ccoffrin ccoffrin mentioned this pull request Oct 21, 2021
@jbarberia
Copy link
Contributor Author

@ccoffrin, I used the two-terminal-hvdc_test_2.raw file to verify that the PSSE-33 could open the .raw cases generated by PowerModels. Also, I used it for some side-by-side checks.

But now it is totally unnecessary, so I will delete it.

@ccoffrin ccoffrin merged commit 635fdce into lanl-ansi:master Oct 25, 2021
@jbarberia jbarberia deleted the PSSE-HVDC branch October 25, 2021 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants