Package org.scictrl.mp.orbitcorrect
Class DBMath
java.lang.Object
org.scictrl.mp.orbitcorrect.DBMath
This class was generated by a SmartGuide.
- Author:
- igor@scictrl.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTells to assamble whole matrix.static final doubleSpeed of light in vacum.static final doubleCharge of electron in As.static byteConstantK_CONVENTION=K_MADstatic final intConstantK_MAD=-1static final intConstantK_WILLE=1static final doublem*DBMath.C^2 where m is mass of electron.static final intTells to assamble matrix only elements concerning X axis.static final intTells to assamble matrix only elements concerning Z axis. -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidcheckDimension(double[][] matrix) checkDimension.static double[][]clone(double[][] m) Returns copy ofdouble[][]matrix.static doublecosh(double a) Returns the hyperbolic cosine ofdoublevalue.static voiddefocussing(double k, double length, double[][] m, int how) Assembles defocusing transfere matrix for magnet with quadrupole field.static voidfocussing(double k, double length, double[][] m, int how) Assambles focusing matrix for magnet with quadrupole momentum.static double[][]identity()Returns 5x5 dimensional identity matrix.static double[][]identity(double[][] m) Returns identity matrix.static double[][]makeBetaMatrix(double betaX, double betaZ, double alphaX, double alphaZ) Creates 5x5 matrix with beta function.static double[][]makeBetaMatrix(double betaX, double betaZ, double alphaX, double alphaZ, double[][] m) Creates 5x5 matrix with beta function.static double[][]makeBetaMatrix(PositionedData beta, PositionedData alpha) Creates 5x5 matrix with beta function.static double[][]makeDipole(double r, double length) Creates matrix representing bending magnet.static double[][]makeDipole(double r, double k, double length) Creates matrix representing bending magnet.static double[][]makeDipole(double r, double length, double[][] m) Creates matrix representing bending magnet.static double[][]makeDipole(double r, double k, double length, double[][] matrix) Creates matrix representing bending magnet.static double[]makeDispersionVector(double d, double dp) Creates 5x5 matrix with beta function.static double[]Creates 5x5 matrix with beta function.static double[][]makeDrift(double length) Creates matrix representing enpty drift space.static double[][]makeDrift(double length, double[][] matrix) Creates matrix representing enpty drift space.static double[][]makeQuadrupole(double k, double length) Creates matrix representing quadrupole magnet.static double[][]makeQuadrupole(double k, double length, double[][] matrix) Creates matrix representing quadrupole magnet.static double[][]makeWedge(double angle, double r) Creates 5x5 matrix representing wedge foccusing correction on rectangular bending magnet.static doublematrixPhase(double[][] m, double beta, double alpha, int which) Return calculated phase shift of transfer matrix.static double[]multiply(double[][] a, double[] x) Multiplies matrix and vector.static double[][]multiply(double[][] b, double[][] a) Multiplies two matrices.static double[][]multiply(double[][] b, double[][] a, double[][] c) Multiplies two matrices.static doublesinh(double a) Returns the hyperbolic sinus ofdoublevalue.static doublesqr(double a) Returns the sqare ofdoublevalue.static double[][]transpond(double[][] m) Returns transpnder matrix.
-
Field Details
-
X_PART
public static final int X_PARTTells to assamble matrix only elements concerning X axis.- See Also:
-
Z_PART
public static final int Z_PARTTells to assamble matrix only elements concerning Z axis.- See Also:
-
BOTH
public static final int BOTHTells to assamble whole matrix.- See Also:
-
CHARGE
public static final double CHARGECharge of electron in As.- See Also:
-
MC2
public static final double MC2m*DBMath.C^2 where m is mass of electron.- See Also:
-
C
public static final double CSpeed of light in vacum.- See Also:
-
K_MAD
public static final int K_MADConstantK_MAD=-1- See Also:
-
K_WILLE
public static final int K_WILLEConstantK_WILLE=1- See Also:
-
K_CONVENTION
public static byte K_CONVENTIONConstantK_CONVENTION=K_MAD
-
-
Method Details
-
checkDimension
checkDimension.
- Parameters:
matrix- an array ofobjectsinvalid reference
double- Throws:
ArrayIndexOutOfBoundsException- if any.
-
clone
public static double[][] clone(double[][] m) Returns copy ofdouble[][]matrix. All sub-arrays must be the same length.- Parameters:
m- adouble[][]matrix- Returns:
- the copy of argument
-
cosh
public static double cosh(double a) Returns the hyperbolic cosine ofdoublevalue.- Parameters:
a-doublevalue- Returns:
- the hyperbolic cosine of argument
-
defocussing
public static void defocussing(double k, double length, double[][] m, int how) Assembles defocusing transfere matrix for magnet with quadrupole field. Defocussing part is in upper left corner and focussing in bottom right.- Parameters:
k- thedoublequadrupole stength of magnetlength- thedoublelength of magnetm- thedouble[][]matrix to be editedhow- it specifies which part of quadrupole matrix is to be assembeled: RingMath.X_PART, RingMath.Z_PART, RingMath.BOTH
-
focussing
public static void focussing(double k, double length, double[][] m, int how) Assambles focusing matrix for magnet with quadrupole momentum. Docussing part is in upper left corner and defocussing in bottom right.- Parameters:
k- thedoublequadrupole stength of magnetlength- thedoublelength of magnetm- thedouble[5][5]matrix to be editedhow- it specifies which part of quadrupole matrix is to be assambeled: RingMath.X_PART, RingMath.Z_PART, RingMath.BOTH.
-
identity
public static double[][] identity()Returns 5x5 dimensional identity matrix.- Returns:
- the
double[5][5]identity matrix
-
identity
public static double[][] identity(double[][] m) Returns identity matrix.- Parameters:
m- an array ofobjectsinvalid reference
double- Returns:
- the identity matrix
-
makeBetaMatrix
public static double[][] makeBetaMatrix(double betaX, double betaZ, double alphaX, double alphaZ) Creates 5x5 matrix with beta function. Its used to transfer beta values throu system.- Parameters:
betaX- a doublebetaZ- a doublealphaX- a doublealphaZ- a double- Returns:
- the
double[5][5]beta matrix
-
makeBetaMatrix
public static double[][] makeBetaMatrix(double betaX, double betaZ, double alphaX, double alphaZ, double[][] m) Creates 5x5 matrix with beta function. Its used to transfer beta values throu system.- Parameters:
betaX- a doublebetaZ- a doublealphaX- a doublealphaZ- a doublem- an array ofobjectsinvalid reference
double- Returns:
- the
double[5][5]beta matrix
-
makeBetaMatrix
Creates 5x5 matrix with beta function. Its used to transfer beta values throu system.- Parameters:
beta- aPositionedDataobjectalpha- aPositionedDataobject- Returns:
- the
double[5][5]beta matrix
-
makeDipole
public static double[][] makeDipole(double r, double length) Creates matrix representing bending magnet.- Parameters:
r- a doublelength- a double- Returns:
- the
double[5][5]bending matrix
-
makeDipole
public static double[][] makeDipole(double r, double length, double[][] m) Creates matrix representing bending magnet.- Parameters:
r- a doublelength- a doublem- an array ofobjectsinvalid reference
double- Returns:
- the
double[5][5]bending matrix
-
makeDipole
public static double[][] makeDipole(double r, double k, double length) Creates matrix representing bending magnet.- Parameters:
r- a doublek- a doublelength- a double- Returns:
- the
double[5][5]bending matrix
-
makeDipole
public static double[][] makeDipole(double r, double k, double length, double[][] matrix) Creates matrix representing bending magnet.- Parameters:
r- a doublek- a doublelength- a doublematrix- an array ofobjectsinvalid reference
double- Returns:
- the
double[5][5]bending matrix
-
makeDispersionVector
public static double[] makeDispersionVector(double d, double dp) Creates 5x5 matrix with beta function. Its used to transfer beta values throu system.- Parameters:
d- a doubledp- a double- Returns:
- the
double[5][5]beta matrix
-
makeDispersionVector
Creates 5x5 matrix with beta function. Its used to transfer beta values throu system.- Parameters:
d- aDispersionDataobject- Returns:
- the
double[5][5]beta matrix
-
makeDrift
public static double[][] makeDrift(double length) Creates matrix representing enpty drift space.- Parameters:
length- a double- Returns:
- the
double[5][5]drift matrix
-
makeDrift
public static double[][] makeDrift(double length, double[][] matrix) Creates matrix representing enpty drift space.- Parameters:
length- a doublematrix- an array ofobjectsinvalid reference
double- Returns:
- the
double[5][5]drift matrix
-
makeQuadrupole
public static double[][] makeQuadrupole(double k, double length) Creates matrix representing quadrupole magnet.- Parameters:
k- a doublelength- a double- Returns:
- the
double[5][5]quadrupole matrix
-
makeQuadrupole
public static double[][] makeQuadrupole(double k, double length, double[][] matrix) Creates matrix representing quadrupole magnet.- Parameters:
k- a doublelength- a doublematrix- an array ofobjectsinvalid reference
double- Returns:
- the
double[5][5]quadrupole matrix
-
makeWedge
public static double[][] makeWedge(double angle, double r) Creates 5x5 matrix representing wedge foccusing correction on rectangular bending magnet. If dipole magnet is rectangular, it's matrix is multiplyed from left and right with this matrix.- Parameters:
angle- a doubler- a double- Returns:
- the
double[5][5]wedge focussing matrix
-
matrixPhase
public static double matrixPhase(double[][] m, double beta, double alpha, int which) Return calculated phase shift of transfer matrix.whichtells wich space axsis to calculate. Valid values areX_PARTandZ_PART.- Parameters:
m-double[5][5]transfer matrixbeta-doublebeta functionalpha-doubleoptical functionwhich- axsis to be calculated- Returns:
doublecalculated phase shift
-
multiply
public static double[][] multiply(double[][] b, double[][] a) Multiplies two matrices.bmatrix is multiplied withamatrix from right. Dimensions of matrices are not important, except the width ofbmust be the same as height ofamatrix.- Parameters:
b- the leftdouble[][]matrixa- the rightdouble[][]matrix- Returns:
double[][]product of b*a
-
multiply
public static double[][] multiply(double[][] b, double[][] a, double[][] c) Multiplies two matrices.bmatrix is multiplied withamatrix from right. Dimensions of matrices are not important, except the width ofbmust be the same as height ofamatrix.- Parameters:
b- the leftdouble[][]matrixa- the rightdouble[][]matrixc- resultdouble[][]matrix- Returns:
double[][]product of c=b*a
-
multiply
public static double[] multiply(double[][] a, double[] x) Multiplies matrix and vector.bmatrix is multiplied withavector from right. The width ofbmust be the same as length ofavector. Returned vector has the same length asbmatrix height.- Parameters:
a- the rightdouble[]vectorx- an array ofobjectsinvalid reference
double- Returns:
double[]vector product of b*a
-
sinh
public static double sinh(double a) Returns the hyperbolic sinus ofdoublevalue.- Parameters:
a-doublevalue- Returns:
- the hyperbolic sinus of argument
-
sqr
public static double sqr(double a) Returns the sqare ofdoublevalue.- Parameters:
a-doublevalue- Returns:
- the square of argument
-
transpond
public static double[][] transpond(double[][] m) Returns transpnder matrix.- Parameters:
m-double[][]argument matrix- Returns:
double[][]transponded matrix
-