desc.particles.ManualParticleInitializerLab.init_particles
- ManualParticleInitializerLab.init_particles(model, field, **kwargs)Source
Initialize particles for a given trajectory model.
- Parameters:
model (AbstractTrajectoryModel) – Model to use for tracing particles, which defines the frame and velocity coordinates.
field (Equilibrium or _MagneticField) – Source of magnetic field to use for tracing particles.
kwargs (dict, optional) – source_grid for the magnetic field computation, if using a MagneticField object, can be passed as a keyword argument.
- Returns:
x0 (jax.Array, shape(N,D)) – Initial particle positions and velocities, where D is the dimensionality of the trajectory model, which includes 3D spatial dimensions and depending on the model, parallel velocity and total velocity. The initial positions are in the frame of the model.
args (jax.Array, shape(N,M)) – Additional arguments needed by the model, such as mass, charge, and magnetic moment (mv⊥²/2|B|) of each particle. M is the number of arguments requested by the model which is equal to len(model.args). N is the number of particles.