fronts.D.power_law

fronts.D.power_law(k, a=1.0, epsilon=0.0)

Return a power-law D function.

Given the scalars a, k and \(\varepsilon\), returns a function D defined as:

\[D(\theta) = a\theta^k + \varepsilon\]
Parameters:
  • k (float) – Exponent

  • a (float, optional) – Constant factor. The default is 1.

  • epsilon (float, optional) – \(\varepsilon\), the deviation term. The default is 0.

Returns:

D

Function to evaluate \(D\) and its derivatives:

  • D(theta) evaluates and returns \(D\) at theta

  • D(theta, 1) returns both the value of \(D\) and its first derivative at theta

  • D(theta, 2) returns the value of \(D\), its first derivative, and its second derivative at theta

In all cases, the argument theta may be a single float or a NumPy array.

Return type:

callable

Notes

Keep in mind that, depending on the parameters, the returned D does not necessarily map every value of \(\theta\) to a positive value.