Skip to content

feat: [AI] allow passing an operating point to linearize using a solution#4443

Open
AayushSabharwal wants to merge 4 commits intomasterfrom
as/linearize-op
Open

feat: [AI] allow passing an operating point to linearize using a solution#4443
AayushSabharwal wants to merge 4 commits intomasterfrom
as/linearize-op

Conversation

@AayushSabharwal
Copy link
Copy Markdown
Member

@AayushSabharwal AayushSabharwal commented Apr 10, 2026

Close #4159

baggepinnen added a commit to JuliaControl/ControlSystemsMTK.jl that referenced this pull request Apr 13, 2026
Replace manual operating point extraction in `trajectory_ss` with
MTK's `LinearizationOpPoint` API (SciML/ModelingToolkit.jl#4443).
This removes the fragile `robust_sol_getindex` helper and simplifies
the implementation.

- Use `_build_op_from_solution` to extract differential states + parameters
- Supplement with linearization system unknowns from the solution
- Remove `robust_sol_getindex` (no longer needed)
- Bump version to 2.7.0, require MTK >= 11.7
- Update docs narrative for trajectory_ss

Closes SciML/ModelingToolkit.jl#4159

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@baggepinnen
Copy link
Copy Markdown
Contributor

baggepinnen commented Apr 13, 2026

I'm testing this PR from ControlSystemsMTK.jl and hit a dispatch ambiguity in _build_op_from_solution when calling with a vector of time points.

The two methods are:

# Method 1 (line 28): scalar
_build_op_from_solution(op::LinearizationOpPoint)

# Method 2 (line 44): vector
_build_op_from_solution(op::LinearizationOpPoint{S, <:AbstractVector}) where {S}

Method 1 implicitly constrains S <: AbstractODESolution (from the struct definition), while method 2 uses an unconstrained where {S}. Julia sees these as ambiguous for LinearizationOpPoint{ODESolution{...}, Vector{Float64}} since neither method is strictly more specific than the other.

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.

Linearize in point from ODESolution

2 participants