Skip to content

BatchZero/mtk-homotopy-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

mtk-homotopy-prototype

Standalone Symbolics-only prototype validating the feasibility of implementing the Modelica homotopy(actual, simplified) operator for initialization in ModelingToolkit.jl. Supporting evidence for SciML/ModelingToolkit.jl#1385 (see also #3988 / #4039).

Scope: Symbolics layer only. No MTK fork modifications, no upstream PR yet — this repo exists purely to back the RFC comment with reproducible evidence.

What's here

  • prototypes/ — isolated Julia environment + 4 experiment scripts covering basic registration, nested homotopy collapse, IfElse.ifelse branches, and broadcast vectorization. See prototypes/README.md for how to run.
  • notes/prototype-findings.md — full writeup of each experiment's setup, conclusion, and implications for a future MTK PR.

TL;DR finding

A single SymbolicUtils.Postwalk(PassThrough(@rule homotopy(~a, ~s) => ~a)) pass handles all four corner cases tested. No new Symbolics traversal API is required; no Fixpoint wrap is required; the corresponding MTK change would land at a single dispatch point in src/initialization.jl. Full details in notes/prototype-findings.md.

Reproducing

cd prototypes
julia --project=. -e 'using Pkg; Pkg.instantiate()'
julia --project=. experiments/01_basic_register.jl
julia --project=. experiments/02_nesting.jl
julia --project=. experiments/03_branches.jl
julia --project=. experiments/04_vectorization.jl

Each script exits 0 on success and prints QN OK.

Versions

Pinned via prototypes/Manifest.toml. Tested with Julia 1.12.4 / Symbolics 6.58.0 / SymbolicUtils 3.32.0 / IfElse 0.1.1.

License

MIT.

About

Symbolics-only feasibility prototype for the Modelica homotopy operator in ModelingToolkit.jl initialization (RFC supporting evidence for SciML/ModelingToolkit.jl#1385)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages