forked from MethodicalAcceleratorDesign/MAD-X-User-Manual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ptc-twiss.tex
564 lines (464 loc) · 23.6 KB
/
ptc-twiss.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
%%\title{MAD-X PTC\_TWISS Module}
% Created by: Valery KAPIN, 21-Mar-2006
% Changed by: Frank Schmidt 04-Apr-2006
% \href{mailto:[email protected]}{ V.Kapin}(ITEP) and
% \href{mailto:[email protected]}{ F.Schmidt}, March 2006
% Changed by: Piotr and Ghislain 24-Jan-2014
\chapter{Ripken Optics Parameters}
\label{chap:ptc-twiss}
\section{Introduction}
The \textbf{PTC\_TWISS module}\cite{schmidt2005} of \madx is
based on the \ptc code and is supplementary to the
\hyperref[chap:twiss]{\texttt{TWISS}} module of \madx.
In \texttt{PTC\_TWISS} the Twiss parameters are calculated according to
the formalism of G.~Ripken, developped in \cite{Ripken1970} and
most accessible in \cite{Ripken1988}.
%% These parameters were available in MAD8 using the TWISS3 command. This
%% module is a typical example of the advantages when using PTC and its
%% Normal Form technique (and of course the object-oriented Fortran90
%% coding): once the rather modest programming has been performed the Twiss
%% calculation will always be automatically correct for all machine
%% conditions like closed orbit, coupling or after a new element has been
%% introduced into the code. In a traditional coding like in MAD8 this
%% depends on reprogramming and modifying the code at various places which
%% is inherently error-prone.
\texttt{PTC\_TWISS} tracks a special representation of the beam in three
degrees of freedom. It works on the coupled lattice functions which are
essentially the projections of the lattice functions for the eigen-modes
on the three planes.
\texttt{PTC\_TWISS} lists the projections of the ellipses of motion onto
the three planes ($x$, $p_x$), ($y$, $p_y$), ($t$, $p_t$) expressed via
Ripken's parameters $b_{k,j}$, $a_{k,j}$, $g_{k,j}$ along with the phase
advances $m_j$ in selected positions, where index $k=1 ... 3$ refers to
the plane ($x$, $y$, ...), and the index $j= 1 ... 3$ denotes the
eigen-mode.
The \texttt{PTC\_TWISS} command also calculates the dispersion values
$D_1$, ... ,$D_4$.
In \madx commands and tables, these parameters are denoted as
\texttt{beta11, ..., beta33}, \texttt{alfa11, ..., alfa33},
\texttt{gama11, ..., gama33}, \texttt{mu1, ..., mu3},
\texttt{disp1, ..., disp4}, respectively.
The Ripken parametrization can be transformed into the Edwards-Teng
parametrization (used in the module
\hyperref[chap:twiss]{\texttt{TWISS}} of \madx) using the formulae of
Lebedev \cite{lebedev2010}.
The parameters are noted as \texttt{betx, bety, alfx, alfy} and the
coupling matrix: \texttt{R11, R12, R21} and \texttt{R22}. In absence of
coupling, the following holds: \texttt{betx = beta11}, \texttt{bety = beta22},
\texttt{alfx = alfa11} and \texttt{alfy = alfa22}.
\texttt{PTC\_TWISS} can also compute the $\Delta p/p_0$
(or $\Delta E/p_0 c$ if time=TRUE) dependency
of the Twiss parameters. The column names \texttt{beta11p, ..., beta33p,
alfa11p, ..., alfa33p, gama11p, ..., gama33p} denote the derivatives of
the optics parameters with respect to $\Delta p/p_0$ (or $\Delta E/p_0 c$ if time=TRUE).
In order to evaluate the $\Delta p/p_0$-dependency of the Twiss parameters,
the order (\texttt{NO}) of the map must set to at least 2.
The derivatives of the dispersion with respect to $\Delta p/p_0$
(or $\Delta E/p_0 c$ if time=TRUE)
have column names: \texttt{disp1p, ..., disp4p}.
Second and third order derivatives have respective column names:
\texttt{disp1p2, ..., disp4p2} for the second order, and
\texttt{disp1p3, ..., disp4p3} for the third order.
In addition, \ptc computes the momentum compaction factor $\alpha_c$ (\texttt{ALPHA\_C}) and time
slip factor $\eta_c$. Higher order derivatives of compaction factor
with respect to $\Delta p/p_0$ up to urder 4 (\texttt{ALPHA\_C\_P}, \texttt{ALPHA\_C\_P2} and \texttt{ALPHA\_C\_P3})
are computed f \texttt{ICASE=56} and \texttt{time=false}, prividing the order of
calculation as defined by \texttt{NO} switch is high enough.
The values appear in the header of the \texttt{PTC\_TWISS} output file,
and a value of -1000000 means the value has not been computed.
%This feature is currently only available in the development
%version. \\
%\textbf{[To be checked]}
For clarification: in the 4-D case, there is the following
correspondence between MAD-X and the Ripken's notations:
\texttt{beta11} $\equiv \beta_{xI}$,
\texttt{beta12} $\equiv \beta_{xII}$,
\texttt{beta21} $\equiv \beta_{yI}$,
\texttt{beta22} $\equiv \beta_{yII}$.
In the uncoupled 4-D case, \texttt{beta11} is the same as the
classical $\beta_x$ (\texttt{betx}) and \texttt{beta22} is $\beta_y$
(\texttt{bety}), while \texttt{beta12} and \texttt{beta21} are zero.
in the coupled case all \texttt{betaNN} are non-zero and \texttt{beta11},
\texttt{beta22} are distinctively different from $\beta_x$, $\beta_y$,
respectively.
\texttt{PTC\_TWISS} also tracks the eigenvectors and prints them to Twiss table
according to the \hyperref[sec:select]{\texttt{SELECT}} command with
\texttt{FLAG=ptc\_twiss}.
Either all 36 components or particular components of the eigenvectors
can be selected with \texttt{EIGN} or \texttt{EIGNij}, respectively
(\texttt{j} = number of eigenvector, \texttt{i} = number of coordinate
\{$x$, $p_x$, $y$, $p_y$, $t$, $p_t$\}).
For ring lattices, \texttt{PTC\_TWISS} computes momentum compaction, transition
energy, as well as other one-turn characteristics such as the tunes
(Q1, Q2 and if \texttt{ICASE=6} with cavity, Qs) and chromaticities (for
\texttt{NO}$\geq 2$).
\textbf{Synopsis:}
\madxmp{
PTC\_CREATE\_UNIVERSE; \\
PTC\_CREATE\_LAYOUT, MODEL=integer, METHOD=integer, NST=integer, [EXACT]; \\
...\\
SELECT, FLAG=ptc\_twiss, CLEAR; \\
SELECT, \=FLAG=ptc\_twiss, COLUMN=name, s, \\
\>beta11,...,beta33, alfa11,...,alfa33, gama11,...,gama33, \\
\>beta11p,...,beta33p, alfa11p,...,alfa33p, gama11p,...,gama33p, \\
\>mu1,...,mu3, \\
\>disp1,...,disp4, disp1p,...,disp4p, \\
\>disp1p2,...,disp4p2, disp1p3,...,disp4p3, \\
\>[eign], eign11,...,eign16,...,eign61,...,eign66; \\
...\\
PTC\_TWISS; \\
...\\
PTC\_END;
}
\section{PTC\_TWISS}
\label{sec:ptc-twiss}
The \texttt{PTC\_TWISS} command causes computation of the Twiss
parameters in Ripken's style. It operates on the working beam line
defined in the latest \hyperref[sec:use]{\texttt{USE}} command.
Applications for the \texttt{PTC\_TWISS} command are similar to the
\hyperref[chap:twiss]{\texttt{TWISS}} command of \madx.
The \texttt{PTC\_TWIS}S can be applied to two basic tasks. It can calculate either a
\hyperref[sec:ptc-twiss-periodic]{periodic solution} or a
\hyperref[sec:ptc-twiss-sol-initial-cond]{solution with initial conditions}.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, \\
\>CLOSED\_ORBIT=logical, DELTAP\_DEPENDENCY=logical, \\
\>SLICE\_MAGNETS=logical, \\
\>RANGE=string, FILE[=filename], TABLE[=tabname], \\
\>INITIAL\_MATRIX\_TABLE=logical, INITIAL\_MATRIX\_MANUAL=logical, \\
\>INITIAL\_MAP\_MANUAL=logical, BETA0=string, MAPTABLE=logical, \\
\>IGNORE\_MAP\_ORBIT=logical, RING\_PARAMETERS=logical, \\
\>NORMAL=logical, TRACKRDTS=logical,\\
\>BETX=real, ALFX=real, MUX=real, \\
\>BETY=real, ALFY=real, MUY=real, \\
\>BETZ=real, ALFZ=real, \\
\>DX=real, DPX=real, DY=real, DPY=real, \\
\>X=real, PX=real, Y=real, PY=real, T=real, PT=real, \\
\>RE11=real, RE12=real, \ldots , RE16=real, \\
\>... \\
\>RE61=real, RE62=real, \ldots , RE66=real;
}
The attributes are:
\begin{madlist}
\ttitem{ICASE}
the dimensionality of the phase-space (4, 5 or
6). (Default:~4)\\ Note that \texttt{ICASE} is internally set to 56 when
attempting to set \texttt{ICASE=6} with no cavity, and \texttt{ICASE} is
internally set to 4 when attempting to set \texttt{ICASE=6} with an RF
cavity with zero voltage.
\ttitem{NO}
the order of the map. (Default:~1)\\ For evaluating the
derivatives of the Twiss parameter w.r.t. $\Delta p/p_0$, e.g. for
evaluating the chromaticities, the order must be at least equal to 2.
\ttitem{DELTAP}
relative momentum offset for reference closed orbit. (Default:~0.0)
\ttitem{CLOSED\_ORBIT}
a logical switch to trigger the closed orbit calculation
(applies to \hyperref[sec:ptc-twiss-periodic]{periodic solution} ONLY). \\
(Default: false)
\ttitem{DELTAP\_DEPENDENCY}
a logical switch to trigger the computation of the Twiss and
dispersion derivatives w.r.t. $\Delta p/p_0$. Derivation formula assume that
\texttt{ICASE $\ge$ 5}, so that $\Delta p/p_0$ is supplied as a parameter. \\
(Default: false)
\ttitem{SLICE\_MAGNETS}
%% the switch to turn on the evaluation of Twiss
%% parameters at each thin slice inside successive magnets, instead of at
%% the middle of each magnet. Slices are located at the so-called
%% 'integration nodes' determined by the number of steps (nst) selected
%% when creating the PTC layout. Note that extremities and fringes are
%% skipped, whereas only the inner slices are kept.
a logical switch to activate the evaluation of Twiss parameters at each
integration step inside magnets, in addition to the end face. The
number of slices is determined by the number of steps (\texttt{NST}) that
can be separately defined for each element, or otherwise set by
\texttt{NST} parameter when creating the PTC layout. Note that the
orbit rms calculated in this mode counts as valid data points both
the end of the previous element and the entrance of the current
element. Since the first integration node is always at the entrance of
the magnet (after position offset and fringe effects are calculated)
which corresponds to the same s position (and usually optical
functions) as the end of the previous element, the points at the
interface between magnets are included twice in the rms calculation. \\
(Default: false)
\ttitem{CENTER\_MAGNETS}
a logical switch to activate the evaluation of Twiss
parameters at the middle of each magnet. This relies on internal slicing
and 'integration nodes' as determined by the number of steps (\texttt{NST})
selected when creating the PTC layout. This number is assumed to be even
otherwise the program issues a warning. \\
(Default: false)
\ttitem{FILE}
if the \texttt{FILE} attribute is omitted, no output is
written to file. \\ If the \texttt{FILE} attribute name is present, the
optional attribute value argument is the name of the file for printing
the \texttt{PTC\_TWISS} output. The default file name is
"ptc\_twiss". \\
(Default: false)
\ttitem{TABLE}
if the \texttt{TABLE} attribute is omitted, no output is
written to an internal table. \\ If the \texttt{TABLE} attribute name is
present, the optional attribute value argument is the name of the
internal table for \texttt{PTC\_TWISS} variables. The default table name
is "ptc\_twiss". \\
(Default: false)
\ttitem{SUMMARY\_FILE}
if the \texttt{SUMMARY\_FILE} attribute is omitted, no summary output is
written to file. \\
If the \texttt{SUMMARY\_FILE} attribute name is present, the optional
attribute value argument is the name of the file for printing the
\texttt{PTC\_TWISS\_SUMMARY} table output. The default file name is
"ptc\_twiss\_summary". \\
(Default: false)
\ttitem{SUMMARY\_TABLE}
if the \texttt{SUMMARY\_TABLE} attribute is omitted, no summary output is
written to an internal table. \\
If the \texttt{SUMMARY\_TABLE} attribute name is present, the optional
attribute value argument is the name of the internal summary table for
\texttt{PTC\_TWISS\_SUMMARY} variables. The default table name is
"ptc\_twiss\_summary". \\
(Default: false)
\ttitem{RANGE}
a string in \hyperref[sec:range]{\texttt{RANGE}} format that
specifies a segment of beam-line for the \texttt{PTC\_TWISS}
calculation. \\
(Default: $\#S/\#E$)
\ttitem{INITIAL\_MATRIX\_TABLE}
a logical flag to trigger the reading of the transfer map from table
named "map\_table" created by a preceding \texttt{PTC\_TWISS} or
\texttt{PTC\_NORMAL} command. The table can be also read
before hand from files using a \hyperref[sec:readtable]{\texttt{READTABLE}}
command.\\
(Default: false)
\ttitem{INITIAL\_MATRIX\_MANUAL}
a logical flag to trigger the use of the input variables \texttt{RE11,
\ldots ,RE66} as the transfer matrix. \\
(Default: false)
\ttitem{RE11,..., RE66}
values of the $6\times 6$ transfer matrix. \\
(Default: $6\times 6$ unit matrix)
\ttitem{INITIAL\_MAP\_MANUAL}
a logical flag to trigger the use of an input map stored beforehand in
file "fort.18", e.g. by a previous initial run of
\hyperref[chap:ptc-normal]{\texttt{PTC\_NORMAL}}). \\
(Default: false)
\ttitem{IGNORE\_MAP\_ORBIT}
a logical flag to ignore the orbit in the map and use the closed orbit
instead if requested, or the orbit defined by the starting point
specified with \texttt{X, PX, Y, P, T, DT} parameters otherwise. \\
(Default: false)
\ttitem{BETA0}
the name of a \texttt{BETA0} block containing the Twiss
parameters to be used as input. When \texttt{ICASE=6} or \texttt{ICASE=56},
this information must be complemented by supplying a value for \texttt{BETZ} on the
\texttt{PTC\_TWISS} command line. \\
(Default: beta0)
\ttitem{MAPTABLE}
a logical flag to save the one-turn-map to table
"map\_table". The one-turn-map can then be used as starting condition
for a subsequent \texttt{PTC\_TWISS}, see \texttt{INITIAL\_MATRIX\_TABLE}
parameter above. \\ (Default: false)
\ttitem{BETX, ALFX, MUX, BETY, ALFY, MUY, BETZ, ALFZ, DX, DPX, DY, DPY} : \\
Edwards and Teng \cite{edwards1973}
\hyperref[chap:twiss]{Twiss and dispersion} parameters:
$\beta_{x,y,z}$, $\alpha_{x,y,z}$, $\mu_{x,y}$, $D_{x,y}$, $D_{px,py}$.\\
(Default: 0)
\ttitem{RING\_PARAMETERS} a logical flag to force computation of ring
parameters ($\gamma_{tr}$, $\alpha_c$, etc.). \\
(Default: false)
\ttitem{X, PX, Y, PY, T, PT} the
\hyperref[subsec:tables-canon]{canonical} coordinates of the initial
orbit. \\ (Default: 0.0) \\
\ttitem{NORMAL} a logical flag that triggers saving of the normal form analysis results
(the closed solution) into dedicated table called \texttt{NONLIN}. It is the same as \texttt{ptc\_normal}.
However, the nonlin table has format such that its coefficients can be accessed within the MADX script using
\texttt{table} command. This permits, for example, to perform matching of these parameters or or value extraction to a variable.
Also, all available orders are calculated and
no \texttt{select\_ptc\_normal} is required.
Currently the following parameters are calculated: tunes (and all their derivatives),
dipsersions (and all their derivatives), eigen values, transfer map,
resonance driving terms (generating function) and the pseudo Hamiltonian.
If radiation and envelope is switched on with \hyperref[sec:ptc-setswitch]{\texttt{PTC\_SETSWITCH}}
then damping decrements, equilibrium emittances and beam sizes are calculated.
Attention: the results are always the plain polynomial coefficients,
which is different from \texttt{ptc\_normal} nomenclature for some variables,
which in turn always gives values of the partial derivatives.
Therefore, in order to obtain values of the partial derivatives the respective factorials
and binomial coefficients need to be factored out by the user.
Also, if TIME=true the chromatic variables are NOT transformed into usual $\Delta p/p_0$ dependence
and in this case they are related to $\Delta E/p_0 c$. For example, dispersions and chormaticities will be
different by relativistic beta factor. Similarly, the T coordinate is time times the speed of light
instead of path length times the speed of light.
\ttitem{TRACKRDTS} a logical flag that triggers tracking of Resonance Driving Terms (RDTs).
For each element all RDTs from order 3 up to value defined by switch \texttt{NO} are saved
in \texttt{TWISSRDT} table.
This table contains also auxiliary columns as s position, element names, strengths and lengths
such that RDT values can be plotted the same way as values from \texttt{TWISS} table.
RDTs are elements of the generating function (GFN) of the normalization transformation
and for compatibility with \texttt{PTC\_NORMAL} notation the columns are prefixed with GNF.
Because they are complex numbers 3 values are saved: real part (GNFC), imaginary part (GNFS) and amplitude (GNFA).
For example, RDT $f_{300000}$ will be saved in columns
\texttt{GNFC\_3\_0\_0\_0\_0\_0}, \texttt{GNFS\_3\_0\_0\_0\_0\_0} and \texttt{GNFA\_3\_0\_0\_0\_0\_0}.
Currently the indexes can be only single digit numbers.
If amplitude of an RDT is smaller than 1e-12, it is saved as zero.
RDTs that have zero amplitude for all elements are not saved in the table.
\end{madlist}
\section{Periodic Solution}
\label{sec:ptc-twiss-periodic}
This is the simplest form of the \texttt{PTC\_TWISS} command, which
computes the periodic solution for a specified beam line. It may
accept all basic attributes described in
\hyperref[sec:ptc-twiss]{\texttt{PTC\_TWISS}} above.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, CLOSED\_ORBIT=logical,\\
\>RANGE=string, FILE[=string], TABLE[=string];
}
\section{Evaluation of Twiss parameters inside magnets}
\label{sec:ptc-twiss-slicing}
This computes the periodic solution for a specified beam
line and evaluates the Twiss parameters at each thin-slice
(a.k.a "integration-node") inside magnets. The number of such
integration-nodes is given by the number of steps (\texttt{NST})
selected when creating the \ptc layout. All other basic
attributes described in \hyperref[sec:ptc-twiss]{\texttt{PTC\_TWISS}}
above may be selected.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, CLOSED\_ORBIT=logical,\\
\>RANGE=string, FILE[=string], TABLE[=string],\\
\>SLICE\_MAGNETS=logical;
}
\textbf{Example:} \\
An example is found in the
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/SliceMagnets/}
{\texttt{PTC\_TWISS} Examples} repository.
\section{Solution with Initial Conditions}
\label{sec:ptc-twiss-sol-initial-cond}
Initial conditions can be supplied in different ways. Naturally only
one of the methods below can be used at a time, and they can not be
mixed. In this mode it is assumed that the lattice is a line and no
ring parameters are evaluated (their values are set to -1000000), unless
\texttt{RING\_PARAMETERS=true}, which forces computation of closed solution
for the resulting map. If a closed solution does not exist, \ptc
reports an error and exits.
The following logic is programmed in \ptc to identify the source of
initial conditions:
\madbox{
xxxxxxxx\=xx\= \kill
IF \>( \=INITIAL\_MATRIX\_TABLE=true \&\& (a map-table exists)) THEN \\
\> \>use \hyperref[subsec:from-map-table]{initial values from a Map-Table}\\
\\
ELSEIF \>( \>INITIAL\_MAP\_MANUAL=true ) THEN \\
\> \>use \hyperref[subsec:from-map-file]{initial values from a Given Map File}\\
\\
ELSEIF \>( \>INITIAL\_MATRIX\_MANUAL=true ) THEN \\
\> \>use \hyperref[subsec:from-given-matrix]{initial values from a Given Matrix}\\
\\
ELSEIF \>( \>BETA0 block is given ) THEN \\
\> \>use \hyperref[subsec:from-beta0-block]{initial values from a BETA0 block}\\
\\
ELSE \\
\> \> use \hyperref[subsec:from-twiss-command]{initial values from Given Twiss parameters}\\
\\
ENDIF
}
\subsection{Initial Values from the Given Twiss Parameters}
\label{subsec:from-twiss-command}
\texttt{PTC\_TWISS} calculates a solution with initial conditions
given by the Twiss parameters, which are explicitly typed as attributes
to the command.
This case is also limited to uncoupled motion of the preceding ring or
beam-line.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, \\ %CLOSED\_ORBIT, \\
\>RANGE=string, FILE[=string], TABLE[=string], \\
\>BETX=real, ALFX=real, MUX=real, \\
\>BETY=real, ALFY=real, MUY=real, \\
\>BETZ=real, ALFZ=real, \\
\>DX=real, DPX=real, DY=real, DPY=real, \\
\>X=real, PX=real, Y=real, PY=real, T=real, PT=real;
}
\textbf{Example:} \\
An example is found in the
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/}
{\texttt{PTC\_TWISS} Examples}
in the folder
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/Example2}
{"Example2"}.
\subsection{Initial Values from a Map-Table}
\label{subsec:from-map-table}
\texttt{PTC\_TWISS} calculates a solution with initial conditions given
as a map-table of preceding ring or beam-line. It requires the input
option \texttt{INITIAL\_MATRIX\_TABLE} and an existing map-table
in memory, as generated by a preceding
\hyperref[sec:ptc-normal]{\texttt{PTC\_NORMAL}} command.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, \\ %CLOSED\_ORBIT, \\
\>RANGE=string, FILE[=string], TABLE[=string], \\
\>INITIAL\_MATRIX\_TABLE;
}
\textbf{Example:} \\
An example is found in the
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/}
{\texttt{PTC\_TWISS} Examples} in the folder
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/Example3}
{"Example3"}.
\subsection{Initial Values from a Map-File}
\label{subsec:from-map-file}
\texttt{PTC\_TWISS} calculates a solution with initial
conditions given as a map-file (fort.18) obtained from a
preceding ring or beam-line. It requires the input option
\texttt{INITIAL\_MAP\_MANUAL} and an existing map-file
in file "fort.18", as generated by a preceding
\hyperref[sec:ptc-normal]{\texttt{PTC\_NORMAL}} command.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, \\ % \\ CLOSED\_ORBIT, \\
\>RANGE=string, FILE[=string], TABLE[=string],\\
\>INITIAL\_MAP\_MANUAL;
}
\textbf{Example:} \\
An example is found in the
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/}
{\texttt{PTC\_TWISS} Examples} in the folder
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/Example3}
{"Example3"}.
\subsection{Initial Values from a Given Matrix}
\label{subsec:from-given-matrix}
\texttt{PTC\_TWISS} calculates a solution with initial conditions given
by a matrix explicitly given as attribute to the command.
It requires the option \texttt{INITIAL\_MATRIX\_MANUAL}.
\madx expects a symplectic 6x6 transfer matrix as input.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, \\ % CLOSED\_ORBIT, \\
\>RANGE=string, FILE[=string], TABLE[=string], \\
\>INITIAL\_MATRIX\_MANUAL, \\
\>RE11=real, RE12=real, ... , RE16=real, \\
\>...\\
\>RE61=real, RE62=real, ... , RE66=real;
}
\textbf{Example:} \\
An example is found in the
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/}
{\texttt{PTC\_TWISS} Examples} in the folder
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/Example4}
{"Example4"}.
\subsection{Initial Values from Twiss Parameters via BETA0-block}
\label{subsec:from-beta0-block}
\texttt{PTC\_TWISS} calculates a solution with initial conditions given by
Twiss parameters, which are transferred from the \texttt{BETA0} block. The
data in the the \texttt{BETA0} block have to be filled by a combination of
the \hyperref[sec:savebeta]{\texttt{SAVEBETA}} and
\hyperref[chap:twiss]{\texttt{TWISS}} commands of \madx for a preceding
ring or beam-line. This case is limited to uncoupled motion of the
preceding machine.
\madbox{
PTC\_TWISS, \=ICASE=integer, DELTAP=real, \\ % CLOSED\_ORBIT, \\
\>RANGE=string, FILE[=string], TABLE[=string], \\
\>BETA0=string ;
}
\textbf{Example:} \\
An example is found in the
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/}
{\texttt{PTC\_TWISS} Examples} in the folder
\href{http://madx.web.cern.ch/madx/madX/examples/ptc_twiss/Example1}
{"Example1"}.
%% EOF