I am trying to use MocoInverse in C++ to analyze muscle activation in a upper limb model. When I replaced the muscle in the model by DeGrooteFregly2016Muscle and run inverse.initialize(), I got an error shows that the DELT1 muscle's default activation must be greater than 0, and the current default activation is 0. I checked the muscle activation bound of DELT1 which is 0.01 to 1. Thus, I am quite confused about why the default activation of DELT1 is 0 instead of 0.01.
The error is shown below
Code: Select all
Error detected by Simbody method DeGrooteFregly2016Muscle::extendFinalizeFromProperties: DELT1: default_activation must be greater than zero, but it is 0.
(Required condition 'get_default_activation() > 0' was not met.)
Code: Select all
try {
MocoInverse inverse;
inverse.setName("I_dynamic");
ModelProcessor modelProcessor(model);
modelProcessor.append(ModOpAddExternalLoads("D:/D/unimelb/capstone/open model/ExtForce.xml"));
modelProcessor.append(ModOpAddReserves(0.01, 1));
modelProcessor.append(ModOpIgnoreTendonCompliance());
//modelProcessor.append(ModOpRemoveMuscles());
//new
modelProcessor.append(ModOpReplaceMusclesWithDeGrooteFregly2016());
// Only valid for DeGrooteFregly2016Muscles.
modelProcessor.append(ModOpIgnorePassiveFiberForcesDGF());
// Only valid for DeGrooteFregly2016Muscles.
modelProcessor.append(ModOpScaleActiveFiberForceCurveWidthDGF(1.5));
modelProcessor.append(ModOpIgnoreTendonCompliance());
// end new
inverse.setModel(modelProcessor);
inverse.setKinematics(TableProcessor("D:/D/unimelb/capstone/UpAndStopAndDown0.6s_JointsKin.sto"));
// allowed extra columns to avoid error
inverse.set_kinematics_allow_extra_columns(true);
inverse.set_mesh_interval(0.002);
inverse.set_initial_time(0);
inverse.set_final_time(0.6);
inverse.set_convergence_tolerance(0.01);
//inverse.set_constraint_tolerance(0.01);
//Muscle& muscle = model.updComponent<Muscle>("/forceset/DELT1");
//muscle.setActivation(initialState, 0.5);
// convert to moco study
MocoStudy inverseStudy = inverse.initialize();
Many thanks,
Rick