57 "The \"DYNAMIC\" command analyses a dynamic 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",
"DYNAMIC");
65 (
"ORDER",
"Order of the analysis; must be at least 2", 6.0);
92 std::ofstream os(file.c_str());
95 "Unable to open file \"" + file +
"\".");
108 os <<
"Accumulated map:\n" << map;
114 std::streamsize old_prec = os.precision(12);
115 os <<
"Fixed point:\n";
116 for(
int i = 0; i < 6; i++) {
117 os << std::setw(24) << fixedPoint[i];
119 os <<
"\nMap around fixed point:\n";
120 os << closedOrbitMap;
130 os <<
"\nEigenvalues of the linear map:\n";
132 for(
int i = 0; i < 6; i++) {
133 os << lambda[i] <<
'\n';
136 os <<
"\nFactorised Lie transformation script(N) for normal form map:\n"
139 os <<
"\nFactorised Lie Transformation script(A) for normalising map:\n"
144 os <<
"\nFractional tunes:\n";
145 for(
int mode = 0; mode < freedom; mode++) {
151 os <<
"\nExcitation constants:\n";
152 for(
int mode = 0; mode < freedom; mode++) {
153 os << std::setw(24) <<
log(std::norm(lambda[2*mode])) / 2.0;
160 os <<
"\nNormalised anharmonicites:\n";
162 for(
int mode1 = 1; mode1 <= freedom; mode1++) {
163 for(
int mode2 = mode1; mode2 <= freedom; mode2++) {
164 os <<
"dQ" << mode1 <<
"/dE" << mode2 <<
" = "
165 << std::setw(24) << QQ(mode1 - 1, mode2 - 1) <<
'\n';
171 for(
int mode = 1; mode <= freedom; mode++) {
172 os <<
"\nInvariant polynomial for mode " << mode <<
":\n"
177 os.precision(old_prec);
double Round(double value)
Round the double argument.
virtual void execute()
Execute the command.
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.
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.
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.
virtual Dynamic * clone(const std::string &name)
Make clone.
virtual void execute()
Apply the algorithm to the top-level beamline.
The base class for all OPAL beam lines and sequences.
Dynamic()
Exemplar constructor.
const PartData & getReference() const
Return the embedded CLASSIC PartData.
static void setGlobalTruncOrder(int order)
Set the global truncation order.
void dynamicFixedPoint(FVector< double, 2 *N > &fp, DragtFinnMap &map)
Compute dynamic fixed point.
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.
std::string getString(const Attribute &attr)
Get string value.