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