-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python Static Optimization #2405
base: main
Are you sure you want to change the base?
Conversation
Thanks for this valuable contribution. Will review and respond on the PR. :+1 |
Moved initStateWithoutRecreatingSystem where it is called only once
I was finishing to implement an improved linear approximation of the constraints in the StaticOptimization of the C++ code, when I noticed that sometimes, for no apparent reason, the muscles equilibrium failed. The work-around (in C++ code) is basically to modify ever so slightly the values of the activations (+0.1%) hoping this solves the equilibrium issues. However, since it throws an error if it fails, right now it is impossible to do the same trick in Python (right now, the C++ throw by-passes the try-catch of python, crashing anyway). Is there a way to "try-catch" this error in python? If it is not possible, I don't think it is useful in any way to implement a full in-depth example of the Static Optimization in Python as the one proposed in this PR since the chances of success are very slim! |
Or, if I am allowed, I would add the exceptions in the swig files so we can catch them :) |
New feature
Brief summary of changes
This is a Python implementation of the Static Optimization. One can use this example as template to perform their own static optimization in Python.
Testing I've completed
This gives similar results as the implementation of the Static Optimization that uses muscle equilibrium
CHANGELOG.md (choose one)
The Doxygen for this PR can be viewed at http://myosin.sourceforge.net/?C=N;O=D; click the folder whose name is this PR's number.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)