Computes the maximum value of a user specified function, which could be a MotionSolve expression or a user subroutine.
The maximum value of a signal
satisfies the following condition: If T* is the
point in time when is
maximum, then
when t ≠T*. If the expression has no maximum value,
the initial value will be returned as the maximum value.
A smooth approximation to the MAX function is implemented in
MotionSolve, so that its sensitivities are analytically
computed. The smooth approximation, known as the alpha soft approximation, is:
(1)
The parameter
is used to control the accuracy of the calculations.
Note:
.
The default value of
is +10 and it should work for most of use cases.
Example
Assume that you are designing a suspension system and there is an upper limit on the
maximum acceleration of the chassis.
Here is a code snippet that shows how the response should be defined with
MaxVal:
>>> # Define the maximum of acceleration
>>> maxAcc = MaxVal(function = "ACCZ({})".format(p.cm.id))