choreo.NBodySyst#
- class NBodySyst#
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
Retrieve a pointer to ODE parameters definition
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
NBodySystdepending on the value ofnintandfft_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
Plots 2D trajectories with one color per body and saves image in file
Attributes
boolWhether to force the rightmost integration point to be included in segments.boolWhether the rightmost integration point is included in segments.boolWhether the symmetry constraints require the rightmost integration point to be included in segments.strName of the FFT backend currently in use.intDimension of ambient space.strA description of the interaction lawintTotal number of binary interactions between segments.intNumber of unique binary interactions between segments.intNumber of bodies in system.intNumber of Fourier coefficients in each loop.intThe number of integration points per period.intHalf the size of a segment.intMinimum number of integration points per period.intNumber of loops in system.intNumber of parameters.intNumber of parameters after removal of unnecessary parts of zero-indexed Fourier coefficients.intNumber of segments in system.intNumber of interacting positions in a segment.intNumber of stored positions in a segment.