SAD Mails in 1994


Send any comments to ICFA@kekvax.kek.jp

SAD back to SAD Home Page



From:	KEKVAX::OIDE         24-JAN-1994 14:03:52.57
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Internal logic, Thread, etc.

   Dear Users:

1. The internal logic of FFS programing facility is fully updated.   There may
appear unwilling side effects.   Please send me if you see something strange.

2. A new function Thread is added.   Cf. Mathematica.

3. A problem in Draw which write a strange line at the end of drawing has been
corrected.
						K. Oide

From:	KEKVAX::OIDE         27-JAN-1994 09:51:28.92
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in RESULTOFTRACKING .

   Dear Users:

1. A bug was found in calling the RESULTSOFTRACKING defined function during
tracking.   This bug has been there since 1/24, and caused unpredictable
effects.   This is corrected.
					K. Oide

From:	KEKVAX::OIDE         30-JAN-1994 12:02:08.98
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   ExponentOfResidual.

   Dear Users:

1. A new variable ExponentOfResidual is defined.   Its roll is to change the
exponent of the convergence calculation in the matching.   We have used the
sum, Sum (d_i)^2, where d_i is the "difference" of the i-th function from the
goal, as the figure of merit.   Now it is changed to

   Sum (d_i)^(ExponentOfResidual/2) .

The default of ExponentOfResidual is 2.   Changing ExponentOfResidual gives a
flexibility in the matching, especially in chromaticity corrections.

                                        K. Oide


From:	KEKVAX::OIDE         31-JAN-1994 11:46:23.59
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Output format of CALC and GO.

   Dear Users:

1. The output format of CALC and GO commands are changed.   The width of output
is specified by the variable PageWidth, which is automatically set from 
env variable COLUMNS when SAD starts.
						K. Oide

From:	KEKVAX::OIDE          2-FEB-1994 11:45:10.94
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   CalculateOptics function.

   Dear Users:

1. A new function CalculateOptics is built to enable caclulation of optics as a
function.   At this time only a primitive routine is released.   Defined
functions with sofisticated features may follow.

Usage:

   CalculateOptics[begin,end,initialcondition,periodic,dim]

where 

	begin:  number or name of element to start the caculation.

	end:    number or name of element to stop the caculation.  At this
		time, end must be in the downstream of begin.

	initialcondition:  array of 27 real numbers to specify the initial
		condition. If periodic is True, it is used only for the
		initial point of the iteration.  The meaning of each
		element is (you can argue on its craziness):

		[1]   alphax	[2]   betax	[3]   psix
		[4]   alphay	[5]   betay	[6]   psiy
		[7]   etax	[8]   eta'x	[9]   etay	[10]  eta'y
		[11]  r1	[12]  r2	[13]  r3	[14]  r4
		[15]  dx	[16]  dx'	[17]  dy	[18]  dy'
		[19]  dz	[20]  dp
		[21]  alphaz	[22]  betaz	[23]  psiz
		[24]  zetax	[25]  zeta'x	[26]  zetay	[27]  zeta'z

		elements 19 and 21 through 27 are reserved for future use and
		not supported at this time.

	periodic:	True for periodic condition.

	dim:	must be 2 at this time.

Value:

	This function returns a list

	{optical_parameters,stability,trace}

where

	optical_parameters:   list of list of (number of elements between begin
                and end,27) which contain parameters at each element.   The
		meaning is same as initialcontition above.  For example,
		optical_parameters[1,2] is betax at begin.

	stability:	list of three flags to show stability {x,y,z}.

	trace:	list of traces {TrX,TrY,TrZ} .


   At this time only 4*5 optical calculation is possible.   All quantities
related to z-coordinate are meningless.

   By this function, you can build, in principle, your own matching routine or
orbit correction routine.   Please try.

						K. Oide
       

From:	KEKVAX::OIDE          3-FEB-1994 17:30:49.32
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   TransferMatrix defined function.

   Dear Users:

1. A new defined function TransferMatrix is released.

Usage: 

a)	TransferMatrix[from,to] returns 4 by 4 matrix from from to to.

b)      TransferMatrix[from,to,optical_parameters] returns 4 by 4 matrix using
		optical parameters in optical_parameters which has been
		obtained by CalculateOptics function.

In case a), from and to are either numbers or names of component in the line.

In case b), from and to must be numbers.  The number 1 corresponds to the first
element of optical_parameters, not necessary to be the begining of the line.

At this time only 4 by 4 version is available. 4 by 5 version (with dispersion)
may follow soon. The 6 by 6 matrix can be obtained by the Emittance function.

					K. Oide

From:	KEKVAX::OIDE          4-FEB-1994 09:56:49.08
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   ResultOfDAPERT.

   Dear Users:

1. A new variable ResultOfDPAERT is defined to hold the result of the last
DAPERT tracking.

Usage:

1. One visit FFS prior to DAPERT tracking, otherwise ResultOfDAPERT never 
works., since the FFS programing system is not initialized.

2. Do DAPERT tracking as usual, either in FFS on in MAIN.

3. Enter FFS and use ResultOfDAPERT which has the form

{{{xmin,xmax},{ymin,ymax},{zmin,zmax}},
 {{z_1,x_1,{turns_11,turns_12,...}},{z_2,x_2,{turns_21,...}},...}
}

where z_i x_i is the values of z and aperture of i-th line of the output of 
DAPERT bar graph, whose information follows as the list {turns_ij}.   The list
is the number of turns of each particle at ij initial condition.   The value of
"score" is not explicitly returned, but you can get it by

  Apply[Plus,Map[#[2]&,ResultOfDAPERT[2]]]

.    
						K. Oide

From:	KEKVAX::OIDE          5-FEB-1994 11:44:39.60
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in closed orbit finding since 2/2.

   Dear Users:

1. There has been a bug in closed-orbit finding in the FFS CALC and GO 
commands since 2/2.   For an ideal orbit, there was no problem.

						K. Oide

From:	KEKVAX::OIDE          6-FEB-1994 08:04:32.65
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New type of element INS.

   Dear Users:

1. A new type of element, INS, is defined.   This element performs an INStant
INSertion in a beam line.   For example, when you want to survey
characteristice of a single cell of a ring, you have had to make matching
sections and dispersion suppressors to calculate emittance, intrabeam
scattering,  and to simulate dynamic apertures, otherwise an rf cavity at 
dispersive place causes synchro-beta coupling.   This is due to the honesty of
SAD, but you may have felt that it is too much, especially in a rough deisgn of
a ring.   The new element INS is built to help such problems.

Usage in MAIN level:

a)    INS name=(DIR=1
                keyword=value,....);

b)    INS name=(DIR=-1
                PSIX=dpsix PSIY=dpsiy);

Case a): This is the beginning of an insertion.   By this insertion the optical
parameters are discontinuously changed to the values speciied by the keywords.
The possible keywords are the same as those of MARK.   The keywords PSIX and
PSIY specifies the phase jump at the element.   For example, if you say EX=0
EPX=0, the element works as an instant dispersion suppressor.

Case b): This is the end of an insertion.   By this element, the optical
parameters are restored to the values right before the previous INS element,
except for PSIX and PSIY, which specify the phase difference from the PREVIOUS
INS element.

   The transformation by INS is just a linear symplectic transformation which
satisfy the above change of optical parameters for the nominal orbit.

   INS is not allowed in solenoids and where the nominal orbit is non-zero.

Usage in FFS:

   Note that if the phase jump is nonzero, the matching across the INS element
fails, since the transfer matrix created by the INS element varies as the
condition of the rest of the beam line.   Therefore when you do matching with
INS, first set PSIX and PSIY of INS elements zero, and after the matching set
the desired value.   For an off-momentum optics or an optics with errors, you
can use INS without such care, because the matrix of INS are only defined for
the nominal optics, and are commonly used for an off-momentum or an errorred
optics.   Therefore chromaticity correction is possible with INS in the usual
way.

   The matrix by INS is only calculated in FFS for an ideal orbit with DP0=0.
Thus you have to once run FFS for the beam line with INS and say calc, prior to  
the tracking or emittance calculation, otherwise they fail.

						K. Oide

From:	KEKVAX::OIDE         13-FEB-1994 09:34:00.16
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   TunesByTracking, internal logic, etc.

   Dear Users:

1. A new variable TunesByTracking is defined to store the result of tune 
analysis in the last tracking, which have been output at the end of TRACK
command when DAPERT is OFF.   The TunesByTracking is a list of length np, the
number of particles.   Each element is a list of four components.   The first
one is a flag to indicate the particle has been lost (=0) or alive (=1).
The 2nd, 3rd, and 4th components correspond to x-, y-, and z- tunes and
amplitudes of the particle.   They are {8,2} lists whici are same as the 
print-outs of TRACK.

2. The internal logic of the variable handling is changed.   As the result, the
speed of list operation is greatly improved, say, 10 times faster.

3. There has been a bug in the TrackParticle function.

4. There has been a bug in the input parser of FFS.   Some expressions
containing ';' like ({1,2};3) have made trouble.

					K. Oide

From:	KEKVAX::OIDE         14-FEB-1994 22:38:43.34
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in List[].

   Dear Users:

1. There has been a bug in a form f[]. For example List[] was different from
{}.

2. A New Function SetAttributes is defined.   Its purpose is same as
Mathematica's, but the usage is different.    Please call me if you need this
function.
					K. Oide

From:	KEKVAX::OIDE         16-FEB-1994 10:16:15.25
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   MapAt, FlattenAt, ReplacePart, MapAll.

   Dear Users:

1. New functions MapAt, FlattenAt, ReplacePart, MapAll has been added.   Those
are same as Mathematica's.

2. There has been a bug in a function with null argument such as Random[] since
the last week.
					K. Oide

From:	KEKVAX::OIDE         18-FEB-1994 11:06:48.10
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   DynamicApertureSurvey.

   Dear Users:

1. A new function DynamicApertureSurvey is created.   This function intends to
perform "DAPERT" tracking as a function in FFS.

Usage:	DynamicApertureSurvey[range,turns,option]

where
	range is an array of {{xmin,xmax},{ymin,ymax},{zmin,zmax,zstep}} .

	turns is the number of turns.

	option is an optional sequence of options.   At this time only 
	the option

		Output->file number

	is available.   This option specifies the file number for the output.
	The default is Output->0, i.e., no file output is made.

Returned value:

	This function returns a list of {score,ResultOfDAPERT}.  
	("ResultOFDAPERT" has been already anounced.)

						K. Oide

From:	KEKVAX::OIDE         19-FEB-1994 20:03:13.99
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   MapIndexed, MapThread.

   Dear Users:

1. New functions MapIndexed and MapThread are added.

2. Bugs related to RuleDelayed and local variables in Module are removed.

						K. Oide

From:	KEKVAX::OIDE         25-FEB-1994 13:24:49.05
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   LINE["EXPAND"],Element["EXPAND"],etc.

   Dear Users:

1. New keyword is defined for LINE and Element functions.

   LINE["EXPAND"]  and Element["EXPAND"]  both expands the values of poer
supplies in the current beam line to magnets.   This function has been
necessary to make Element["VALUE",name]=x or LINE[key,name]=x commands
effective without other FFS commands like CAL.

2. A new option ExpandElementValues is defined for functions Emittance and
DynamicApertureSurvey.   If it is True (default), LINE["EXPAND"] is done prior
to calculation.

						K. Oide

From:	KEKVAX::OIDE          1-MAR-1994 16:18:01.40
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   LinearSolve,Eigensystem,Det,ToString, etc.

   Dear Users:

1. Functions Eigensystem, LinearSolve, and Det are changed to handle complex
numbers.   SingularValues has not been able to use complex.

2. Complex math operations for a list are made greatly faster.

3. A new function ToCharacterCOde, FromCharacterCode, and ToString is added.

						K. Oide

From:	KEKVAX::OIDE          2-MAR-1994 11:27:51.02
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Switch, etc.

   Dear Users:

1. A new function Switch is defined.   It is same as Mathematica's.

2. A new function SeedRandom is defined.

   SeedRandom[number] sets number to the seed of Random[] and GaussRandom[].

3. A new function GaussRandom is defined.

   GaussRandom[] returns a pseud randomnumber with Gaussian distribution of
sigma=1, mean=0.   The cutoff is set by GCUT=cutoff.

4. A new function NormalCoordinates is defined.

   NormalCoordinates[i] returns a list of {matrix,orbit} at location i in the
current beam line, where matrix is the 4*4 matrix from physical corrdinate to
the normal coordinate.   You can use SymplecticInverse[matrix] to obtain the
inverse.

   NormalCoordinates[i,param] returns {matrix,orbit} from the optical parameter
list param, which has been obtained by CalculateOptics or the Twiss function.

5. The action of While and Do to Return is changed, and now they are same as
Mathematica's.

					K. Oide

From:	KEKVAX::OIDE          2-MAR-1994 17:20:31.14
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bugs in Module, etc.

   Dear Users:

1. There has been a bug in Module since the change of the internal login on
2/13.   Returning the value of a local variable made a problem.

2. Table, Do, Sum, Product are updated.

3. The function ARRAY is converted to a defined function.

4. There was a bug in LinearSolve when the r.h.s. is a single vector.

					K. Oide

From:	KEKVAX::OIDE          4-MAR-1994 16:05:02.62
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Usage of DynamicApertureSurvey.

   Dear Users:

1. The usage of DynamicApertureSurvey is changed to handle more general
specification of NZ.

New Usage:  

DynamicApertureSurvey[{{xmin,xmax},{ymin,ymax},list_of_z},turns,option]

where list_of_z is a list of values of NZ to track.   If you write 
Range[zmin,zmax,zstep] for list_of_z, it works as the old usage.

   Please note that the values of EMITX and EMITY are correct when
DynamiApertureSurvey is called.   Those can be set by either Emittance[] or
 the EMIT command, but is reset to the values in the MARK at the beginning of
the line when you enter in FFS.

						K. Oide



From:	KEKVAX::OIDE          7-MAR-1994 18:02:48.66
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Twiss, etc.

   Dear Users:

1. A bug was found, by Kikuchi san, in the Twiss function.    If the first
argument is '*' or 'ALL', it does an unpredictable effect.

2. The internal logic on variables is updated.

					K. Oide

From:	KEKVAX::KIKUCHIM     11-MAR-1994 16:27:51.08
To:	@[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: FLAG, Monitor, Steer

Dear users,

New functions FLAG, Monitor and Steer were installed.

1. FLAG reads and writes sad flags.

  FLAG[flag,write]

  returns current setting of the flag.

 a) flag is a flag such as 'CELL', 'RING', etc.
 b) write is optional. if write is True, flag is set
    True and if it is False, flag is set False.

2. Monitor specifies monitor elements.

  Monitor[pattern,{dx,dy},{precx,precy},attachlist]

 returns a list of

  {position-of-monitors_List, {offsetx_List,offsety_List},
  {precisionx_Real,precisiony_Real},{attachlist_List}}

 a) pattern is a string or a list of string such as
   'M*' or {'M.1','M.2','M.4'}.
 b) dx and dy are real numbers that represent an offset of
   monitors relative to the nearest quad/sext.
 c) precx and precy are real numbers that represent a precision on
    each measurement. 
 d) attachlist is optional. It is a list of position of elements
    which is assumed to be the elements the monitor is fixed to.

3. Steer specifies steering elements

  Steer[pattern,error]

 returns a list of 

  {position-of-steers_List,error_List}

 a) pattern is a string or a list of string such as
   'Z*' or {'ZX.1','ZB.2','ZY.4'}.
 b) error is a setting error of the kick angle.

              M. Kikuchi


From:	KEKVAX::OIDE         13-MAR-1994 17:03:28.53
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Sort, Union, Order, etc.

   Dear Users:

1. New functions Sort, Union, and Order have been installed.   These are very
similar to Mathematica's, except the ordering of a character string and lists.

2. A problem in Length[x] for a non-list element x is fixed.

3. Error message is somewhat improved.   Now it often shows the name of the 
function which generated the error.

3. Attributes of Map, Apply, Select, MapAt are adjusted to those of 
Mathematica.

4. There has been a bug in the error handling routine related to the SetPart
operation.
						K. Oide

From:	KEKVAX::OIDE         14-MAR-1994 09:28:57.25
To:	KEKVAX::KIKUCHIM
CC:	OIDE
Subj:	RE: SAD/COR update: FLAG, Monitor, Steer

   I would like to establish the following as the baseline in SAD/FFS 
functions:

   <<  Policy of installing a new function into SAD/FFS. >>

1. Avoid names which already exist in Mathematica.

2. A name must be specific to what the function does.   The name must be
sufficient to be long such as DynamicApertureSurvey or OneTurnTransferMatrix.
This policy is actually different from the old policy on SAD/FFS commands, but
because in the functions we can define alias names for any functions, we do
not have to make the name short any more.

3. The number of compiled built-in functions should be minimized.   The
built-in functions should be limited to the basic functions, and its
derivatives should be defined as the defined-function.   For example, MapAll is
not a compiled function but defined by 
   
   MapAll[f_,a_]:=Map[f,a,{0,Infinity}];

. Handling of options is also easier in the defined function than in a compiled
form.

					K. Oide 

From:	KEKVAX::OIDE         15-MAR-1994 10:48:23.00
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Pattern and Optional.

   Dear Users:

1. A new operator : is defined.   It works in the same way as Mathematica's.

1)   symbol:pattern      gives a name "symbol" to pattern expression "pattern".

2)   pattern:default     defines an optional argument who's default value is
			"default".

The "default" is evaluated prior to the function call.
   There is some syntactical ambiguity in this definition.   For example a form
like x:y looks to belong both 1) and 2).    Like Mathematica, this form is
interpreted 1).   It may be a little bit strange to use the same notation for 
such different functions, but it is still better than the usage of [] in SAD.
([] means the body of a function reference, array subscript, and substring.)

						K. Oide


From:	KEKVAX::KIKUCHIM     15-MAR-1994 17:17:45.20
To:	@[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: CorrectOrbit

Dear users,

New defined function CorrectOrbit was prepared for coreections.

Usage:

   CorrectOrbit[monitor,steer,optics,options]

  monitor_List : a list of monitor element which is defined by the defined
                 function Monitor.
  steer_List   : a list of steerring element which is defined by the
                 function Steer.
  optics_List  : a list of optics parameters which is defined by the function
                 CalucalateOptics.
  options      : optional parameters in the form of opt->parameters;
    option     default
    ------------------------------------------------------------------------
    SetSteer   True    Set steer values.
    Solver     'LSQ'   type of solver routine. 'MICADO' is available.
    Zsum       False   'Zerosum' option for steerings.
    Tune       {0,0}   a list of tune {nu-x,nu-y}. If tune is zero, that of
                       optics is used for calculation of response matrix.
      (another option such as conditiond-correction, bump etc will be 
       available in near future)
    ------------------------------------------------------------------------
  output      : a list of kick angle

                       M. Kikuchi


From:	KEKVAX::YAMAMOTO     "Noboru" 15-MAR-1994 21:10:52.59
To:	@USER$DISK1:[OIDE]SADUSERS.
CC:	
Subj:	SAD update.

     Dear Users,

   SAD toplevel now accept character string as an argument for READ command.
It does not support file name expansion yet.

	Syntax of READ command:
	READ  |""|STD;

   Noboru

From:	KEKVAX::KIKUCHIM     17-MAR-1994 20:21:53.50
To:	@[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: extended CorrectOrbit.

Dear users,

Defined function CorrectOrbit was extended to accomodate
a lot of options.

Usage:

   CorrectOrbit[orbit-kind,monitor,steer,optics,options]

  orbit-kind   : a character or a list of characters which represent
                 kind of orbit to be corrected, for example, 
                 'X', 'EY', '{'X','Y'}, {'Y','EY'}, etc.
  monitor_List : a list of monitor element which is defined by the defined
                 function Monitor.
  steer_List   : a list of steerring element which is defined by the
                 function Steer.
  optics_List  : a list of optics parameters which is defined by the function
                 CalucalateOptics.

  options      : optional parameters in the form of opt->parameters;
    ________________________________________________________________________
    option     default        descriptions
    ------------------------------------------------------------------------
    SetSteer   True            Set steer values.
    Solver     'LeastSquare'   Type of solver routine. 'Micado' is available.
    ZeroSum    False           'Zero-sum' option for steerings, that means
                               the solution obey a constraint of
                                  Sum[c[i]*x[i],{i,NumberOfSteer}]==0,
                               where, c[i]=BendLength[i]*K0_in_Design)[i].
    Tune       {0,0}           a list of tune {nu-x,nu-y}. If tune is zero, 
                               that of optics is used for calculation of 
                               response matrix.
    Orbit      orbit in the    a list of orbit values which is to be minimized.
               Twiss buffer    Example: 
                             {Twiss['DX',Monitor_List],Twiss['DY',Monitor_List}
                              if Orbit-kind is {'X','Y'}.
    Calc       True            Calulate a resultant optics and set it in the 
                               Twiss buffer--without copying "power-supply" 
                               values--, that has been done in the COR 
                               command automatically.
                               (This is nearly the same as CALC command, which
                                copies "power-supply" values before calcul-
                               ation)
    Epsilon    1e-8            Epsilon value for the LinearSolve.
    Condition  {{},{}}         A list {c,d}, where c is a matrix and d is
                               a vector representing a condition equations
                               that the solution should obeys:
                                            c.x==d  .
                               For example, ZeroSum->True is equivalent to
                               Condition->{{1,1,...,1},{0}} ,
                               (if all the steering has the same length and
                                K0).
      (another option such as bump etc will be
       available in near future)
    ------------------------------------------------------------------------
  output      : a list of kick angle

                                                          M. Kikuchi


From:	KEKVAX::OIDE         18-MAR-1994 08:51:30.68
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Operation for one or zero arguments.

   Dear Users:

1. Operations with one or zero arguments are managed as close to Mathematica's
as possible.   For instance, Plus[] returns 0, and Plus[3] returns 3, etc.

					K. Oide

From:	KEKVAX::KIKUCHIM     19-MAR-1994 18:27:14.41
To:	@[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: On Condition option in CorrectOrbit.

Dear users,

 More convenient form of Condition option for CorrectOrbit was 
prepared.
  
  Condition->{{'ZX.1','ZX.2','ZX.3'},{1,-2,1},0}}

is acceptable. This is equivalent to 

      ZX.1 -2*ZX.3 +ZX.3 == 0  .

An older style, 

  Condition->{c,d}  (* c and d represents the condition  c.x==d *)

is still accepted.

                                        M. Kikuchi

From:	KEKVAX::OIDE         20-MAR-1994 11:38:19.73
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bugs.

   Dear Users:

1. The EXEC command has bee out of function since about January.

2. There has been a bug in Map, Apply, MapAt, etc., when map(apply)ing a
defined-function which returns a non-numeric list.   Actually this was a
serious because it is related to a deep defect in the current logic in the
variable allocation.   Although it is temporarily fixed, there still remains a
possibility of similar bugs.   Please use Map, Apply, etc. more and more 
to find out the bug, but be careful on the result.

3. A new function Sign and Rest is installed.

					K. Oide

From:	KEKVAX::OIDE         22-MAR-1994 10:12:08.94
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   bug in SingularValues.

   Dear Users:

1. SingularValues has been wrong when the matrix A has more lines than columns.

					K. Oide

From:	KEKVAX::OIDE         27-MAR-1994 10:33:28.55
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Problem in Element, etc.

   Dear Users:

1. The Element function has been strange if it is used as 

   Element[keyword,name]=value ,

and when keyword is same as the matching variable (such as K1 in QUAD, ANGLE in 
BEND, etc.)   It has been changed the saved value, not the current value to be
used in CALC or GO commands.   I have changed this situation so that if the
keyword is same as the matching variable, it changes only the current value and
does not touch the saved value.   If it is not the matching variable (like L in
QUAD, ROTATE in BEND, etc.), it changes the saved value, because there is no 
current value for such keyword.

2. The internal login of Select is updated for a better performance.
					
							K. Oide

From:	KEKVAX::OIDE         28-MAR-1994 08:36:00.57
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   TableForm, etc.

   Dear Users:

1. A new defined functino TableForm is introduced.   It is convenient to print
out a list or matrix.   At this time only a primitive version is released.

Usage:     TableForm[x]

No option is possible.

2. The output routine is somewht improved to handle a very long string and a
string in the quoted format.

					K. Oide

From:	KEKVAX::OIDE         31-MAR-1994 12:20:30.37
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   LINE, Element.

   Dear Users:

1. Now the functions LINE and Element accept the FFS-wildcard string as the
second argument for most keywords (first argument).   For example

   Element["NAME","Q*"]

returns a list of element names staring "Q".   This function returns a list if
zero or more than 1 element matches, and a non-list quantity if only one
matches or no wildcard is used.
					K. Oide

From:	KEKVAX::OIDE          1-APR-1994 06:36:47.55
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New functions: Scan, Identity, Hold, ReleaseHold, TimeUsed.

   Dear Users:

1. New functions Scan, Identity, Hold, ReleaseHold, TimeUsed are Installed.  
Those are essentially same as Mathematica's.

						K. Oide

From:	KEKVAX::OIDE          5-APR-1994 00:21:44.15
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   AtomQ, NumberQ, VectorQ, MatrixQ, Outer, etc.

   Dear Users:

1. New functions AtomQ, NumberQ, VectorQ, MatrixQ, and Outer has been added.  
Those are same as Mathematica's.

2. Subroutine tqr is modified to remove a probably-unnecessary part on
degeneration.
						K. Oide

From:	KEKVAX::OIDE          5-APR-1994 16:23:45.52
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in LINE & Element.

   Dear Users:

1. There has been a bug in LINE and Element whe the keyword is "POSITION".  Not
only that it caused an error when there is no element for the specified name,
but it now returns a null list.
					K. Oide

From:	KEKVAX::OIDE          7-APR-1994 10:51:38.70
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   "GEO" in LINE, Count, Position, etc.

   Dear Users:

1. A new keyword "GEO" is added to LINE to read geometric parameters of the
beam line.

Usage:		LINE["GEO"]
		LINE["GEO","QF*"], etc.

Above returs a list of lists.   Each component has a form

		{{Rxi,Reta,Rzeta},{chi1,chi2,chi3}}

whose definition is same as the FFS convention.   The unit of chi's are radian.
At this time we cannot calculate those parameters by a function, but by the
CALC command.

2. New function Count is added.   The function Position now accepts the
levelspec.   Those are same as Mathematica's, except the option is not yet
possible.
					K. Oide

From:	KEKVAX::KIKUCHIM      8-APR-1994 20:16:36.93
To:	@[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: New defined function MakeBump

Dear Users,

New defined function MakeBump was written. This corresponds to
old command BUMP.

Usage --->  MakeBump[orbitcondition_List,target,XorY,nsteer,steer,opt,option]

Result --->(1) Returns a list of kick angle, 
           (2) set them to steers if SetSteer->True in option_list, and
           (3) calculate optics and save th result in the buffer Twiss if
               Calc->True.
Arguments --->
 (1) orbitcondtion_List : a list or a list of list of orbit conditions. This
        should be given by the forms of
        {name,variable,value} or a list of it. For example,
        {'QF.1','X',1e-3} ---> x should be 1e-3 at QF.1
        {{'QD.1','X',1e-3},{'QF.1','PX',0}} ---> x should be 1e-3 at QD.1
                                             AND px should be 0 at QF.1

      ather conditions to make the bump closed is given by the following
            arguments: target, XorY, nsteer
 
 (2) target: a name or a position of center of the bump around which 
             appropriate stters are automatically selected.
 (3) XorY  : specify 'X' or 'Y' to make a horizontal or vertical bump.
 (4) nsteer : number of steers to make the closed bump. It might be extended
             automatically upto nsteer+3, in the case of coulpled line.
 (5) steer : a list of steers. This should be given by the function 
             Steer[...].
 (6) opt : a list of optics values. It is given by the function
             CalculateOptics.
 (7) options: optional argument to set options. The following options are 
             currently available.

     option     default      description
    _______________________________________________________________________
    SetSteer    True         Set kick-angles to steers.
    Calc        True         Calculate optics after setting the kick-angles
    _______________________________________________________________________

Examples ---> 
   opt=CalculateOptics[1,LINE['LENGTH'],{0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
       0,0,0,0,0,0,0,0,0},FLAG['CELL'],2];          ! calculate design_optics
   str=Steer['Z*'];                                 ! define usable steers
   FcolCos={{'IIIF','Y',y},{'IIIF','PY',0}};        ! define conditions
   MakeBump[FcolCos/.y->1e-3,'IIIF','Y',6,str,opt]; ! make vertical bump.

                                       M. Kikuchi

From:	KEKVAX::KIKUCHIM      8-APR-1994 20:30:48.95
To:	@[OIDE]SADUSERS.
CC:	
Subj:	Resend previous mail.

Dear Users,

New defined function MakeBump was written. This corresponds to
old command BUMP.

Usage --->  MakeBump[orbitcondition_List,target,XorY,nsteer,steer,opt,option]

Result --->(1) Returns a list of kick angle,
           (2) set them to steers if SetSteer->True in option_list, and
           (3) calculate optics and save th result in the buffer Twiss if
               Calc->True.
Arguments --->
 (1) orbitcondtion_List : a list or a list of list of orbit conditions. This
        should be given by the forms of
        {name,variable,value} or a list of it. For example,
        {'QF.1','X',1e-3} ---> x should be 1e-3 at QF.1
        {{'QD.1','X',1e-3},{'QF.1','PX',0}} ---> x should be 1e-3 at QD.1
                                             AND px should be 0 at QF.1

      ather conditions to make the bump closed is given by the following
            arguments: target, XorY, nsteer

 (2) target: a name or a position of center of the bump around which
             appropriate stters are automatically selected.
 (3) XorY  : specify 'X' or 'Y' to make a horizontal or vertical bump.
 (4) nsteer : number of steers to make the closed bump. It might be extended
             automatically upto nsteer+3, in the case of coulpled line.
 (5) steer : a list of steers. This should be given by the function
             Steer[...].
 (6) opt : a list of optics values. It is given by the function
             CalculateOptics.
 (7) options: optional argument to set options. The following options are
             currently available.

     option     default      description
    _______________________________________________________________________
    SetSteer    True         Set kick-angles to steers.
    Calc        True         Calculate optics after setting the kick-angles
    _______________________________________________________________________

Examples --->
   opt=CalculateOptics[1,LINE['LENGTH'],{0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
       0,0,0,0,0,0,0,0,0},FLAG['CELL'],2];          ! calculate design_optics
   str=Steer['Z*'];                                 ! define usable steers
   FcolCos={{'IIIF','Y',y},{'IIIF','PY',0}};        ! define conditions
   MakeBump[FcolCos/.y->1e-3,'IIIF','Y',6,str,opt]; ! make vertical bump.

                                       M. Kikuchi


From:	KEKVAX::OIDE         13-APR-1994 09:51:04.20
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Reverse, Bug in Select, MatrixQ, etc.\

   Dear Users:

1. A new function Reverse is added.   It is same as Mathematica's.

2. A bug is found in Select and MatrixQ when the list has only one component.

3. The internal logic of calling a defined function and pattern matching is
updated to reduce the overhead.   The overhead becomes 1/3 of before and now
faster than Mathematica in most cases.
					K. Oide

From:	KEKVAX::OIDE         27-APR-1994 03:41:29.65
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Internal logic for function calls.

   Dear Users:

1. The internal logic for symbol-asignment, especially for the defined-function 
calls, are updated to be consistent.   No changes should be noticed by this
update.

						K. Oide

From:	KEKVAX::OIDE         27-APR-1994 13:05:50.74
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in GCUT.

   Dear Users:

1. There has been a problem in GCUT since probaly October last year, that the
internal value of 'GCUT' is not updated only by the error-specifying commands
like DELX, etc.   It is updated by CALC or GO or EMIT, etc.   Thus when you
specify an error by DELX etc right after GCUT=value, it was not effective at
all.   If you have done CLAC or GO or EMIT or STAT before DELX, it was OK.
This bug is caused at the very beginning of the installing variables, functions,
and expressions in FFS.

					K. Oide

From:	KEKVAX::OIDE          1-MAY-1994 02:32:25.07
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Element["NAME"] .

   Dear Users:

1. There has been a bug in Element["NAME",n], where n is a number.   (It
returns a long character string.)     It is fixed.
					K. Oide

From:	KEKVAX::OIDE          4-MAY-1994 02:10:45.57
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   lower case letters in keywords of LINE,Twiss,Element .

   Dear Users:

1. The keywords in functions LINE, Twiss, and Element now accept lower case
letters.   All lower cases are converted to upper cases.

					K. Oide

From:	KEKVAX::OIDE          4-MAY-1994 02:59:47.26
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in input reader routine.

   Dear Users:

1. There has been a strange bug that if one once make an error of missing 
closing quote, the input reader of FFS persist to think it is in the quotation, 
so that the comment (!) is not understood properly, until you "close" the 
quotation by typing another quote. This has been corrected.

					K. Oide

From:	KEKVAX::OIDE          5-MAY-1994 03:24:27.19
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   TracePrint, etc.

   Dear Users:

1. A new function TracePrint is added.

Usage:	TracePrint[expr]

prints expressions in expr before its evaluation.   The printed expression is
o
limited to those at the first level of the CompondExpression (;).  
This function is useful for debugging.   At this time this function is
differently works as Mathematica's, and takes only one argument.

2. There has been a problem in the internal logic of variable scoping in
defined-functions since the change of last month.   This problem may deassign
the value of a local variable of an argument of a defined function in some
cases.

						K. Oide

From:	KEKVAX::OIDE          9-MAY-1994 03:12:37.70
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Definitions, etc.

   Dear Users:

1. A new funtion Definition is added.

Usage:   Definition[symbol1,symbol2,...]

prints out the definitions associated with symbol1... (which can be any
expression.)   This may help your debugging.

2. The MEASURE command now takes the initial x-y coupling R1..R4 into account.

					K. Oide

From:	KEKVAX::KIKUCHIM     10-MAY-1994 23:10:11.15
To:	@[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: Bugs in MICADO

Dear users,

I have found a bug in the MICADO code. It has NOT selected
'best' correctors in almost all the cases. This bug has lived
since Micado was implemented. I apologize to users who have drawn
a critical conclusion based on the Micado.

						M. Kikuchi


From:	KEKVAX::OIDE         12-MAY-1994 02:47:32.71
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in scoping.

   Dear Users:

1. There has been a problem in the scoping logic of a symbol.   If a symbol is
once defined as a local variable of Module first, the reference at the symbol
in the main level may results "Too deep recursivce call".   This is corrected.

					K. Oide

From:	KEKVAX::OIDE         24-MAY-1994 16:57:20.96
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Tab code, etc.

   Dear Users:

1. A TAB code can be used in the input deck.   It is interpreted as a space
everywhere.   If you want to enter a TAB code in a string, use \t.

2. Symbol name SEED has been wrong ly asigned a symbol value "Sin" to make 
SEED=n error, to avoid confusing SEED command, but it was a bad idea.
Now symbol SEED has a value of symbol SEED and it is protected.    Thus SEED=n
causes an error and SEED n works as a command.

						K. Oide

From:	KEKVAX::OIDE         25-MAY-1994 15:01:54.22
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in #variable.

   Dear Users:

1. Due to yesterday's change, a bug is created to cause an error when a number
is stored to #variable, like #QF, etc.

						K. Oide

From:	KEKVAX::OIDE         28-MAY-1994 08:21:55.68
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in MULT.

   Dear Users:

1. The MULT element is changed to include skew multipole componets and fringe
field for multipoles.

Keywords:
	L			(length)
	K0, K1, .., K14 	(normal component of multipoles)
	SK0, SK2, ..,SK14 	(skew components of multipoles)
        EPS  			(accuracy.   The default is 10^-4)
        DX, DY, ROTATE		(misalignments)
        DISFRING     		(if nonzero, fringe field is turned off)
        DISRAD       		(if nonzero, radiation is urned off)

   Note that there is no skew component of the quadrupole component.   You 
have to ROTATE the magnet to get it.
   At this time MULT is only avaialble in TRACK and EMIT, not in FFS optics
matching.   FFS will be changed after 6/7.

						K. Oide



From:	KEKVAX::OIDE          8-JUN-1994 13:08:29.69
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in tracking in thin steering or bend.

   Dear Users:

1. A bug was found in the tracking routine in a thin-steering-bend (both L and
ANGLE are zero.)   This caused Segmentation fault in some cases.

2. A problem in the formatting routine autofg is fixed.   It caused an error
when the column width is less than six and the number is negative and the
exponent is smaller than -99.

						K. Oide

From:	KEKVAX::OIDE          9-JUN-1994 19:46:38.44
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New keyword V1 and ROTATE in cavity.

   Dear Users:

1. A new keyword V1 and ROTATE are added in a cavity element.   ROTATE is the
skew rotation angle which is same as QUAD and others.   The new keyword V1 is
for dVc/dx (change of acceleration by horizontal displacement) of the cavity.   
Its unit is V/m.   At this time only the tracking includes the effect of V1.

						K. Oide

From:	KEKVAX::OIDE         10-JUN-1994 14:11:28.42
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Normal coordinate in EMIT when RFSW is OFF.

   Dear Users:

1. The choice of the normal coordinate in EMIT is changed in the case that RFSW
is OFF, to nullify the (5,6) component of the coordinate transformation matrix.
Actually this has been done already if RFSW is ON.   Without this choice, the
(5,6) component may become a huge number which gives wrong number of momentum
compaction or bunch length, even if it is mathematically no problem.

						K. Oide

From:	KEKVAX::KIKUCHIM     20-JUN-1994 18:17:24.83
To:	@[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: New Defined function MakeBump

Dear users,

New function MakeBump was developed in order to make a bump.
It extends the old command BUMP in some sence.

Usage: 
	MakeBump[bump_conditions,correctors,optics]

	bump_conditionss: a list of bump conditions. The following styles
			of specification, for example, are allowed:
		1.   {'QF','X',1e-3}
		2.   {{'QF','X',1e-3},{'QD','PX',1e-4}}
		3.   {{'QF','X',1e-3},'QF','X',6}
		4.   {{{'QF','X',0},{'QF','PX',1e-4}},'QF,'X',6}
		The first means that x should be 1mm at "QF", and the
		second that x should be zero while px is 0.1 mrad at "QD".
		The third specifies a target "QF" at which the bump is made
		centered, a plane "X", the horizontal plane in this case, and
 		the number of correctors to make a bump under the condition that
		x==0 at "QF". The fourth is the same as the third except it
		also demands that px==1e-4 at "QF".
	correctors: corrector elements that is given by a function Steer.
	optics: an optics which is given by CalculateOptics.
 Example:
	1. opt=CalculateOptics[.....];
	   .......
	   str=Steer['Z*'];
	   MakeBump[{{{'QF','X',1e-3},{'QD','PX',1e-4}},'X',6},str,opt];
	2. MakeBump[{{'QF','X',0},{'QF','PX',1e-4}},str,opt];
	  ! This makes an orbit that satisfies x==0 at "QF" and px==1e-4 at "QF"
	  ! using all the correctors.

							M. Kikuchi


From:	KEKVAX::OIDE         21-JUN-1994 06:50:32.42
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Weight of matching variables, etc.

   Dear Users:

1. The weights of matching variables are changed:

type		old		new

drift		1/(ave. L)^2	1/(ave. beta)^2
bend		1/L		1/sqrt(emit*ave.beta+eta^2 DP^2)
quad		1		1
sext		eta*DP		eta*DP

The biggest change is made for the weight of bend.    Its change has been to
much in most cases, compared to other elements.

2. The limit on the number of matching functions times matching variables is
removed.   You can increase them as much as the memory is available.

					K. Oide

From:	KEKVAX::OIDE         22-JUN-1994 07:33:17.08
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Weight in off-momentum matching.

   Dear Users:

1. The weight in the off-momentum matching is changed.   Now the square of the
residuals of each function is divided by the number of the momentum points.  
It gives more weight in the on-momentum matching when on-momentum matching and
off-momentum matching are done simultaneously.   Nevertheless the printed
number of the residual becomes smaller in the case of the off-momentum
matching.   (You should multiply the number of momentum points to compare with
the old residuals.)

2. When there are more than one marker elements with the same name exist in a
line, it has been the LAST one to be saved its values by the SAVE and STOP 
commands.   Now it is changed to save the LAST one.    This should be less
confusing (but it is still confusing anyway).

						K. Oide

From:	KEKVAX::OIDE         24-JUN-1994 20:34:53.66
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Number of off-momentum points, etc.

   Dear Users:

1. Now the number of the off-momentum optics in the matching has become 
unlimited, as long as there is enough memory.   According to this change,
entire objects are recompiled, so there may appear some unexpected side-effect.

2. A new command FITP_OINTS is created to change the number of the off-momentum 
condition simultaneously for all matching condidtions, unless the condition is
only for on-momentum.

Usage:

   FITP n

changes all conditions to n off-momentum points, unless the present number of
points for the condition is 1.

						K. Oide

From:	KEKVAX::OIDE         27-JUN-1994 09:47:07.13
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in DAPERT when number of z is larger than 50.

   Dear Users:

1. There has been a bug in DAPERT tracking when the number of points in
z-direction is larger than 51.   At least the results after the 52nd line 
were wrong.

					K. Oide

From:	KEKVAX::OIDE         29-JUN-1994 14:19:26.85
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   DAPERT, bend.

   Dear Users:

1. Now you can specify a negative number to the NX and NY parameters of the
DPAERT tracking.    This means the initial amplitude can be negative.   Please
note that the second number of Nx or NY must correspond to the worse aperture,
i.e., NX=(0, -50) is usually OK but NX=(-50, 0) is not.    The reason is that
the tracking starts from the second number toward to the first, and stops when
sccessive 7 points make full turn.

2. The optics calculation in FFS for a flat-bend is changed.    The routine for
the body of bend becomes exact and same as the routine for emittance and
tracking.
					K. Oide

From:	KEKVAX::OIDE         30-JUN-1994 15:07:28.18
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in EXEC .

   Dear Users:

1. There has been problems in the EXE_CUTE command:

a) After an execution, the rest of line was ignored.
b) Lower case letters in the command string were capitalized.

Those are fixed.

2. The internal logic of the matching condition handling is changed.    Also
the maximum number of conditions is increased to 3001.

					K. Oide

From:	KEKVAX::OIDE          1-JUL-1994 15:20:11.38
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in matching NY with CELL, FitValue.

   Dear Users:

1. A bug was found in the matching of NY when CELL is on.   The derivative of
NY has been wrong.    This bug has been there at least since 6/5/1992, until
Kamada san pointed out today that the converging speed of NY is too slow in 
his lattice.   It is amazing that nobody has not noticed this for more than two
years.   Maybe the special logic of the matching in FFS has conceiled the bug.

2. Now you can specify the goal of a matching as a value of any function with
FitValue.

Usage:   FitValue[loc,fun,dp_,v_,vnow_]:= (function body);

where	loc:	character string to specify the location of fit, like "QF.2"
	fun:    character string to specify the fitting function, like "BX"
	dp_:	pattern to receive dp/p 
	v_:     pattern to receive the fitting value given by FFS commands.
	vnow_	pattern to receive the current value of the function.

At this time the zone-fitting or the relative fitting does not support
FitValue.

example:    FitValue["***","NX",dp_,v_,vnow_]:=v_+2*Pi*0.02*(dp/0.01)^2;

After this setting, the off-momentum matching of NX creates a second-order
chromaticity.

To clear FitValue, use Clear or FitValue[....]:=v .

						K. Oide


From:	KEKVAX::OIDE          2-JUL-1994 11:38:19.67
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   DECA.

   Dear Users:

1. A decapole element is now introduced in FFS, TRACK,and EMIT.

Usage    DECA   name=(	L = length 
			K4 = B''''L/Brho
			DX = x-offset
			DY = y-offset
			ROTATE = skew rotaion angle
			DISFRING = nonzero to disable nonlinear Maxwellian 
				fringe
			ÄISRAD = nonzero to disable radiation )

The keywords are equal to those of SEXT except K4 instead K2.

						K. Oide

From:	KEKVAX::OIDE          2-JUL-1994 17:15:25.25
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   MULT in FFS.

   Dear Users:

1. Now a MULT element can be used in FFS.    The optics is calculated, yet it
can still not be a matching variable.   The optics calculation is much simpler
in FFS than in EMIT or TRACK to save CPU time.    The parameter EPS is not
valid in FFS.   Also the fringe field is not taken into account.

						K. Oide

From:	KEKVAX::OIDE          3-JUL-1994 08:46:15.67
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Matching by MULT.

   Dear Users:

1. Now you can use a MULT element for a mtching variable in FFS.   You can
choose one of K1, K2, K3, K4 as the variable by the VARY command.

Usage:    VARY K1 elem1, [elem2,...]

which is similar to the case of BEND (ANGLE and K1 are choosable).
The default variable of MULT is K1.
   Thus any straight magnet can be defined as MULT in principle, but the speed
is significantly slow compared to individual routines.   There still
unsupported keywords remain in MULT like F1, F2, FRINGE of QUAD, etc.

						K. Oide

From:	KEKVAX::OIDE          5-JUL-1994 15:01:31.22
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug.

   Dear Users:

1. A bug was found in the routine to read a number.   This bug has been there
since September last year, but its effect depended on circumstances.   The
worst case caused Floating Exception, otherwise no problem.

						K. Oide

From:	ACSAD1::YAMAMOTO     "Noboru Yamamoto" 13-JUL-1994 09:58:43.21
To:	@AHSAD.ML
CC:	KEKUX::"SY02@KEKCC.KEK.JP"
Subj:	Task Broker on CCWS91

   Dear SAD users,

  Now Task broker daemon is running on CCWS91, one of the work staion 
in Data Handling Division. A job you submitted on AHSAD may  run on CCWS91.
I hope you cannot distinguish the difference between ahsad and ccws91. BUT
if you have any trouble related with this change, please contact with 
Yamamoto.

  Thank you for your co-operation,

   Noboru Yamamoto

From:	KEKVAX::OIDE         13-JUL-1994 19:17:02.49
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in steering, etc.

   Dear Users:

1. There was a bug in the tracking for a steering magnet of lenth zero.   It
has caused a segnentation fault.

2. The tracking of a steering was wrong when FRINGE is nonzero, which mean the
linear fringe given by the parameter F1 is ON.

3. The weight of matching function for off-momentum matching is changed.   The
on-momentum part has a weight of 1, and each off-momentum part has weight of
1/n, where n is the number of off-momentum points.

4. If you use the rmon, rmons, rmonr commands or -u function in
classic.el to monitor the processes of ahsad cluster, please make a file named 
.rhosts in your home directory to see the processes on CCWS91.   The example 
of .rhosts is in /users/oide/.rhosts .   You may copy it and change the uid 
in the file.

							K. Oide


From:	KEKVAX::OIDE         15-JUL-1994 22:49:16.74
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in TITLE & CASE in drawing.

   Dear Users:

1. The TITLE and CASE in drawings have been malfunctioned since probably around 
last November.   It is now fixed.

Usage(in FFS Only):

	    TITLE="title string"
	    CASE ="case  string"

Those are used for the arguments of the TITLE and CASE commands of TopDrawer.

						K. Oide

From:	KEKVAX::OIDE         23-JUL-1994 06:45:49.36
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   A new type of element, MAP.

   Dear Users:

1. A new type of element MAP is introduced.   This is made to enable a 
user-defined map of particles and also to allow user to do anything (doing 
statistics, etc.) at any point of a line during a tracking. 

Usage:

First define a MAP element at MAIN level:
 
     MAP    name=();

Right now it does not have any keyword.    Insert it at the location(s) where
you want to use it.

Then in FFS, define the function ExternalMap as

    ExternalMap["TRACK",n,nt_,x_]:=body;

where the first argument must be "TRACK".   The second argument n is the
position of MAP couting from the beginning.    It can be obtained using
LINE["POSITION","name.m"].    The third argument nt_ is used to receive the
number of turns which is incremented by the tracking.   The last argument x_ is 
used to receive the coordinates of particles.    It is [7,np] list of real
numbers.    The elements [1..6,i] is (x,px,y,py,z,dp/p) of i-th particle.
The [7,i] element is 1 if the i-th particle still survives, and 0 if it is
lost.

You can define ExternalMap to change the coordinates of each particle as you
like by returning a new x in the same format as above.    If you do not return
it or you return in a different format, the tracking routine does not change
the particle coordinates.    You can neither rebirth a lost particle nor kill
a surviving particle.

After defining ExternalMap, it is called every turn in tracking.

Example:

   MAP P1=();
   ....
   LINE A=(... P1 ... P1 ...);
   ....
   FFS USE=A;
     ExternalMap["TRACK",LINE["POSITION","P1.2"],nt_,x_]:=
	(Print[x];x*2);

   ....
   TRACK USE=A ....;

This example defines ExternalMap to print out the coordinates of all particles
at the second P1 in the line A.    It also makes all coordinates of all
particles twice in every turn.

   This routine has been just installed today and your comments will improve
this further.
						K. Oide


   

From:	KEKVAX::OIDE         24-JUL-1994 14:00:52.99
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in APERT.

   Dear Users:

1. The keywords of APERT are changed.    The keywords DX and DY are deleted and
DX1, DX2, DY1, DY2 are created instead.    DX1 and DX2 specify the aperture
range in x and DY1, DY2 in y.    You have to specify all four keywords, since
the default is zero which is not suitable for a usual case.

2. The automatic check of amplitude in tracking has not been working when the
ring is too short, typically less than 20 elements.    It is corrected and the
amplitude is checked in every turn.

						K. Oide

From:	KEKVAX::OIDE         25-JUL-1994 14:10:39.05
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   CMPLOT.

   Dear Users:

1. The meaning of CMPLOT flag is changed.    It has been used to plot the
average of all paricles in the tracking, but now it is anly used to specify the 
Gaussian distribution at the beginning of the tracking.    The center of mass
can be plotted by other tools using RESULTSOFTRACKING, TrackParticles,
ListPlot, etc.

2. In the case that RFSW=ON but without RF cavity, EMIT does not calculate
EMITZ.   In such case the tracking now uses SIGZ instead of EMITZ to give the
initial amplitude in z direction.
						K. Oide

From:	KEKVAX::OIDE         14-AUG-1994 19:34:20.48
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.    New functions Intersection and Complement.

   Dear Users:

1. New functions Intersection and Complement have been built.    Those are same
as Mathematica's.

Usage:    Intersection[list1, list2, ...]   gives a sorted list of members
              which are contained in all fo list1, list2, ...

          Complement[eall, e1, e2,...]   gives a sorted list of members of eall 
              which are contained in none of e1, e2, ....

						K. Oide

From:	KEKVAX::OIDE         15-AUG-1994 11:52:54.63
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   MemberQ, Position.

   Dear Users:

1. A new function MemberQ is added.   This is same as Mathematica's.

   Usage:   MemberQ[list, pattern]
	    MemberQ[list, pattern, levelspec]

2. Function Position now take the optional fourth argument to specify the
maximum number of elements to be returned.   This is same as Mathematica's.

   Usage:   Position[list, pattern]
            Position[list, pattern, levelspec]
            Position[list, pattern, levelspec, n]   <---  new .

3. A problem was found in the Protect and Unprotect functions.   It did not
return the internal return-code properly.
				
						K. Oide

From:	KEKVAX::OIDE         17-AUG-1994 08:25:31.66
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Underflow in optics calculation, etc.

   Dear Users:

1. During optics calculation in FFS the underflow has been ignored since SAD
moved to ahsad, but it sometimes spent a signinficant amount of CPU time due to
the floating exception trap.   Now a very small amount of the twiss parameters
(less than 10^-40) is forced to be zero.

2. New (defined) functions Round, Nest, NestList, Fold, FoldList are added.    
Those should be same as Mathematica's.

3. There was a problem in the Floor and Ceiling functions when the argument is
an integer.
						K. Oide

From:	KEKVAX::OHMI         24-AUG-1994 11:48:20.77
To:	@[OIDE]SADUSERS.
CC:	
Subj:	beambeam interaction on sad

Dear Users
Beam beam simulation becomes available on sad.
The Beam beam element is defined by a decralation, BEAMBEAM.
An example is shown here.

 BEAMBEAM    BMBM  =(NP=1.4D10 BETAX=0.3296D0 BETAY=0.8D-2 EX=0.D0
             EY=0.D0 EMIX=1.7364D-8 EMIY=3.44D-10 DP=0.7589D-3
                          ALPHAX=0.D0 ALPHAY=0.D0 SIGZ=3.964D-3
             SLICE=5.D0  XANGLE=10.D-3 STURN=nstart)
 ;

 Define other elements .....

 MARK IP ......
 ;
 LINE  ARC=(....... ) 
       RING=(IP BMBM ARC);
 EMIT USE=RING;
 nparticle=20;
 ON CMPLOT;
 TRACK USE=ASC NPART=nparticle TURNS=nturn
   NX=(1)
   NY=(0.14142)
   NZ=(1);

More informations are in ahsad*:/users/ohmi/texs/BB.ps, which is Postscript
file.

Regards,       K.Ohmi


From:	KEKVAX::KIKUCHIM      6-SEP-1994 17:04:37.68
To:	@[OIDE]SADUSERS.
CC:	
Subj:	Lattice Editor

Dear users,

	I have written a Mathematica function which reads
a SAD input deck, modifies it and writes it on another file.
This function is able to insert steerings, for example, at 
specified positions and to automatically adjust neibouring 
drifts lengths.

Example:

  filein="/users/kikuchim/KEKB/LER/fqlc80.sad";
  fileout="/users/kikuchim/KEKB/LER/fqlc80z.sad";

  data=First[ ReadList[filein,Record,RecordSeparators->{}] ];
  inf=StringToStream[data];

  newdata=
  EditLine[data,"FQCELL","QD* L*","QD* LQZ Z L*A",
    ElementDefinition->
   "DRIFT L*A=(L=LENGTH[L*]-LENGTH[LQZ]-LENGTH[Z]);"];

  WriteString[fileout,newdata]

  In this example, the line "FQCELL" is edited such that
a sequence of elements that match "QD* L*" is modified to 
"QD* LQZ Z L*A", adding element definitions by
"DRIFT L*A=(L=LENGTH[L*]-LENGTH[LQZ]-LENGTH[Z]);".
  The function LENGTH[x] searches a definition of x in the input
file and returns the length of the element x.

If you want to use please contact me.

				M. Kikuchi
 

From:	KEKVAX::OIDE          6-SEP-1994 23:17:42.37
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Set to head of list in Set, ReplacePart.

   Dear Users:

1. There has been a problem in Set and ReplacePart when it is done to the head
of a list.   In the worst case, it destructs the memory allocation.   It is
fixed.
						K. Oide

From:	KEKVAX::OIDE          9-SEP-1994 05:08:14.56
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in DISP B.

   Dear Users:

1. The DISP B command now displays more practical quantities than before,
especially when the x-y coupling is non-negligible.   It prints out

AXp:	Projected alpha_x
BXp	Projected beta_x
EMITXp:	Projected emittance_x
EXp:	Projected eta_x
EPXp:	Projected eta'_x
Element:Name of element
Sigx	Projected x-size
Sigy	Projected y-size
rot	rotation angle in x-y plane
AYp:	Projected alpha_y
BYp	Projected beta_y
EMITYp:	Projected emittance_y
EYp:	Projected eta_y
EPYp:	Projected eta'_y
sigp:   sigma_p

Those quantities are more or less close to those which can be directly 
measured in a real machine.

						K. Oide

From:	KEKVAX::OIDE          9-SEP-1994 22:08:42.74
To:	@SADUSERS.
CC:	OIDE
Subj:	Lectures on Beam Dynamics.

   Dear Users:

   The accelerator theory group of KEK will hold:

--------------------------------------------------------------------
                Lecture Series on Particle Dynamics
                    from 11 to 21 October 1994 
		     Building "3-goukan", KEK
                   KEK Accelerator Theory Group
 
We are happy to anounce a series of lectures given by three leading
physicists from 11 to 21 October. 

K. L. Brown (SLAC) 
               "A Brief History of the Development of Linear and
               Non-Linear Charged Particle Optics from 1946-1994

               with applications to the design of Spectrometers,

               Beam Lines, Linear Accelerators, Linear Colliders,
               and Closed Orbit "Circular" Machines."
                   11 (Tue.)          13h30m-15h00m  Room 425
                   12 (Wed.)          13h30m-15h00m  Room 425

J. Irwin   (SLAC)
              "Calculation of the Beam-Beam Tail" 
                   11 (Tue.)          15h30m-17h00m  Room 425
              "Use of Lie Algebra for Accelerator Design" 
                   12 (Wed.)          15h30m-17h00m  Room 625

A. Dragt (Maryland) 
              "Moment invariants for Nonlinear Hamiltonian Systems"
                   13 (Thu.)          13h30m-15h00m  Room 625
              "Taylor series maps and their Domain of Convergence"
                   14 (Fri.)          13h30m-15h00m  Room 625
              "Lectures on  Lie Methods with Applications to Nonlinear
               Dynamics and Ray Optics"  
                   17 (Mon.)          10h30m-12h00m  Room 625
                   18 (Tue.)          13h30m-15h00m  Room 425
                   19 (Wed.)          10h30m-12h00   Room 625
                   20 (Thu.)          10h30m-12h00   Room 625
                   21 (Fri.)          10h30m-12h00   Room 625 

For detail, reservation of KEK dormitory, etc,                
contact K.HIRATA (tel:0298-64-5276, e-mail HIRATA@KEKVAX.KEK.JP)
        K.Oide   (tel:0298-64-5249, e-mail OIDE@KEKVAX.KEK.JP) 

From:	KEKVAX::OIDE         15-SEP-1994 21:31:51.75
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Sort, Union.

   Dear Users:

1. Sort and Union had a bug which returns a wrong answer or causes Segmentation
Fault.   It is fixed.

2. The output format of DISP command is changed to be usable for input of 
spread-sheet as it is.

						K. Oide

From:	KEKVAX::OIDE         22-SEP-1994 13:21:10.43
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Join.

   Dear Users:

1. A bug was found in the function Join.   There is a problem when the first
argument is not a list of reals and the second is a list of real.   It is
fixed.
					K. Oide

From:	KEKVAX::OIDE         28-SEP-1994 19:12:52.14
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in SeedRandom.

   Dear Users:

1. A bug was found in SeedRandom[v] when v is negative (v+2 is set as the
seed).   It is corrected.
					K. Oide		

From:	KEKVAX::OIDE         29-SEP-1994 15:00:48.26
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Problem in EMIT when Vc is zero.

   Dear Users:

1. There has been a problem in emittance calculation when Vc is zero.   This is
realted to the threshold to determine two eigenvalues are equal (Jordan form).
The threshold has been exactly zero up to now, but it was a problem.   Now the
threshold is set to 1e-8 (relative difference.)   Also a message will appear
when the normal mode is far from symplectic.
						K. Oide

From:	KEKVAX::OIDE          1-OCT-1994 19:36:54.22
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Local variables, DAPWIDTH, etc.

   Dear Users:

1. A problem was found in the logic of scoping of the local variables.   This
has caused a confusion of variables when a local variable with same name is 
used in different modules and the module is called in different levels.   A
first aid has bee applied on this problem, but it may need a fundamental 
change in future.   

2. A new variable DAPWIDTH is defined to specify the width of the full-turn
amplitude in DAPERT.   It was a constant (=7) up to now.   You can change this
number either in MAIN or FFS level. The default is 7.

3. The Mathematica format ($FORM="M") had a problem, and it is fixed.

						K. Oide

From:	KEKVAX::OIDE          3-OCT-1994 18:46:55.91
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Module.

   Dear Users:

1. A problem was found in Module on the logic of the returning its result.   It
is first-aided, but deeper cure may be necessary in near future.

					K. Oide

From:	KEKVAX::OIDE          4-OCT-1994 07:50:13.61
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   More bugs in scoping.

   Dear Users:

1. More bugs are found in the scoping logic of symbol-evaluation.   These bugs
confused a "removed" symbol with an active one when defining a new local
variable.   These are fixed, and a few related routines are updated  to improve
the performance, but this must be a new source of another bug.

					K. Oide

From:	KEKVAX::OIDE          4-OCT-1994 15:04:24.54
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Direction of LINE and components.   New.

   Dear Users:

1. SAD will be changed to recognize the direction of a beamline and a magnet
when a minus sign is attached.   For example, suppose two lines are defined as

   LINE A=(X Y Z);
   LINE B=(-A);

then the expanded form of the line B becomes (-Z -Y -X), instead of the old
one (Z Y X) .   A negative monomial of a magnet is also possible.   The effect 
of the minus sign on each magnet depends on the type of the magnet:

BEND:   Switches edge angles E1 and E2.   Reverses ROTATE angle.
QUAD,SEXT,OCT,DECA,MULT,STEER: Reverses ROTATE angle.
SOL:    Reverses BZ.
MARK:   Reverses ALPHAX,ALPHAY,EPX,EPY,R2,R3,DPX,DPY .

You may argue whether the ROTATE of a BEND should be reversed or not
Other quantities related to COORD, INS, SOL are subject to change.

By this change, some of existing decks will not work properly.   The
replacement of the load module will be done tomorrow morning.

						K. Oide

From:	KEKVAX::OIDE          4-OCT-1994 18:16:03.35
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Sign of BZ.

   Dear Users:

1. The sign of BZ of a negative SOL element (see the previous mail) will NOT be
reversed.   
						K. Oide

From:	KEKVAX::OIDE          6-OCT-1994 18:26:20.27
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in finding matching solution.

   Dear Users:

1. A bug was found in the matching routine, in the case of RING and the
matching point and the matching variable are at the same place.   The
derivative of functions at the same point by the variable was wrong.   This bug
was there since 1990.   If the fit point and the variable are at different
places, there was no problem.   The case of a transport line was also no
problem.   This was fixed and the performance of a matching in such a case has
been drastically improved.
						K. Oide

From:	KEKVAX::OIDE          7-OCT-1994 16:09:12.81
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   ROTATE does not change by minus element.

   Dear Users:

1. The ROTATE angle of a magnet which is aligned with a negative sign is NOT 
reversed.   

2. A new keyword "DIR" is added to the function LINE.

   LINE["DIR",magnet] returns 1 when the magnet is aligned in positive
		direction, and -1 in negative direction.   The argument magnet
		can be a number or a string with wildcards.

   LINE["DIR"] returns a list of directions of all magnets in the beamline.

   You can change the direction by

   LINE["DIR",magnet]=dir .

Example:

   LINE["DIR","QF.2"]=-1   sets the direction of QF.2 -1 .

   Do[LINE["DIR",i]=1,{i,LINE["LENGTH"]-1}]  sets directions of all magnets 1
		(Note that the last element has always direction 1, and cannot
		be changed by Set .)

						K. Oide

From:	KEKVAX::OIDE         11-OCT-1994 17:31:38.44
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Sign of BZ, etc.

   Dear Users:

1. The sign of solenoid is switched by the minus sign of an element.

2. There were a lot of trouble since last week in routines related to bending.

						K. Oide

From:	KEKVAX::OIDE         19-OCT-1994 10:38:58.66
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in save with couple.

   Dear Users:

1. A problem was found in the SAVE command of FFS when COUPLE is specified and 
the coupling coeeficient is not unity.   Presumably this bug has been there
since a long time ago.
						K. Oide

From:	KEKVAX::OIDE         24-OCT-1994 09:20:49.82
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Quadrupole in solenoid.

   Dear Users:

1. Routines for a quadrupole in solenoid are totally changed to
a) use a new integrator which integrates the linear part and adds corrections
of the nonlinear part by a kick, as a quad.
b) enable to use the quad strength as a matching variable.
c) handle an arbitrary shape of the solenoid field in the quad.

The usage of c):

Define the function Solenoid Shape as

   SolenoidShape[i] = list of relative field strengths

where i is the location of the quad in the solenoid, and the r.h.s. is a table
to specify the RELATIVE strength of Bz in the quad.   The values in the table
are relative to the nominal strength given by the SOL element of the section 
involving the quad, at equally-separated points along s.   The number of points
is arbitrary.

						K. Oide

   

From:	KEKVAX::YAMAMOTO     "Noboru Yamamoto" 27-OCT-1994 13:54:28.83
To:	MIMASHI,OIDE,IDAH,SHIRAKAT,YUKINORI,KEKUX1::TAWADA,CHIKAKO,MACHIDA
CC:	
Subj:	SAD update :  new version of mfalloc.f

  Dear SAD users,

  I have replaced the module mfalloc.f with new one. This change should be invisible to most of you.

  New feature of mfalloc.f is a dynamical memory allocation, i.e. when mfalloc run out of free space
it will ask the system for new memory space through malloc system function. So you don't need 
worry about MAXMEM size anymore. 

 mfalloc(-1) still returns size of maximum block  mfalloc keeps.
 mfalloc(n) returns index of first element in the returned block. you can accsess the block ether
rlist(i) and ilsit(i,j).  The returned value may larger than MAXMEM or smaller then zero.

 If you find any problem releted to this chenge , please contact to Noboru Yamamoto.

 Thank you,

 Noboru Yamamoto

From:	KEKVAX::OIDE          1-NOV-1994 11:51:22.76
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Multiple variables in an element, etc.

   Dear Users:

1. Changes are made to allow multiple variables (e.g. K1 and ROTATE for a
quadrupole) for an element in the matching.   The FREE and FIX commands is 
changed to specify this.

Usage:	FREE varname [keyword] [varname1 [keyword1] ...]

where varname is the name of element like Q*, and keyword is the keyword which
is to be the variable.   If keyword is omitted the default parameter of the
element type is assumed.   The available parameters are:

	Type		default		optional
	DRIFT:		L
	BEND:		ANGLE		K1
	QUAD:		K1		ROTATE
	SEXT:		K2
	OCT:		K3
	DECA:		K4
	MULT:		K1		K2,K3,K4

Example:	FREE Q* QC{12}* ROTATE S*

makes K1 of Q*, ROTATE of QC{12}*, and K2 of S* free.



Usage:	FIX  varname [keyword] [varname1 [keyword1] ...]

where varname is the name of element like Q*, and keyword is the keyword which
is to be fixed.   If keyword is omitted, ALL keywords are assumed.

   The free parameters can be seen by VAR_IABLES or VARS commmand.

   The REC_OVER command works only for the free variables which are currently
chosen.   One a variable is fixed, its information for REC_OVER is lost.

   The SAVE and RESET commands work on all default variables (as before),
and also on variables which have been chosen since the start of the current 
FFS session.

   The COUP_LE command is valid for all keywords, but the coefficient is valid
only for the default variable.   For other parameters, 1 is assumed.


2. The reset command is changed to take variable names, like as SAVE.   If no
variable name is given, all default variables and all variables which have been
chosen since the start of the current FFS session.

3. The radiation at the fringe of a bend with the thickness given by the
parameter F1 is now evaluated with an approximation.   F1 becomes effective
only when another parameter FRINGE is nonzero.    In this approximation the 
fringe of thickness f reduces the radiation as

	delta int B^2 ds = -B^2 f/6
	delta int B^3 ds = -B^2 f/4 ,

where B is the magnetic field of the bend.

							K. Oide

From:	KEKVAX::YAMAMOTO     "Noboru"  2-NOV-1994 00:32:22.15
To:	@USER$DISK1:[OIDE]SADUSERS.
CC:	
Subj:	SAD update: reduced execution code size.

    Dear SAD users,

    Following the changes in mfalloc function, the default memory
size of sad1.exe is reduced to 1/3. This change should not be visible to
the users. If you find any problem, please contact with Noboru Yamamoto.

   To SAD developers,

   mfalloc(n) now returns 0 when it fails to allocate requested space. 
Caller of mfalloc is resposible to check the return value. 
   mfalloc(-1) returns maxmum contiguous block size within the blocks which
mfalloc routine take careof. You may request lager block size than the size
returned by mfalloc(-1). mfalloc tries to allocate memory through malloc
system routine.
  
  Noboru

From:	KEKVAX::OIDE          2-NOV-1994 18:13:54.51
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bugs in solenoid, ExternalMap, etc.

   Dear Users:

1. A bug was found in the solenoid routine of emittance calculation in the case
BZ=0.   The transfer matrix with BZ=0 and nonzero orbit was wrong.   This bug
was created about 2 weeks ago.

2. A bug was found in ExternalMap when there was lost particles.   The passed
information to the ExternalMap defined function was wrong when some particles
had been lost.

3. The routine RESULTSOFTRACKING is changed to be called N+1 times when the
tracking is done for N turns.   It was called N times at the beginning of each
turn, so the data after the last turn was simply ignored.   The PLOT facility
also changed to use the last data.

						K. Oide


From:	KEKVAX::OIDE          6-NOV-1994 09:35:10.24
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in LINE, Element, reference of lement value by #.

   Dear Users:

1. A bug was found in "VALUE" or default variable name argument of 
LINE and Element functions, and strength-reference with # (like #QF).   
The reference of strength error coefficient was wrong.   This bug was created
about 2 weeks ago when multi-variable matching was introduced.

						K. Oide

From:	KEKVAX::OHMI         10-NOV-1994 16:47:52.94
To:	@[OIDE]SADUSERS.
CC:	
Subj:	Beambeam

Dear Users
Beambeam element "BMBM" accepts an input format of beam envelepe.
For example,
 BEAMBEAM    BMBMX  =(NP=1.4D10 R11=5.1E-9 R22=5.666666666666667E-8
             R33=2.72E-12   R44=4.25E-8  R55=1.6E-5 R66=5.776E-7
             S
LICE=5.  XANGLE=10.D-3 STURN=nstart)
where
R11=, R12= ......
The input format of envelope is higher priority than that of twiss parameters.

                                K.Ohmi

From:	KEKVAX::OIDE         18-NOV-1994 06:55:02.69
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Finite Amplitude Matching, etc.

   Dear Users:

1. A new method of optical matching, "Finite Amplitude Matching" is installed
in FFS.   This is a technique to improve the transverse linearity of a machine.
This method try to make the linear optics around a betatron motion equal to the
optics around the no-oscillation optics for each momentum deviation.   If the
machine is completely linear, those must be equal.   In the case of a ring, the
betatron orbit never close, but this method simply ignores it.   It should be
still OK, since in a perfect linear machine, the optics around the open orbit
is also equal to the nominal optics.

Usage:   MatchingAmplitude:=f ;

where f is an expression which returns a list {{dpa,xa,ya},...} .  The amount
dpa is the relative momentum deviation of the betatron motion to be matched.
The quantities xa and ya are the amplitude of the betatron motion normalized by
sqrt of the emittance abs(EMITX)+abs(EMITY) for both x and y.   When the
matching range specified by DP and DP0 involves dpa, the matching for
oscillation with amplitudes xa and ya are done.   The initial condition of the
oscialltion is 
   (x0,0,0,0),(-x0/2,px0/sqrt[3],0,0),(-x0/2,-px0/Sqrt[3],0,0),
   (0,0,y0,0),(0,0,-y0/2,py0/Sqrt[3]),(0,0,-y0/2,-py0/Sqrt[3]) 
plus the orbit of dpa .  Thus three motions are asigned for each of xa and ya.
If you add {dpa,-xa,-ya} in the list, six motions are calculated.   Any number 
of the set {dpa,xa,ya} can be used in the MatchingAmplitude, as long as the cpu
time is available.   
   The expression f is evaluated each time the GO command is issued.

2. The output format of GO and CALC commands are changed when the number of
columns are not sufficient to show all the off-momentum and finite-amplitude
optics.   In such a case, the top bad-convergent optics of the number of 
columns are shown and the value of DP and the magnitude of residual are also
shown.

3. The definition of the twiss parameters for off-momentum optics is changed.
It used be based on (x,px/p), and now switched to (x,px/p0).   You can choose
the formaer by saying NOCANON in FFS.

4. The memory allocation in FFS is changed to reduce the allocaton-free
overhead time.

						K. Oide




From:	KEKVAX::OIDE         20-NOV-1994 12:55:03.48
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in matching.

   Dear Users:

1. An old bug was found in the matching routine.   The save/restore of the
initial condition of optics may have destroyed some other part of memory.   The
result of optics calculation itself was OK, but the matching speed may have
been affected.   This bug was very old, at least 3 years, but the reason why it
has not been found is unknown.   Maybe the recent change of matching routines
revealed this old bug.
					K. Oide

From:	KEKVAX::YAMAMOTO     "Noboru Yamamoto" 28-NOV-1994 11:08:02.99
To:	@sadusers.dis
CC:	yamamoto
Subj:	SAD Update: new mfalloc.

¡¡¡¡Dear SAD users,

      I have received  no report on the problem in the beta  version of SAD executable module 
until now.  I reased  this version in the production module, i.e. /usr/local/bin/sad1.exe now
uses new algorithm to allocate memory. As I said before, the diffrence shoud be transparent
to the users, i.e. you cannot distingush the diffrence between old version and new version.

  If you have problem with the new version, please contact with Noboru.

  Noboru Yamamoto

From:	KEKVAX::OIDE         29-NOV-1994 10:34:23.32
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in finding solution in matching.

   Dear Users:

1. A bug was found in the matching routine of FFS, which calculates a wrong
number of derivative of functions in the case of the two-point matching, and 
the same point (probably only the second one) is commonly used for another 
single-point matching like 

     FIT QC1 QC2 NX 0.5
     FIT QC2 BX 10

Thus the converging speed was slow in such cases, or the matching failed.
The result of the optics calculation has no problem.   This bug was there 
probably since 1989.
						K. Oide

From:	KEKVAX::OIDE          3-DEC-1994 10:14:57.53
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   LINE["EXPAND"] and Element["EXPAND"]

   Dear Users:

1. LINE["EXPAND"] and Element["EXPAND"] have been malfunctioned since the
change for the multi-variable matching two months ago.   Now it is restored.
LINE["EXPAND"] and Element["EXPAND"] are identical.   These anly distribute the
value of the default variable, like "K1" of quadrupole.   Other variables like
"DX" of quad are not disributed, so you should use LINE function to set them.


Example:   Suppose you have two magnets named "QF" in a line:

 LINE["NAME","QF.*"]   !returns a list of name of magnets which matches "QF.*"

{"QF","QF.2"}    

 LINE["K1","QF.*"]     !returns a list of "K1" of magnets "QF.*".

{.1549322394,.1549322394}

 Element["K1","QF"]=0.1    !set 0.1 to the "K1" of POWER SUPPLY "QF".

.1

 LINE["K1","QF.*"]

{.1,.1549322394}       !now only the first magnet of "QF.*" is changed....

 LINE["EXPAND"]        !until you say LINE["EXPAND"] or Element["EXPAND"].

 LINE["K1","QF.*"]     

{.1,.1}                !Then all "K1"s of "QF.*" are adjusted.

						K. Oide

From:	KEKVAX::OIDE         14-DEC-1994 14:12:44.04
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in LINE["EXPAND"] and Element["EXPAND"].

   Dear Users:

1. A bug was found in LINE["EXPAND"] and Element["EXPAND"].   This bug prevent 
to include the effect of the error specified DK when expansion is done.

						K. Oide

From:	KEKVAX::YAMAMOTO     "Noboru" 20-DEC-1994 00:16:59.00
To:	@SADUSERS.DIS
CC:	
Subj:	SAD update. 

   Dear SAD users,

   /proj/oldsad/sad1.exe (a.k.a. /usr/local/bin/sad1.exe ) is rebuild. If you
find any problem with this version. Please let me know.
`
  Noboru Yamamoto


From:	KEKVAX::OIDE         20-DEC-1994 09:59:06.49
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   LINE["DK"].

   Dear Users:

1. A new keyword "DK" is added to the function LINE.   It returns the value of
error (plus 1) specified by the DK command.

Usage:

   LINE["DK"]		returns a list of (1+DK)s of all elements.
   LINE["DK","QF"]	returns the value of (1+DK) of the first "QF".
   LINE["DK","QF*"]	returns a list of (1+DK)s of magnets which match "QF*".
 
   LINE["DK","QF.2"]=v  sets 1+DK of "QF.2" to v.

When you have specified DK by the DK command, the value of a power supply is
set to the first magnet after its DK is multiplied.   Thus you have to always
multiply its DK when you set the value through the Element function, i.e.,
you should say

   Element["K1","QF"]=0.1*LINE["DK","QF"] ,

to be consistent.

From:	KEKVAX::YAMAMOTO     "Noboru Yamamoto" 22-DEC-1994 01:40:26.60
To:	@sadusers.dis
CC:	yamamoto
Subj:	SAD Update: Beta testers are wanted.

Dear SAD users,

  I would like to  ask you to test a new version of SAD, sad1.exe.beta , with you SAD.
It uses improved(?) memory allocation routines (mfalloc/pfalloc). 
Your cooperation is greately appriciated.

 Thank you.
Noboru yamamoto