Class PenaltyBarrierU_quadratic_bis

Inheritance Relationships

Base Type

Class Documentation

class Mechatronix::PenaltyBarrierU_quadratic_bis : public Mechatronix::PenaltyBarrierU_base

Piecewise quadratic penalty.

Public Functions

inline explicit PenaltyBarrierU_quadratic_bis(string const &name)

Construct the penalty.

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

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

The following values are precomputed for the penalty.

\[ H=1-h,\qquad A_0=\frac{1}{h},\qquad A_1 = \frac{\epsilon}{H^2}, \qquad A_2 = \frac{2\epsilon}{H}, \qquad A_3 = \frac{1-A_1}{h^2}+A_1, \qquad A_4 = \frac{2}{h}\left(1-A_1\right)+ A_2 \]
Parameters
  • epsilon – value \( \epsilon \)

  • tolerance – value \( h \)

inline virtual real_type eval(real_type x) const override

Compute penalty value

\[\begin{split} p(x) = \begin{cases} 1+(2\,A_0(x+1)-A_4)(x+1) & x < -1 \\[1em] \epsilon + ( A_3(x+H) - A_2)(x+H) & x \in [-1,-1+h] \\[1em] A_1\, x^2 & x \in [-H,H] \\[1em] \epsilon + ( A_3(x-H) + A2)(x-H) & x \in [H,1] \\[1em] 1 + ( 2A_0 (x-1) + A_4 )(x-1) & x>1 \end{cases} \end{split}\]

where the values

\[ H=1-h,\qquad A_0=\frac{1}{h},\qquad A_1 = \frac{\epsilon}{H^2}, \qquad A_2 = \frac{2\epsilon}{H}, \qquad A_3 = \frac{1-A_1}{h^2}+A_1, \qquad A_4 = \frac{2}{h}\left(1-A_1\right)+ A_2 \]

are precomputed after a call of method setup.

../_images/U_QUADRATIC2_0.jpeg

inline virtual real_type eval_D(real_type x) const override

First derivative of the penalty

../_images/U_QUADRATIC2_1.jpeg

inline virtual real_type eval_DD(real_type x) const override

Second derivative of the penalty

../_images/U_QUADRATIC2_2.jpeg

inline virtual real_type solve(real_type RHS) const override

solve \( p'(z) = r \)