field_force: Apply a vector field to particles

field_forceR Documentation

Apply a vector field to particles

Description

This force adjusts the velocity of particles based on a supplied vector field. The vector field can either be specified using x and y velocities, or angle and magnitude. Velocity adjustments are calculated based on a bilinear interpolation.

Training parameters

The following parameters defines the training of the force and can be passed along a call to wield()

  • x : A matrix giving the velocity in the x direction at each grid point

  • y : A matrix giving the velocity in the y direction at each grid point

  • angle : A matrix giving the direction of the velocity at each grid point. Will only be considered if x and y are missing.

  • vel : A single numeric or a matrix of the same dimensions as angle giving the magnitude of velocity at each grid point.

  • xlim : The coordinate span of the vector field in the x direction.

  • ylim : The coordinate span of the vector field in the y direction.

See Also

Other forces: center_force, collision_force, link_force, manybody_force, map_force, mean_force, random_force, reset_force, trap_force, x_force, y_force


thomasp85/particles documentation built on Sept. 1, 2022, 2:43 p.m.