Template Function GridKit::Math::indicator

Function Documentation

template<class ScalarT, typename RealT>
inline ScalarT GridKit::Math::indicator(const ScalarT x, const ScalarT f, const RealT limit_min, const RealT limit_max)

Smooth anti-windup indicator for a limited state variable.

Template Parameters:
  • ScalarT – - Scalar data type

  • RealT – - Real data type (see GridKit::ScalarTraits<ScalarT>::RealT)

Parameters:
  • x[in] - State variable

  • f[in] - Pre-limit derivative of the state variable

  • limit_min[in] - Minimum limit

  • limit_max[in] - Maximum limit

Returns:

Scalar value in [0, 1]: 1 when dynamics should pass through, 0 when integration should be blocked.