Skip to content

Computational improvements to static optimization #4037

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Applications/Analyze/test/testStaticOptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,14 @@ void testArm26DisabledMuscles() {
ASSERT_EQUAL(forces.getColumnLabels().findIndex("TRIlat"), -1);
ASSERT_EQUAL(forces.getColumnLabels().findIndex("TRImed"), -1);

StaticOptimization& statOpt =(StaticOptimization&)model.getAnalysisSet().get("StaticOptimization");
Storage* statesDerivativeStore = statOpt.getStatesDerivativeStore();
const Storage* statesStore = statOpt._statesStore;
Array<double> time;
Array<double> time_d;
int nt = statesStore->getTimeColumn(time);
int nt_d = statesDerivativeStore->getTimeColumn(time_d);
ASSERT_EQUAL(nt, nt_d);
ASSERT_EQUAL<Array<double>>(time, time_d, std::numeric_limits<double>::epsilon());

}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ v4.6
- Fixed a bug where `DeGrooteFregly2016Muscle::getBoundsNormalizedFiberLength()` was returning
tendon force bounds rather than fiber length bounds. (#4040)
- Fixed bugs in `PolynomialPathFitter` when too few coordinate samples were provided. (#4039)
- In `StaticOptimization`, state derivatives are now pre-calculated at the time points of the original data, rather than calculated during optimization from splines. This change reduces computational time by as much as 25%. (#4037)
- Exposed the "dissipated energy" state variable allocated by the `SimTK::Force::LinearBushing` that is internal to `BushingForce`.
This change fixed a bug in Moco where adding a `BushingForce` led to a segfault due to a mismatch between the size of the
auxiliary state vector reserved by Moco and `SimTK::State::getZ()`. (#4054)
Expand Down
Loading