SAD Mails in 1991


Send any comments to ICFA@kekvax.kek.jp

SAD back to SAD Home Page



From:	KEKVAX::OIDE          8-JAN-1991 09:44:39.16
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

   A Happy New Year!

1. The error specification commands like DELX is so changed as to allow a
non-random error.   The new syntax is

   DELX  amount  [U_NIFORM]  element1[ element2...]

If UNIFORM (can be abbreviated down to U) is specified, the amount is assigned
to the elements.
						K. Oide

From:	KEKVAX::OIDE          9-JAN-1991 17:39:51.59
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. The output of EMIT command is changed to suppress very special matrice.
A new flag EMIOUT is added.   If EMIOUT is off, the output of the matrice is
supressed.   The default is OFF.   Outside of FFS, Use ON/OFF EMIOUT; Inside of
FFS, use EMIOUT or NOEMIOUT.
						K. Oide

From:	KEKVAX::OIDE         10-JAN-1991 16:50:14.11
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. There was a bug in TFFSA.   There was a mistake in a logic which is supposed
to save calculation of on-momentum optics when only sextupoles are variables.  
This bug makes an error when the start point satisfies the matching conditions
except geometric functions (LENG, RX, RY, RZ, CHI1, CHI2, CHI3).   TFFSA is now
fixed.

2. A bug in TFDISP is fixed to make the output record of DISP always less than
132.
						K. Oide

From:	KEKVAX::OIDE         17-JAN-1991 17:11:45.93
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. #MRAE.SAD.FORT and #MRAE.SAD.LOAD will be the newest version of SAD after
today, for a time beeing.   Please do not ask me the reason.

2. The way to specify the matching condition in FFS is changed.   If you do not
specify the second parameter in the condition command like BX, AX, etc., the
value 1 (ie., on momentum matching) is assumed if this condition is a new one
or has been rejected.  If the value has been set to more than one, the value is
not changed if you omit the second parameter.   For example,

FFS USE=AAA;                        FFS USE=AAA;
   BX 10              is equal to      BX 10 1

FFS USE=AAA;                        FFS USE=AAA;
   BX 10 3                             BX 10 3
   ...                is equal to      ...
   BX 10                               BX 10 3

FFS USE=AAA;                        FFS USE=AAA;
   BX 10 3                             BX 10 3
   ...                                 ...
   REJ BX             is equal to      REJ BX
   ...                                 ...
   BX 10                               BX 10  1

						K. Oide

From:	KEKVAX::OIDE         18-JAN-1991 11:50:17.49
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. Since now, please use KO04.SAD.FORT and KO04.SAD.LOAD as the latest version
of SAD.   Please forget the message of yesterday.   Please do not ask the
reason.
						K. Oide

From:	KEKVAX::OIDE         19-JAN-1991 13:52:56.99
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. TFFSA, TFFS, TFINIT, TFTYP1, and DOLINE are changed to include octupoles 
in the matching.

2. A bug in TFAPRT is fixed.
						K. Oide

From:	KEKVAX::OIDE         20-JAN-1991 00:44:25.85
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. Now you can specify a maximum value and a minimum value for each element
during matching.   The syntax is

    |MIN|MAX|MINMAX|MAXMIN|ABSMAX|MAXABS| 

Example:    s* MINMAX 13

The keyword MIN and specify value to the minimum and maximum value,
respectively.   The keywords MINMAX ... MAXABS all specify -abs(value) 
to the minimum value and abs(value) to the maximum value.   Wildcards can be
used for .   The present value of the variable is truncated between
the minmum and the maximum.   The MIN_LENGTH command is discarded according to
this change.   TFFS, TFFSA, TFINIT, TFGETV are changed.

2. You can see the minimum and the maximum values of variables by the new 
ATT_RIBUTE command.

Syntax:   ATT [ [...]]

The status of COUPLE is also displayed by this command.   Wildcards can be used
for .   If  is omitted, all variables are displayed.

						K. Oide

From:	KEKVAX::OIDE         20-JAN-1991 17:09:23.91
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. A login in the matching in TFFSA is changed, especially on the treatment of
the initial condition when CELL flag is set.   A small improvement on the speed
may be expected.

2. TFSHOW is changed to make the length of the output less than 80 columns when
the matching momentum number is more than 6.
							K. Oide

From:	KEKVAX::OIDE         30-JAN-1991 15:25:26.12
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. The input format of a solenoid is changed to enable a change of the strength
in a solenoid.   The new one is:
 a) A solenoid section must be enclosed by two SOL elements with the keyword
    BOUND = 1.   One of them must have another keyword GEO=1, which specifies
    the geometric origin of the solenid, i.e., at the element with GEO=1, you
    can specify the position and angle of the design orbit relative to the
    solenoid axis.
 b) You can insert an arbitral number of SOL elements in a solenoid section
    with different strengths.   The strengths of them are specified by the new
    keyword BZ.   The old one RHO is abandoned.   A value of BZ of a SOL
    element specifies the longitudinal B field AFTER the element.   Therefore
    if the you have to reverse the order of solenoid section, need a special 
    care.   The last SOL element must contain the value of BZ right before it.
Routines TSOL, TSOLE, QSOL, DOLINE, TSGEO, TFTYP1, TFSAVE are changed.

2. The output formats of EMIT and ATT_RIBUTE are changed.
						K. Oide

From:	KEKVAX::OIDE         30-JAN-1991 17:17:32.06
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. A bug in QDBEND, which causes an overflow, is fixed.
					K. Oide

From:	KEKVAX::OIDE          1-FEB-1991 16:45:19.60
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. The effect of the fringe field of a quadrupole is now included in the
tracking.   The routine TQUAD is changed to do that.   If you find something
abnormal, please let me know.
						K. Oide

From:	KEKVAX::OIDE          4-FEB-1991 10:50:41.13
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. Like as quadrupoles, the nonlinear (third order in Hamiltonian) part of the 
fringe field of a bend is now included in the tracking.   TBEND is changed.
							K. Oide

From:	KEKVAX::OIDE          4-FEB-1991 15:04:25.25
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. The output format of DISP F is somewhat improved.   TFDISP is changed.
						K. Oide

From:	KEKVAX::OIDE          5-FEB-1991 12:28:20.46
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. The flag EMIT lost its roll.   The emittance is calculated by EMIT command
no matter which the EMIT flag is on or off.   Neither FFS nor TRACK commands
never calculate the emittance.   Note that the COD flag is still active.   If
COD is on, the closed orbit is calculated in the EMIT command.   If off, only
the emittance is calculated.   The COD flag has no effects on FFS and TRACK
commands.   The routine TRACK is changed.

2. Minor modifications are made on TQUAD, TTURN, TTHIN, TAPERT.
						K. Oide

From:	KEKVAX::OIDE          6-FEB-1991 11:51:47.26
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. There was a bug in the modification of TBEND (tracking in a bend) on Monday.
Order of a statement was wrong.   Motion in vertical plane in a bend was wrong.

2. Minor modification are made on TBEND, TTURN, TPARA, TLINA.
						K. Oide

From:	KEKVAX::OIDE          8-FEB-1991 23:12:10.68
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1.  Now you can calculate a dynamic aperture of a ring by one command!

(usage)

ON DAPERT;
TRACK USE=RING NPART=# of part. TURNS=turn NX=(max. of nx) 
               NY=(max of ny) NZ=(min of nz, max of nz);

This command creates a diagram like

  NZ   0----|----1----|----2----|----3----|----4----|----5
  0.0  ******AAAAAAAAAAAAAA9742000000000000000000000000000
  1.10 ******AAAAAAAAAA86300002340000000000000000000000000
  2.20 *****AAAAAA9700000000000000000000000000000000000000
            ..........

The number at the left side of each line means NZ.   The horizontal axis is the
transverse amplitude (NX and NY).   The maximum amplitude specified by the
above command is devided into 50 points.   NY is always set to be  proportional
to NX.   A character in a line means the number of turns for a particle with
corresponding (NX, NY, NZ), devided by 100, i.e., 0 means less than 100, 9:
900-999, A: 1000-1099, Z: 2500-2599, a: 2600-2699, etc.   The asterisk means
the area where the tracking is omitted.

The number of particles affects to the whole cpu time.   Typically, around 100
is a good number, but it depends on the ring.

					K. Oide

 

From:	KEKVAX::OIDE         11-FEB-1991 10:39:51.03
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. The spec of the dynamic aperture diagram (ON DPAERT) is changed.
The new one is:

ON DPAERT;
TRACK USE=ring NPART=# of particles TURNS=# of turns
      NX=([min. of nx,] max. of nx)
      NY=([min. of ny,] max. of ny)
      NZ=(min of nz, max of nz, step of nz);

If the minimum of NX or NY is omitted, zero is assumed.   The three parametes
minimum, maximum, and stepsize of NZ MUST be specified.   The length of the
diagram depends on the specification of NZ unless it exceeds 51.

2. The handling of an overflow during tracking is changed to use the system
subroutine.   Routines TTURN, TRACK, TRACKA, TBEND, TQUAD, TAPERT, and TTHIN
are changed.
						K. Oide

From:	KEKVAX::OIDE         26-FEB-1991 10:28:31.00
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. In the present formalism for x-y coupling, the integer part of the tune 
becomes indeterminate when a transition from the normal region ("|R|<1") to the
abnormal region ("|R|>1") happens.   To evade this difficulty, the matching
procedure is changed to handle the integer part when this transition happens.
Namely, the matching is done for the amount dNX'=dNX-NINT(dNX) when the
transition happens, where dNX is the diffence of the NX from the goal value.  
If the transition does not occur, the difference more than +-0.5 in the tune is
taken into account, as before.   We may need a better formalism in future to
solve this mess.

2. The keyword for the matching of geometric locations, RX, RY, and RZ will be
changed to GX, GY, and GZ, respectively, in a few hours.   Please contact me if
you are uncomfortable on this change.   The merit of this change is the initial
character of the keywords becomes more systematic for representing the
character of the function than now.
						K. Oide   

From:	KEKVAX::OIDE          1-MAR-1991 08:42:16.50
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. A new routine for synchrotron integral is installed by Ohmi san.   Ask him
(KEKVAX::OHMI) the detail.

2. A skew rotation error of a bend is now included in all calculations.   Until
now, a design value and an error has not been treated separately.   The DTHETA
command in FFS has meant the change of design value, but now it means an error.
The new version include the rotation as two kicks at the entrance and the exit
of a bend, which is a good approximation unless the error is big.   Routines
TBEND, TBENDE, TBEDI, TBRAD, QBEND, TTURN, TTURNE, QTWISS are modified.

3. The concatenation of linear elements in the tracking with OFF RFSW flag is
abandoned.   The meaning of OFF RFSW in the tracking becomes a) to turn off all
cavities and b) to ignore z coordinate.   Routines TLIN and TMTRA are
disappeared.

4. A new flag FIXSEED in FFS is created to specify whether the seed of the
random number is updated after the MEAS_URE command or not.   If FIXSEED or
NOMOVESEED is specified, the seed is not updated MEAS.   If NOFIXSEED or
MOVESEED is specified, the seed is updated by MEAS.   Routines TFFSA, TRACKB,
TRACKE, and TMACRO are modified.
						K. Oide

From:	KEKVAX::OIDE          1-MAR-1991 10:17:11.68
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Manual.

   Dear Users:

   An insufficiently updated version of the SAD/FFS manual is available at the
public folder of OIDE's MAC (3goukan 4F).   (Please do not expect too much.)
					K. Oide

From:	KEKVAX::KIKUCHIM      1-MAR-1991 17:01:48.09
To:	OIDE
CC:	
Subj:	twsdrw

The bugs in my TWSDRW is corrected and it can be used freeky:
Usage   DRAW [R1 R2 R3 R4 DETR]
Note if R4 and DETR are specified simultaneously, DETR overrides R4.

From:	KEKVAX::OIDE          1-MAR-1991 17:19:34.30
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.

   Dear Users:

1. The DRAW command is modified by Kikuchi san so as to draw the R matrix and
detR.   The new syntax is

   DRAW BX|BY|EX|EY|ORB|R1|R2|R3|R4|DETR [variable]

Please ask Kikuchi san in detail.
						K. Oide

From:	KEKVAX::OIDE          4-MAR-1991 17:07:34.45
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Definition of the edge angle.

   Dear Users:

1. In the next version, which will be made today or tomorrow, the definition of
the edge angle E1 and E2 will be changed.   The new definition of E1 and E2
mean the RATIO to the ANGLE.   For example, a rect bend B with 0.1 rad bend
angle is written as

   BEND B=(ANGLE=0.1 E1=0.5 E2=0.5);

This modification will simplify the input and the matching routines.
						K. Oide

From:	KEKVAX::OIDE          5-MAR-1991 11:22:03.03
To:	@SADUSERS. 
CC:	OIDE
Subj:	SAD Update. E1, E2, DDK

   Dear Users,

1. The definition of E1 and E2 in a bend is changed as told yesterday.   The
new definition defines the ratio to the bend angle.

2. A new keyword K0 is defined for a bend.   It is used for a steering angle.
The kick angle is -K0 in horizontal.

3. A new error DDK is defined for an error of the K0 parameter of a bend.

   Routines DOLINE, TFFS, TFFSA, TFINIT, TFRST, TFSAVE, TFGETV, TFSETV, TTURN,
TTURNE, QTWISS, TFKWRD, TMACRO, and TERROR are modified.

						K. Oide

From:	KEKVAX::OIDE          5-MAR-1991 16:00:04.14
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update. IDEAL

   Dear Users,

1. A newflag IDEAL is created.   If IDEAL (or NOERROR) is specified, optics
calcualtion in FFS does not take errors into account.   If NOIDEAL (or ERROR)
is specified, errors given by DELX etc. is included in the calculation.   The
initial value is NOIDEAL (or ERROR).
					K. Oide

From:	KEKVAX::OIDE         12-MAR-1991 10:44:48.81
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Intrabeam.

   Dear Users:

1. A new routine to calculate the emittance growth due to the intrabeam
scattering is addted to the EMIT command.   The formula is derived by Kuroda
san, from Bjorken's paper.   There is an ambiguity in the log term.   The
present version uses log=20, but a more physical consideration may be
necessary.   The present version calculates the scattering at the entrance and
the exit of each element.    Scattering in a solenoid is not implemented yet.  
The accuracy of the calculation of is about 10^-3.
   Usage:   ON INTRA;   PBUNCH=particles/bunch;   EMIT USE=...;
Routines DOLINE, TRACK, TEMIT, TCOD, TTURNE, TSOLE are modified.   New routines
TINTRB, FINTRB, BINT, EIGS33 are added.
						K. Oide

From:	KEKVAX::OIDE         12-MAR-1991 16:29:49.90
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Intrabeam (cont.)

   Dear users,

1.  The log term in the intrabeam calculation is determined as
    log(2 b/r_e),  b=min(sigx,sigy,(gamma sigx sigy sigz/N)^(1/3)), 
where N is the number of particles/bunch.

2.  A new parameter MINCOUP is defined.   It specifies the minimum x-y coupling
in the intrabeam calculation.
						K. Oide

From:	KEKVAX::OIDE         13-MAR-1991 16:16:53.27
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   A bug in FFS.

   Dear Users,

1. A bug in STOP command of FFS, which has resided there since 3/5, was killed.  
This bug prevents to save parameters to a MARK element when STOP is issued.

2. An improvement is done in the iteration of the intrabeam calculation.   More
than factor 2 speed up is expected.
						K. Oide

From:	KEKVAX::OIDE         20-MAR-1991 15:18:59.38
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   DISFRING

   Dear Users:

1. A new flag DISFRING is made to disable the nonlinear fringe field of quads
and bends in the tracking.   If DISFRING=1 is specified in the element
definition, the nonlinear fringe field is disabled.   In a quadrupole, the
fourth order terms of px and py in the hamiltonian are also neglected.
						K. Oide

From:	KEKVAX::OIDE         22-MAR-1991 11:51:05.50
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Quad in solenoid.

   Dear Users:

1. A quadrupole in a solenoid is now supported with restrictions below.
a) The axis of a quadrupole must be parallel to the solenoid axis.
b) The relative accuracy of the calcuration is 10^-6.   Symplecticity is held
down to the round-off error.
c) Transverse displacements DX and DY and skew rotation ROTATE are supported.

2. A bug is found in QDCELL which calculates derivertives in the matching.  
Kuroda san will fix it today.   The matching does not work properly.
						K. Oide

From:	KEKVAX::OIDE         22-MAR-1991 12:50:37.74
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   QDCELL.

   Dear Users:

1. The bug in QDCELL is removed.
					K. Oide

From:	KEKVAX::OIDE         24-MAR-1991 10:38:17.16
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.    "Tr(A-B)**2<0".

   Dear users,

1. I realized that the case when the message "Tr(A-B)**2<2" qppears in the
optics calculation of FFS corresponds to the case that all four eigenvalues
become complex and unstable.   In such a case, it is not possible to decompose
the transfer matrix to two symplectic modes.    Therefore it is not a bug or a
calculation error, but a quite physical situation.   The current treatment
which recognizes both x and y modes unstable is a reasonable solution.
					K. Oide

From:	KEKVAX::OIDE          2-APR-1991 19:31:44.28
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Small changes in TRACK etc.

   Dear Users,

1. The frequency of printing out of smear during the tracking is changed.   The
frequency is now adjusted to the number of turns.

2. The output format of CALC and GO is changed to increase the digits.

3. A zero divide in EMIT is corrected.
						K. Oide

From:	KEKVAX::OIDE          3-APR-1991 11:54:14.39
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Matching trace.

   Dear Users,

1. The matching function TRX and TRY revived.   These are useful for finding
stable optics.   These are only applicable at the end of a
line.   These should be used under INS condition, and CELL should be said after
a stable solution is found.  For example,
     ------
     INS 
     FIT TRXM 1.99 TRYM 1.99
     FREE Q* GO
     CELL CALC
     ------
will find a stable optics.   Routines QDTWIS, QDCELL, TGETFV are changed.
						K. Oide


From:	KEKVAX::OIDE          8-APR-1991 12:47:08.35
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Tracking in a combined bend.

   Dear Users,

1. Tracking in a combined bend is changed.   The new method includes effects
up to the fifth order of the Hamiltonian.   The vector potential

   A_phi=K1(r/2(log(r/rho)-1/2)-y^2/r),

where r=(rho+x), is used in the calculation.   This A_phi satisfies the Maxwell
equation.   A new parameter EPS is defined for each bend.   If EPS<0, only the
linear term is  taken.   If EPS>0, it specifies the accuracy.   If EPS=0, the
default value EPS=1E-6 is used.   Actually, EPS determines the number of
divisions in the bend as

   NDIV=sqrt((K1*L)^3/EPS)/3.

The computing time is proportional to NDIV.
   You should find an appropreate value of EPS for your problem.   If x/rho is
small, EPS<0 can be the best choice.
   The optics calculations in FFS and EMIT are equivalent to EPS<0.

2. The output of "Smear" in the tracking is changed.   Now it prints the smear
during the period of printing, ie., the statistics is cleared after each
print out.
					K. Oide

From:	KEKVAX::OIDE          8-APR-1991 12:50:24.59
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Tracking in a combined bend.  (ps)

   Dear Users,

1. The vector potential in the previous mail was wrong.   The correct one is
A_phi=K1(r/2(log(r/rho)-1/2)-y^2/2/r).
						K. Oide


From:	KEKVAX::OIDE          9-APR-1991 15:26:06.56
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Length fit.

   Dear Users,

1. There was a bug in the fitting of orbit length.   The fitting for the
length between two points did not work.   The routine TFFSA is now corrected.
						K. Oide

From:	KEKVAX::KIKUCHIM     15-APR-1991 20:30:35.25
To:	OIDE
CC:	
Subj:	Beam-size drawing

Beam-size can now be drawn using my TWSDRW:
Command format;
    DRAW |SIGX|SIGY|TILT|

From:	KEKVAX::OIDE         16-APR-1991 08:33:52.09
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Draw beam size.

   Dear users,

1. Kikuchi san made a drawing of beam size.    The new keywords for DRAW in FFS
are SIGX, SIGY, and ROTATE (rotation in the x-y plane).    The reference axis
is the physical accerelator coordinate.
						K. Oide

From:	KEKVAX::OIDE         16-APR-1991 11:39:29.72
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Error commands.

   Dear users,

1. The syntax of error commands in FFS is changed.   The new syntax is

{DELX|DELY|DK|DDK|DTHETA|DL} - 
{amount [U_NIFORM|R_ANDOM]|[U_NIFORM|R_ANDOM] amount} element [element1..]

   Now element specifies each element, not the power supply.   Thus you have to
say QF* instead of QF to give errors to all QF.n.   The keywords U_NIFORM and
R_ANDOM are not new, and specifies whether uniform errors or random errors are
assigned.
   Routines TERROR and TFFSA are changed.
						K. Oide

From:	KEKVAX::OIDE         16-APR-1991 11:52:50.83
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   DRAW TILT

   Dear users,

1. Sinonyms are made for the keywords of DRAW in FFS.

   COD is equivalent to ORBIT.   OBT is now abandoned.    TILT is equivalent 
to ROTATE.
						K. Oide

From:	KEKVAX::OIDE         16-APR-1991 16:51:01.69
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   COD finding in EMIT.

   Dear users,

1. There was an inappropreate part in the COD finding routine in the EMIT
command. COD finding with a strong radiation was not good.   Routine TCOD is
changed. (Kamada san found this problem.   This problem arose in this February
or January.)

2. The speed of TEMAT and ELNAME is improved.
						K. Oide

From:	KEKVAX::OIDE         18-APR-1991 09:53:27.83
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   DLENGTH.  etc.

   Dear users,

1. A new parameter DLE_NGTH is defined in FFS.   It specifies the dilation of
the circumference for the EMIT command like as FSHIFT in the main level.   The
unit of DLE_NGTH is meter.

2. Now the EMIT_TANCE command in FFS sets X and Y emittances to EMIX and EMIY,
energy spread to DP, and makes the momentum distribution GAUSS after
completion.

3. The syntax analyzer in TFFSA is changed.   Missing parameters are reported
more strictly.
							K. Oide

From:	KEKVAX::KIKUCHIM     20-APR-1991 18:54:25.59
To:	OIDE
CC:	
Subj:	TWSDRW bug

As you know, if the specified element name in the DRAW command does not
correspond any element in the line, the word is absorbed in the DRAW and
never transfered to next FFS command. This is because the FFS reads 
unconditionally next word after TWSDRW finished
has finished. So TWSDRW was 
modified as follows; TWSDRW returns a logical variable (EXIST) as a last    
argument if the word was not understandable as a parameter of DRAW command.
Thus the TFFSA should be modified as follows;
  call twsdrw(......)
  if(not.exist.) then
    the control goes next command routine
  else
    read next word   
    and goes the next command routine
  endif
.

From:	KEKVAX::OIDE         22-APR-1991 16:50:47.07
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.    DRAW update by Kikuchi san.

   Dear users,

1. Kikuchi san updated DRAW command to accept the range of aline to be drawn.
The new syntax is

   DRAW [start stop] keywords [element]

If start is located after stop, it draws from the start to the end of
line, then fold back to the beginning of line, and draw to the stop element,
as what you expect it should be.
					K. Oide

From:	KEKVAX::OIDE         17-MAY-1991 06:19:49.30
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Setting values to variables, etc.

   Dear users,

1. Now you can change all parameters of an element in FFS.   The new syntax is

   variable [R_ELATIVE] [MIN|MAX|MINMAX|MAXMIN|MAXABS|ABSMAX] [keyword] value

,where keyword specifies the parameters like K1, DX, ROTATE, etc.   Wildcards
can be used for variable, but all vaiable which match to the wildcard must have
the same type.   Attributes R_ELATIVE and MIN...ABSMAX are valid only for the
variable parameter.   If the keyword is not the variable parameter, the changed
value is always saved no matter you say STOP or QUIT when exit from FFS.

2. A new command REP_EAT and UNTIL is added.   The syntax is

   REPEAT [n]  (any commands)  UNTIL [?CONV]

This repeats (any commands) n times.  If UNTIL ?CONV is specified, the
repetition is aborted if the last GO command was succesfully done ("Matching
complete").   If n is omitted, 1 is assumed.   REPEAT ... UNTIL loop can be
nested up to a large number.   This command is a sort of a languagize of SAD
which will be greatly extended in near future.   You may have been frustrated
in the poor language capability of the present version of SAD.

3. No major modifications will be expected until the new version of SAD appear
in July with a fully object-oriented, languagized capacity.   The contributors
should be prepared to the rewriting their codes.   Users will have to modify
the input decks significantly.
						K. Oide

From:	KEKVAX::OIDE         22-MAY-1991 10:16:18.80
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   ?STAB_LE.

   Dear Users,

1. A new condition ?STAB_LE is added to the REPEAT...UNTIL loop, as well as
?CONV_ERGED.   This condition is satisfied when the last GO or CAL_CULATE
command does not say "Vertical Unstable" or "Horizontal Unstable".   If the
CELL flag is off (or INS is on), ?STABLE is always satisfied.   This condition
loop may help to find out a stable optics, but the power is limited until the
full languagization is done in future.
						K. Oide 

From:	KEKVAX::OIDE         23-MAY-1991 08:53:14.21
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   DISP B.

   Dear Users,

1. A new function for DISP_LAY is added.   DISP_LAY B_EAM lists the beam size
and the rotation angle in the physical coordinate.   The Sigx and Sigy in the
list are the overall beam size in the physical coordinate, not the principal
values.   The Rot angle is the rotation angle of the principal axis of the
physical spot.   These values should be equal to those of DRAW SIGX SIGY
ROTATE.   Do not forget to specify EMIX, EMIY, DP, and the flag GAUSS or
UNIFORM before the DISP B command.   (EMIT in FFS also sets them.)

2. The name of the function of DISP_LAY to list the R matrix is changed to
DISP_LAY R_MATRIX.   Now we have five functions of DISP_LAY:

   DISP_LAY		Twiss parameters and length, value, s.
   DISP_LAY R_MATRIX    Twiss parameters and R matrix.
   DISP_LAY O_RBIT      Twiss parameters and orbit.
   DISP_LAY B_EAM       Twiss parameters and beam size, rotation.
   DISP_LAY G_EOMETRY   Geometric parameters.

We have also an attribute E_XTREMUM, which limits the abvoe list only locations
where BX or BY become an extremum.

3. The argument of TFBEAM is changed.   The new one is

   CALL TFBEAM(twiss,i,theta,beam)

.   The momentum factor is now calculated inside of TFBEAM.

					K. Oide

From:	KEKVAX::OIDE         23-MAY-1991 09:37:31.94
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Mild SVD.

   Dear Users,

1. The SVD routine TSOLVG is modified.   The original SVD cuts a singular
value w smaller than epsilon.   This is equivalent to that it replaces the
singular value as

	w'=w           (w>epsilon)
	w'=infinity    (w s
            0     s0
            <---- l ---->

We define parameters I0, I1, I2 as

   I0 = Integrate[        K(s)/K0,{s,0,l}]
   I1 = Integrate[  (s-s0)K(s)/K0,{s,0,l}]
   I2 = Integrate[(s-s0)^2K(s)/K0,{s,0,l}]

where K(s) is the shape of the end field at the entrance of a quad, K0 the
nominal strength, and l the length of the end field region.   The location s0
is the point where the effective length is defined as usual, i.e., I0=l-s0.
K(s) is chosen positive for horizontal focusing as the convention.
The linear correction matrix is written as

   M = {{1-K0(I0^2/2-I1),  K0( I2-I0^3/3)},
       {              0, 1+K0(I0^2/2-I2)}}   ,

which is correct up to order K0.   Since this matrix is symplectic only up to 
the first order of K0, a symplectized transformation which has the same effect
as M up to K0 is done in the actual calculation in SAD.   The magnitude of the
correction is K0 l^2/24, which is less than about 10^-3 in usual cases.

   New keywords F1, F2, and FRINGE are added to QUAD to specify the above
parameters.   First you put the  of the end field, l_eff, to
F1.

   F1 = l_eff,

where l_eff is defined as

   l_eff = SIGN(SQRT(a),a)

with
  
   a = 24(I0^2/2-I1).

This effective depth is equal to the depth l when the end field is linear.  
This is why we define l_eff as above.

   Second you specify the second keyword as

   F2 = I2-I0^3/3 .

Note that F2 vanishes if the end field is antisymmetric around the location s0.
If F2 is not zero, the effect at the entrance is not the inverse of that at the
exit.

   The third keyword FRINGE is used to disignate where the corrction is done:

   FRINGE = 0   ----   No correction.   Hard edge calculation.
   FRINGE = 1   ----   Correction is made only at the entrance.  
   FRINGE = 2   ----   Correction is made only at the exit.
   FRINGE = 3   ----   Correction is made both at the entrance and the exit.

These inconvenient specifications of FRINGE is necessary for matching at the
middle of a quadrupole when F2 is nonzero, since the entrance and the exit do
not cancel each other.   If the field is antisymmetric you can alwayse use 
FRINGE=3.

   One may argue about the nonlinear effects from the longitudinal component of
the field associated by the end field, but their leading terms are essentialy
included in the Forest's calculation of the Maxwellian hard edges.   The slow
rise and fall of the end field only give corrections of order K0 l^2 to the
leading terms.   Therefore we can reasonably neglect them in SAD.
  
   Similar correction is also possible for multipole magnets, and may be
introduced in future.

   This correction is significant when the quad is thin, strong, and large
bored.   The tune shift by a single linear end field is written as

   Delta nu = alpha K0 l^2 / 48 Pi ,

which becomes big for a final focusing quad of a low beta insertion.

From:	KEKVAX::OIDE         23-JUL-1991 08:43:21.17
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New flag EMITDIV.

   Dear users,

1. A new variable EMITDIV is added both in the main level and FFS.   This
number specifies how to divide a bend and a quad during the calculation of 
EMIT.   This number is used as the ratio of the actual division to the standard
division.   The default value is 1.   If you say EMITDIV=0.1; (or 
EMITDIV 0.1 in FFS), the division number becomes about 1/10 of the standard
value.    This affects to the accuracy of C.O.D. and emittance calculation.

2. Now MOMENTUM can be specified in FFS.   Say MOMENTUM 1E9 to set the momentum
to 1 GeV.

3. The IAP of M680 looks very funny.   When vectorized, the following loop 

      do 10 i=1,np
        a=px(i)**2+py(i)**2
        pz(i)=1.d0-a/(2.d0-a/(2.d0-a/2.d0))
        if(a .gt. 1.d-4)then
          pz(i)=1.d0-a/(2.d0-a/(2.d0-a/(2.d0-a/(2.d0-a/(2.d0-a/(1.d0+pz(i)))))))
        endif
10    continue

becomes always slower than unvectorized, no matter how big number is given to
np (the loop length).   This may be due to the if statement.  This compiler
surely vectorized the if structure, but slower than unvectorized.
						K. Oide

From:	KEKVAX::OIDE         29-JUL-1991 10:57:30.20
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bugs in steering. and thin bends.

   Dear Users,

1. Bugs were found in the tracking routine in a steering and a thin bend.
Steering was wrong when the kick angle is non-zero.   A thin bend was wrong
when skew-rotated.
						K. Oide

From:	KEKVAX::OIDE         31-JUL-1991 09:53:02.76
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   EMITDIV.

   Dear Users,

1. The default value of EMITDIV was wrongly set to zero.   It is corrected to
set 1.
						K. Oide

From:	KEKVAX::OIDE          3-AUG-1991 12:06:09.69
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   EMIT in sext, etc.

   Dear users,

1. Radiation in a sextupole and a octupole is now included in the emittance
calculation.   Although this only gives a small correction in usual cases, 
things become more consistent by this change.

2. The internal variables in the tracking are changed.   The new set is
(x, px/p, y, py/p, z, dp/(p0+sqrt(p0+dp)), v0-v, pz/p).   This choice looks
suitable to both precision and speed.   You may argue a lot about this.
					K. Oide

From:	KEKVAX::OIDE         14-AUG-1991 11:31:26.68
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Format of EMIT.

   Dear Users,

1. The output format of EMIT is slightly changed.   Note that the unit of
C.O.D. at the beginning of the output is changed to meter, raddian, and unity.
						K. Oide	

From:	KEKVAX::OIDE         22-AUG-1991 11:51:38.47
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Improved EMIT, etc.

   Dear Users,

1. The emittance calculation is changed to use the same transformation as the
tracking, as follows.

element       Old EMIT and FFS              New EMIT and TRACK
---------------------------------------------------------------------------
Drift         2nd order in px, py.          exact solution.
Bend          2nd order in px, py, x/rho.   exact solution.
              linear field index.           Maxwellian field index.
              No nonlinear fringe.          Maxwellian fringe.
Quad          2nd order in px, py.          higher order correction at edge.
              No nonlinear fringe.          Maxwellian fringe.
Sext and Oct  2nd order drift with kicks.   exact drift with kicks.

These changes may only give small corrections for the emittance calculation,
but be important for further applications.   The increased load of CPU is 
absorbed by an improvement of other parts (TMULBS).

2. The calculation of the time delay due to the nonlinear fringe of a quad
was wrongly estimated factor 2 bigger in the tracking.    It is corrected but
the effect may be small anyway.
						K. Oide


From:	KEKVAX::OIDE         29-AUG-1991 10:53:13.55
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New flag FLUC.

   Dear users,

1. A new flag FLUC is made to control the radiation excitation during 
tracking.  If FLUC is ON and RAD is ON, both the radiation damping and
excitation is done (this is the old mode when RAD is ON).   If FLUC is
OFF and RAD is ON, only the damping is included.   If RAD is OFF, no
radiation effect is applied.

Speed for 12 particles tracking in the B Factory lattice:

   RAD   FLUC    CPU time/particle/turn
-------------------------------------------
   ON    ON      15.7  msec
   ON    OFF     12.7  msec
   OFF   ---      7.7  msec

					K. Oide

From:	KEKVAX::OIDE          4-SEP-1991 17:46:00.78
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   PZ.

   Dear users,

1. The internal variable for pz in the tracking is changed 
from pz/p to pz/p-1.   This change improved the speed typically 7% faster and
made the code simpler.				K. Oide

From:	KEKVAX::OIDE          8-SEP-1991 14:20:00.48
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Intrabeam.   Serious.

   Dear users,

1. The calculation of the emittance growth due to intrabeam scattering was
imperfect.   I should have used the LOCAL momentum distribution in a bunch,
instead of the overall momentum distribution of the bunch.   This means that we
have to subtract the correlation terms between momentum and position, i.e.,
we should use

   ' =  -  Inv(  ) 

instead of .   This change reduces the emittance growth about 50% in the
case of the JLC damping ring!

2. In the EMIT command, the Touchek lifetime is now calculated as a function of
momentum acceptance, when INTRA is ON.
						K. Oide

From:	KEKVAX::OIDE         20-OCT-1991 08:28:47.26
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in TTHIN, etc.

   Dear Users,

1. A bug was found in the tracking of a zero length multipoles.   This
bug was created on around Sept. 5.   All tracking results after Sept. 5
with zero length sextupoles was wrong.   Sextupoles with finite length
was OK. All results before Sept. 5 have also no problem.

2. Tracking routine in a bend with quantum radiation is changed.   The
speed is increased about 30%, and the algorithm becomes same as
the non-radiation routines.

3. A new keyword TOTAL is added to the REJ_ECT command.   REJECT TOTAL
cancels all fitting conditions at all fitting locations in the line.

					K. Oide

From:	KEKVAX::OIDE          5-NOV-1991 12:21:29.63
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Number of fitting conditions.

   Dear Users,

1. The upper limit of the number of fitting conditions in FFS is now increased
to 200.   It used to be 40.
						K. Oide

From:	KEKVAX::OIDE         29-NOV-1991 22:10:20.63
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Touchek lifetime.

   Dear Users,

1. A bug was found in the calculation of Touchek lifetime.

2. A bug was found in the tracking with DAPERT option.   It has not been 
   cured yet completely.
					K. Oide

From:	KEKVAX::OIDE         17-DEC-1991 08:19:13.87
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Fringe, etc.

   Dear users,

1. The method of integration of Forests' fringe is changed.   The Hamiltonian
is 

   H = U + V,
   U = a u^3 pv, 
   V = a v^3 pu,

where u = (x + y)/sqrt(2) v = (x - y)/sqrt(2), and a is a parameter determined
by the strength of a quad.   The old integration was

   exp(:V:)exp(:U:),

which is correct up to the first order of a.   At the exit the sign of a and
the order of U and V are changed.   In contrast, the new one is

   exp(:U/2:)exp(:V:)exp(:U/2:),

which is now correct up to the second order of a.   At the exit of the quad the
sign of a is changed.   The new integrator is definitely better than the old
one (if there is no bug), no matter how significant or insignificant effects 
it causes on results of tracking.   The old load module is kept in
KO04.SAD.LOAD(\SAD0) for comparison.

2. The maximum aperture to judge loss of a particle in tracking is now able to
specify using LOSSAMPL = aperture; in the MAIN level.   The default value is 
1 m, which is same as before.

3. The output of EMIT when RFSW is OFF is corrected.   It calculates all
parameters properly including intrabeam effects even when RFSW is off, 
if appropreate voltage is given by cavities.   If there is no cavity, some 
parameters becomes wrong.
						K. Oide

From:	KEKVAX::OIDE         19-DEC-1991 16:14:28.44
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   A bug in tracking.

   Dear users,

1. A bug is found in the stationary phase in the tracking.   The stationary
phase has been wrongly set to zero at the beginning of tracking.   This changes
the slope and non-linear of rf.   It may be significant for a high stationary 
phase machine like TRISTAN flat-top.
						K. Oide

From:	KEKVAX::OIDE         21-DEC-1991 16:11:06.98
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New tool.   Fourier analysis on tracking.

   Dear users,

1. A new tool, Fourier analysis, is added to the tracking.   This is very
similar to the beginning of the Warnock-Ruth method.   If the new flag FOURIER
is turned ON, SAD does fitting of action angle variables with a fourier series

   J = SUM over m [ i m Am(J') exp(i m phi) ] + J',    (1)

where (J,phi) is the physical variables, whereas J' is the true action, i.e.,
J'= constant.   The integer vector m=(mx,my,mz) ranges in
|mx|+|my|+|mz|<=MAXORDER, which can be given in the SAD MAIN level.   SAD finds
the coefficients Am for each particle, by a least square method which minimize
the r.m.s. error of (1) at end of every turn of tracking.   As the result, SAD 
outputs J', residual error of the fitting, "prediction of maximum J", and
biggest 16 coefficients.   This new tool may help your understanding on the 
dynamic aperture of a circular machine.   Please use it.   Any criticism on
this tool is welcome, including bug information.
						K. Oide