Skip to main content

calcMtpSynXModeledValues.m


% This function is part of the NMSM Pipeline, see file for full license.
%
%
% (struct, struct, struct) -> (struct)
% returns the synergy extrapolation modeled values for the given inputs
% for MTP


function modeledValues = calcMtpSynXModeledValues(values, ...
experimentalData, params)
[modeledValues.muscleExcitations, modeledValues.muscleExcitationsNoTDelay] = ...
calcMuscleExcitationsSynX(experimentalData, ...
values.electromechanicalDelays, values.emgScaleFactors, ...
values.synergyWeights, experimentalData.synergyExtrapolation);
neuralActivations = calcNeuralActivations(modeledValues.muscleExcitations, ...
values.activationTimeConstants, experimentalData.emgTime, ...
experimentalData.numPaddingFrames);
modeledValues.muscleActivations = calcMuscleActivations( ...
neuralActivations, values.activationNonlinearityConstants);
[modeledValues.normalizedFiberLength, ...
modeledValues.normalizedFiberVelocity] = ...
calcNormalizedMuscleFiberLengthsAndVelocities(experimentalData, ...
values.optimalFiberLengthScaleFactors, ...
values.tendonSlackLengthScaleFactors);
modeledValues.passiveForce = calcPassiveForceLengthCurve( ...
modeledValues.normalizedFiberLength, ...
experimentalData.maxIsometricForce, ...
experimentalData.pennationAngle);
modeledValues.muscleJointMoments = calcMuscleJointMoments( ...
experimentalData, modeledValues.muscleActivations, ...
modeledValues.normalizedFiberLength, ...
modeledValues.normalizedFiberVelocity);
end