Maths Directory

Only the integration and Funcs modules are used for the BES diagnostics. The first one contains some useful quadrature formulas and the second one contains some function for the computation of the solid angle.

Integration Module

FPSDP.Maths.Integration.integration_points(dim, meth, obj='', size=-1)[source]

Defines a few quadrature formula (in any number of dimension)

Parameters:
  • dim (int) – Dimension of the integration
  • obj (str) – Type of domain of integration (for dim>1, e.g. ‘disk’ )
  • meth (str) – Method of integration (e.g ‘GL4’ for Gauss-Legendre accuracy order 2)
  • size – Object describing the geometry of the problem (e.g. radius for a disk)
Returns:

Points and weights of the quadrature formula

Return type:

Named tuple (.pts and .w)

Funcs Module

simple math functions used for debugging and/or productive runs

FPSDP.Maths.Funcs.heuman(phi, m)[source]

Compute the Heuman’s lambda function

\(\Lambda_0 (\xi,k) = \frac{2}{\pi}\left[E(k)F(\xi,k') + K(k)E(\xi,k')- K(k)F(\xi,k')\right]\) where \(k' = \sqrt{(1-k^2)}\)

Parameters:
  • phi (np.array[N]) – The amplitude of the elliptic integrals
  • m (np.array[N]) – The parameter of the elliptic integrals
Returns:

Evaluation of the Heuman’s lambda function

Return type:

np.array[N]

FPSDP.Maths.Funcs.solid_angle_disk(pos, r)[source]

Compute the solid angle of a disk on/off-axis from the pos the center of the circle should be in (0,0,0)

\[\begin{split}\Omega = \left\{\begin{array}{lr} 2\pi-\frac{2L}{R_\text{max}}K(k)-\pi\Lambda_0(\xi,k) & r_0 < r_m \\ \phantom{2}\pi-\frac{2L}{R_\text{max}}K(k) & r_0 = r_m \\ \phantom{2\pi}-\frac{2L}{R_\text{max}}K(k)+\pi\Lambda_0(\xi,k) & r_0 > r_m \\ \end{array}\right.\end{split}\]

Read the paper of Paxton “Solid Angle Calculation for a Circular Disk” in 1959 for the exact computation.

Parameters:
  • pos (np.array[N,3]) – Position from which computing the solid angle
  • r (float) – Radius of the disk (the disk is centered in (0,0,0) and the perpendicular is along the z-axis)
Returns:

Solid angle for each positions

Return type:

np.array[N]

Runge-Kutta Module

FPSDP.Maths.RungeKutta.runge_kutta_explicit(order, alpha=None)[source]

Coefficient of the explicit Runge-Kutta methods.

Parameters:order (int) – Order of the Runge-Kutta method
Returns:Coefficient of the Butcher table
Return type:tuple(a,b,c)

Table Of Contents

Previous topic

Input and Output Directory

Next topic

Collisions and Plasma Simulations Directory

This Page