Skip to main content

calcVerticalGroundReactionForceAndSlopeError.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% Calculate error between experimental and modeled vertical ground reaction
% force. This function returns the value errors and slope errors. This
% function is meant to be used in a task where horizontal ground reaction
% forces are not included.
%
% (struct, struct) -> (double, double)
% Calculate error between experimental and modeled vertical GRFs.


function [valueError, slopeError] = ...
calcVerticalGroundReactionForceAndSlopeError(inputs, modeledValues)
valueError = inputs.experimentalGroundReactionForces(2, :) - ...
modeledValues.verticalGrf;
slopeError = inputs.experimentalGroundReactionForcesSlope(2, :) - ...
calcBSplineDerivative(inputs.time, modeledValues.verticalGrf, 2, 25);
end