periastron_optimization_function ================================ .. py:function:: luminet.black_hole_math.periastron_optimization_function(p: float, ir_radius: float, ir_angle: float, bh_mass: float, incl: float, order: int = 0) -> float Cost function for the optimization of the periastron value. This function is optimized to find the periastron value that solves Equation 13 in cite:t:`Luminet1979`: .. math:: 4 M P - r (Q - P + 2 M) + r (Q - P + 6 M) \text{sn}^2 \left( \frac{\gamma}{2 \sqrt{P/Q}} + F(\zeta_{\infty}, k) \right) = 0 When the above equation is zero, the photon periastron value :math:`P` is correct. .. seealso:: :py:meth:`solve_for_periastron` to calculate the periastron of a photon orbit, given an accretion disk radius of origin :math:`R`. :Parameters: * **periastron** (*float*) -- Periastron distance * **ir_radius** (*float*) -- Radius in the black hole frame * **ir_angle** (*float*) -- Angle in the black hole frame * **bh_mass** (*float*) -- Black hole mass * **incl** (*float*) -- Inclination of the black hole * **order** (*int*) -- Order of the image. Default is :math:`0` (direct image). :returns: *float* -- Cost function value. Should be zero when the photon periastron value is correct.