I'm using OpenSim 4.0 to simulate a chair-rise task in OpenSim 4.0 using a modified LaiArnold 2017 model (https://simtk.org/frs/?group_id=1302). I'm having some issues with high activations during the task, and I was looking into the model's muscle fiber lengths and tendon lengths during the tasks. I was trying to run a Muscle Analysis through Matlab (using code from https://simtk.org/projects/optcntrlmuscle), but I'm getting very large optimal fiber lengths (Figure 1). When I run a Muscle Analysis through the GUI (Figure 2), I get entirely different muscle fiber lengths.
Any help figuring this out will be much appreciated!
Rachel
Figure 1 Figure 2 The Matlab code is shown below:
Code: Select all
import org.opensim.modeling.*
% get the analysis tool and change variables
[FunctionPath,~]=fileparts(mfilename('fullpath'));
path_generic_file=fullfile(FunctionPath,'settings_Muscle_analysis.xml');
tool=AnalyzeTool(path_generic_file,false);
tool.setLoadModelAndInput(true)
osimModel=Model(model_sel);
tool.setModel(osimModel);
tool.setResultsDir(output_path);
tool.setInitialTime(event(1));
tool.setFinalTime(event(2));
[~, name, ~]=fileparts(motion_file);
tool.setName(name);
% run the analysis
tool.setModelFilename(model_sel);
tool.setCoordinatesFileName(motion_file);
out_path_xml=fullfile(output_path,['muscle_analysis_' name '.xml']);
tool.print(out_path_xml);
tool.run;