Package cnuphys.swim
Class DefaultDerivative
java.lang.Object
cnuphys.swim.DefaultDerivative
- All Implemented Interfaces:
IDerivative
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDerivative
(int charge, double momentum, FieldProbe field) The derivative for swimming through a magnetic field -
Method Summary
Modifier and TypeMethodDescriptionvoid
derivative
(double s, double[] u, double[] du) Compute the derivatives given the value of s (path length) and the values of the state vector.void
set
(int charge, double momentum, FieldProbe field)
-
Constructor Details
-
DefaultDerivative
The derivative for swimming through a magnetic field- Parameters:
charge
- -1 for electron, +1 for proton, etc.momentum
- the magnitude of the momentum.field
- the magnetic field
-
-
Method Details
-
set
-
derivative
public void derivative(double s, double[] u, double[] du) Compute the derivatives given the value of s (path length) and the values of the state vector.- Specified by:
derivative
in interfaceIDerivative
- Parameters:
s
- the value of the independent variable path length (input).u
- the values of the state vector ([x,y,z, tx = px/p, ty = py/p, tz = pz/p]) at s (input).du
- will be filled with the values of the derivatives at s (output).
-