Package cnuphys.swim

Class SectorDerivative

java.lang.Object
cnuphys.swim.SectorDerivative
All Implemented Interfaces:
IDerivative

public class SectorDerivative extends Object implements IDerivative
Used for swimming in the sector system with a rotated composite field
Author:
heddle
  • Constructor Details

    • SectorDerivative

      public SectorDerivative(int sector, int charge, double momentum, RotatedCompositeProbe rcProbe)
      The derivative for swimming through a magnetic field
      Parameters:
      sector - the sector [1..6]
      charge - -1 for electron, +1 for proton, etc.
      momentum - the magnitude of the momentum.
      field - the magnetic field
  • Method Details

    • set

      public void set(int sector, int charge, double momentum, RotatedCompositeProbe rcProbe)
    • derivative

      public void derivative(double s, double[] Q, double[] dQds)
      Compute the derivatives given the value of s (path length) and the values of the state vector.
      Specified by:
      derivative in interface IDerivative
      Parameters:
      s - the value of the independent variable path length (input).
      Q - the values of the state vector ([x,y,z, px/p, py/p, pz/p]) at s (input).
      dydt - will be filled with the values of the derivatives at t (output).