refraction_render.calcs.FermatEquationsCurve¶
-
class
refraction_render.calcs.
FermatEquationsCurve
(R0, f, args=())[source]¶ Bases:
refraction_render.calcs.euler_equations.FermatEquations
Solver for light ray in a 2D Polar geometry for \(n=n(s,y)\).
This object takes in three user defined functions: \(n(s,y), \frac{\partial n(s,y)}{\partial s}, \frac{\partial n(s,y)}{\partial y}\) and uses these functions to solve Fermat’s equations for the path of a light ray. Here \(s=R0 heta\) and \(y=r-R0\) in order to make this equation comparable to the Euclidian geometric.
-
__init__
(R0, f, args=())[source]¶ Intializes the FermatEquationsEuclid object.
- Parameters
- fcallable
function which returns the index of refraction and its gradient as a tuple: \(n(s,y),\frac{\partial n(x,y)}{\partial y},\frac{\partial n(s,y)}{\partial s}\).
- argsarray_like, optional
optional arguments which go into the functions.
Methods
__init__
(R0, f[, args])Intializes the FermatEquationsEuclid object.
solve_ivp
(a, b, y0, dy0, **kwargs)Solve initial value problem for light rays.
-
solve_ivp
(a, b, y0, dy0, **kwargs)¶ Solve initial value problem for light rays.
- Parameters
- ascalar
initial position for the solution of the ray’s path.
- bscalar
final position for the solution of the ray’s path.
- y0array_like of shape (n,)
initial position of the ray’s.
- dy0array_like of shape (n,)
initial derivative (with respect to the independent variable) of the ray’s trajectory.
- kwargsoptional
additional arguments to pass into solver, see scipy.integrate.solve_ivp for more details.
- Returns
- Bunch object with the following fields defined:
- tndarray, shape (n_points,)
Time points.
- yndarray, shape (n, n_points)
Values of the solution at t.
- solOdeSolution or None
Found solution as OdeSolution instance; None if dense_output was set to False.
- t_eventslist of ndarray or None
Contains for each event type a list of arrays at which an event of that type event was detected. None if events was None.
- nfevint
Number of evaluations of the right-hand side.
- njevint
Number of evaluations of the Jacobian.
- nluint
Number of LU decompositions.
- statusint
- Reason for algorithm termination:
-1: Integration step failed.
0: The solver successfully reached the end of tspan.
1: A termination event occurred.
- messagestring
Human-readable description of the termination reason.
- successbool
True if the solver reached the interval end or a termination event occurred (
status >= 0
).
Notes
The solver can solve the path of an arbitrary number of light rays in one function call however the format of the solutions has the y(x) positions stacked on top of the derivatives.
-