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

pf and pt dcline active power with same sign in psse parser #794

Open
iagochavarry opened this issue Oct 25, 2021 · 7 comments
Open

pf and pt dcline active power with same sign in psse parser #794

iagochavarry opened this issue Oct 25, 2021 · 7 comments

Comments

@iagochavarry
Copy link

Shouldn't the active power in each of the dcline terminations have opposite signs (one end is absorbing - positive sign - and the other is injecting - negative sign)?

I think in matpower convention pt is negative and pf is positive.

In psse parser, power_demand have the same sign.

        power_demand = dcline["MDC"] == 1 ? abs(dcline["SETVL"]) : dcline["MDC"] == 2 ? abs(dcline["SETVL"] / pop!(dcline, "VSCHD") / 1000) : 0
        ...
        sub_data["pf"] = power_demand
        sub_data["pt"] = power_demand

In matpower parser, the pt is set to be negative

        dcline["pt"] = -dcline["pt"] 
@ccoffrin
Copy link
Member

In PowerModels pf and pt should be what the measured values on the from and to sides of any line (AC or DC). Adding them together should yield the value of the line losses.

I presume this was checked when we built the Matpower parser (and the associated negative sign). However, if you find there is an inconsistency in that interpretation, please let me know.

I'll ask @jbarberia regarding what is the convention for this in of PSSE.

@iagochavarry
Copy link
Author

I presume this was checked when we built the Matpower parser (and the associated negative sign). However, if you find there is an inconsistency in that interpretation, please let me know.

In Matpower parser this seems to be correct!

I'll ask @jbarberia regarding what is the convention for this in of PSSE.

Additionaly, if we look at the hvdc psse parsing test, the limits for pt are negative, and the variable itself is positive (inconsistency).

julia> data = PowerModels.parse_file("../test/data/pti/two-terminal-hvdc_test.raw")
julia> data["dcline"]["1"]
Dict{String, Any} with 26 entries:
  "pmaxt"     => 0.0
  "pmint"     => -0.2
  "pt"        => 0.2
  "pmaxf"     => 0.2
  "pminf"     => 0.0
  "pf"        => 0.2

I believe that the PSSE parser don't have the loss factor information (loss = 0). Therefore, the equivalence should be something like:

 pf + pt = loss = 0 => pf = - pt

@frederikgeth
Copy link
Collaborator

In the math model, powermodels sticks with the convention pf+ pt = ploss >=0 (if r>=0). Matpower, however in its data model, defines pf-pt=ploss. I think this is mainly because they're re-using the generator model to implement dc lines instead of the ac line model. This does indeed lead to the optimized variables pf and pt having the same sign in the solution. The minus in the parser comes from this change of convention. I don't know what the PSS/E convention is.

@ccoffrin
Copy link
Member

ccoffrin commented Nov 6, 2021

@jbarberia you do know the PSSE convention on this point?

@jbarberia
Copy link
Contributor

@ccoffrin sorry for the delay in replying.

In PSSE, the desired power value is set in the rectifier (SETVL> 0) or in the inverter (SETVL <0). In both cases the power-flow goes from the rectifier to the inverter.
The losses can be calculated with the dc-line voltage (VSCHD) and the dc-line resistance (RDC)

Example:

SETVL = -100 [MW]
RDC = 6.2 [Ohm]
VSC = 640 [kV]

current = SETVL / VSC = 217.4 [A] 
loss = current^2 * RDC = 0.29 [MW]

pt = 100 [MW] #rectifier-side
pf = 100.29 [MW] #inverter-side

For a better conversion of the model from PSSE to PM it would be better to take into account the losses.

@ccoffrin
Copy link
Member

ccoffrin commented Nov 8, 2021

@jbarberia thanks for this. Based on what you say here at least it sounds like we should account for a sign change in the pt and pf values when reading/writing data files or omit these values. Do you have a preference one way or another?

@jbarberia
Copy link
Contributor

I agree with the sign change. We could also add the losses on one side or the other depending on the sign of SETVL.

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

No branches or pull requests

4 participants