Skip to main content

computeDesignOptimizationContinuousFunction.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function computes the dynamic constraints, path constraints (if any)
% and cost function terms (if any) for design optimization.
%
% (struct) -> (struct)
%


function modeledValues = computeDesignOptimizationContinuousFunction(inputs)

values = getDesignOptimizationValueStruct(inputs.phase, inputs.auxdata);
inputs = updateSystemFromUserDefinedFunctions(inputs, values);
modeledValues = calcTorqueBasedModeledValues(values, inputs.auxdata);
modeledValues = calcSynergyBasedModeledValues(values, inputs.auxdata, ...
modeledValues);
modeledValues.dynamics = calcDesignOptimizationDynamicsConstraint(values, ...
inputs.auxdata);
if ~isempty(inputs.auxdata.path)
modeledValues.path = calcDesignOptimizationPathConstraint(values, ...
modeledValues, inputs.auxdata);
end
modeledValues.integrand = calcDesignOptimizationIntegrand(values, ...
modeledValues, inputs.auxdata);
end