Package xal.tools.beam.ens
Class Particle
java.lang.Object
xal.tools.beam.ens.Particle
- All Implemented Interfaces:
Serializable
Represents a particle in six-dimensional phase space.
- Author:
- CKAllen
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParticle()
Creates a new instance of ParticleParticle
(double q, double m, PhaseVector z) Creates a new instance of ParticleCreates a new instance, a deep copy, of this object -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Perform a deep copy of this particle objectelectricField
(R3 ptFld) Computes the Coulomb electric field of the particle at the given field point.electricField
(R3 ptFld, double radius) 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 radius) Computes electric potential assuming the particle was an uniform sphere of charge with radius R.double
Get charge of particledouble
getMass()
Get mass of particleGet the velocity vector of the particlegetPhase()
Get the entire (homogeneous) phase space coordinates of particleGet the position vector of the particlemagneticField
(R3 ptFld) Computes magnetic field assuming the particle is an uniform sphere of charge with radius R.magneticField
(R3 ptFld, double radius) Computes magnetic field assuming the particle is an uniform sphere of charge with radius R.void
print
(PrintWriter os) Print out the properties of this particle.void
setCharge
(double q) Set charge of particlevoid
setMass
(double m) Set mass of particlevoid
Set (homogeneous) phase space coordinates of particle
-
Field Details
-
FAC_ELEC
public static final double FAC_ELECCoefficient for electrical properties- See Also:
-
FAC_MAG
public static final double FAC_MAGCoefficient for magnetic properties- See Also:
-
-
Constructor Details
-
Particle
public Particle()Creates a new instance of Particle -
Particle
Creates a new instance of Particle- Parameters:
q
- particle chargem
- particle massz
- phase space coordinates (homogeneous coordinates)
-
Particle
Creates a new instance, a deep copy, of this object- Parameters:
p
- particle object to be deep copied
-
-
Method Details
-
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
Set (homogeneous) phase space coordinates of particle -
getCharge
public double getCharge()Get charge of particle -
getMass
public double getMass()Get mass of particle -
getPosition
Get the position vector of the particle -
getMomentum
Get the velocity vector of the particle -
getPhase
Get the entire (homogeneous) phase space coordinates of particle -
electricPotential
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 singularities 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
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 potentialradius
- radius of finite particle- Returns:
- electric potential of "smeared" particle at field point in volts
-
electricField
Computes the Coulomb electric field of the particle at the given field point. Note that very large fields exist sufficiently close to the particle. To avoid numerical singularities 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
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 fieldradius
- radius of finite particle- Returns:
- electric field vector of "smeared" particle in volts/meter
-
magneticField
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 fields exist sufficiently close to the particle. To avoid numerical singularities 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
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 fieldradius
- radius of finite particle- Returns:
- magnetic field vector of "smeared" particle in Amperes/Meter
-
print
Print out the properties of this particle.- Parameters:
os
- output stream receiving text description- Since:
- Apr 15, 2011
-