Class PenaltyBarrierU_quartic¶
Defined in File PenaltyBarrierU.cc
Inheritance Relationships¶
Base Type¶
public Mechatronix::PenaltyBarrierU_base
(Class PenaltyBarrierU_base)
Class Documentation¶
-
class
Mechatronix
::
PenaltyBarrierU_quartic
: public Mechatronix::PenaltyBarrierU_base¶
-
Piecewise cubic penalty.
Public Functions
-
inline explicit
PenaltyBarrierU_quartic
(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 \)
for \( h \) and
vars[name()+"Epsi"]
for \( \epsilon \)Set the internal parameters
\[ H=1-h,\qquad C_0 = \frac{\epsilon}{H^2},\qquad C_1 = \frac{4}{h^4},\qquad C_2 = \frac{12}{h^4},\qquad C_3 = 6h^4 C_0,\qquad C_4 = C_3^{1/3},\qquad C_5 = \frac{C_4}{6}; \]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 penalty
\[\begin{split} p(x) = \epsilon\frac{x^2}{H^2} + \frac{1}{H^4} \begin{cases} (x+H)^4 & x < -1+h \\[1em] 0 & x\in[-H,H] \\[1em] (x-H)^4 & x > 1-h \end{cases} \end{split}\]where the parameters
\[ H=1-h,\qquad C_0 = \frac{\epsilon}{H^2},\qquad C_1 = \frac{4}{h^4},\qquad C_2 = \frac{12}{h^4},\qquad C_3 = 6h^4 C_0,\qquad C_4 = C_3^{1/3},\qquad C_5 = \frac{C_4}{6}; \]are precomputed after a call of method
setup
.
-
inline virtual real_type
solve
(real_type RHS) const override¶
-
Solve the problem \( p'(x) = r \)
By setting
\[ R = \frac{r}{2\epsilon},\qquad C_2 = 6\epsilon h^4,\qquad C_1 = (C_2)^{1/3},\qquad A = \left(\sqrt{C_2+(9(|R|-H))^2}+9(|R|-H)\right)^{1/3}, \]the solution is\[\begin{split} x = \mathrm{sign}(R) \begin{cases} |R| & |R| < H \\[1em] \frac{C_1}{6}\left(A-\frac{C_1}{A}\right)+H & \mathrm{otherwise} \end{cases} \end{split}\]
-
inline explicit