Class ClipIntervalWithErf

Inheritance Relationships

Base Type

Class Documentation

class Mechatronix::ClipIntervalWithErf : public Mechatronix::IntervalBase

interval clipping class

Inizialization

inline ClipIntervalWithErf()
void setup(real_type h, real_type delta = 0)

Set h and delta for the approximation of characteristic of clippin function: \( \textrm{clip}(x) \approx \max\{-1,\min\{1,x\}\} \)

\[ \mathrm{clip}(x) = \displaystyle\frac{1}{2}\left( (x+1)\textrm{erf}(\kappa\,(x+1)) -(x-1)\mathrm{erf}(\kappa\,(x-1)) +\frac{ \mathrm{e}^{-\kappa^2(x+1)^2} - \mathrm{e}^{-\kappa^2(x-1)^2} } { \kappa\,\sqrt{\pi} } \right) \]

where

\[ \mathrm{clip}(1) = 1-h \]

the true clipping is

\[ (1-\delta)\mathrm{clip}(x) + \delta\,x \]
void setup(GenericContainer const &gc)

Update

inline void update_h(real_type h)
inline void update_delta(real_type delta)

Evaluate

virtual real_type eval(real_type x) const override

../_images/ClipIntervalWithErf0.jpeg

virtual real_type eval_D(real_type x) const override

../_images/ClipIntervalWithErf1.jpeg

virtual real_type eval_DD(real_type x) const override

../_images/ClipIntervalWithErf2.jpeg

Info

virtual string info() const override