gov.sns.tools.beam.ens
Class Particle
java.lang.Object
|
+--gov.sns.tools.beam.ens.Particle
- All Implemented Interfaces:
- java.io.Serializable
- public class Particle
- extends java.lang.Object
- implements java.io.Serializable
- See Also:
- Serialized Form
|
Field Summary |
static double |
s_dblFacElec
Coefficient for electrical properties |
static double |
s_dblFacMag
Coefficient for magnetic properties |
|
Constructor Summary |
Particle()
Creates a new instance of Particle |
Particle(double q,
double m,
PhaseVector z)
Creates a new instance of Particle |
Particle(Particle p)
Creates a new instance, a deep copy, of this object |
|
Method Summary |
Particle |
copy()
Perform a deep copy of this particle object |
R3 |
electricField(R3 ptFld)
Computes the Coulomb electric field of the particle at the given field point. |
R3 |
electricField(R3 ptFld,
double R)
Computes electric field assuming the particle is an uniform sphere of
charge with radius R. |
double |
electricPotential(R3 ptFld)
Computes the Coulomb potential of the particle at the given field point. |
double |
electricPotential(R3 ptFld,
double R)
Computes electric potential assuming the particle was an uniform sphere of
charge with radius R. |
double |
getCharge()
Get charge of particle |
double |
getMass()
Get mass of particle |
R3 |
getMomentum()
Get the velocity vector of the particle |
PhaseVector |
getPhase()
Get the entire (homogeneous) phase space coordinates of particle |
R3 |
getPosition()
Get the position vector of the particle |
R3 |
magneticField(R3 ptFld)
Computes magnetic field assuming the particle is an uniform sphere of
charge with radius R. |
R3 |
magneticField(R3 ptFld,
double R)
Computes magnetic field assuming the particle is an uniform sphere of
charge with radius R. |
void |
print(java.io.PrintWriter os)
|
void |
setCharge(double q)
Set charge of particle |
void |
setMass(double m)
Set mass of particle |
void |
setPhase(PhaseVector z)
Set (homogeneous) phase space coordinates of particle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
s_dblFacElec
public static final double s_dblFacElec
- Coefficient for electrical properties
- See Also:
- Constant Field Values
s_dblFacMag
public static final double s_dblFacMag
- Coefficient for magnetic properties
- See Also:
- Constant Field Values
Particle
public Particle()
- Creates a new instance of Particle
Particle
public Particle(double q,
double m,
PhaseVector z)
- Creates a new instance of Particle
- Parameters:
q - particle chargem - particle massz - phase space coordinates (homogeneous coordinates)
Particle
public Particle(Particle p)
- Creates a new instance, a deep copy, of this object
- Parameters:
p - particle object to be deep copied
copy
public Particle copy()
- Perform a deep copy of this particle object
setMass
public void setMass(double m)
- Set mass of particle
setCharge
public void setCharge(double q)
- Set charge of particle
setPhase
public void setPhase(PhaseVector z)
- Set (homogeneous) phase space coordinates of particle
getCharge
public double getCharge()
- Get charge of particle
getMass
public double getMass()
- Get mass of particle
getPosition
public R3 getPosition()
- Get the position vector of the particle
getMomentum
public R3 getMomentum()
- Get the velocity vector of the particle
getPhase
public PhaseVector getPhase()
- Get the entire (homogeneous) phase space coordinates of particle
electricPotential
public double electricPotential(R3 ptFld)
- Computes the Coulomb potential of the particle at the given field point.
Note that very large potential exist sufficiently close to the particle.
To avoid numerical singularites the particle is assumed to have a finite
radius equal to the "classical proton radius", which is ~1e-18. Thus, the
potential of a uniform sphere is substituted for field points closer than
this radius.
- Parameters:
ptFld - field point to evaluate the potential
- Returns:
- the coulomb potential in volts
electricPotential
public double electricPotential(R3 ptFld,
double R)
- Computes electric potential assuming the particle was an uniform sphere of
charge with radius R. Giving the particle a finite size removes the singularity
in the potential at the particle position.
This function is also useful in averaging the potential over grids. By giving the
radius the same order as the grid dimensions, the particle appears to smear over
the grid. That is, the radius is a numerical tuning parameter for averaging.
- Parameters:
ptFld - field point to evaluate the potentialR - radius of finite particle
- Returns:
- electric potential of "smeared" particle at field point in volts
electricField
public R3 electricField(R3 ptFld)
- Computes the Coulomb electric field of the particle at the given field point.
Note that very large fiels exist sufficiently close to the particle.
To avoid numerical singularites the particle is assumed to have a finite
radius equal to the "classical proton radius", which is ~1e-18. Thus, the
field of a uniform sphere is substituted for field points closer than
this radius.
- Parameters:
ptFld - field point to evaluate the potential
- Returns:
- electric field vector in volts/meter
electricField
public R3 electricField(R3 ptFld,
double R)
- Computes electric field assuming the particle is an uniform sphere of
charge with radius R. Giving the particle a finite size removes the singularity
in the field at the particle position.
This function is also useful in averaging the field over grids. By giving the
radius the same order as the grid dimensions, the particle appears to smear over
the grid. That is, the radius is a numerical tuning parameter for averaging.
- Parameters:
ptFld - field point to evaluate the electric fieldR - radius of finite particle
- Returns:
- electric field vector of "smeared" particle in volts/meter
magneticField
public R3 magneticField(R3 ptFld)
- Computes magnetic field assuming the particle is an uniform sphere of
charge with radius R. Note that we compute magnetic field H, and not the
magnetic flux vector B. Giving the particle a finite size removes the singularity
in the field at the particle position. Note that very large fiels exist sufficiently
close to the particle.
To avoid numerical singularites the particle is assumed to have a finite
radius equal to the "classical proton radius", which is ~1e-18. Thus, the
field of a uniform sphere is substituted for field points closer than
this radius.
Note that if the momentum coordinates of the particle's phase space vector are
(x',y',z') then the returned field must be multiplied by beta-c, since the
mechanical momentum coordinates are assumed in the field calculations.
- Parameters:
ptFld - field point to evaluate the electric field
- Returns:
- magnetic field vector of "smeared" particle in Amperes/Meter
magneticField
public R3 magneticField(R3 ptFld,
double R)
- Computes magnetic field assuming the particle is an uniform sphere of
charge with radius R. Note that we compute magnetic field H, and not the
magnetic flux vector B. Giving the particle a finite size removes the singularity
in the field at the particle position.
Note that if the momentum coordinates of the particle's phase space vector are
(x',y',z') then the returned field must be multiplied by beta-c, since the
mechanical momentum coordinates are assumed in the field calculations.
This function is also useful in averaging the field over grids. By giving the
radius the same order as the grid dimensions, the particle appears to smear over
the grid. That is, the radius is a numerical tuning parameter for averaging.
- Parameters:
ptFld - field point to evaluate the electric fieldR - radius of finite particle
- Returns:
- magnetic field vector of "smeared" particle in Amperes/Meter
print
public void print(java.io.PrintWriter os)