Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Update Project.toml compat to support ModelingToolkit v10 and v11
  • Use __legacy_defaults__ instead of removed defaults keyword in System constructor (src/evaluator.jl)
  • Add build_initializeprob=false to ODEProblem calls for MTK v11 compatibility (src/BaseModelica.jl)
  • Update tests to use initial_conditions()/bindings() instead of removed defaults() function

Details

MTK v11 introduced breaking changes:

  1. The defaults keyword argument to System was removed and replaced with initial_conditions, bindings, and __legacy_defaults__
  2. The defaults() accessor function was removed
  3. The initialization system for ODEProblem has stricter requirements

This PR uses the backwards-compatible __legacy_defaults__ approach to minimize changes while supporting both v10 and v11.

Test plan

  • All 128 tests pass locally with MTK v11.4.0
  • CI tests pass on GitHub

🤖 Generated with Claude Code

Changes:
- Update Project.toml compat to support MTK v10 and v11
- Use __legacy_defaults__ instead of removed defaults keyword in System constructor
- Add build_initializeprob=false to ODEProblem calls for MTK v11 compatibility
- Update tests to use initial_conditions()/bindings() instead of removed defaults()
- Format code with SciMLStyle

All 128 tests pass with MTK v11.4.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit 2aae256 into SciML:main Dec 30, 2025
7 of 9 checks passed
@ChrisRackauckas-Claude
Copy link
Contributor Author

Updated to v11-only with proper API

Per feedback, I've updated this PR to:

  1. Drop MTK v10 support - Now v11 only in Project.toml
  2. Remove build_initializeprob=false workaround
  3. Use proper MTK v11 initialization API:
    • Set defaults on parameters using ModelingToolkit.setdefault()
    • Set defaults on variables from initial equations
    • Provide default guess of 0.0 for variables without explicit start values
    • Remove __legacy_defaults__ keyword

All 128 tests still pass with MTK v11.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants