choreo.NBodySyst#
- class NBodySyst(Py_ssize_t geodim=2, Py_ssize_t nbody=2, double[::1] bodymass=None, double[::1] bodycharge=None, list Sym_list=[], inter_law=None, unicode inter_law_str=None, inter_law_param_dict=None, bool ForceGeneralSym=False, bool ForceGreaterNStore=False)#
This class defines a N-body system
Class Constructor
- __init__()
Defines a N-Body System.
See also
- Parameters:
geodim (
int
, optional) – Number of dimensions of ambiant space. Typically 2 or 3, but can be any positive integer. By default: 2.nbody (
int
, optional) – Number of bodies in the system, by default 2.bodymass (
numpy.ndarray
(shape = (nbody), dtype = np.float64)
, optional) – Masses of the bodies in the system, by defaultnumpy.ones
.bodycharge (
numpy.ndarray
(shape = (nbody), dtype = np.float64)
, optional) – Charges of the bodies, by defaultnumpy.ones
.Sym_list (
list
, optional) – List of a priori symmetries in the system, by default[]
.inter_law (optional) – Function defining the interaction law, by default
None
.inter_law_str (
str
, optional) – Description of the interaction law dictating the dynamics of the system, by defaultNone
.inter_law_param_dict (
dict
, optional) – Parameters pertaining to the interaction law, by defaultNone
.ForceGeneralSym (
bool
, optional) – Whether to force the symmetries to be treated in full generality when computing positions or velocities from parameters (and vice-versa, both in direct or adjoint mode), or to try an optimized route instead. Most users should leave this option to its default value, which isFalse
.ForceGreaterNStore (
bool
, optional) – Whether to force the number of stored segment positions to be increased, even though the symmetries might not require it. Most users should leave this option to its default value, which isFalse
.
Methods Summary
Sets the interaction law of the system.
Profiles the computation of the gradient of the action with respect to parameters.
Defines a N-Body System.
Allocates the buffer arrays used in
NBodySyst
depending on the value ofnint
andfft_backend
.Frees the memory allocated for the buffer arrays used in
NBodySyst
._summary_
Plots 2D trajectories with one color per body and saves image in file
Attributes
bool
Whether to force the rightmost integration point to be included in segments.bool
Whether the rightmost integration point is included in segments.bool
Whether the symmetry constraints require the rightmost integration point to be included in segments.str
Name of the FFT backend currently in use.object
object
'bool'
int
Dimension of ambient space.str
A description of the interaction lawint
Total number of binary interactions between segments.int
Number of unique binary interactions between segments.int
Number of bodies in system.int
Number of Fourier coefficients in each loop.int
The number of integration points per period.int
Half the size of a segment.int
Minimum number of integration points per period.int
Number of loops in system.int
Number of parameters.int
Number of parameters after removal of unnecessary parts of zero-indexed Fourier coefficients.int
Number of segments in system.int
Number of interacting positions in a segment.int
Number of stored positions in a segment.