Repository navigation
Support state and input arrays of different types in linearize - #1072
Merged
Merged
Conversation
The Jacobian with respect to the input converted the state to the type of the input with `convert(typeof(u), x)`. This fails when the state and the input are static arrays of different lengths, and discards the array type of the state, e.g., the components of a ComponentArray. The state is now converted element-wise to the element type of the input, which preserves the array type of the state. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Seo8ETEV7wrEk54KBJb7sy
baggepinnen
added a commit
to baggepinnen/LowLevelParticleFilters.jl
that referenced
this pull request
Oct 1, 2026
…ension The failure of linearization for static arrays of different lengths is fixed in ControlSystemsBase.linearize instead, see JuliaControl/ControlSystems.jl#1072. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Seo8ETEV7wrEk54KBJb7sy
|
This is an automated message.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1072 +/- ##
=======================================
Coverage 91.64% 91.64%
=======================================
Files 42 42
Lines 5795 5795
=======================================
Hits 5311 5311
Misses 484 484 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
baggepinnen
referenced
this pull request
Oct 1, 2026
ControlSystemsBase requires MatrixPencils 1.8.3 or later, which requires julia 1.8 or later, so the package could not be installed on julia 1.6. The registration of ControlSystemsBase 1.22.1 was not merged automatically for this reason. Claude-Session: https://claude.ai/code/session_01Seo8ETEV7wrEk54KBJb7sy Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
baggepinnen
referenced
this pull request
Oct 1, 2026
The julia compat lower bound was raised to 1.10 in #1073, which the General registry does not accept in a patch release. Claude-Session: https://claude.ai/code/session_01Seo8ETEV7wrEk54KBJb7sy Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Summary
linearize(f, x, u, args...)computed the Jacobian with respect to the input asconvert(typeof(u), xi)converts the state to the array type of the input. This causes two failures:DimensionMismatch, e.g.,x::SVector{4}andu::SVector{2}. This occurs, for example, inControlSystemsBase.observability(filter, x, u, p, t)for nonlinear filters of LowLevelParticleFilters.jl with static arrays.ComponentArraystate and aVectorinput, the components are lost, andx.vinfthrows aFieldError.The state is now converted element-wise,
convert.(eltype(u), xi), which keeps the container type of the state and gives its elements the dual-number type of the input.Tests
lib/ControlSystemsBase/test/test_hammerstein_wiener.jl: anSVector{3}state with anSVector{2}input, and aComponentArraystate with aVectorinput. Both fail with the previous implementation (DimensionMismatchandFieldError) and pass with the new one.test_hammerstein_wiener.jlpasses. The full test suite was not run.The ControlSystemsBase version is bumped to 1.22.1.
Host:
demeter2, Claude Code sessionsession_01Seo8ETEV7wrEk54KBJb7sy🤖 Generated with Claude Code
https://claude.ai/code/session_01Seo8ETEV7wrEk54KBJb7sy