Open Robbybp opened 4 years ago
These are good suggestions. The problem with the current implementation is that there is only ever 1 discretization equation for each DerivativeVar. If a DerivativeVar is a mixed partial derivative, only 1 discretization equation is written that "nests" the discretizations for each individual ContinuousSet. This is the reason Pyomo.DAE does not currently support the "method of lines" approach for PDEs. I think I can support these changes when I refactor the discretization transformations to better support PDEs.
When solving for consistent initial conditions (among other applications, I'm sure), it is useful to know which
ContinuousSet
s a..._disc_eq
is discretizing. For some simple cases, this can be done by:This is slower than necessary and not reliable if multiple derivatives are present in the discretization equation. I think the current most reliable way identify
_disc_eq
s with respect to a particular set is to iterate overDerivativeVars
, check for those with respect to the set, then find the constraint with the corresponding..._disc_eq
name. This is non-intuitive (to find someConstraint
s we iterate overVar
s?) and relies on discretization equations having the correct name.How hard would it be to give
disc_eq
s acontinuousset_list
attribute or method? It would be nice if we had aDiscEq
subclass ofConstraint
, although this may cause its own trouble.