Add stability constraints to the Park 2004 model.#452
Draft
moorepants wants to merge 5 commits intocsu-hmc:masterfrom
Draft
Add stability constraints to the Park 2004 model.#452moorepants wants to merge 5 commits intocsu-hmc:masterfrom
moorepants wants to merge 5 commits intocsu-hmc:masterfrom
Conversation
Member
Author
|
This now works if the line in sympy is changed to |
moorepants
commented
Apr 29, 2025
Member
Author
|
The found closed loop gains give stable eigenvalues: |
Member
Author
|
I opened this SymPy issue regarding the limitations of the stability conditions function: sympy/sympy#28010 |
Member
Author
|
@chris-konrad and @tvdbogert, this may be of interest. It still needs some tweaks upstream in SymPy for it to work smoothly, but this demonstrates adding criteria to guarantee stability in a parameter identification problem. |
|
Hello, the stability criteria should now work correctly (sympy/sympy#28265). |
Member
Author
|
This works with SymPy master. Nice! I think I'll wait to merge (if I do) for when SymPy 1.15 comes out. |
Member
Author
|
Getting this unrelated error in the docs build: |
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 #251
This change requires the development version of SymPy: 1.15.dev0.
SymPy recently gained a feature to calculate the stability criteria for a linear system. It uses the Routh-Hurwitz method to find the set of inequalities that guarantee the roots of the characteristic equation all have negative real parts. opty recently gained the functionality to add extra inequality constraints to the equations of motion. This is particularly useful for problems where you want to find parameters that ensure asymptotic stability of the model. The Park 2004 example is one such problem. Here we identify the control parameters from measurement data for the nonlinear human standing model but also linearize the dynamics model and can ensure that the identified control parameters will guarantee stability of the closed loop linear model.
TODO
get_asymptotic_stability_criteria()upstream in SymPy, StateSpace.get_asymptotic_stability_conditions() hangs on state matrices with moderately long matrix entry expressions sympy/sympy#28010