|
Graph Framework
|
A description of the integration methods for solving the ray equations.
This page documents the types of solver methods available. These solvers integrate the wave propagation equations to solve for the ray trajectory. Each solver builds expressions for the updates to \(\vec{x}\) and \(\vec{k}\). These expressions are used to build map kernels that can be iterated to integrate the ray equations. Available integrators are:
This solver only works when the system is separable. The conditions for separability are \(\frac{\partial\frac{\partial D}{\partial\vec{k}}}{\partial\vec{k}}\equiv 0 \) and \(\frac{\partial\frac{\partial D}{\partial\vec{x}}}{\partial\vec{x}}\equiv 0 \) If the equations are separable, the solver proceeds as
\begin{equation}\vec{x}_{h}=\vec{x}+\frac{dt}{2}\frac{\partial\vec{x}}{\partial t}\left(\vec{x},\vec{k},\omega\right)\end{equation}
Where \(\frac{\partial\vec{x}}{\partial t}\left(\vec{x},\vec{k},\omega\right)\) represents the equation of motion evaluated at the current \(\vec{x}\) and \(\vec{k}\). Using the half step \(\vec{x}_{h}\) we can update \(\vec{k}\).
\begin{equation}\vec{k}_{next}=k+dt\frac{\partial\vec{k}}{\partial t}\left(\vec{x}_{h},\vec{k},\omega\right)\end{equation}
Then we can take the remaining half step to update \(\vec{x}\).
\begin{equation}\vec{x}_{next}=\vec{x}_{h}+\frac{dt}{2}\frac{\partial\vec{x}}{\partial t}\left(\vec{x}_{h},\vec{k}_{next},\omega\right)\end{equation}
This solver integrates coupled differential equations using the Runge Kutta to second order. It starts by computing a sub-step for \(\vec{x}\) and \(\vec{k}\).
\begin{equation}\vec{x}_{1}=dt\frac{\partial\vec{x}}{\partial t}\left(\vec{x},\vec{k},\omega\right)\end{equation}
\begin{equation}\vec{k}_{1}=dt\frac{\partial\vec{k}}{\partial t}\left(\vec{x},\vec{k},\omega\right)\end{equation}
That sub-step is used to compute a second sub-step.
\begin{equation}\vec{x}_{2}=dt\frac{\partial\vec{x}}{\partial t}\left(\vec{x} + \vec{x}_{1},\vec{k} + \vec{k}_{1},\omega\right)\end{equation}
\begin{equation}\vec{k}_{2}=dt\frac{\partial\vec{k}}{\partial t}\left(\vec{x} + \vec{x}_{1},\vec{k} + \vec{k}_{1},\omega\right)\end{equation}
These sub-steps are combined into a single step update.
\begin{equation}\vec{x}_{next}=\vec{x}+\frac{\vec{x}_{1}+\vec{x}_{2}}{2}\end{equation}
\begin{equation}\vec{k}_{next}=\vec{k}+\frac{\vec{k}_{1}+\vec{k}_{2}}{2}\end{equation}
This solver integrates coupled differential equations using the Runge Kutta to fourth order. Like the second order Runge Kutta, this solver computes 4 sub-steps.
\begin{equation}\vec{x}_{1}=dt\frac{\partial\vec{x}}{\partial t}\left(\vec{x},\vec{k},\omega\right)\end{equation}
\begin{equation}\vec{k}_{1}=dt\frac{\partial\vec{k}}{\partial t}\left(\vec{x},\vec{k},\omega\right)\end{equation}
\begin{equation}\vec{x}_{2}=dt\frac{\partial\vec{x}}{\partial t}\left(\vec{x} + \frac{\vec{x}_{1}}{2},\vec{k} + \frac{\vec{k}_{1}}{2},\omega\right)\end{equation}
\begin{equation}\vec{k}_{2}=dt\frac{\partial\vec{k}}{\partial t}\left(\vec{x} + \frac{\vec{x}_{1}}{2},\vec{k} + \frac{\vec{k}_{1}}{2},\omega\right)\end{equation}
\begin{equation}\vec{x}_{3}=dt\frac{\partial\vec{x}}{\partial t}\left(\vec{x} + \frac{\vec{x}_{2}}{2},\vec{k} + \frac{\vec{k}_{2}}{2},\omega\right)\end{equation}
\begin{equation}\vec{k}_{3}=dt\frac{\partial\vec{k}}{\partial t}\left(\vec{x} + \frac{\vec{x}_{2}}{2},\vec{k} + \frac{\vec{k}_{2}}{2},\omega\right)\end{equation}
\begin{equation}\vec{x}_{4}=dt\frac{\partial\vec{x}}{\partial t}\left(\vec{x} + \vec{x}_{3},\vec{k} + \vec{k}_{3},\omega\right)\end{equation}
\begin{equation}\vec{k}_{4}=dt\frac{\partial\vec{k}}{\partial t}\left(\vec{x} + \vec{x}_{3},\vec{k} + \vec{k}_{3},\omega\right)\end{equation}
These sub-steps are combined into a single step update.
\begin{equation}\vec{x}_{next}=\vec{x}+\frac{\vec{x}_{1}+2\left(\vec{x}_{2}+\vec{x}_{3}\right)+\vec{x}_{4}}{6}\end{equation}
\begin{equation}\vec{k}_{next}=\vec{k}+\frac{\vec{k}_{1}+2\left(\vec{k}_{2}+\vec{x}_{3}\right)+\vec{x}_{4}}{6}\end{equation}
This method is an extension of the 4th Order Runge Kutta which adapts the step size to the solutions error. We define a loss function
\begin{equation}f_{loss}\left(dt,\lambda\right)=\frac{1}{dt}-\lambda D^{2}\end{equation}
We use a newton method to solve for \(dt \) and \(\lambda \) which minimize \(f_{loss}\). The new \(dt \) is then used in a standard 4th Order Runge Kutta iteration.
This section is intended for code developers and outlines how to create new solver methods. All solvers use the same solver::solver_interface interface. New solver models can be created from a subclass of solver::solver_interface or any other existing solver class and overloading class methods.
When a new solver method is subclassed from solver::solver_interface no methods need to be overloaded, Instead expressions for
must be created.