Custom unit model - solve performance for large grids #1312
Replies: 1 comment
-
Yes, IDAES typically implements everything in Pyomo. I believe your intuition is correct that a 1000x25 element grid model will be time consuming to construct (with Pyomo.DAE) and challenging to solve (e.g. with Ipopt). However, doing so is not out of the question with careful implementation and initialization. I have solved problems with grids on this order implemented directly in Pyomo in the past. One way to address this is through surrogate modeling. I.e. train a surrogate model, via e.g. ALAMO, on your detailed calculations, and embed this model into IDAES/Pyomo. I believe IDAES has an interface to make this easy, although I have not used it. IDAES developers have done this for loosely similar models in the past. Another option, which I believe is close to what you are describing, is to try to directly embed your detailed calculations into a Pyomo model via PyNumero. This can be done with the ExternalGreyBox class, which allows combining custom calculations with Pyomo models into a single PyNumero object (which can then be solved). See an example here This is somewhat of a beta capability, and IDAES does not support defining unit models like this (although I think this is a very interesting avenue of potential ressearch and development). Note that if you are going to go this route, you will need to supply derivatives of your custom calculations. |
Beta Was this translation helpful? Give feedback.
-
I have some existing dynamic model code for a packed bed thermal energy storage system that I would like to modify and integrate with IDAES to enable transient analysis for power cycles. However, I'm concerned about the solver performance if I implement it with Pyomo, as that seems to be the way that everything in IDAES works from my initial research. Expected grid sizes are on the order of 1000 elements for the 1D fluid and solid phases, with grid size for the 2D tank walls on the order of 1000 x 25 elements. Currently I'm leveraging SciPy's sparse linear algebra routines to handle the wall conduction and make the code fairly performant, but I'm afraid that this problem might not be well suited to having all the equations translated into Pyomo's model format with constraints. I would appreciate some guidance from IDAES developers on the best way to interface my code with IDAES. If possible, my goal would be to contribute this model to the codebase once it's ready. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions