Graph Framework
Loading...
Searching...
No Matches
Solvers

A discription of the integation methods for solving the ray equations.

Introduction

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:


Split Simplextic

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}


2nd Order Runge Kutta

This solver integates coupled differential equations using the Runge Kutta to second order. It starts by computing a substep 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 substep is used to compute a second substep.

\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 substeps 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}


4th Order Runge Kutta

This solver integates coupled differential equations using the Runge Kutta to fouth order. Like the second order Runge Kutta, this solver computes 4 substeps.

\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 substeps 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}


Adaptive 4th Order Runge Kutta

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.


Developing new solvers

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.

tempate<dispersion::function DISPERSION_FUNCTION>
class new_solver : public solver_interface<DISPERSION_FUNCTION> {
...
}

When a new solver method is subclassed from solver::solver_interface no methods need to be overloaded, Instead expressions for

must be created.