Class Barrier1X

Inheritance Relationships

Base Type

Class Documentation

class Mechatronix::Barrier1X : public Mechatronix::RegularizedBase

Barrier function class

This class implement a smooth approximation of the ideal barrier class \( b(x) \) where ideal barrier satisfy \( b(x)=\infty \) for \( x<0 \) and \( b(x)=0 \) for \( x>0 \).

Inizialization

inline explicit Barrier1X()
virtual void setup(GenericContainer const &gc) override

Initialize regularization parameters with a GenericContainer. Expect to find gc("h") containing a real scalar.

void setup(real_type h)

Initialize regularization parameter \( h \).

Set the parameter \( h>0 \) for the barrier function.

This parameter is used to define barrier \( b(x) \) in such a way \( b(h)=1 \). Moreover \(b(h)=1\), \(b(0)=\infty\) and \( b(\infty) = 0 \).

inline void update_h(real_type h)

Update regularization parameter \( h \).

Evaluate

virtual real_type operator()(real_type x) const override

Evaluate barrier function

\[\begin{split} b(x) = \begin{cases} \mathrm{NaN} & \textrm{for $x\leq 0$} \\[1em] h^2/x & \mathrm{otherwise} \end{cases} \end{split}\]

../_images/BARRIER_1X_0.jpeg

virtual real_type D(real_type x) const override

First derivative of the barrier function

../_images/BARRIER_1X_1.jpeg

virtual real_type DD(real_type x) const override

Second derivative of the barrier function

../_images/BARRIER_1X_2.jpeg

Info

virtual string info() const override