28-DEC-1996 10:57:20.98
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. A new function SetElement.
Dear Users:
1. A new function SetElement is introduced to create/set/read a MAIN-level
element.
Usage: SetElement[ element-name, element-type, options]
where
element-name: name of the element, either a symbol or a string
element-type: type of the element, a symbol, a string, or a number
options: one or more rules or list of rules of the form
keyword -> value or keyword :> value, to set the corresponding
value of keyword of the element.
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.
K. Oide
27-DEC-1996 11:18:54.05
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Change in nonlinear fringe, etc.
Dear Users:
1. Changes are made in the nonlinear fringe of QUAD and MULT so that
now it is applied twice, before and after the linear fringe, by
half amount each. In the previous version it was done once before
linear at the entrance and after linear at the exit.
2. Now optics calculation in QUAD takes the geometric term as
the tracking and EMIT do. This change makes CALC and GO quite slower,
typically by 20 to 30%.
K. Oide
Subject:SAD Update. Bug in V1 of CAV.
Date:Thu, 28 Nov 96 14:43:10
From:
To: @sadusers.
CC: oide
Dear Users:
1. A bug was found in tracking in CAV when any of V1, V11, V20, V02 is nonzero.
The sign of the transverse kick caused by them were wrong, then it violated the
law of physics. This bug was created on 7/15/1993.
K. Oide
26-NOV-1996 17:52:58.30
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Bug in a list of complex number.
Dear Users:
1. A bug was found in memory allocation of a list of a complex number,
created by EigenSystem and Fourier. It caused Segmentation Fault, but a list
created by other functions are OK.
K. Oide
13-NOV-1996 12:24:30.88
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Bug in DRAW.
Dear Users:
1. A strange bug was found in DRAW. When the length of an element is very
close to an integer times 1/100 of the total length, this bug caused
Segmentation Fault.
K. Oide
31-OCT-1996 09:21:40.96
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Extended Twiss parameters.
Dear Users:
1. EMITTANCE(EMIT) now calculates the extended Twiss parameters at the entrance
of the ring and prints out them. Those are also avilable by
Emittance[OneTurnInfrmation->True] with the symbol ExtendedTwissParameters.
A symplectic matrix such as the normal mode matrix can be expressed in terms
of the extended Twiss parameters. In 6 by 6 case, those are
AX BX ZX EX
PSIX AY BY ZPX EPX
R1 R2 PSIY ZY EY
R3 R4 ZPY EPY
AZ BZ
PSIZ .
A(X,Y,Z), B(X,Y,Z) are alphas and betas in the usual sense, after a diagonaliza
tion to 2 by 2 submatrices. PSI(X,Y,Z) are the rotation angle to set one
the coordinate to parallel to the (X,Y,Z) axes. R(1,2,3,4) are the
componentsof the x-y coupling matrix (see x-y-coupling). E(X,PX,Y,PY) are
"dispersions" which decouples synchro-beta coupling terms together with
Z(X,PX,Y,PY). Those parameters should agree with what FFS calculates in
the case of no synchro-beta couplings.
extended-twiss-parameters definitions :
Let V denote the matrix to define the normal mode, i.e.,
U = V . u
where U = {X, PX, Y, PY, Z, PZ} and u = {x, px, y, py, z, delta} are normal
physical coordinates, respectively. The matrix V can be expressed as
V = P . B . R . H ,
where
H = {{(1 - Det[Hx]/(1 + a))I, Hx.J2.Transpose[Hy].J2/(1+a), -Hx},
{Hy.J2.Transpose[Hx].J2/(1+a), (1 - Det[Hy]/(1 + a))I, -Hy},
{-J2.Transpose[Hx].J2, -J2.Transpose[Hy].J2, a I}},
R = {{b I, J2.Transpose[r].J2, 0},
{r, b I, 0},
{0, 0, I}},
P . B = {{Px.Bx, 0, 0 },
{0, Py.By, 0 },
{0, 0, Pz.Bz}} ,
with
a^2 + Det[Hx] + Det[Hy] = 1
b^2 + Det[R] = 1 .
Symbols I, J2, Hx,y, r, Bx,y,z, Px,y,z above are 2 by 2 matrices:
I = {{1, 0},
{0, 1}},
J2 = {{0, 1},
{-1, 0}},
r = {{R1, R2},
{R3, R4}},
Bk = {{ 1/Sqrt[betak], 0 },
{ alphak/Sqrt[betak], Sqrt[betak]}},
Pk = {{ Cos[psik], Sin[psik]},
{-Sin[psik], Cos[psik]}} .
Matrices Hx,y defines dispersions as
{{zetax, etax},
{zetapx, etapx},
{zetay, etay},
{zetapy, etapy}} = R . Join[Hx, Hy] .
K. Oide
26-OCT-1996 23:45:40.62
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Revolution frequency for non-electron ring.
Dear Users:
1. There has been confusion of revolution frequency between FFS and TRACK,
in the case of a non-electron ring. FFS recognizes a variable MASS to specify
the mass of a particle, but TRACK does not but keywords PROTON, etc. Then the
revolution frequency in TRACK was wrong in particular a non-relativistic case.
Now I rewrite them so that the revolution frequency is consistently determined
by the lattice, MOMENTUM and MASS in all routines. The keywords to specify
the particle flavor becomes obsolete.
K. Oide
17-OCT-1996 14:53:28.49
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. A new flag GEOCAL.
Dear Users:
1. A new flag "GEOCAL" has been added to turn on/off the calculation of
geometry of the beamline. It defaults ON, and when ON, everything is
same as before, i.e., the geometry is always updated by CALC or GO using
the current value of elements. If it is OFF, the geometry and the
coordinate transformation by SOL are never changed. This is desirable
when you have to simulate the misalignment of magnets in SOL, etc.
GEOCAL is turned OFF by
OFF GEOCAL;
in the MAIN or
NOGEOCAL or GEOFIX
in FFS.
If you turn off GEOCAL before the first FFS of a beam line, no
geometry calculation is made at all, and probably it will cause trouble
in most cases. Thus it is recommended to turn off it in FFS so that it
calculates the geometry at least once.
2. Calculation of geometry for a bend with nonzero F1 was corrected. Now the
geometry is and should be never affected by the presense of F1.
K. Oide
20-SEP-1996 11:07:53.05
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Homepage has got a name!
Dear Users:
1. SAD homepages have got new names:
SAD: http://www-acc-theory.kek.jp/sad.html
SAD/FFS: http://www-acc-theory.kek.jp/SAD/SADHelp.HTML
K. Oide
9-SEP-1996 15:07:55.85
From: KEKVAX::OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. A serious bug in EMITY.
Dear Users:
1. A serious bug was found in calculation of EMITY, in EMIT command or
Emittance function. It was supposed to do
EMITY = Sqrt[ B_33 * B_44 - B_34^2 ] ,
where B_ij is the equilibrium beam matrix in the normal mode,
but actually
EMITY = Sqrt[ B_33 * B_44 - B_45^2 ]
was done. Then though the calculation of B_ij was right, the value of EMITY
was wrong. The value printed out as "Emittance Y" was also wrong. The
difference would be big when the damping was fast and also the y-z coupling was
strong (due to vertical dispersion in rf, etc.). This bug has been there
since before 2/20/1993, when SAD moved from HITAC to HP. The calculation by
the SYNCHROBETA command was OK, since it did not use the value in EMITY.
Recalculation is recommended for any case. (The module has been corrected, but
you can reproduce the wrong number using the expression above with the B_iJ
printed out with EMIOUT.)
K. Oide
16-AUG-1996 15:44:54.25
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Up to 32 chars for a name in MAIN level.
Dear Users:
1. Now the maximum length of a name of a MAIN level element is increased to 32
characters.
2. A bug in TYPE which did not show the unit "DEG" is fixed.
K. Oide
29-JUL-1996 22:02:59.87
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Bug in EMIT for fringe+solenoid.
Dear Users:
1. A bug has been found in emittance calculation for a quad or mult
with nonlinear fringe and solenoid. There was a small error in the
matrix element. This bug was created on around 7/12.
K. Oide
29-JUL-1996 12:52:20.47
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Tracking supports OFFSET partially.
Dear Users:
1. Now Tracking commands and functions supports OFFSET of a MARK, except the
function TrackParticles with the start or stop point is either a MARK with
nonzero OFFSET or next of it. Tracking entire beam line is OK.
K. Oide
29-JUL-1996 06:30:04.11
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. More on OFFSET.
Dear Users:
1. Now OFFSET of MARK becomes supported by EMIT. EMIT start calculation from
the location deferred by the OFFSET of the first MARK, and stops at the
deferred location by the MARK at the end of beam line, if exist.
Tracking commands still do not support it.
2. The amount of OFFSET is interpreted according to the direction of the
beamline, i.e., it points the same location in a beam line A and -A.
3. OFFSET is not valid inside of a solenoid.
K. Oide
27-JUL-1996 13:23:19.72
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. A new keyword OFFSET for MARK.
Dear Users:
1. A new keyword OFFSET enables a MARK element to move to any place of a beam
line. OFFSET is a relative position from the current potision. A fraction is
allowed to specify a location within an element.
If the MARK at the beginning of a beam line has OFFSET nonzero, the optics
calculation starts from the shifted location. If the last component of a
beam line is a MARK with nonzero OFFSET, the optics calculation stops at the
shifted location. The periodic condition is applied between those shifted
locations.
Examples:
(1) LINE A = ( ... QF PQFC ... );
QUAD QF = (L=0.3 K1=0.2);
MARK PQFC = (OFFSET = -0.5);
Here PQFC represents the center of QF.
(2) LINE A = ( ... PQFC QF ... );
QUAD QF = (L=0.3 K1=0.2);
MARK PQFC = (OFFSET = 1.5);
Here PQFC represents the center of QF, too (consider why).
Restrictions:
(1) Only the optics calculation if FFS takes the effect of OFFSET into account.
EMIT and tracking ignores it, at least in the current version.
(2) The output by DISPLAY(DISP) outside of the narrowed region by OFFSET are
meaningless.
(3) The geometric origin and the origin of LENG shift to the first MARK.
K. Oide
23-JUL-1996 17:21:27.86
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Bug in DRAW in BEND.
Dear Users:
1. There was a bug in DRAW and also the function Twiss, when it calculates the
optics in a BEND. It mishandled the edge angle. This bug was there since
Twiss was changed to support the fractional number as the component number,
maybe this January.
K. Oide
2-JUL-1996 09:30:11.82
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. More misalignments of MULT.
Dear Users:
1. New keywords CHI1, CHI2, and DZ have beend added to a MULT element to
express its misalignment. They specify all misalignments of a rigid
body, together with DX, DY, and ROTATE (=CHI3). At the entrans of MULT,
the coordinates of a particle are transformed as
{ x } { c3 -s3 0 } { 1 0 0 } { c1 0 -s1 } { x - DX }
{ y } = { s3 c3 0 } { 0 c2 -s2 } { 0 1 0 } { y - DY }
{ ds }1 { 0 0 1 }.{ 0 s2 c2 }.{ s1 0 c1 }.{ - DZ } ,
where c1 and s1 are Cos[CHI1] and Sin[CHI1], etc. The inverse is applied at
the exit.
Those misalignments are also valid within a solenoid.
Other straight elements such as QUAD or THIN do not and will not have
these full misalignment specifications, because they can be substituted by
MULT.
K. Oide
21-MAY-1996 11:47:53.27
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. BeamLineName, etc.
Dear Users:
1. A new function BeamLineName is installed. BeamLineName[] returns the name
of the current beam line. When a BeamLine object is used by USE or VISIT, it
creates a LINE of MAIN level, with an automatically naming "L$nnnnnn".
2. The internal logic of pattern-matching is change so that a mathcin like
MatchQ[a + b, p_ + (p:)]
correctly. It should be False, while Trun in the old version.
K. Oide
14-MAY-1996 21:40:39.94
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Bugs, InitialOrbit in Emittance[].
Dear Users:
1. A bug was found in expression evaluation in FFS. This bug destructs some
unpredictable location of the memory, so any side effect was possible.
2. A bug was found in the tracking routine of bend, when F1 <> 0 and RFSW is
ON. The linear fringe wrongly affected the synchrotron motion at the exit of
a bend.
3. A new option InitialOrbit is added to the function Emittance.
Usage: Emittance[..,InitialOrbit->{x0,px0,y0,py0,z0,dp0p0}, ..]
specifies the incoming orbit when NOCOD is given. This is useful when one
needs a 6D transfer matrix and orbit of a transport line.
K. Oide
10-MAY-1996 13:47:11.92
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD/FFS commands on WWW.
Dear Users:
1. Now we have a home page on SAD/FFS commands and functions on WWW.
The Location is
http://130.87.74.156/SAD/SADHelp.HTML ,
which can be accessed from SAD home page
http://130.87.74.156/SAD/sad.html .
Please try it.
K. Oide
9-MAY-1996 10:09:04.31
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. BeamLine object to contruct/edit beam lines.
Dear Users:
1. A new object BeamLine is defined to allow construction/editing beam lines in
FFS.
Usage: BeamLine[e1, e2, ...];
where e1, e2 has a form of
[ - ][ n* ] x ,
with x being one of
1) a name (either a symbol or a character string) of an element defined in MAIN.
2) a name (either a symbol or a character string) of a LINE defined in MAIN.
3) a BeamLine object.
An optional negative sign specifies the direction and a number n the repetition
number in the same way as MAIN. A BeamLine object is automatically expanded
to the lowest level whenever it is evalluated. Editing of BeamLine can be
done using any List-handling functions such as Join, Insert, Delete, etc. of
FFS.
A BeamLine object can be used for FFS calculation when it is used as the
argument of USE or VISIT commands:
Examples:
1) USE BeamLine[IP,QF,QD]
2) aaa=ExtractBeamLine[]; ! See below
USE Join[aaa,-aaa]
2. Utility functions ExtractBeamLine, WriteBeamLine, PrintBeamLine are defined.
Usage: ExtractBeamLine[line]
returns a BeamLine object which represents the expanded form of line which has
been defined in MAIN. If line is omitted, the current line is assumed.
Usage: WriteBeamLine[f, b1,.. ,option]
writes the BeamLine b1,.. to file f. If Format->"MAIN" is given, it writes in
the MAIN-input format. If Name->{name1,..} is given, names of BeamLines are
also written. The number of Name must be larger than number of BeamLines.
Usage: PrintBeamLine[b1,.. ,option]
is equivalent to WriteBeamLine, but the output goes to stdout.
K. Oide
2-MAY-1996 18:49:03.76
From: KIKUCHIM
To: @USER$DISK4:[OIDE]SADUSERS.
CC:
Subj: SAD/cor update: Condition option for MakeBump[].
Dear users,
New option Condition is available for MakeBump[].
The format is exactly the same as the Condition option for
CorrectOrbit[]:
for example
MakeBump[.....,
Condition->{{'ZX.1','ZX.2','ZX.3'},{1,-2,1},0}}
]
This is equivalent to a condition
ZX.1 -2*ZX.3 +ZX.3 == 0 .
Other form of
Condition->{c,d} (* c and d represents the condition c.x==d *)
is also acceptable.
KIKUCHI M.
30-APR-1996 21:55:21.64
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Bug in linear fringe of bend.
Dear Users:
1. A bug is found in transformation in tracking, emittance, and FFS with linear
fringe (F1) of bend. The signs of the change of x and z at the fringe were
wrong. This bug has been there probably since 1992. The transformation by
F1 can be seen by typing
HELP element bend f1 .
K. Oide
26-APR-1996 09:06:30.03
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. V20, V11, V02 for CAVI.
Dear Users:
1. New keywords V20, V11, V02 are added to CAVI to express transverse second
order dependence of the acceleration. The acceleration is given by
dE = e*(VOLT+V1 x+V20 x^2/2+V11 x y+V02 y^2/2)
*Sin[2 Pi FREQ (t-ts) + PHI].
Up to now, V1, V20, V11, V02 are valid only in the tracking.
K. Oide
28-FEB-1996 08:44:30.90
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. OpticsPlot.
Dear Users:
1. A new function OpticsPlot has been installed. This does what DRAW command
does as a function, for further flexibility and extendability.
Example:
OpticsPlot[{{"BX","BY"},{"EX","EY"}},Names->"Q*",Region->{"QF.1","QF.2"}]
is nearly equivalent to the command
DRAW QF.1 QF.2 BX BY & EX EY Q* ,
but creates the TopDrawer output to file #9 (and plots immediately when called
in X), and also returns a Graphics object, which is compatible with ListPlot
and Plot functions. An example of an extendability is OpticsPlot accepts
lists of data or user-defined functions to plot:
OpticsPlot[{"DX",{{{1,0.001},{5,-0.002}},Unit->Meter,
FrameLabel->{"DX0MEAS1","GLXLLLLX"}}}]
plots a list which represents orbit at component #1 and #5 together with
calculated value "DX", in the same window. This was only possible by DRAW
only for limited cases (e.g. specified by the MON command).
Please try this. More information is available by typing
help fun gra opt
in an FFS session.
K. Oide
16-FEB-1996 15:29:56.52 MAIL
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. New option Saved in Element.
Dear Users:
1. The function Element takes an option Saved. Element[key,elem,Saved->True]
refers the saved value, otherwise the value in the first component under the
specified element. The saved value of an element is considered as the design
value in many keywords, such as ROTATE. The default is Saved->False.
K. Oide
15-FEB-1996 02:21:35.85 NEWMAIL
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Nonlinear fringe field of bend in FFS.
Dear Users:
1. The nonlinear fringe field of a bend is now installed in the optics
calculation of FFS. This is basically same as what is done in EMIT and TRACK.
Actually the routine for a bend becomes common with EMIT, i.e., 6D calculation
instead of 4*5D. The cost is the speed, and the optics calculation becomes
typically 50% slower.
K. Oide
13-FEB-1996 22:39:45.40 NEWMAIL
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Revolution frequency.
Dear Users:
1. A very primitive bug was found in the calculation of revolution frequency.
Since 1986 it has been calculated by (circumference/speed of light), thus there
were problems in a nonrelativistic case. The most dangerous case was when the
rf frequency is given by HARM, not by FREQ. Otherwise there is no direct use
of revolution frequency in the optics calculation or tracking, so they were
safe.
K. Oide
16-JAN-1996 09:43:28.52 NEWMAIL
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. FitFunctions to use arbitrary functions in matching.
Dear Users:
1. A new symbol FitFunction is installed to use user-defined functions in the
matching by GO command.
Usage: FitFunction := fun,
where fun is a function that returns a real number or a list of real numbers to
be nullified by GO. The goal of GO is make fun zero or list of zeros, as well
as built-in matching conditions. Sum of fun^2 is added to MatchingResidual.
GO also evaluates FitFunction to obtain the derivatives numerically. The
function fun can refer the value of variables by Element or LINE functions, and
the optical functions at DP0 by Twiss. The algorithm of matching is same as
that for built-in conditions, but it is slower because of the numerical
differentiation, when the beam line is big and the number of variables large.
Example: FitFunction := {Twiss["BX","***"]-20, Twiss["BY","***"]-20};
which puts the same goal as
FIT *** BX 20 BY 20 .
K. Oide
9-JAN-1996 12:16:44.31
From: OIDE
To: @SADUSERS.
CC: OIDE
Subj: SAD Update. Alternatives(|), FFS$Status.
Dear Users:
1. A new operation Alternatives (|) is introduced. It is assigned to a
single-varticalbar (|), then it contradicts the previous notation for Or.
Thus I assigned double-varticalbar (||) to Or. You have to modify your
^^^^^^^^^^^^^^^^^^^^^^^
script that has been using |. I am very sorry for making this kind of
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
confusion again.
New Old
Or || |
Alternatives | (undefined)
2. A test version of window interface of SAD is made. Try to type FFS$Status
in FFS session on X. Unfortunately it is very slow for unknown reason.
It is fully written in SAD script, which is in /SAD/share/Packages/FFSStatus.n.
You may see it and how simple (complicated) it is. Actually it uses Tcl/Tk
and the interface is also written in SAD script, which is in
/SAD/share/Packages/Tk.n . Actually it is still far to complete, not
only because of its speed, but the structures of the interface. We need more
experience on this issue.
K. Oide