maxVal
Computes the maximum value of a signal during a simulation.
The maximum value of a signal f(q(t)) satisfies the following
conditions:
- If T* is the point in time when f(q(t)) is a maximum, then f(q(T*)) < f(q(t)) when t ≠ T*
- f'(q(T*)) = 0
- f”(q(T*)) < 0
If the expression has no maximum value, the initial value will be returned as the maximum value.