-
Notifications
You must be signed in to change notification settings - Fork 3
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
Think about how to build StructJuMP models #5
Comments
Most importantly the JuMP model must be dis-entangled from the EnergyModel since with StructJuMP there might now be multiple ones. So, the standard form of |
addto!(::JuMP.AbstractModel, ::EnergyModel, ::Component) which allows using different jump models per component. Not sure if that is good enough! |
Support for PIPS-IPM interior point solver needs to be done if used: StructJuMP/StructJuMP.jl#24 |
There are two interesting ways of structuring:
One way could be to have T = axis(c, :snapshots)
G = axis(c)
addto!(::JuMP.AbstractModel, ::EnergyModel, c, G[1], T[1]) which would be called in addto!(::JuMP.AbstractModel, ::EnergyModel, c, G[1])
addto!(::JuMP.AbstractModel, ::EnergyModel, c, T[1])
addto!(::JuMP.AbstractModel, ::EnergyModel, ::Component) Just a thought. I don't know how good it is and it would probably mess with the current structure a lot. If one wants to separate the investment variables/constraints from dispatch variables/constraints it gets more messy: addto!(::JuMP.AbstractModel, ::EnergyModel, c, G[1], T[1], investment_flag=true/false) I am not sure if this is worth doing. |
Ok, here's an idea, which I think solves this seemingly difficult problem cleanly and combines well New repr. of time (#14): I did simplify my explanation above a tiny bit, the method signatures for the function addto!(jm::ModelView, ::EnergyModel, c::Generator)
@variable jm ...
@constraint jm ...
end and there is a addto!(jm::JuMP.AbstractModel, m::EnergyModel, c::Component) = addto!(ModelView(jm, c), m, c) connector, that automatically wraps the jump model in a small jump extension, which redirects where jump objects are stored and prefixes their names with Ok, that was all an unnecessary explanation, because the idea was not finished yet, it's still a bit WIP, but here's the current state:
struct SubEnergyModel # the name is still WIP
model::EnergyModel
subset
jumpmodel::JuMP.AbstractModel
objects
end Then, one could construct such SubEnergyModels sm = SubEnergyModel(m, Dict(:buses=>some_buses), jm, Dict{Symbol,Any}())
addto!(sm::SubEnergyModel, ::EnergyModel, c::Component) A typical addto! method would then do the function addto!(sm::SubEnergyModel, ::EnergyModel, c::Generator)
G = axis(sm, c)
T = axis(sm, :snapshots) # To be changed to maybe `timeaxis`
jm = ModelView(sm.jumpmodel, sm, c) # That's a detail the user should not have to know about
@variable jm ...
end Open questions:
... |
StructJuMP
allows to organize and separate the block structure of huge models. In a nutshell one creates variables and constraints on severalStructuredModel
instances, one of which is the master and several others which define the subproblems.These instances can then be communicated to parallel solvers like
PIPS
orDSP
.Do we want to split the variables constraints of a single component? ie Generator dispatch being split from capacity? Are there multiple cuts one would like to make?
@fneum Thoughts?
The text was updated successfully, but these errors were encountered: