Barrier

ipctk.barrier(d: float, dhat: float) float

Function that grows to infinity as d approaches 0 from the right.

\[b(d) = -(d-\hat{d})^2\ln\left(\frac{d}{\hat{d}}\right)\]
Parameters:
d: float

distance

dhat: float

activation distance of the barrier

Returns:

The value of the barrier function at d.

ipctk.barrier_gradient(d: float, dhat: float) float

Derivative of the barrier function.

\[b'(d) = (\hat{d}-d) \left( 2\ln\left( \frac{d}{\hat{d}} \right) - \frac{\hat{d}}{d} + 1\right)\]
Parameters:
d: float

distance

dhat: float

activation distance of the barrier

Returns:

The derivative of the barrier wrt d.

ipctk.barrier_hessian(d: float, dhat: float) float

Second derivative of the barrier function.

\[b''(d) = \left( \frac{\hat{d}}{d} + 2 \right) \frac{\hat{d}}{d} - 2\ln\left( \frac{d}{\hat{d}} \right) - 3\]
Parameters:
d: float

distance

dhat: float

activation distance of the barrier

Returns:

The second derivative of the barrier wrt d.


Last update: January 26, 2023