Specifications

233
AnyOutputFun MaxAct = {
Val = .MaxMuscleActivity;
};
};
This allows us to refer to Study.Output.MaxMuscleActivity before it actually gets created.
AnyOutputFun is actually a class of mathematical function that returns the output (when existing) associated
with the Val member. So here we have created a function called MaxAct that takes no arguments and
returns the output data for .MaxMuscleActivity. Notice that AnyOutputFun must be declared inside a study in
order to resolve the association with the output data structure of the particular study.
We can now use the output function, MaxAct, in our design measure simply by calling the function in the
assignment of the Val member of the AnyDesMeasure:
AnyDesVar SaddlePos = {
Val = Main.BikeParameters.SaddlePos;
Min = Val - 0.07;
Max = Val + 0.10;
};
AnyDesMeasure MaxAct = {
Val = max(..Study.MaxAct());
};
Notice the definition. The MaxAct function for each InverseDynamicAnalysis operation returns a vector of
maximum muscle activities in the model. The vector has as many components as the study has time steps,
i.e. 50 in the present case. In the definition of the AnyDesMeasure we want to save only the largest value of
each of the vector, so we wrap the call of the MaxAct function in another max function. AnyScript gives you
a number of such data processing functions and we shall study others further down. Please refer to the
reference manual for further details.
One thing is missing before we can try the whole thing out: We must specify how many steps we want the
parameter study to perform for each parameter. As in AnyBodyStudies this is done by the nStep variable,
but where nStep in an AnyBodyStudy is an integer variable, it is a vector with one component for each
AnyDesVar in an AnyParamStudy. We shall be modest at first and choose only five steps in each direction.
And so, the final AnyParamStudy looks like this:
AnyParamStudy ParamStudy = {
Analysis = {
AnyOperation &Operation = ..Study.InverseDynamicAnalysis;
};
nStep = {5,5};
AnyDesVar SaddleHeight = {
Val = Main.BikeParameters.SaddleHeight;
Min = Val - 0.05;
Max = Val + 0.03;
};
AnyDesVar SaddlePos = {
Val = Main.BikeParameters.SaddlePos;
Min = Val - 0.07;
Max = Val + 0.10;
};
AnyDesMeasure MaxAct = {
Val = max(..Study.MaxAct());
};
};