Repository navigation
feat(metadata): the grid of a problem by modeling, coarser for ModelingToolkit (#435) - #473
Merged
Merged
Conversation
…ngToolkit (#435, T5 of #449) grid_size_data(problem, backend): the entry of the optional field :grid_sizes, else the default of the modeling, the grid of the problem but for ModelingToolkit (at most 50, solved by shooting). The JuMP models, the convergence test and the problem pages use it; the linter checks :grid_sizes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 2 tasks
2 of 3 tasks
This was referenced Nov 20, 2026
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.
Refs #435, #449 (T5). Based on #472: to merge after it. Conventions: ct-conventions v0.14.0, ct-agents v0.5.0.
Summary
The modelings are independent but for the definition of the problems (parameters, initial guess, description): each has its own configurations, grid and references (#435). This PR gives each its grid.
grid_size_data(problem, backend), by dispatch: the entry of the modeling in the new optional metadata field:grid_sizeswhen the problem needs one, else the default of the modeling: the grid of the problem (:grid_size), but forModelingToolkitBackend, solved by direct shooting (Corleone, one integration per control interval), at mostMODELING_TOOLKIT_GRID_SIZE = 50steps. Corleone's own tests and examples use 4 to 120 control intervals.grid_size_data(problem)is unchanged.grid_sizekeyword of the JuMP models (grid_size_data(:p, JuMPBackend()), same value), the convergence test and the crons, the problem pages (the grid of each modeling); the skeleton of a new problem and the linter, which checks:grid_sizes(a positiveIntper modeling with a status).Metadatanow depends onModelings(MOD5, a sibling earlier in the order).bioreactorin the ModelingToolkit cron, local, with #472: converged in 24 s, 2.2 GB, instead of not converged after 682 s and 7.5 GB (table in #472). Its objective on 50 steps, -12.9174, is not comparable with the trapezoidal references on 600 steps: the references by modeling come next (they need this grid).Test plan
core: 1359 passed (new:grid_size_databy modeling, with a problem added for the test; the linter on:grid_sizes).Pkg.test(; test_args=["ModelingToolkit", "cron", "problem=bioreactor"]): converged, 24 s, 2.2 GB.🤖 Generated with Claude Code