57 "The \"STATIC\" command analyses a static transfer map.") {
59 (
"LINE",
"Name of the lattice to be analysed");
61 (
"BEAM",
"Name of the beam to be used");
63 (
"FILE",
"Name of the file to be written",
"STATIC");
65 (
"ORDER",
"Order of the analysis; must be at least 2", 2.0);
81 return new Static(name,
this);
92 std::ofstream os(file.c_str());
95 "Unable to open file \"" + file +
"\".");
106 std::cout <<
"mapper.execute(); start " <<
std::endl;
108 std::cout <<
"mapper.execute(); done " <<
std::endl;
111 os <<
"Accumulated map:\n" << map;
112 std::cout <<
"Accumulated map done " <<
std::endl;
115 std::streamsize old_prec = os.
precision(12);
123 os <<
"Fixed point:\n";
124 for(
int i = 0; i < 4; i++) {
125 os << std::setw(24) << fixedPoint[i];
127 os <<
"\nDispersion map:\n" << dispersionMap
128 <<
"\nMap with dispersion removed:\n" << map;
137 os <<
"\nEigenvalues of the linear map:\n";
139 for(
int i = 0; i < 4; i++) {
140 os << lambda[i] <<
'\n';
143 os <<
"\nFactorised Lie transformation script(N) for normal form map:\n"
146 os <<
"\nFactorised Lie Transformation script(A) for normalising map:\n"
151 os <<
"\nFractional tunes:\n";
152 for(
int mode = 0; mode < freedom; mode++) {
158 os <<
"\nExcitation constants:\n";
159 for(
int mode = 0; mode < freedom; mode++) {
160 os << std::setw(24) <<
log(std::norm(lambda[2*mode])) / 2.0;
167 os <<
"\nNormalised anharmonicites:\n";
169 for(
int mode1 = 1; mode1 <= freedom; mode1++) {
170 for(
int mode2 = mode1; mode2 <= freedom; mode2++) {
171 os <<
"dQ" << mode1 <<
"/dE" << mode2 <<
" = "
172 << std::setw(24) << QQ(mode1 - 1, mode2 - 1) <<
'\n';
177 for(
int mode = 1; mode <= freedom; mode++) {
178 os <<
"\nInvariant polynomial for mode " << mode <<
":\n"
185 os.precision(old_prec);
double Round(double value)
Round the double argument.
virtual Static * clone(const std::string &name)
Make clone.
Build a Lie-algebraic map using a finite-length lens for each elements.
MMatrix< m_complex > complex(MMatrix< double > real)
A templated representation for matrices.
The base class for all OPAL actions.
FLieGenerator< double, N > invariant(int i) const
Get invariant polynomial for mode i.
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
The base class for all OPAL exceptions.
constexpr double two_pi
The value of .
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
Tps< T > log(const Tps< T > &x)
Natural logarithm.
int degreesOfFreedom() const
Get number of stable degrees of freedom.
static BeamSequence * find(const std::string &name)
Find a BeamSequence by name.
virtual void execute()
Execute the command.
const DragtFinnMap< N > & normalisingMap() const
Get normalising map as a Lie transform.
Normal form of a truncated Taylor series map.
const FVector< std::complex< double >, 2 *N > & eigenValues() const
Get eigenvalues of the linear part as a complex vector.
void removeDispersion(DragtFinnMap &dm, DragtFinnMap &map)
Split map into dispersion map and non-dispersive part.
static Beam * find(const std::string &name)
Find named BEAM.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
FMatrix< double, N, N > anharmonicity() const
Get anharmonicities as a matrix.
virtual Beamline * fetchLine() const =0
Return the embedded CLASSIC beam line.
Static()
Exemplar constructor.
The base class for all OPAL beam lines and sequences.
const PartData & getReference() const
Return the embedded CLASSIC PartData.
void staticFixedPoint(FVector< double, 2 *N > &fp, DragtFinnMap &map)
Compute static fixed point.
static void setGlobalTruncOrder(int order)
Set the global truncation order.
double getReal(const Attribute &attr)
Return real value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
const DragtFinnMap< N > & normalForm() const
Get normal-form map as a Lie transform.
Inform & endl(Inform &inf)
std::string getString(const Attribute &attr)
Get string value.