Repository navigation
Order the roots of polynomials with particle coefficients consistently - #1103
Open
baggepinnen wants to merge 1 commit into
Open
baggepinnen wants to merge 1 commit into
baggepinnen wants to merge 1 commit into
Conversation
The roots of a polynomial with MonteCarloMeasurements particle coefficients are computed for each particle separately. Without sorting, the order of the roots differs between particles, so the particle-valued roots do not form conjugate pairs and the conversion to zpk fails. A package extension computes these roots with the default sorting by real and imaginary part. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This is an automated message.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1103 +/- ##
=======================================
Coverage 92.29% 92.29%
=======================================
Files 42 43 +1
Lines 6177 6179 +2
=======================================
+ Hits 5701 5703 +2
Misses 476 476 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.












Fixes the
zpkconversion failure reported in JuliaControl/RobustAndOptimalControl.jl#118.ControlSystemsBase.rootscallsPolynomials.roots(p; sortby=nothing). For a polynomial withMonteCarloMeasurementsparticle coefficients, the eigenvalues of the companion matrix are computed for each particle separately, and without sorting, the order returned by LAPACK differs between particles. A particle-valued root then combines different roots (in the example of the issue, the first root is real in 1493 particles and complex in 507), so the particle-valued roots do not form exact conjugate pairs andSisoZpkthrowszpk model should be real-valued, but poles do not come in conjugate pairs.Changes:
ControlSystemsBaseMonteCarloMeasurementsExt, in whichrootsof a polynomial withAbstractParticlescoefficients uses the default sorting by real and imaginary part. The members of each conjugate pair then occupy the same adjacent positions in every particle. The order of roots for other coefficient types is unchanged.runtests.jlandtest_analysis.jlrequire to be unloaded initially.The full ControlSystemsBase test suite passes locally (Julia 1.13.2).
Not addressed here:
bodeplotof the uncertainzpkorssmodel fails on comparisons of uncertain values unlessunsafe_comparisons(true)is set.polesof an uncertaintf(used bybodeplot) fails on a method ambiguity of\between MonteCarloMeasurements and LinearAlgebra inMatrixPencils.poldiv. With RobustAndOptimalControl loaded,bodeplotof the uncertaintfworks.Host: demeter2, session: MatrixEquations v3 compat PRs (session_01JGy8YZaumSKXZ3ucgmVARB), working directory: /home/baggepinnen/.julia/dev
🤖 Generated with Claude Code