lanl-ansi / PowerModels.jl

A Julia/JuMP Package for Power Network Optimization
https://lanl-ansi.github.io/PowerModels.jl/stable/
Other
388 stars 145 forks source link

Nodal Prices #409

Closed spmacdonald closed 1 year ago

spmacdonald commented 5 years ago

Hello,

Is it possible to calculate the nodal LMP prices for each bus in the OPF case with PowerModels?

Thank you

ccoffrin commented 5 years ago

Yes, but as of v0.8.6 this is only working for linear models (e.g. DC-OPF).

The basic setup is,

result = run_dc_opf("case14.m", ipopt_solver, setting = Dict("output" => Dict("duals" => true)))

Then look for the value lam_kcl_r in result["solution"]["bus"].

Additional examples can be reviewed here, https://github.com/lanl-ansi/PowerModels.jl/blob/master/test/output.jl#L71

PS: The best forum for general questions about PowerModels is discourse, github issues are best for reporting bugs and feature requests.

spmacdonald commented 5 years ago

Ok, good to know thank you. What would it take to do this for the AC case? I am interested in helping but would need some guidance.

Any interest in including a method to decompose the LMP into components? energy, congestion and losses.

ccoffrin commented 5 years ago

There is an issue in supporting AC that has to do with how JuMP v0.18 is implemented. I don't exactly recall the details. It should be easy to support in JuMP v0.19, which is noted here, https://github.com/lanl-ansi/PowerModels.jl/issues/199

If you would like to play with JuMP v0.19 have a look at the version of PowerModels in the v0.7-moi branch.

As for decomposing the LMP into components. I am not familiar with that method, do you have a refrence I can read?

spmacdonald commented 5 years ago

Regarding decomposing the LMP into components:

As you know all centrally coordinated electricity markets in the United States employ locational pricing to price electric energy. They define the LMP at a bus to be: LAM_i = system energy price + congestion_i + losses_i

I have asked PJM for a technical reference on how the losses are calculated, they sent me this training document: https://www.pjm.com/-/media/training/core-curriculum/ip-lmp-101/lmp-training.ashx?la=en It is a bit light on details and I am working with them to get additional information.

Here are some relevant papers:

Luonan Chen, H. Suzuki, T. Wachi and Y. Shimura, "Components of nodal prices for electric power systems," in IEEE Transactions on Power Systems, vol. 17, no. 1, pp. 41-49, Feb. 2002. doi: 10.1109/59.982191

Xu Cheng and T. J. Overbye, "An energy reference bus independent LMP decomposition algorithm," in IEEE Transactions on Power Systems, vol. 21, no. 3, pp. 1041-1049, Aug. 2006. doi: 10.1109/TPWRS.2006.876703

T. Orfanogianni and G. Gross, "A General Formulation for LMP Evaluation," in IEEE Transactions on Power Systems, vol. 22, no. 3, pp. 1163-1173, Aug. 2007. doi: 10.1109/TPWRS.2007.901297

D. Cheverez-Gonzalez and C. L. DeMarco, "Mutually orthogonal LMP decompositions: Congestion decomposes, losses do not," 2009 6th International Conference on the European Energy Market, Leuven, 2009, pp. 1-6. doi: 10.1109/EEM.2009.5207186

F. Li, E. Litvinov and T. Zheng, "A combined LMP model considering reference independent decomposition and fictitious nodal demand," IEEE PES General Meeting, Providence, RI, 2010, pp. 1-5. doi: 10.1109/PES.2010.5589739

D. Chéverez-González and J. Lin, "Mutually orthogonal LMP decomposition: Analysis of PJM network by null space approach," IEEE PES General Meeting, Providence, RI, 2010, pp. 1-8. doi: 10.1109/PES.2010.5588186

V. Sarkar and S. A. Khaparde, "Optimal LMP Decomposition for the ACOPF Calculation," in IEEE Transactions on Power Systems, vol. 26, no. 3, pp. 1714-1723, Aug. 2011. doi: 10.1109/TPWRS.2011.2104371

P. Lipka, S. S. Oren, R. P. O’Neill and A. Castillo, "Running a More Complete Market With the SLP-IV-ACOPF," in IEEE Transactions on Power Systems, vol. 32, no. 2, pp. 1139-1148, March 2017. doi: 10.1109/TPWRS.2016.2569596

ccoffrin commented 5 years ago

I am going to take a similar stance as @rdzman on this one. I am opening to accepting PRs that perform this computation, but it's not a super high priority for me to implement at this point.

I'll also note, if the shift factors are required adding their computation to PowerModels (https://github.com/lanl-ansi/PowerModels.jl/issues/87) would be the first step to implementing such a feature. After that the computation you propose for LMPs would be fairly easy.

I do hope to implement a PTDF model in the next couple of months.

spmacdonald commented 5 years ago

That is understandable. Are you open to collaborators? I am interested in helping

ccoffrin commented 5 years ago

Absolutely. GitHub pull requests are a natural way to collaborate on code. High code quality is a requirement for PowerModels. PowerModelsAnnex is a good place for contributing prototype code.

If you would like software design tips or more scientific discussion we can setup a VC. Just send me an email.

On Tue, Nov 6, 2018 at 11:31 AM Scott MacDonald notifications@github.com wrote:

That is understandable. Are you open to collaborators? I am interested in helping

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/lanl-ansi/PowerModels.jl/issues/409#issuecomment-436358800, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDeqtBzVNyikQT_upYqMP7UFQmCQ7zPks5usdV8gaJpZM4YMMhk .

spmacdonald commented 5 years ago

Thanks a lot, I appreciate the offer.

I spent some more time reading today and found this paper:

https://www.ferc.gov/legal/staff-reports/2017/marginallosscalculations.pdf

which seems to be what I am after.

gcherot commented 2 years ago

Hello, I have two questions:

  1. What do "lam_kcl_r" and "lam_kcl_i" mean? In other words, which constraints are they the dual of?
  2. Is it possible to access the value of all Lagrange multipliers at the end of the optimisation? If not, could you consider adding this feature? I am willing to help but I have no experience in Julia.
ccoffrin commented 2 years ago

These lambda values are the Lagrange multipliers of the power balance constraint "r" for active power and "i" for reactive power.

mtanneau commented 1 year ago

I second the request to be able to grab the Lagrange multipliers of all constraints (not just power balance): thermal constraints, voltage magnitude bounds, active/reactive power bounds, etc...

ccoffrin commented 1 year ago

Closing as nodal prices are now widely supported. Made a new issue for expanding the scope of dual reporting.