組み込み関数

AccelerateParticles[]

AccelerateParticles does TrackParticles with acceleration in a ring for a given number of turns. The adiabatic damping is automatically taken cared.

Usage:    AccelerateParticles[beam_,mom_,{n_Symbol,nturn_},opt___]

where beam is a list of beam coordinates in the same format for TrackParticles. mom is an expression to determine MOMENTUM in each turn as a function of turn number n. nturn is the total number of turns. An option Synchronize specifies a routine to be executed at every turn of the tracking (e.g. changing voltages and magnet settings, or storing the results.)

Example:
 AccelerateParticles[
   beam,
   Which[
     n < 100,  1e9,
     n <= 200, 1e9 + (n - 100) * 1e7,
     True, 2e9],
   {n, 300},
   Synchronize :> ((
     d = {d, MOMENTUM/1e9 * (1 + #2[[2,6,1]])})&)];

BeamMatrix[]

BeamMatrix[i] returns a 6 by 6 beam-matrix at location i. The index i can have a fraction to specify intermediate numbers (see LINE or Twiss). The calculation is based on linear 4 by 5 calculation in the present version, so the z-direction is meaningless. Flag GAUSS affects the result.

CalculateOptics[]

DynamicApertureSurvey[]

Usage: DynamicApertureSurvey[range,nturn,options]

where

range:
a list of {xrange,yrange,zrange}, with
  • xrange: {xmin, xmax},
  • yrange: {ymin, ymax},
  • zrange: {z1, z2, .., zn},
  • These values are the initial amplitude divided by the equilibrium values, i.e., Sqrt[2Jx,y/(EMITX+EMITY)], Sqrt[2Jz/EMITZ].
  • See EMITTANCE(EMIT) command or Emittance function.
nturn:
number of turns to track.
options:
Output->lfn : output to the unit lfn (see OpenWrite).
  • ReferenceOrbit->{x0, px0, y0, py0, z0, dp0} : Survey is done around this orbit.
  • ExpandElementValues->True(default) : set the values of the components according to the values of elements. Machine errors may be reset. See machine-error-commands, CALCULATE(CALC).

DynamicApertureSurvey returns the result as a list: {score,{{{xmin, xmax},{ymin, ymax},{z1, z2, .., zn}}, {{z1,score1,{turn1_1,..,turn1_50}},.., {zn,scoren,{turnn_1,..,turnn_50}}}}} ,

where score = Sum[scorei,{i,n}], scorei is the "score" of i-th momentum, and turni_j is the lossed turn of the particle with i-th momentum and j-th intial amplitude.

DynamicApertureSurvey tracks number of particles with different initial conditions in the range given by range. It outputs a z-x diagram of the dynamic aperture of the ring. Fifty one initial conditions are chosen in the range x-range for each point of z-range. The initial y-amplitude is linearly dependent on the x-amplitude. It tracks from xmax to downward for each z-amplitude zn, until the particles turns nturn with successive DAPWIDTH x-amplitudes. The default DAPWIDTH is 7.

Element[]

Element[key-string, {element-pattern-string | element-position}] returns values for key-string of elements which match element-pattern-string or located at element-position. It returns a list if more than one elements match. The key-string and element-pattern-string can be symbols, unless values are not assigned to them.

If the second argument is omitted, it means all elements.

The element-position can be known by Element["POSITION"].

Key-strings "VALUE" and element-keywords allows to be set (i.e., Element[a,b] = v) when element-pattern-string chooses only one element. If a value is set to Element, it is automatically distributed to all components those belong to the element. If the keyword is the default variable, the error given by machine-error-command DK is applied.

The arguments of Element can be lists. It automatically maps as

  Element[{a,b,c..},y]  means {Element[a,y],Element[b,y],Element[c,y]..}
  Element[x,{a,b,c..}]  means {Element[x,a],Element[x,b],Element[x,c]..},

where both x and y can be also a list.

If an option Saved->True is given, Element refers the save-buffer which can be transferred to other beam lines. Otherwise values set by Element are not saved when FFS is stopped, unless they are the default-keyword or keywords once used in matching.

"LENGTH"
Number of elements in the beam line. No second argument.
"POSITION"
Position of the element in the element-list.
"NAME"
Name of the element.
"VALUE"
Current value of the default keyword of the element.
"KEYWORDS"
List of avilable keywords of the element.
"DEFAULT"
The default keyword of the element.
"TYPE"
The internal code-number of the type of the element.
"TYPENAME"
The name of the type of the element.
keyword
If keyword is the default keyword, it means the current value. If not, it means the saved value. Changing the non-default keyword by Element does not affects the current setting of the components.
"EXPAND"
Distribute the value of the default-keywords and the keywords used in the matching to all components in the beam line. No second argument.

Setting by Element["VALUE",..] or Element[keyword,..] to the DEFAULT keyword or a matching-variable keyword changes the current value, and distributed to the components in the succeeding calculation.

Emittance[]

Emittance[option] returns a set of rules as

Emittance[keyword1->value1, keyword2->value2, .. ]

Its options and default values are Matrix(False), Orbit(False), OneTurnInformation(False), Emittance(True), ExpandElementValues(True), SaveEMIT(False), InitialOrbit(Null), InitialBeamMatrix(Null), and Output(0).

Stable
True if all modes are stable and the closed orbit is found.
Tunes
{nux, nuy, nuz} .
EnergyLossU0
RfVoltageVc
EquilibriumPosition
dz in meter.
MomentumCompaction
OrbitDilation
ds in meter.
BucketHeight
dV/E0
HarmonicNumber
OrbitAtExit
physical c.o.d. at the end of line.
DampingRate
{T0/taux, T0/tauy, T0/tauz}
Emittances
{emitx, emity, emitz}
MomentumSpread
sigma p/p0
BunchLength
sigma_z
TuneShiftByRadiation
{dnux, dnuy, dnuz}
OrbitAtEntrance
physical c.o.d. at the entrance of the ring.
OneTurnTransferMatrix
symplectic part of the one-turn transfer matrix.
OneTurnDampingMatrix
deviation of transfer matrix due to radiation.
NormalCoordinates
conversion matrix from physical to normal coords.
OneTurnExcitation
excitation matrix by radiation.
EquilibriumBeamMatrix
equilibrium beam matrix. ExtendedTwissParameters list of rules giving the extended twiss parameters at the entrance of the ring.
ClosedOrbit
List of physical closed orbit at every element in the ring.

joins.

TransferMatrices
List of physical transfer matrix from the beginning of the beam line to all elements.
IntrabeamExcitation
List of the change of the 6 x 6 beam matrix due to the intrabeam scattering (only when INTRA), converted to the beginning of the beam line. join the result.

e.g.

e=Emittance[OneTurnInformation->True];
Print[e];

{(Stable->1),(Tunes->{.41000072296375,-.200000813579703,.002497234603957}),
(EnergyLossU0->1.975866800538E-8),(RfVoltageVc->280000),
(EquilibriumPosition->-1.95607185575E-12),
(MomentumCompaction->-.057760321501227),(OrbitDilation->0),
(BucketHeight->.009468321123791),(HarmonicNumber->9.000000000000001),
(OrbitAtExit->
 {1.93370835773E-28,1.995277189606E-28,0,0,1.411355062907E-16,1.084700572294E-17}),
(DampingRate->{-2.58354495546E-18,-2.5828999458E-18,-4.8719529598E-18}),
(Emittances->{4.994380442109E-22,0,2.172167619153E-23}),
(MomentumSpread->6.135593837532E-14),(BunchLength->3.540285263006E-10),
(TuneShiftByRadiation->
 {-7.57448848582E-21,-7.50894252549E-21,4.076685460013E-22}),
(OrbitAtEntrance->{0,0,0,0,0,0}),
(OneTurnTransferMatrix->{{-1.318622486585564,5.092003430078398,0,0,
   -4.84361184541E-17,-1.18597376861E-11},
  {-.100561453441162,-.370038232403309,0,0,-5.00207497737E-17,
   1.508498380724E-11},
  {0,0,-2.123193991653657,-28.15497378490119,0,0},
  {0,0,.242235641391719,2.741218257037087,0,0},
  {2.109145428434E-11,-7.25091257415E-11,0,0,.999918478558929,
   90.53250970862776},
  {3.73003576322E-18,-7.56051167907E-17,0,0,-2.719200765705E-6,
   .999835331947432}}),
(OneTurnDampingMatrix->
 {{3.396648596358E-18,-1.27735440153E-17,0,0,-3.06894799312E-24,
   1.090681626608E-18},
  {2.522630128947E-19,1.017083966905E-18,0,0,-2.51802935182E-25,
   1.111929928384E-19},
  {0,0,4.931669475657E-18,6.556995085315E-17,0,0},
  {0,0,-5.98539980601E-19,-6.61770630628E-18,0,0},
  {1.425577202796E-20,-3.59992911724E-19,0,0,1.047170469604E-22,
   -4.09572760319E-16},
  {-2.83110600725E-26,7.878277758692E-26,0,0,8.831878812514E-24,
   -9.74289159125E-18}}),
(NormalCoordinates->
 {{.324389146964567,5.207644652117E-17,0,0,1.092776526232E-17,
   -5.3400489764E-12},
  {-.287138159652035,3.082717191242008,0,0,3.526077874788E-17,
   -2.55155266559E-11},
  {0,0,.183791727488419,0,0,0},{0,0,.470023195334256,5.440941296245306,0,0},
  {1.291074015085E-13,-2.16232726123E-13,0,0,.013164622686276,
   7.346770105866E-17},
  {1.449392028178E-15,-3.12840365212E-15,0,0,3.48820164998E-5,
   75.961159224295497}}),
(ExtendedTwissParameters->
 {(AX->-.885165741020919),(BX->9.503145281179011),(PSIX->-1.68930340639E-17),
  (AY->2.557368613687328),(BY->29.603842189187533),(PSIY->0),
  (AZ->.002649678409406),(BZ->5770.0977106987726),(PSIZ->-9.67174564065E-19),
  (R1->0),(R2->0),(R3->0),(R4->0),(ZX->-3.36416201701E-17),
  (ZPX->-1.45771726658E-17),(ZY->0),(ZPY->0),(EX->1.642528853855E-11),
  (EPX->9.807147883025E-12),(EY->0),(EPY->0)}),
(OneTurnExcitation->
 {{4.290591433401E-34,4.07257757044E-35,0,0,-2.7190472232E-33,
   -6.6699073572E-35},
  {4.07257757044E-35,7.58348599413E-36,0,0,-3.93483250361E-34,
   -6.75251586558E-36},
  {0,0,0,0,0,0},{0,0,0,0,0,0},
  {-2.7190472232E-33,-3.93483250361E-34,0,0,1.059379850094E-30,
   1.839338275444E-32},
  {-6.6699073572E-35,-6.75251586558E-36,0,0,1.839338275444E-32,
   4.375746705235E-34}}),
(EquilibriumBeamMatrix->
 {{4.746232309234E-21,4.420854474008E-22,0,0,1.090206409835E-26,
   1.362975709041E-30},
  {4.420854474008E-22,9.373285457251E-23,0,0,1.557465958092E-27,
   -3.71261803757E-31},
  {0,0,0,0,0,0},{0,0,0,0,0,0},
  {1.090206409835E-26,1.557465958092E-27,0,0,1.253361974346E-19,
   -5.75553375091E-26},
  {1.362975709041E-30,-3.71261803757E-31,0,0,-5.75553375091E-26,
   3.764551173916E-27}})}
Example
{ax,bx,ay,by,az,bz}={AX,BX,AY,BY,AZ,BZ}/.(ExtendedTwissParameters/.Emittance[Matrix->True]

End[]

Closes the current output-stream and set the output stream to the standard output(6). It also suspends all the input streams and switches to the standard input(5). Since this command affects all input and output streams, you may consider to use TERMINATE(TERM) or CLOSE(CLO) to suspend or close them selectively.

FFS[]

FFS[command-string] executes command-string as FFS commands. Any commands can be used. Some commands CALCULATE(CAL), GO, VARIABLES(VAR), SHOW returns their result, otherwise Null is returned. All outputs of the commands are suppressed.

FFS[command-string,lo] directs the output of the commands to file-number lo. The file-number lo may be given by OpenWrite or OpenAppend.

The IF structure and REPEAT(REP) loop must be closed in a single FFS.

FitValue[]

Usage:
(1) FitValue[component, function, {id_,dp_}, goal_, now_] := body

modifies the goal of the matching of function at component. The argument id_ is the orbit id for MatchingAmplitude or InitialOrbits. The argument dp_ receives the value of dp/p0. The argument goal_ is the value of the goal of the matching set by matching-function-commands. The argument now_ is the current value of function.

Example: FitValue["$$$", "NX", {_,dp_}, goal_, now_] := goal + dp * xix * 2 * Pi

sets the tune NX to have chromaticity xix.

(2) FitValue[component1, component2, function, {id_,dp_}, goal_, now1_, now2_] := body

modifies the value of the function at component1 for a two-component matching. Component1 is assumed upstream in the beamline. The value of body is used in place of the current value, now1. The argument id_ is the orbit id for MatchingAmplitude or InitialOrbits. The argument dp_ receives the value of dp/p0.

The argument goal_ is the value of the goal of the matching set by matching-function-commands. The argument now1 and now2 are the current values of the function at component1 and component2, respectively.

Example: FitValue["QF1", "QF2", "NX", _, goal_, now1_, now2_] := 
  If[Abs[now2-(now1+goal)] < 0.01*2*Pi , Null, now1]

sets the tune difference between QF1 and QF2 gaol +- 0.01.

During the matching process the matching routine calls FitValue with arguments, then if body returns a number, it overides the goal give by matching-function-commands. If body returns Null, the matching of function is ignored. sets the tune NX to have chromaticity xix.

The matching-function-command is necessary besides FitValue to perform the matching. Only defining FitValue does not do the matching.

FitWeight[]

A defined function to modify the weight of matching of particular function at particular component with particular momentum offset.

Usage:   FitWeight[component, function, {id_,dp_}, default_] := weight;

where

component
is the name of the location of the fit, like "QF.2", etc.
function
is the name of the matching-function, like "BX", "LENG", etc.
id_
is the id number of the orbit for MatchingAmplitude or InitialOrbits.
dp_
is a variable to receive the momentum deviation of the fit.
default_
is a variable to receive the default fit weight.
weight
is an expression which returns the desired weight.
Example: FitWeight["$$$","LENG",{_,dp_},ws_]:=ws*10;

makes the weight of LENG at $$$ 10 times (100 times in MatchingResidual) bigger than the default.

GeoBase[]

GeoBase[{chi1, chi2, chi3}] converts the rotation angles of the coordinate base vectors to a transformation matrix {{x_gx,x_gy,x_gz}, {y_gx,y_gy,y_gz}, {z_gx,z_gy,z_gz}}

LINE[]

LINE[key-string, {component-pattern-string | component-position}] returns values for key-string of components which match component-pattern-string or located at component-position. It returns a list if more than one comonents match. The key-string and component-pattern-string can be symbols, unless values are not assigned to them. The second arg can be a fractional number to denote an intermediate value of two components.

If the second argument is omitted, it means all components.

The component-position can be known by LINE["POSITION"].

Key-strings "DIR" and component-keywords allows to be set (i.e., LINE[a,b] = v) when component-pattern-string chooses only one component.

The arguments of LINE can be lists. It automatically maps as

  LINE[{a,b,c..},y]  means {LINE[a,y],LINE[b,y],LINE[c,y]..}
  LINE[x,{a,b,c..}]  means {LINE[x,a],LINE[x,b],LINE[x,c]..},

where both x and y can be also a list.

"LENGTH"
Number of components in the beam line. No second argument.
"POSITION"
Position of the component in the beam line.
"NAME"
Name of the component.
"TYPE"
The internal code-number of the type of the component.
"TYPENAME"
The name of the type of the component.
"ELEMENT"
The name of the corresponding element.
"DIR"
The orientation of the component, +-1.
"S"
The orbit length to the entrance from the beginning of the beam line.
"LENG"
Same as "S".
"GEO"
Geometric-parameters at the entrance of the component, {{GX, GY, GZ}, {CHI1, CHI2, CHI3}}.
"GAMMA"
Lorentz factor gamma.
"GAMMABETA"
Lorentz factor gamma*beta = Sqrt[gamma^2 - 1].
"SIGab"
Beam matrix componet, where a and b are one of X, PX, Y, PY, Z, DP. If b is omitted it returns Sqrt[SIGaa] is returned. Just "SIG" returns the entire 6 by 6 beam matrix.
"SIZEab"
Beam matrix componet calculated by (CODPLOT;EMIT), where a and b are one of X, PX, Y, PY, Z, DP. If b is omitted it returns Sqrt[SIZEaa] is returned. Just "SIZE" returns the entire 6 by 6 beam matrix.
"MULT"
The ordered number of each component belonging to the same element, starting from 1.
keyword
The value of the keyword of the component (see below).
"EXPAND"
Distribute the value of the default-keywords and the keywords used in the matching to all components in the beam line. No second argument.

Setting by LINE[keyword,..] to the DEFAULT keyword for the FIRST component changes the current value of the corresponding element, because the value of an element is stored in the first component.

Examples:

LINE['S']          returns an array of orbit length s of the line.
LINE['S',name]     returns s of the element specified by name.
LINE['S',i]        returns s of the i-th element.
LINE['TYPE']       returns an array of type of elements in the line.
LINE['TYPE',name]  returns the type of the element specified by name.
LINE['TYPE',i]     returns the type of the i-th element.
LINE['NAME',name]  returns the name of the element specified by name.
LINE['NAME',i]     returns the name of the i-th element.
LINE['LENGTH',i]   returns the number of elements in the line.
LINE['POSITION',name]   returns an array of positions of elements which match name.

OptimizeOptics[]

Usage: OptimizeOptics[options]

optimizes (1 + MatchingResidual) or any function using DownhillSimplex with variables specified by FREE. Unlike GO, any keyword of any element can be a varible.

OptimizeOptics returns the final simplex. The variables are set to the values which give the minimum of the function so far at the end.

InitialSimplex -> initial sets the initial simplex to initial. The default is Null, which mean to create initial from the current value of the variables. Its format is same as for initial of DownhillSimplex SimplexSize -> size is the initial size of the simplex. Each variable is relatively shifted by this amount from the current value.

Example:
  free Q* Q* L
  fit nx .3 ny .2
  OptimizeOptics[]

optimizes the optics by changing the lengths of quads which are not allowed by GO, as well as K1 of quads.

OrbitGeo[]

OrbitGeo[location] returns the geometry {GX, GY, GZ} of the current (not design) orbit.

RadiationField[]

To calculate the field of the synchrotron radiation from particles, first record trajectories of particles. This is done by the function TrackParticles with a new flag RADLIGHT on. When RADLIGHT is on, TrackParticles returns a list

  {beam, trajectory} ,

where beam is a list as {location, coordinates}, and trajectory is a list

  { {t1 .. tm}, {x1 ..xm}, {y1 .. ym}, {z1 .. zm} }, ..

where {t,x,y,z}_i is the coordinates of the particle at i-th point in the trajectory. The origin and the direction of the spatial coordinates are the same as GEO coordinat {GX, GY, GZ}. One can track many particles at the same time by TrackParticles, so the trajectory has the dimensions {np, m}, where np is the number of particles.

After the trajectry is obtained, one can calculate the field in time domain at any observation point. This is done by the function RadiationFiled as

  field = RadiationField[ trajectory[[i]], obs];

where trajectoryi is the trajectory of the i-th particle, and obs is the spatial coordinate of the observation point in the GEO coordinate. The output field is a list

  { {tau1 .. taum},
    {Ex1 .. Exm}, {Ey1 .. Eym}, {Ez1 .. Ezm},
    {Hx1 .. Hxm}, {Hy1 .. Hym}, {Hz1 .. Hzm},
    {Sx1 .. Sxm}, {Sy1 .. Sym}, {Sz1 .. Hzm} }

where H = (n x E)/(c mu0) and S = E x H , and tau is the observation time.

RadiationField uses the Feynmann-Heviside formula

  E = (mu0 e/4pi) (c^2n/R^2 + R/c d(c^2n/R^2)/dt + d^2n/dt^2) ,

where n and R are the direction vector and the distance from the electron at the retarded time to an observation point.

The derivatives in the above formula is calculated using the spline interpolation.

Next one can calculate the spectrum of the field by RadiationSpectrum as

  spect = RadiationSpectrum[ {field[[1]], field[[k]]},
       {lambda1, lambda2, dlambda} ] ,

where filedk is one of the fields calculated by RadiationField. The range of the wavelength is gven as a list above. The output spectrum spect is a list as { {k1 .. kk}, {c1 .. ck}, {s1 .. sk} } ,

where k1 .. kk is the wave number k = omega/c, c1 .. ck and s1 .. sk are the cosine and sine integrals of the field in tau1 .. taum , i.e.,

  ck + I sk = Integrate[ field[tau] Exp[I c k tau] dtau] .

An example is seen in /users/oide/WORK/oldsad/sad/examples.sad .

RadiationSpectrum[]

To calculate the field of the synchrotron radiation from particles, first record trajectories of particles. This is done by the function TrackParticles with a new flag RADLIGHT on. When RADLIGHT is on, TrackParticles returns a list

  {beam, trajectory} ,

where beam is a list as {location, coordinates}, and trajectory is a list

  { {t1 .. tm}, {x1 ..xm}, {y1 .. ym}, {z1 .. zm} }, ..

where {t,x,y,z}_i is the coordinates of the particle at i-th point in the trajectory. The origin and the direction of the spatial coordinates are the same as GEO coordinat {GX, GY, GZ}. One can track many particles at the same time by TrackParticles, so the trajectory has the dimensions {np, m}, where np is the number of particles.

After the trajectry is obtained, one can calculate the field in time domain at any observation point. This is done by the function RadiationFiled as

  field = RadiationField[ trajectory[[i]], obs];

where trajectoryi is the trajectory of the i-th particle, and obs is the spatial coordinate of the observation point in the GEO coordinate. The output field is a list

  { {tau1 .. taum},
    {Ex1 .. Exm}, {Ey1 .. Eym}, {Ez1 .. Ezm},
    {Hx1 .. Hxm}, {Hy1 .. Hym}, {Hz1 .. Hzm},
    {Sx1 .. Sxm}, {Sy1 .. Sym}, {Sz1 .. Hzm} }

where H = (n x E)/(c mu0) and S = E x H , and tau is the observation time.

RadiationField uses the Feynmann-Heviside formula

  E = (mu0 e/4pi) (c^2n/R^2 + R/c d(c^2n/R^2)/dt + d^2n/dt^2) ,

where n and R are the direction vector and the distance from the electron at the retarded time to an observation point.

The derivatives in the above formula is calculated using the spline interpolation.

Next one can calculate the spectrum of the field by RadiationSpectrum as

  spect = RadiationSpectrum[ {field[[1]], field[[k]]},
       {lambda1, lambda2, dlambda} ] ,

where filedk is one of the fields calculated by RadiationField. The range of the wavelength is gven as a list above. The output spectrum spect is a list as { {k1 .. kk}, {c1 .. ck}, {s1 .. sk} } ,

where k1 .. kk is the wave number k = omega/c, c1 .. ck and s1 .. sk are the cosine and sine integrals of the field in tau1 .. taum , i.e.,

  ck + I sk = Integrate[ field[tau] Exp[I c k tau] dtau] .

An example is seen in /users/oide/WORK/oldsad/sad/examples.sad .

SetElement[]

Create/set/read a MAIN-level element in FFS level.

Usage: SetElement[ element-name, element-type, options]

where

SetElement returns a list of infromation of the element, in the suitable form for applying SetElement again.

You can define a new element by SetElement.

You can change the values of keywords of the element. You cannot, however, change the type of the element, nor cannot delete the element.

The element-type can be Null. If so, a null type is assumed for a new element.

Examples:
  LINE A = ( .. );
  QUAD QF = (K1 = 0.2);
  ...
  FFS USE = A;
    ...
   SetElement["QF"]                     ! reads values of QF.
   SetElement["QF","QUAD"]              ! same as above.
   SetElement["QF","BEND"]              ! error because QF is QUAD.
   SetElement["QF",,{"K1"->0.1}]        ! set K1 of QF to 0.1 .
   SetElement["QF","QUAD",{"K1"->0.1}]  ! same as above.

!Assuming QF1 and QF2 are undefined yet:
   SetElement["QF1","QUAD",{"K1"->0.1}] ! create a new QUAD QF1 with K1=0.1 .
   SetElement["QF2",,{"K1"->0.1}]       ! error because no type with key.
   SetElement["QF2"]                    ! This is OK.
   SetElement["QF2","QUAD"]             ! Now the type of QF2 is defined.

SymplecticJ[]

SymplecticInverse[]

TrackParticles[]

TrackParticles[{始点要素番号,転送前の粒子座標},終点要素番号,turn数]

Usage:

TrackParticles[{location,beam},dest,nth];

TransferMatrix[]

List of physical transfer matrix.

Usage:

TransferMatrix["始点","終点"]

eg.

TransferMatrix["^^^","QC1LE.1"];
TransferMatrix["QC2RP.2","$$$"];

Twiss[]

Twiss[optical-function, component] returns the value of the optical-function at the entrance of component. The values are those calculated by the last CALCULATE(CALC) or GO commands, or CalculateOptics function.

The second argument, component can be a name of component, a component number, or a list of them. If the number has a fraction, the intermediate value in the component is calculated.

Twiss["ALL",component] or Twiss["*",component] returns all 27 optical-functions at the entrance of component as a list: {AX, BX, NX, AY, BY, NY, EX, EPX, EY, EPY, R1, R2, R3, R4, DX, DPX, DY, DPY, DZ, DP, AZ, BZ, NZ, ZX, ZPX, ZY, ZPY},

which can be directly used in CalculateOptics. In the current version, however, parameters after AZ are uninteresting, because it always returns 1 for BZ and zeros for the others.

Keywords "PEX", "PEPX", "PEY", "PEPY" return dispersions in the phisical coordinate.

Keywords "LENGTH", "GAMMA", "GAMMABETA", "S", "SIGab" return the same results as for the function LINE.

The units of NX, NY, NZ are radian.

VariableRange[]

Usage:   VariableRange[element, keyword ,v_] := expression

where the current value of the element:keyword is passed in v_, and expression should give False when the value is out of range.

Example: VariableRange["QF","ROTATE",v_]:= -0.1 < v < 0.1;

This restricts the range of the rotation angle of QF within +-100 mrad.

VariableRange[_,"ROTATE",v_]:= -0.1 < v < 0.1;

This specifies the same for all elements.

The expression can also return the range as a list {vmin, vmax}, which may give more chance of solution-finding for the matching routine.

VarableRange only acts for variables which join the matching with the FREE command.

VariableWeight[]

Usage: VariableWeight[element, keyword ,v_] := expression

where the default weight for matching with element:keyword is passed in v_, and expression should return a modified value of weight. If non-real is returned, the default weight is used.

Example: VariableWeight["QF","K1",v_]:= 0.1*v;

reduces the weight of QF1:K1 to 1/10 of the default value.

The weight also affects the step size of the numerical derivative of the response. A smaller weight makes the step size larger.

VarableWeight only acts for variables used in the matching with the FREE command.

The default weights for some keywords such as VOLT have been defined to be reasonable for usual cases.


トップ   差分 バックアップ リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-02-07 (火) 10:51:55