# MinVal

Computes the minimum value of a user specified function, which could be a MotionSolve expression or a user subroutine.

The minimum value of a signal $f\left(q(t)\right)$ satisfies the following condition: If T* is the point in time when is $f\left(q(t)\right)$ minimum, then $f\left(q(T*)\right)\ge f\left(q(t)\right)$ when t ≠T*. If the expression has no minimum value, the initial value will be returned as the minimum value.

A smooth approximation to the MIN function is implemented in MotionSolve, so that its sensitivities are analytically computed. The smooth approximation, known as the alpha soft approximation, is:

## Example

Assume that you want to put a lower limit on the velocity of a vehicle.

```
>>> # Define the minimum of velocity
>>> minVel = MinVal(function = "VZ({},{})".format(p.cm.id,ref.id))
```