tardis.transport.montecarlo.nonhomologous_grid module
- tardis.transport.montecarlo.nonhomologous_grid.depressed_quartic(leading_coefficient: float, cubic_coefficient: float, quadratic_coefficient: float, linear_coefficient: float, constant_coefficient: float) tuple[float, float, float, float][source]
Return the real roots of a quartic and NaN for complex roots.
The polynomial is normalized before it is depressed, then factored into two quadratics using a real solution of its resolvent cubic.
- Parameters:
- leading_coefficientfloat
Coefficient of the fourth-degree term.
- cubic_coefficientfloat
Coefficient of the third-degree term.
- quadratic_coefficientfloat
Coefficient of the second-degree term.
- linear_coefficientfloat
Coefficient of the first-degree term.
- constant_coefficientfloat
Constant term.
- Returns:
- tuple of float
Four real roots or NaN placeholders for non-real roots.
- tardis.transport.montecarlo.nonhomologous_grid.solve_resonance_quartic(line_velocity: float, impact_parameter_squared: float, velocity_intercept: float) tuple[float, float, float, float][source]
Solve the structured quartic for line-resonance ray coordinates.
A
projected_positionroot satisfies:(projected_position - line_velocity)**2 * ( projected_position**2 + impact_parameter_squared ) == velocity_intercept**2 * projected_position**2- Parameters:
- line_velocityfloat
Target line-resonance projected velocity, scaled by the shell velocity difference.
- impact_parameter_squaredfloat
Squared ray impact parameter, scaled by the squared shell width.
- velocity_interceptfloat
Intercept of the shell’s linear radial velocity law, scaled by the shell velocity difference.
- Returns:
- tuple of float
Four dimensionless signed ray-coordinate roots or NaN placeholders for non-real roots.