Skip to content

feat(metadata): the grid of a problem by modeling, coarser for ModelingToolkit (#435) - #473

Merged
ocots merged 2 commits into
mainfrom
feat/grid-by-backend
Nov 20, 2026
Merged

ocots merged 2 commits into
mainfrom
feat/grid-by-backend

Conversation

@ocots

@ocots ocots commented Nov 20, 2026

Copy link
Copy Markdown
Member

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_sizes when the problem needs one, else the default of the modeling: the grid of the problem (:grid_size), but for ModelingToolkitBackend, solved by direct shooting (Corleone, one integration per control interval), at most MODELING_TOOLKIT_GRID_SIZE = 50 steps. Corleone's own tests and examples use 4 to 120 control intervals.
  • grid_size_data(problem) is unchanged.
  • Users: the default grid_size keyword 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 positive Int per modeling with a status).
  • Metadata now depends on Modelings (MOD5, a sibling earlier in the order).

bioreactor in 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_data by 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.
  • CI.

🤖 Generated with Claude Code

ocots and others added 2 commits November 20, 2026 17:14
…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>
@ocots ocots added the run ci github-runner Trigger the CI workflow on GitHub-hosted runners label Nov 20, 2026
Base automatically changed from perf/mtk-solver to main November 20, 2026 17:30
@ocots
ocots merged commit 9a14a4d into main Nov 20, 2026
18 of 19 checks passed
@ocots
ocots deleted the feat/grid-by-backend branch November 20, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run ci github-runner Trigger the CI workflow on GitHub-hosted runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant