Is it possible to obtain the power flow equations in the form of f(x) = 0 from PowerModels.jl?
Follow-up question, is it possible to get the system of nonlinear equations h(x) = 0 that make up a power flow problem, i.e. h(x) = 0, where h(x) = [ f(x)^\top\!, \, g(x)]^\top, where f(x) are the said power flow equations, and h(x) are the bus specifications?
As of PowerModels v0.14, PowerModels focuses on building JuMP models (with DC Power Flow being the only dedicated routine that does not require JuMP). So it is not easy to extract the system of equations into Julia functions, such as f(x). If you would like to quickly inspect the JuMP model you can do this,
using PowerModels; using JuMP; using Ipopt
m = Model()
result = run_ac_opf("case.m", with_optimizer(Ipopt.Optimizer), jump_model=m)
println(m)
Thanks for the great work! Unfortunately, this comes three months too late for an industry project, but I’ll definitely bear that in mind for future reference.
I very much like that you compute the Jacobian as well!
Related to the original question, if I were to return the function f!, that gives me the desired equations.