Class PenaltyBarrierU_tan2

Inheritance Relationships

Base Type

Class Documentation

class Mechatronix::PenaltyBarrierU_tan2 : public Mechatronix::PenaltyBarrierU_base

Squared Tangent barrier.

Public Functions

inline PenaltyBarrierU_tan2(string const &name)

Construct the barrier.

inline virtual void setup(real_type epsilon, real_type tolerance) override

Initialize the barrier internal parameters based on the values of \( h \) and \( \epsilon \)

for \( h \) and vars[name()+"Epsi"] for \( \epsilon \)

Set the internal parameter

\[ C = \frac{\epsilon}{2\left(\tan\left(\displaystyle\frac{\pi}{2}(1-h)\right)\right)^2} \]

based on the values of \( h \) and \( \epsilon \)

Parameters
  • epsilon[in] value \( \epsilon \)

  • tolerance[in] value \( h \)

inline virtual real_type eval(real_type x) const override

Compute the barrier

\( p(x) = C\left[\tan\left(\frac{\pi}{2}x\right)\right]^2+\frac{\epsilon}{2}x^2 \)

../_images/U_TAN2_0.jpeg

inline virtual real_type eval_D(real_type x) const override

First derivative of the barrier

../_images/U_TAN2_1.jpeg

inline virtual real_type eval_DD(real_type x) const override

Second derivative of the barrier

../_images/U_TAN2_2.jpeg

inline virtual real_type solve(real_type RHS) const override

Solve the problem \( p'(x) = r \)

The solution is iterative.

inline virtual void check_range_throw(real_type u, real_type u_min, real_type u_max) const override

check if value of the control is in the correct range

inline virtual bool check_range(real_type u, real_type u_min, real_type u_max) const override