Moco analyze() function
Posted: Tue Aug 30, 2022 1:42 am
Dear Moco users,
I am trying to perform muscle analysis on a Moco Solution in Python. First I used this code:
However, I received the error message that the speeds and values were not in the trajectory. Good point I thought and appended the speeds and values from a MovoInverse solution with some additional code:
The error message I receive now is that 176 states which are in the solution are not in the model...these are for example: "/forceset/semiten_r".
I also tried the standard OpenSimAnalyze function which works but does not provide valid outputs (e.g. straight line for normalized muscle_lengths during a gait cycle).
So summarizing....I want to perform muscle analysis on a MocoStudy solution but have trouble to get the analyze() function running. Do you have any suggestions?
Thanks and kind regards
Christian
I am trying to perform muscle analysis on a Moco Solution in Python. First I used this code:
Code: Select all
solution = study.solve()
outputs = osim.StdVectorString()
outputs.append('.*active_force_length_multiplier')
table = study.analyze(solution, outputs)
However, I received the error message that the speeds and values were not in the trajectory. Good point I thought and appended the speeds and values from a MovoInverse solution with some additional code:
Code: Select all
solution = study.solve()
solution.insertStatesTrajectory(osim.TimeSeriesTable(MocoInverseSolutionFileName))
outputs = osim.StdVectorString()
outputs.append('.*active_force_length_multiplier')
table = study.analyze(solution, outputs)
I also tried the standard OpenSimAnalyze function which works but does not provide valid outputs (e.g. straight line for normalized muscle_lengths during a gait cycle).
So summarizing....I want to perform muscle analysis on a MocoStudy solution but have trouble to get the analyze() function running. Do you have any suggestions?
Thanks and kind regards
Christian