Skip to main content

calcPassiveForcePenaltyCost.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% (Array of number, struct) -> (Array of number)
% returns the cost for all rounds of the Muscle Tendon optimization


function cost = calcPassiveForcePenaltyCost(modeledValues, costTerm)
errorCenter = valueOrAlternate(costTerm, "errorCenter", 0);
maximumAllowableError = valueOrAlternate(costTerm, "maxAllowableError", 10);
cost = calcDeviationCostArray( ...
modeledValues.passiveForce, errorCenter, ...
maximumAllowableError);
end