-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Summary
PR #100 updates the compat entry for ModelingToolkit to include version 11 for NeuralLyapunovProblemLibrary. This introduces several breaking changes that need to be addressed before the PR can be merged.
Breaking Changes Encountered
1. Symbolics Version Requirement
- Issue: ModelingToolkit 11 requires Symbolics v7.x, but NeuralLyapunovProblemLibrary restricted Symbolics to v6.37.
- Status: ✅ Fixed by updating compat to
Symbolics = "6.37, 7"
2. structural_simplify Return Type Change
- Issue: In MTK 9,
structural_simplify(sys, (inputs, outputs))returned a tuple(simplified_sys, input_functions). In MTK 11, it returns just the System directly. - Affected Files:
test/pendulum_test.jl(line 35-41)test/double_pendulum_test.jl(lines 89-95, 179-185)test/planar_quadrotor_test.jl(lines 25-31, 122-128)test/quadrotor_test.jl(lines 34-40, 154-160)
- Status: ✅ Fixed by removing tuple unpacking (
sys, _ = structural_simplify(...)→sys = structural_simplify(...))
3. linearize Namespacing Changes (Remaining Issue)
- Issue: MTK 11 has stricter namespacing requirements. When accessing variables via
getproperty(e.g.,sys.input_var), the variables become namespaced (e.g.,sys₊input_var), butlinearize/mtkcompileexpects non-namespaced names. - Error Message:
The following inputs provided to `mtkcompile` were not found in the system: quadrotor_3d₊T(t) quadrotor_3d₊τφ(t) ... - Affected Files:
test/quadrotor_test.jl(LQR controller test usinglinearize)
- Fix Required: Use
toggle_namespacing(sys, false)before accessing variables that will be passed tolinearize:sys_nns = toggle_namespacing(sys, false) inputs = [sys_nns.input_var] mtkcompile(sys; inputs)
Test Results After Partial Fix
| Test Suite | Status |
|---|---|
| Simple pendulum | ✅ Pass (5/5) |
| Double pendulum | ✅ Pass (11/11) |
| Planar Quadrotor | ✅ Pass (14/14) |
| Quadrotor (3D) | ❌ Partial (12/13 pass, 1 error in LQR test) |
| Quality Assurance | ✅ Pass (18/18) |
Suggested Next Steps
- Update the quadrotor LQR test to use
toggle_namespacingwhen accessing variables forlinearize - Verify the fix doesn't break backward compatibility with MTK 9.x
- Consider adding version-conditional code if the API differs significantly between MTK 9 and 11
Reference
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
No labels