pyoculus.maps.standard_map
standard_map.py
Pyoculus implementation of the standard map with automatic differentiation
The map is ‘raised’ so that the identity mapping takes place at p=0.5
Functions
return a pure (jax-transformable) function for the t-times applied map Used to automatically differentiate the map and get the gradients |
|
|
Pyoculus implementation of the standard map with automatic differentiation |
|
Inverse of the Tokamap as described in: Balescu, Radu, Mǎdǎlina Vlad, and F. |
- pyoculus.maps.standard_map.standardmap_f_pure(y, k)
Pyoculus implementation of the standard map with automatic differentiation
The map is ‘raised’ so that the identity mapping takes place at p=0.5
- pyoculus.maps.standard_map.standardmap_frev_pure(y, k)
Inverse of the Tokamap as described in: Balescu, Radu, Mǎdǎlina Vlad, and F. Spineanu. “Tokamap: A Hamiltonian twist map for magnetic field lines in a toroidal geometry.” Physical Review E 58.1 (1998): 951.
The theta funtion is not directly invertible, so a simple Newtons method with analytical derivatives is used to solve for the inverse.
with W(psi) the winding function monotonically increasing from w up.
- pyoculus.maps.standard_map.return_f_t_pure(t)
return a pure (jax-transformable) function for the t-times applied map Used to automatically differentiate the map and get the gradients
Note that for reverse mappings, we have to differentiate through a Newtons iteration, so the accuracy is probably bad.
- class pyoculus.maps.standard_map.StandardMap(K=0, w=0.666)
two-dimensional iterated map described in: Balescu, Radu, Mǎdǎlina Vlad, and F. Spineanu. “Tokamap: A Hamiltonian twist map for magnetic field lines in a toroidal geometry.” Physical Review E 58.1 (1998): 951.
This is a map that is slightly more complex than the standard map or the nontwist map, but is a two-dimensional iterated map for which it is easier to define the (monotonic) twist profile or safety factor profile.
- f(t, y0)
This method represents the mapping function. It takes a point \(y_0\) in the domain and returns its image under \(t\) application of the map.
- Parameters:
t (float or int) – The number of times the map is applied.
y0 (array) – The initial point in the phase space.
- df(t, y0)
Computes the Jacobian matrix of the map at \(y_0\) after \(t\) applications \(df^t = (\frac{\partial f^t}{\partial x})_{i,j}\).
Uses a cache to avoid re-creating and re-compiling functions.