PR 4/7: Pyomo multi-period DAE model#9
Open
bernalde wants to merge 1 commit intopr/pyomo-utils-singlestepfrom
Open
PR 4/7: Pyomo multi-period DAE model#9bernalde wants to merge 1 commit intopr/pyomo-utils-singlestepfrom
bernalde wants to merge 1 commit intopr/pyomo-utils-singlestepfrom
Conversation
This was referenced Mar 3, 2026
fa26a34 to
65fc2c3
Compare
b8a82c3 to
53ad6d9
Compare
This PR adds the core multi-period Pyomo model: lyopronto/pyomo_models/model.py (640 lines): - Multi-period differential-algebraic equation (DAE) formulation - Orthogonal collocation discretization for time integration - Physics constraints: vapor pressure, sublimation rate, heat transfer - Equipment capability constraints - Product temperature limits - Variable scaling for numerical stability - Support for both Tsh and Pch optimization Key features: - Uses Pyomo DAE transformations from IDAES - Implements same physics as scipy-based calculators - Warmstart from scipy solution for faster convergence - Configurable time discretization (number of periods) Tests (4 files): - test_model_multi_period.py: Multi-period model construction - test_model_advanced.py: Advanced model features - test_model_validation.py: Input validation - test_physics_equations.py: Physics equation verification This is the core model used by the optimizer functions (PR 5).
53ad6d9 to
389c49e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full trajectory optimization model. Discretizes the drying process into multiple time periods, encoding the physics (vapor pressure, product resistance, energy balance, mass transfer) as Pyomo constraints. Supports both finite-difference and collocation discretization. Log-transform for vapor pressure to avoid numerical issues with exponentials.
PR 4 of 7 in the Pyomo integration series.
Changes
lyopronto/pyomo_models/model.py— Full multi-period DAE modeltests/test_pyomo_models/test_model_multi_period.py— Multi-period tests (741 lines)tests/test_pyomo_models/test_model_advanced.py— Advanced model teststests/test_pyomo_models/test_model_validation.py— Validation against scipytests/test_pyomo_models/test_physics_equations.py— Physics equation testsKey Physics Encoded as Constraints
PR Chain
Testing
~2075 lines of new tests covering model construction, discretization, physics constraints, and validation against scipy baseline.