Skip to content

Implement matrix balancing for DARE solver #9127

Description

@calcmogul

Is your feature request related to a problem? Please describe.
Our iterative DARE solver based on the structure-preserving doubling algorithm can produce inaccurate solutions if the system matrix has vastly different eigenvalues (e.g., fast velocity dynamics and a slow decaying integrator).

Describe the solution you'd like
SciPy's direct DARE solver performs matrix balancing via scipy.linalg.matrix_balance (with permuting and scaling enabled) before the solve. That function uses LAPACK's GEBAL. We want to avoid a dependency on Fortran, so we'll have to write our own C++ routine using Eigen for building the diagonal similarity transformation.

We also need to determine if there's some matrix structure to preserve during the rebalancing process. SciPy's solver mentions preserving symplectic structure, but I don't know if the same applies to wpimath's solver, or what that looks like implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: wpimathMath librarytype: featureBrand new functionality, features, pages, workflows, endpoints, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions