EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH

PTC_SELECT

USER MANUAL

SYNOPSIS


PTC_SELECT, 
table      = [s, none, none], 
column     = [s, none, none], 
polynomial = [i, none] , 
monomial   = [s, none] , 
parametric = [l, false, true], 
quantity   = [s, none] ; "


Description

Selects map elements to be:

a) Stored in a user specified table and column. Table and column must be specified than, and such table with such column must exists.

b) Stored as a function (taylor series) of knobs, if any is defined. Than, parametric should be set to true. Both a) and b) can be joined in one command.

Examples

dog leg chicane : strength of quads is matched to obtain required T112 value.

dog leg chicane : postion of quads is matched to obtain required T566 value.

dog leg chicane : dipols and quads strengths are matched with the help of knobs to obtain required momentum compaction and Twiss functions.

Command parameters and switches

table
string,

Specifies name of the table where values should be stored.

column
string,

Specifies name of the table where values should be stored.

polynomial
integer,

Specifies row of the map.

monomial
string composed of digits

Defines monomial of the polynomial in PTC nomenclature. Its lengh should be equal to number of variables. Each of digits corresponds to the exponent of a variable. Monomial 'ijklmn' defines xipxjykpyl ΔTm(Δp/p)n. For example, element=2 and monomial=1000000 defines coefficient of the second polynomial (that defines px) close to x, in the other words it is R21.

parametric
logical, default false, if value explicitly not specified then true

If it is true, and any knobs are defined the map element is stored as the parametric result.

PROGRAMMERS MANUAL

The command is implemented pro_ptc_select function in madxn.c and by subroutine addpush in madx_ptc_knobs.f90, that is part of madx_ptc_knobs_module

On the very beginning the existance of the table and within column is checked. In the case of failure, error message is printed and the function is abandoned.

The command parameters are passed as the arguments of addpush Fortran routine. A selection is stored in a type called tablepush_poly defined madx_ptc_knobs.inc. A newly created object is added to array named pushes.

More then one element might be stored in a single table, so the module must assure that each of tables is augmented only ones for each magnet (or integration slice). For that purpose array of tables to be augmented (named tables) is stored separately and we assure that a table is listed here only ones. This is simply done by checking if a table name is not already listed before adding a new element to the array.

In case the user requested an element to be stored in the paramteric format, and column in the array of parametric results is reserved and the index of the column is remembered in index field of tablepush_poly type is filled. In the other case this field is equal to zero.

The routine ptc_twiss (defined in file madx_ptc_twiss.f90), after tracking each of magnets in the sequence, calls putusertable routine. This routine loops over selected elemetns defined in the pushes table. For each of them it extracts the requested element from the map using .sub. operator of PTC and stores it in the defined table and column. If index field is not zero and any knob is defined, it extracts the polynomial using .par. operator, and stores it in the 2D array called results, in the row corresponding to the number of the magnet (or integration step) and column defined by the index field.