Class ClipReciprocal

Class Documentation

class Mechatronix::ClipReciprocal

clip reciprocal class

Inizialization

inline explicit ClipReciprocal()
void setup(real_type h, real_type a)

Set a and h for the approximation of clipped function: \( \min(a,x^{-1}) \)

\[\begin{split} \textrm{rec}(x) = \begin{cases} a & \textrm{if $x<1/a-h$} \\[1em] a+(x-d)^3(b+c/x) & \textrm{if $x<1/a+h$} \\[1em] 1/x & \textrm{otherwise} \\[1em] \end{cases}, \qquad \textrm{where} \qquad \begin{cases} b = \frac{a}{16\,h^3} & \\[1em] c = -\frac{1+3ah}{16\,h^3} & \\[1em] d = \frac{1}{a}-h & \end{cases} \end{split}\]
void setup(GenericContainer const &gc)

Update

inline void update_h(real_type h)
inline void update_epsilon(real_type a)

Evaluate

compute clip function \( c(x) \)

real_type operator()(real_type x) const

Evalute regularized clipping

../_images/CLIP_RECIPROCAL_0.jpeg

real_type D(real_type x) const

compute clip function first derivative \( c'(x) \)

First derivative of regularized clipping

../_images/CLIP_RECIPROCAL_1.jpeg

real_type DD(real_type x) const

compute clip function second derivative \( c''(x) \)

second derivative of regularized clipping

../_images/CLIP_RECIPROCAL_2.jpeg

Info

virtual string info() const = 0
inline void info(ostream_type &stream) const

Protected Attributes

real_type m_h
real_type m_a
real_type m_b
real_type m_c
real_type m_d
real_type m_Hmin
real_type m_Hmax