SAD Mails in 1995


Send any comments to ICFA@kekvax.kek.jp

SAD back to SAD Home Page



From:	KEKVAX::OIDE          9-JAN-1995 19:13:56.15
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in emittance in BEND, etc.

   Dear Users:

1. A bug was created on 11/1/1994 at 9:35 by myself in routine tbende.f,
so that the emittance calculation in a bend was wrong.   The effect of
curvature in the body of a bend was simply ignored.   Thus the damping
partition has been wrong for about 2 months, especially in the case of a 
small machine.

2. There was a problem in the initialization of FFS whe the first element is
not a MARK element, so that the initial condition of Twiss parameter was
wrong.   This is fixed (the routine tfinit.f), but it is strongly recommended
to place a MARK at the beginning of the line.

					K. Oide

From:	KEKVAX::OIDE          7-FEB-1995 09:24:12.18
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   VariableRange, more wildcards.

   Dear Users:

1. A new function VariableRange is added to specify the range of a variable in
the matching.

Usage:   VariableRange[name,key,v_]:=expression

wherethe value of the variabel is passed in v, and expression should give 
False when the value is out of range.

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

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

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

This specifies the same for all elements.

VarableRange only acts for variables which join the matching with FREE command.
it does not change the current value.

2. More wildcards for element names are defined.

List of wildcards:

%           matches any one character
*           matches any zero or more characters
{...}       matches any one character enclosed in {}.
{^...}      matches any one character which is not enclosed in {^}    New.
...|...     matches any of before and after | (alternative)    New.

					K. Oide

From:	KEKVAX::OIDE         14-FEB-1995 11:56:27.62
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Quad fringe in EMIT, threshold of SVD in matching.

   Dear Users:

1. The emittance routine for the fringe field of quads is changed to have a
consistency with the tracking routine.   The actual difference should be small.

2. The threshold of singular value decomposition in the matching routine is
changed from 1e-5 to 1e-6, since better results are obtained in many cases.  
In the past there were a few inperfectness in the calculation of the
derivative, so a large threshold may have been necessary to hide the
inperfectness.   Thes derivative routines have been updated recently, so
smaller threshold may become preferrable.

						K. Oide

From:	KEKVAX::OIDE         15-FEB-1995 19:07:20.55
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in RESET, etc.

   Dear Users:

1. A bug was found in RESET command when there are non-variable elements (like
MONI, etc.) in the line.   It destroys some memory locations and the result is
unpredictable.   It is fixed.   This bug was there since last November.

2. The threshold of SVD for matching nwo depends on the converging speed.  
It becomes smaller when the convergence becomes faster.   The minimum is 1e-6.

							K. Oide


From:	KEKVAX::OIDE         20-FEB-1995 10:32:27.36
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New technique of matching convergence.

   Dear Users:

1. A new technique is added in the matching method.   The converging speeds
can be different for functions.   An easier-convenging function has faster
speed.   This trick improves the matching in several cases.   Please try it and
report your feeling.
					K. Oide

From:	KEKVAX::OIDE         24-FEB-1995 12:54:05.12
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   First element must be MARK in FFS.

   Dear Users:

1. The first element of a beam line must be a MARK element when it is used by
FFS.   This change was necessary for a future extension of the matching which
will come soon.   Now FFS simply returns when the first element is not MARK.

2. The techinique of matching introduced on 2/20 is canceled, since it gives
worse effects in some cases.

						K. Oide

From:	KEKVAX::OIDE         25-FEB-1995 09:12:01.79
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Initial conditions as matching variables.

   Dear Users:

1. Now you can use initial conditions of a beam line as the matching variables.  
This may be convenient in desingning an insertion.

Usage:   FREE I I ... 

Example: FREE AXI BXI AYI BYI
         FIT AX 0 BX 10 AY 0 BY 10
         GO

This example specifies alpha_x,y beta_x,y at the entrance of the beam line as
the matching variables, then mathces at the end of line.

This function is only effective in the case of INS, and null in CELL.

						K. Oide

From:	KEKVAX::OIDE          2-MAR-1995 15:07:24.76
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in BEAM_SIZE command.

   Dear Users:

1. A bug was found in BEAM_SIZE command which returns crazy projected
parameters in DISP B.   This bug was there probably since last November.

2. The weight for geometric parameters in matching is changed so that only
parameters down to the last fit-point affects to the weight.

					K. Oide

From:	KEKVAX::OIDE          3-MAR-1995 10:28:23.37
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Solenoid field error DBZ.

   Dear Users:

1. Fiels strength error of a solenoid can be specified by a new keyword DBZ.
It does not affect the geometry of the orbit unlike BZ.    The unit is Tesla.
Random errors of solenoid filed can be specified by DDK command like for bends.

Example:	DDK 1e-2 ES*

This sets a random field error of r.m.s. 0.01 Tesla for solenoids ES*.
Note that the unit of DDK for bends is mrad, and Tesla for solenoids.

					K. Oide

From:	KEKVAX::OIDE          3-MAR-1995 11:06:47.24
To:	@SADUSERS.
CC:	OIDE
Subj:	Erratum.

   Dear Users:

The unit of DDK for bends is radian, not mrad.

From:	KEKVAX::OIDE          9-MAR-1995 09:42:07.30
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   MatchingResidual, OffMomentumWeight.

   Dear Users:

1. New variables are defined in FFS:

MatchingResidual:   holds the value of the residual of the convergence of the
                    latest GO or CALC command.   Read only.

OffMomentumWeight:  This is for changing the relative weight of the
                    off-momentum optics in matching.   The residual of the
                    off-momentum part becomes heavier if this value is large.
                    The default is 1.   This may be convenient when you need to
                    find the on- and off- momentum optics simultaneously.

						K. Oide

From:	KEKVAX::YAMAMOTO     "Noboru" 10-MAR-1995 15:49:20.62
To:	@KEKVAX::USER$DISK:[OIDE]SADUSERS.
CC:	
Subj:	SAD update: new execution module.

 Dear SAD users, 

  I have updated  the execution module of SAD, sad1.exe today. You will not
notice the difference between old and new.  This is done for  minor bug fix.

  Noboru Yamamoto

From:	KEKVAX::OIDE         10-MAR-1995 16:49:17.19
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in ALPHAY of MARK.

   Dear Users:

1. Since Feb 15, there was a bug in the keyword ALPHAY of a MARK element.
It was wrongly coded as ALPHAX, and ALPHAX also meant ALPHAX.    The keyword AY
was OK.   ALPHAY was set to zero unless AY was used.

						K. Oide

From:	KEKVAX::OIDE         18-MAR-1995 12:56:44.29
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Nonlinear fringe of quads in FFS.

   Dear Users:

1. Now FFS involves the nonlinear fringes of quads in the optics calculation in
the same was as the tracking and the emittance.

2. In the matching, the couple command anly connects the default variables.  
Other variables are connected to the "physically connected" element, i.e., the
element which is the same type and not separated by a drift space.

					K. Oide

From:	KEKVAX::OIDE         20-MAR-1995 11:35:29.16
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Memory-less version.

   Dear Users:

1. To manage the recent shortage of the memory especially for a large optical
matching, a memory-less scheme is used in FFS optics calculation.   FFS now
gives up to hold all off-momentum optical data during the matching, but keeps 
only necessary data.   By this change, the required memory is about 20M bytes
less than before for a typical matching job of the KEKB lattice.   Due to 
this change, the DISP and MATRIX commands are only able to access the
center-momentum optics, but it is not serious since you can shift the momentum
by setting DP0 nonzero.   Since this is not a small change inside of FFS, some
unexpected side-effects may appear.

					K. Oide

From:	KEKVAX::OIDE         21-MAR-1995 15:47:01.61
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Execute FFS commands in a function.

   Dear Users:

1. A new function FFS is built to execute FFS commands in the function syntax.

Usage:		FFS[commands]
		FFS[commands,output]

where commands is a character string containing command-string of FFS.   The
second argument output is optional and specifies the output file number of the
commands.   If output is omitted no print-out is made.

Example:	FFS["fit bx 10; free qf; go",6]

According to this function, you can execute any FFS command as a function, so
you can construct a program consistently in the function-syntax.

Remarks:

1) This function does not return the result of the commands.   They should be
attained using other functions.

2) The if-else-elseif-endif and repeat-until structures must be closed in a
single call of FFS[].  It cannot be overridden nor interleaved.

Example:	if a==b
		   calc
		   FFS["else  go"]  ! <-- This is a wrong usage.
		endif

In this example, the else command in FFS[] is not recognized as the else for
the outer if-structure.

						K. Oide


From:	KEKVAX::OIDE         24-MAR-1995 06:04:18.13
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in quad, reference of values, etc.

   Dear Users:

1. A bug was generated on 3/18 in the optics calculation of a quad, when 
the offset is non-zero.

2. A bug was created on 3/20 in the reference of an element using # sign (like
#qf).

					K. Oide

From:	KEKVAX::OIDE         25-MAR-1995 07:47:51.16
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in matching.

   Dear Users:

1. A bug was created around 3/18 in the matching routine.   This bug makes a
trouble when the second element of a line is a matching variable, while the
third element is not a variable.   Otherwise irrelevant.

						K. Oide

From:	KEKVAX::OIDE         11-APR-1995 18:07:58.21
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   UpSet, UpSetDelayed.

   Dear Users:

1. New operations UpSet (^=) and UpSetDelayed (^:=) are introduced.   These are
basically same as Mathematica's.

2. An optimization of the compiler (+O4) has caused a significant slow-down of
the tracking, since beginning of March.   It is canceled.

						K. Oide

From:	KEKVAX::OIDE         14-APR-1995 20:36:20.64
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   FitWeight.

   Dear Users:

1. The weight of matching becomes changeable by specifying FitWeight
defined-function.

Usage:   FitWeight[fitpoint,fun,dp_,ws_]:=weight;

where   fitpoint is the name of the location of the fit, like "QF.2", etc.
	fun      is the name of the function, like "BX", "LENG", etc.
        dp_      is to receive the momentum deviation of the fit.
        ws_      is to receive the default fit weight.
        weight   is an expression which returns the desired weight.

Example: FitWeight["***","LENG",dp_,ws_]:=ws*10;

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

						K. Oide

From:	KEKVAX::OIDE         18-MAY-1995 16:44:15.04
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   A new command USE to switch the beam line in FFS.

   Dear Users:

1. A new command USE is added in FFS.   This command switches the beamline in
the FFS session without return to the MAIN level.

Usage:   USE line_name

which switches the beamline to anothe beamline specified by line_name.   All
line-specific settings like the matching conditions are LOST in the current
implementation.   REPEAT and IF control is preserved.   USE can be used in the
function FFS[] too.

Example:

	FFS USE=LINE1;       ! Starts FFS with LINE1
	...
	...
	USE LINE2       ! Now switches to another line LINE2
	...
	USE LINE1       ! You may switch back to LINE1, but all fit conditions,
			! etc. have been lost, so you have to set them again.
	.....

To implement this function, the fundamental part of FFS was modified, so any
unexpected side-effects may appear.   Please be careful even if you do not
use this function.
						K. Oide

From:	KEKVAX::OIDE         19-MAY-1995 12:05:09.77
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   USE NOEXPAND .

   Dear Users:

1. A new keyword NOEXPAND is added to the USE command to prevent expanding the
beam line.  Otherwise it is (re-)expanded.

Usage:   USE NOEXPAND line_name

Actually, the first version of USE defaulted NOEXPAND, so it may have caused a
confusion.
					K. Oide

From:	KEKVAX::OIDE         20-MAY-1995 13:28:30.01
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New commands VISIT and BYE.

   Dear Users:

1. New commands VISIT and BYE are added in FFS.   VISIT switches the beam line
in FFS like USE, but you can return to the original line by BYE, keeping the
previous settings of FIT, FREE, etc.

Example:
	FFS USE=LINE1
          FIT *** NX .25
          FREE QF
	  VISIT LINE2      !visit another line
	  ...
	  ...
	  BYE		!return to LINE1
	  GO		!matching condition is preserved
	  ...

The control structure of FFS has been greatly changed for USE, VISIT, and BYE,
so unwilling side effects may be caused even if you do not use them.

						K. Oide

From:	KEKVAX::OIDE         23-MAY-1995 14:43:17.52
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New fringe integrator.

   Dear Users:

1. The integrator of the fringe of quads is changed.   A generating function

	G(x,P)=x P + H(x,P)

has been used for the fringe for a long time, where x is the old coordinate and
P is the new momentum, and H is the Hamiltonian of the fringe. The
transformation with this generating function has a problem that the 
transformations at the entrance and the exit do not cancel.   It produces  some
unpleasant effects when the quad has a big offset.   Thus the second-order
generating function is now applied for the integration:

	G'(x,P)=x P + H(x,P) + H,x(x,P) . H,p(x,P)/2 ,

where comma denotes the derivative and dot the inner product.  Although this
still does not exactly cancel the entrance and the exit, the residue is the
third order of K, quad strength.   I think in practical cases it should be
sufficient, and actually it is good for KEKB.

						K. Oide

From:	KEKVAX::OIDE         23-MAY-1995 14:52:57.76
To:	KEKUX::"furukawa@maple.kek.jp",KEKUX::"oyamada@130.34.128.3",KEKUX::"nakazato@130.34.128.3",KEKUX::"yukisima@thkLn1.Lns.tohoku.ac.jp",KEKUX::"holt@calvin.fnal.gov"
CC:	OIDE
Subj:	SAD Update.   New integrator for fringe.

   Dear Users:

1. The integrator of the fringe of quads is changed.   A generating function

        G(x,P)=x P + H(x,P)

has been used for the fringe for a long time, where x is the old coordinate and
P is the new momentum, and H is the Hamiltonian of the fringe. The
transformation with this generating function has a problem that the
transformations at the entrance and the exit do not cancel.   It produces  some
unpleasant effects when the quad has a big offset.   Thus the second-order
generating function is now applied for the integration:

        G'(x,P)=x P + H(x,P) + H,x(x,P) . H,p(x,P)/2 ,

where comma denotes the derivative and dot the inner product.  Although this
still does not exactly cancel the entrance and the exit, the residue is the
third order of K, quad strength.   I think in practical cases it should be
sufficient, and actually it is good for KEKB.

                                                K. Oide


From:	KEKVAX::OIDE         24-MAY-1995 17:55:25.15
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in linear fringe of quad.

   Dear Users:

1. The transformation for the linear fringe of a quadrupole is changed.
The old transformation was

   G(x,Px,y,Py)=(1+a)x Px + b/2/p Px^2 + y Py/(1+a) - b/2/p Py^2 ,

where (x,y) are the old coordinates and (Px,Py) are the new momenta.
a and b are coeeficients give as

   a=-K F1 abs(F1)/24/p
   b= K F2/p .

This transformation had a problem that the entrance and the exit do not cancel
even if b=0.   The new transformation is

   G'(x,Px,y,Py)=exp(a)(x Px + b/2/p Px^2)+exp(-a)(y Py + b/2/p Py^2) .

					K. Oide


From:	KEKVAX::OIDE         25-MAY-1995 10:50:39.75
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Dtae,FromDate,ToDate, CALC NOEXP_AND .

   Dear Users:

1. New functions Date, FromDate, ToDate are installed.  These are same as
Mathematica's.   These (and also Mathematica) do not support the leap second.

2. An option NOEXP_AND is added to the CALC command.   It inhibits expanding of
magnets before calculation.   It may be useful when you specially changed the 
line by the LINE function, etc.   All internal relations by COUPLE or DK are
ignored by this option.

					K. Oide

From:	KEKVAX::OIDE         25-MAY-1995 17:53:47.80
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in GO.

   Dear Users:

1. A bug was created this mornig during the change for CAL NOEXP.   The
matching sometimes did not work due to this bug.

						K. Oide

From:	KEKVAX::OIDE         26-MAY-1995 07:32:27.66
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Unset, etc.

   Dear Users:

1. A new operation Unset (=.) has been defined.   This is same as
Mathematica's.

2. A change has been made in parsing of input so that

   1/.3    means    Divide[1,0.3]    (used to be Replace[1,3]),
   a=.3    means    Set[a,0.3].

The period becomes the part of the following number if there is no space
between them.

3. A bug in Replace when the rule is a list containing a rule to replace a 
number to another number is fixed.

					K. Oide



From:	KEKVAX::OIDE         26-MAY-1995 20:21:56.57
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Prompt in FFS.

   Dear Users:

1. The prompt of FFS changed when the input expression or function is
incomplete.   It shows the nearest operator waiting the completion.

Example:

***/IP2:***>Sin[1		! This line is incomplete,
 ...[.. +3*			! Then prompt shows "[", and "+3*" is typed,
 ...*   4             		! Then prompt shows "*", and "4" is typed,
 ...[.. ]			! Then prompt shows "[" again, then "]"
.420167036826641		! completes the expression Sin[1+3*4].
***/IP2:***>

						K. Oide


From:	KEKVAX::OIDE         27-MAY-1995 07:50:09.42
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Continuation by \.

   Dear Users:

1. Continuation of an input line in FFS becomes possible by adding a
backslash(\) at the end of line.   The end of line means that AFTER the removal
of a comment and trailing spaces.   The continuation is done directly, i.e.,
the next line is appended to the current line directly erasing the backslash,
and the line-break after the backslash does not work as a delimiter of a word.

Example:

***/IP2:***>  a="This is a string \
which continues to the next line\ ! backslash works after removeal of comment.
. A comment is specified by \"!\"\n\ ! The "!" in a quotation is not a comment.
which is placed \"outside\" of quatation, \
but the rule may not be perfect,\nso you should avoid \
interlacing the comment and quote as much as possible.";


This input creates a long character string a:

***/IP2:***>Print[a]
This is a string which continues to the next line. A comment is specified by "!"
which is placed "outside" of quatation, but the rule may not be perfect,
so you should avoid interlacing a comment and a quotation as much as possible.
***/IP2:***>

						K. Oide

From:	KEKVAX::OIDE         28-MAY-1995 11:34:24.54
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New functions Read, OpenRead, ToExpression .

   Dear Users:

1. A new function Read is installed.   This is a simplified version of
Mathematica's.   At this time, only three forms are supported:

   Read[lfn]
   Read[lfn,String]
   Read[lfn,Expression] ,

where lfn is a file number obtained by

  lfn=OpenRead[filename] .

The third form of Read is same as the first one.   The first one reads an
expression from the file lfn, evaluate it, and returns the result.   The second
one returns a string read from the file until the newline.   When a line is
once read by Read[lfn], comment is removed and tabs are converted to spaces.
If a line is read by Read[lfn,String], comment and tabs are involved in the
result.

2. A new function ToExpression is installed.   This is basically same as
Mathematica's.

					K. Oide

From:	KEKVAX::OIDE         30-MAY-1995 08:37:22.48
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Function, Read[l,Word], etc.

   Dear Users:

1. A new function Function (named-argument form of a pure function) is
installed.   It is same as Mathematica's.

2. Another form of Read, Read[l,Word] is defined.   It is similar to
Mathematica's.   This form accepts an option WordSeparators as Mathematica,
but it mus specify a character string containing separation characters.
Thus each separator must be a single character.   The default setting is
WordSeparators->" ,\t" .

3. Read can read input from the input stream.   If you specify -1 for the file
number, it reads from the current input stream.   You may also specify
non-opend file number like Read[5], then it reads from the standard input.

4. A problem in processing a filename with "~" has been corrected.

					K. Oide

From:	KEKVAX::OIDE         31-MAY-1995 16:11:57.79
To:	@CLASSIC.
CC:	OIDE
Subj:	My macro (classic.elc) for X-Window.

   Dear friends:

   I have updated the EMACS macro, classic.elc, for X-Window.   It is now
compatible with X, at least you use eXodus on Mac.   All keypad functions are
same except , which is mapped to Control-pagedown in the eXodus
version.   I have not yet tried other terminals like MacX, HP, DEC, etc.
The selection of buffer by function keys - is not supported, because EMACS
has its own menu on X.    (run),  (background run),  (submit), 
 (tstat) are supported.
   The setting of the eXodus keyboard is Digital LK101 USA F6..F20.
   Please try it.
					Katsunobu

From:	KEKVAX::OIDE          1-JUN-1995 06:02:17.53
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Element["NAME",x].

   Dear Users:

1. A bug was found in Element["NAME",x] when x is a string.   It gave a
meaningless answer.

						K. Oide

From:	KEKVAX::OIDE          3-JUN-1995 11:46:29.60
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in matching with limit of variables.

   Dear Users:

1. The algorithm of the matching is changed to handle the limit on variables
better.   The new one accesses closer to the limit than the old one.   For some
examples, it gives better results, but it may depend on the application.  
Please try it anyway.
						Katsunobu

From:	KEKVAX::OIDE          5-JUN-1995 18:36:19.89
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bugs in Visit, FitWeight

   Dear Users:

1. A bug was found in VISIT.   It did not expand at all.

2. A bug was found in FitWeight.   It did not work for off-momentum optics
calculation at all.
						K. Oide

From:	KEKVAX::OIDE          7-JUN-1995 08:53:33.82
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in VariableRange.

   Dear Users:

1. The function VariableRange now accepts a form {min,max} which specifies the
minimum and the maximum values of a matching variable.

Example:    VariableRange["QF1","ROTATE",v_]={-0.01,0.02};

sets the range of ROTATE of QF1 between -10 mrad and +20 mrad in the matching.
The old form of VariableRange which returns True or False is still valid.

						K. Oide

From:	KEKVAX::OIDE         10-JUN-1995 22:26:24.65
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in Thread.

   Dear Users:

1. A bug was found in the function Thread.   It caused an unnecessary pile-up
of garbage of memory in some cases, and eventually may have lead to a memory
fault.   This bug has been there since Thread was creeated.

						K. Oide

From:	KEKVAX::OIDE         15-JUN-1995 07:12:51.94
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in zone-maximum fitting, etc.

   Dear Users:

1. A bug was found in fitting for maximum value in a zone 
(e.g., FIT A B BXM 10).  It has been wrong since around 3/20 in this year.

2. FFS has been using a new memory allocation technique to prevent the memory
overflow, since this Tuesday.

3. A bug was found in COUP_LE command in detecting the over-coupling.

						K. Oide

From:	KEKVAX::KIKUCHIM     21-JUN-1995 22:35:16.71
To:	@USER$DISK4:[OIDE]SADUSERS.
CC:	
Subj:	sad/cor update: ReadMonitorData[]

(1) Defined function ReadMonitorData[] is available.
  This function is equvqlent to READMON command.
  Usage:

    ReadMonitorData[filename,trimlevel]

    filename: filename to be read in.
    trimlevel: optinal parameter. If it is given, the monitors which are greater
               than rms*trimlevel are chopped.
    This function reads the monitor data to the "dx" and "dy" slots in the
    buffer "Twiss" and also gives an output in a form

        {bpms,{x,y}}

    where bpms are monitor positions and x and y are lists of corresponding
    data.
  Example:

    a=ReadMonitor["/data/mrdata/cod/study/kikuchim/bpm_002_19_21_55",2];
    bpm=Monitor[a[1]];
    ......

   In this example the monitor is read from a file named
   "/data/mrdata/cod/study/kikuchim/bpm_002_19_21_55" to the Twiss buffer
   and chopped with the level of 2 sigma and the resultant monitor data is 
   set to a variable a. Using a[1], monitor element is defined in the following
   line.

(2) Defined function ChopMonitorData[] is available.
  This function is equivalent to TRIM command.
  Usage:

     ChopMonitorData[mondata,trimlevel]

     mondata: bpm data in the form
          {bpm,{x,y}}
     or
          bpm.
     The bpm is a list of monitor positions and x and y are
     corresponding data. In the latter form {x,y} is taken from
     Twiss buffer.
     trimlevel: triming level in unit of sigma.

     This function outputs the resultant bpmdata in the form of

         {bpm1,{x1,y1}}.

(3) Defined function SubMonitorData[] is available.
  This is equivalent to PUSH SUB commands.
  Usage:
 
    SubMonitorData[a,b,trimlevel]

      Output is a-b trimed with trimlevel.

      a: bpm data in the standard form of
   
         {bpma,{xa,ya}}.

      b: bpm data in the standard form of
 
         {bpmb,{xb,yb}}.

     Subtraction is executed for the element included in the
     intersection of bpma and bpmb.


Please let me know any requests and complaints.

				KIKUCHI M.

From:	KEKVAX::OIDE         23-JUN-1995 10:24:33.73
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   PatternTest, StringMatchQ, StringPosition, ToUpperCase,

   Dear Users:

1. A new operator PatternTest (?) is defined.   It works in the same way as
Mathematica's.

2. New functions StringMatchQ, StringPosition, ToUpperCase are introduced.  
These are basically same as Mathematica's, but do not accept any options.

3. A new option ReadNewRecord is defined for Read[_,Word,___].   If it is
True(default), it reads a new record at the end of record.   Otherwise it 
does not read the new record, and returns "" when it reaches the end of 
record.

4. A problem with EMIT when a huge kick angle is given for a BEND, has been
solved.
					K. Oide

From:	KEKVAX::KIKUCHIM     28-JUN-1995 10:24:57.11
To:	@USER$DISK4:[OIDE]SADUSERS.
CC:	
Subj:	sad/cor update: ReadMonitorData etc.

  I have modified specifications of ReadMonitorData, ChopMonitorData,
and SubMonitorData according to Koiso-san's suggestion.
  These functions accept or give a 'monitor data' object. The
'monitor data' object is defined as 

		{monitor,data},

where monitor is a 'monitor' object, which may be defined by the function 
Monitor[]:

	monitor={position_list,{Xmisalign_list,Ymisalign_list},
		{Xprecision,Yprecision},attachposition_list}.

The 'data' is a list of corresponding orbit data, 

	data={xorbit_list,yorbit_list}. 

(1) ReadMonitorData[filename,trimlevel]
  returns a monitordata object AND leaves the data in the internal buffer Twiss.
    filename : (charactor string) a filename to be read in.
    trimlevel: (optional)(real number or a list of real number) triming level
               in unit of standard deviation. Using the latter form, different
               levels can be given to horizontal and vertical data.

(2) ChopMonitorData[monitordata,trimlevel]
  returns a monitordata trimmed with a trimlevel.
    monitordata:('monitordata' object) for input
    trimlevel: (real number or a list of real number) triming level
               in unit of standard deviation. Using the latter form, different
               levels can be given to horizontal and vertical data.

(3) SubMonitorData[monitordataA,monitordataB,trimlevel]
  returns a subtraction of monitordataA and monitordataB AND leaves the result
  in the internal buffer Twiss. If trimlevel is given,
  The subtracted data trimmed with trimlevel is returned.
    monitordataA: ('monitordata' object)
    monitordataB: ('monitordata' object)
    trimlevel: (optional)(real number or a list of real number) triming level
               in unit of standard deviation. Using the latter form, different
               levels can be given to horizontal and vertical data.

Please send any request or complaint to me.

					KIKUCHI M.

From:	KEKVAX::KIKUCHIM     28-JUN-1995 10:43:47.98
To:	@USER$DISK4:[OIDE]SADUSERS.
CC:	
Subj:	SAD/cor updata: DeleteMonitorDataRegion[].

New function DeleteMonitorDataRegion[] is available.

  DeleteMonitorDataRegion[monitordata,region]
excludes the monitor elements in the region and returns the
rest as a 'monitordata' object.
  monitordata:('monitordata' object) 
  region:(list of names or positions).

		KIKUCHI M.


From:	KEKVAX::OIDE         28-JUN-1995 16:19:31.66
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Help, Goto, Label, Break, Continue.

   Dear Users:

1. Help command is introduced.   Type Help (or help or HELP) at the FFS prompt.
The messages are still not perfect, but may provide better information on
SAD/FFS than the existing "manuals".   Please try.   After now the messages 
will be updated regularly.

2. New functions Goto, Label, Continue, and Break are introduced.   These
work in the same way as Mathematica's.

3. The roll of Return has been changed by introducing Break.   It used to 
have the similar roll as Break in Do, While, For, but now it becomes to be
catched only by functions.

						K. Oide

From:	KEKVAX::OIDE         29-JUN-1995 19:58:29.00
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in null argument.

   Dear Users:

1. A change has been made in a null argument.   For a defined function f,
f[] used to mean f[Null], but now these are different.   For a built-in
function, f[] is same as f[Null].

						K. Oide

From:	KEKVAX::OIDE         30-JUN-1995 11:27:11.49
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   New functions Fourier and InverseFourier.

   Dear Users:

1. New functions Fourier and Inverse Fourier are installed.    They are same as
Mathematica's except that when the length of the list is not 2^n, it extends
the list to 2^n, and pads zeroes at the rest.   (You may compare its speed with
Mathematica's.)
							K. Oide

From:	KEKVAX::OIDE          5-JUL-1995 09:42:19.05
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in weighting of matching.

   Dear Users:

1.   There has been a bug in the routine to determine the weight of functions
during the matching.   This bug was introduced on 6/15 when fixing the other
bug caused on 3/20 this year.   This bug makes a wrong weight when there is a
maimum fitting condition, and in an ultimate case, it makes a weight of a
function zero, so the result of matching becomes incorrect even it says
"Matched".   I have to say that the results of matching after 6/15 should be
reviewed if you use the maximum fitting.

2. The internal logic of the expression evaluation is changed to gain speed.

						K. Oide

From:	KEKVAX::OIDE          5-JUL-1995 14:22:35.42
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   A new command TDR to run TopDrawer within FFS.

   Dear Users:

1. A new command TDR is introduced to run TopDrawer from FFS.

Usage:   TDR {filename|file_number}

runs TopDrawer (tdr) using the file specified by filename or file_number as the
input.   It supports both Tek terminal and X-window.

Example:   out 'a' DRAW bx by & ex ey q* close out tdr 'a'

						K. Oide

From:	KEKVAX::OIDE          5-JUL-1995 15:08:02.58
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in StringJoin.

   Dear Users:

1. A bug in StringJoin which creates "Memory Full" since yesterday has been
corrected.
				K. Oide	

From:	KEKVAX::OIDE          5-JUL-1995 18:12:47.06
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   FFS["VAR"] returns the list of variables.

   Dear Users:

1. A change is made on the function FFS to enable to return the result of FFS
command as the value of the function.   At this time, only the VARIABLES(VAR)
command can returns the value.

   Usage:   FFS["VAR"]

returns a list of nvar elements, where nvar is the number of current matching-
variables given by the FREE command.   Each element has the form

  {name,keyword,now,previous,saved} ,

which corresponds to the output of the VARIABLES(VAR) command.

   In future, more commands will be changed to return the value.

						K. Oide

From:	KEKVAX::OIDE          6-JUL-1995 11:43:19.15
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   FFS["SHOW"] returns the current matching conditions.

   Dear Users:

1. FFS["SHOW"] now returns the current matching conditions as a list.
Each element has a form of

{component1, component2, function, goal-value, number-of-momentums,scale},

which corresponds to the new format of the print-out by SHOW.

2. The format of SHOW has been changed to enable to use it directly as
the input deck.

					K. Oide

From:	KEKVAX::OIDE          7-JUL-1995 10:03:16.21
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   FFS["CALC"], FFS["GO"] returns the result as a list.

   Dear Users:

1. FFS["CALC"] and FFS["GO"] now returns the result as a list.   The format
of the returned list is

   {dp, kind, residual, function-values},

where

dp:       list containing dp/p0 .
kind:     list of kind of the orbit (ususally 0, 1 to 6 for the
          finite-amplitude-matching).
residual: list containing the residual for the orbit.

Above are lists with length == number of orbits.

function-values: list of length nc (== number of calculated items). Each
                 element has the form:

        {component1,component2,function,list-of-values}

where

component1, component2: fit locations.
function: name of the function.
list-of-values: list of values of the function for each orbit.  Length nf.

						K. Oide

From:	KEKVAX::OIDE          7-JUL-1995 18:29:58.99
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Problem in Draw.

   Dear Users:

1. There was a problem in DRAW.    When CALC or GO was done only though the
function FFS, and there is no direct CALC or GO, DRAW made a wrong figure.
This problem has been corrected.
					K. Oide

From:	KEKVAX::OIDE          9-JUL-1995 10:17:52.34
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Set to Element, new keywords, etc.

   Dear Users:

1. A Change has been made on setting a value to the default keyword of
the element via Element["VALUE",ele]=v or Element[key,ele]=v.   It did not
include the strength error given by the DK command when writing, so even 
setting the same number read-out changed the actual value.   Now this problem 
has been solved. Both the read-out and write-in takes the effect of DK into
account.   Note that writing non-default keyword by Element[keyword,ele]=v
changes only the SAVED value, and does not affect the value of the components.
Consider to use LINE to change them instead of Element.

2. New key-strings "KEYWORDS" and "DEFALUT" have been added to Element.   See
HELP.

3. Internal logics for Upset and pattern-matching are changed, so there may
appear some unexpected side effects.

						K. Oide

From:	KEKVAX::OIDE         10-JUL-1995 15:21:16.15
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Keyword of LINE, etc.

   Dear Users:

1. The key-strings of LINE has been changed.   Type "HELP fun FFS LINE key".

2. Element["EXPAND"] and LINE["EXPAND"] had a bug to cause Segmentation Fault.
It is corrected.

						K. Oide

From:	KEKVAX::OIDE         20-JUL-1995 18:16:44.66
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in symbol-definition, Check, etc.

   Dear Users:

1. The internal logic of symbol-definition and evaluation of the defined
function is renewed.   It is now more Mathematica-like.  For instance,

    f[x_]:=(... x=2 ..)

used to be allowed in SAD even if f is refered as f[2], etc., since x_ created
a new symbol when f[x_] is refered.   This is no longer valid, since like
Mathematica, no symbol is generated with x_ which is only used as a pattern to
replace the symbol x in r.h.s.
   Another change is that you can define both f[x_ ..] and f simultaneously.
This is also the same style as Mathematica's, but I do not know how useful it
is.
   Despite the outer looking effects of the change, the internal structure was
significantly updated.   It simply means an increase of the chance of bugs.
Please be careful....

2. Error messages are somewhat improved.

3. A new function Check is installed.   This is same as Mathematica's.

4. There was a bug in SetPart (a[..]=.. where a is a list ), when elements of a
are duplicated from a single element.   It is fixed.

						K. Oide

From:	KEKVAX::OIDE         24-JUL-1995 16:10:55.42
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Change in VAR and FFS["VAR"], Bug in pure-function, etc.

   Dear Users:

1. VARIABLES(VAR) has been changed to show the minimum, maximum, coupled
element, coupling coefficients as well.   Thus FFS["VAR"] returns a larger
list whose each element is 

{name, keyword, now-value, previous-value, saved-value, minimum, maximum,
 coupled-element, coupling-coefficient} .

2. I made a bug in pure-function yesterday to cure another bug in Slot.
The latter was old and rare only appeared when Slot refers another Slot.

						K. Oide

From:	KEKVAX::OIDE         26-JUL-1995 11:30:25.08
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   OptimizeOptics, DownhillSimplex

   Dear Users:

1. New functions OptimizeOptics and DownhillSimplex are installed.
OptimizeOptics optimizes optics to satisfy the matching conditions given by
matching-function-commands varying the elements which are specified by FREE.
The conditions and variables are same as those for GO.   The merit of
OptimizeOptics is it can optimize any keyword of any element (for instance it
optimizes the length of a quad, etc.)
   OptimizeOptics calls DonwhillSimplex.
   OptimizeOptics returns the final simplex, which is the sorted list of
   {f_i,{v_1, v_2, ..}}
where f_i is the value of the optimized function with variables {v_1, v_2, ..}.
The default optimize function gives f=1+MatchingResidual.

Usage: p=OptimizeOptics[options]

where options and defaults are

option             default    meaning
SimplexSize        0.03       size of the initial simplex, 
                              i.e., dk_i/k0 for each degree of freedom.
OptimizeFunction   CalculateMatching[#,OptimizeVlist]&
InitialSimplex     Null       If non-Null, it is used as the initial simplex.
MaxIteration       Max[100,10*Length[simplex]]
Output             6          file number to print out the intermediate values
                              of the function at largests and smallests
Tolerance          10^-6      tolerance to abort the optimization.   
                              If (fmax-fmin)/(abs(fmax)+abs(fmin)) becomes
                              Smaller than this number, it aborts.

Usage: DownhillSimplex[p,f,options]

where

p: intial simplex, which is the sorted list of {f_i, {v_1, v_2, ..}}.
f: the function to be optimized.

option             default          meaning
VariableRange      {{-INF,INF},..}  List of {vmin,vmax}.
MaxIteration       Max[100,10*Length[simplex]]
Output             6                file number to print out the intermediate 
                                    smallests and largests values of the 
                                    function
Tolerance          10^-6            tolerance to abort the optimization.   


						K. Oide
                              If (fmax-fmin)/(abs(fmax)+abs(fmin)) becomes


From:	KEKVAX::OIDE         12-AUG-1995 10:34:21.14
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   FRINGE affects the nonlinear fringe.

   Dear Users:

1. The keyword FRINGE of QUAD now controls the nonlinear fringe as well as the
linear fringe.   The effects of FRINGE and DISFRIN are summarized as
                
                   DISFRIN=0                   DISFRIN<>0
             Nonlinear      Linear       Nonlinear     Linear
FRINGE=0    entr & exit      none          none         none
FRINGE=1       entr          entr          none         entr
FRINGE=2       exit          exit          none         exit
FRINGE=3    entr & exit   entr & exit      none      entr & exit

2. The calculation of nonlinear fringe of a quad in FFS now uses the second
order integrator which is same as in EMIT and TRACK.

3. The closed orbit finding in FFS is improved in speed.

						K. Oide

From:	KEKVAX::OIDE         22-AUG-1995 12:19:21.93
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Kinematical term in drift, etc.

   Dear Users:

1. The optics calculation in FFS now treats a drift exactly, like as TRACK and
EMIT.   All kinematical terms are involved.   Linear optics around a large 
orbit is affected.

2. The optimization by GO has been improved when a variable becomes close to
the limit.    It becomes slower but returns better results.

						K. Oide

From:	KEKVAX::OIDE          1-SEP-1995 06:13:36.11
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in off-momentum matching with INS.

   Dear Users:

1. A bug was found in the off-momentum matching with INS (NOCELL).   The optics
calculation of the off-momentum part during the matching was wrong, and it did
not converge to the optimum.   This bug was there since this May.   Calculation
with CELL has been OK.
					K. Oide

From:	KEKVAX::OIDE         21-SEP-1995 17:54:58.10
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   SAD runs on acsad2!

   Dear Users:

1. Now SAD runs on acsad2 (DEC alpha 8200, 3 CPUs).   The speed of SAD has been
benchmarked as:

			acsad2		ahsad
FFS Functions:		  8.43		 25.8		sec
FFS CALC:		 29.4		 99.9		sec
FFS Matching:		112.0		289.8		sec
DAPERT Tracking:	 41.6		 97.7		sec

The input deck is /users/oide/WORK/oldsad/sad/bench.sad, which has a KEKB
lattice as the example.   

   The disks of acsad2 are basically common with ahsad.   Therefore once you
login to acsad2 (IP:130.87.75.43), you can use SAD in the same way as ahsad.

   The load module of SAD is now either /SAD/bin/OSF1/sad1.exe or
/SAD/bin/HP-UX/sad1.exe .   The command /proj/oldsad/sad1.exe (and its copy
/SAD/bin/sad1.exe) automatically choose the load module which is runnable on 
your machine.

   The default packages are changed to /SAD/share/Packages/ .   This is common
in both systems.

   You can use TaskBroker on acsad2 in the same way as ahsad, but TaskBroker 
only submits to ahsad for the time being.

2.  Your .login and .cshrc files may need minor modifications to run both on
ahsad and acsad2.   The system-dependent settings can be done using the command
uname in the scripts.   Please look at /users/oide/.cshrc as an example.

3. Please remind that your password for acsad2 and ahsad must has both
uppercase and numbers.   If your current one on ahsad does not, please change
it on ahsad, by yppasswd.

							K. Oide


From:	KEKVAX::OIDE          6-OCT-1995 02:09:03.67
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bugs in Return, FPE in tracking, etc.

   Dear Users:

1. The function Return has been out of order, when issued in Do, Table, etc.

2. Floating exceptions(FPE) has been occurred in tracking in bend in DEC.   
Since the architecture of DEC AXP requires to detect FPE by the code, otherwise
the performance is degraded.   When we installed SAD in DEC last month I
rewrote routines to detect FPE, but it was not or could not be perfect.   I
will correct it whenever it is found.

3. It has been noticed that the result of tracking is slightly different in DEC
from HP.   It is still unclear whether itt is due to any bug or just a matter 
of the floating precision and the kaotic nature of the dynamic aperture.   I
cannot tell which is correct right now.   This will be investigated further 
more.
					K. Oide

From:	KEKVAX::KIKUCHIM      6-OCT-1995 15:06:10.78
To:	@USER$DISK4:[OIDE]SADUSERS.
CC:	
Subj:	SAD/FFS/cor update: weight option for CorrectOrbit[]

Dear users,

New option Weight is available in the defined function
CorrectOrbit[]. Weight introduces different significanse 
between monitors in minimizing process of residual rms.

Usage: CorrectOrbit[....,Weight->weight_List,...]

   weight_List : A list of weights to the monitors.
		 Default is Table[1,{Length[monitor]}].
   
Example: This example tries to correct orbit applying
	 10 times significance to the monitors adjacent
	 to sextupoles.

   ! definition of monitors.
	bpm=Monitor["M*"];
   ! Here are sextupoles, 
	sext=LINE["position","S*"];
   ! and the find monitors adjacent to the sextupoles.
	bpmsext=Map[Part[#,1]&,NearestMonitors[sext,bpm[1]]];
   ! Calucaulate weighting list
	wei=Map[If[MemberQ[bpmsext,#],10,1]&,bpm[1]];
   ! and correct orbit!
     	CorrectOrbit["Y",bpm,str,optics,Weight->wei];

				KIKUCHI M.


From:	KEKVAX::OIDE          2-NOV-1995 07:59:55.93
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Bug in cor, etc.

   Dear Users:

1. A bug in orbit correction with CELL was fixed.   It was caused in a routine
pqcell by calling another routine with an obsolete way.   It is called by the
cor command, not by the correction functions.

2. On acsad2, the tracking by DAPERT and the off-momentum matching has been
performed by parallel processing with 3 CPUs.   You see the acceleration.

						K. Oide

From:	KEKVAX::KIKUCHIM      6-NOV-1995 12:27:52.21
To:	@USER$DISK4:[OIDE]SADUSERS.
CC:	
Subj:	SAD/COR update: CorrectOrbitBump[]

Dear users,

New defined-function CorrectOrbitBump[] is available. This function
makes a correction of orbit with closed orbit bumps.

Usage: CorrectOrbitBump[kind,bumps,bpm,str,optics,options]

	argument default comment
	----------------------------------------------------------
	kind     none    kind of orbit like "X", "EY", {"Y","EY"}.
	bumps    none    a function or a list of functions which de-
			 fines bump characteristics. Each function
			 must have a form such as

			 {"X","NTSYM",8, #,,,,ExtraCondition->{}}&
			
			 This function defines a bumps in the "X"-plane
			 at the point "NTSYM" using 8 correctors with
			 a variable height. Fifth to seventh arguments
			 specify the px,ex, and epx(they are Null in the
			 above example).
	bpm	none	 bpm defined by the function Monitor[].
	str	none	 steer defined by the function Steer[].
	optics  none	 optics defined by CalculateOptics[].
	options none	 same options as in the CorrectOrbit[].
	----------------------------------------------------------
Result: (1) returns a lsit of kick angle and calculted bump variables.
	(2) corrector strength is changed.
	(3) calculate optics if Calc->True and Operate_>false.
	(4) leave an estimated orbit if ExpectedOrbit->True.

				KIKUCHI M.

From:	KEKVAX::OIDE         12-NOV-1995 11:04:00.77
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Calculation of synchrotron light.

   Dear Users:

1. A new functions are installed to calculate the waveform and the spectrum of
the synchrotron radiation from a single electron traversing a lattice defined
by SAD.   It uses Feynmann-Heviside formula

   E \approx (mu0 e/4pi) d^2n/dt^2 ,

where n is the direction vector from the electron at the retarded time to an
observation point.   There are two more terms in the original equation which
have not been implemented, but they are normally small when

   gamma lambda << R ,

where R is the distance from the electron to the observation point.

   SAD first records trajectories of particles.   This is done by the function
TrackParticles with a new flag RADLIGHT on.   When RADLIGHT is on,
TrackParticles returns a list 

   {beam, trajectory} ,

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

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

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

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

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

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

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

where H = n x E and S = E x H , and tau is the observation time.

   The second derivative in the above formula is calculated using the spline
interpolation.

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

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

where filed[k] is one of the fields calculated by RadiationField.   The range
of the wavelength is gven as a list above.   The output spectrum spect is a
list as

   { {k1 .. kk}, {c1 .. ck}, {s1 .. sk} }

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

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

						K. Oide


From:	KEKVAX::OIDE         20-NOV-1995 12:24:09.04
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Setting to Element.

  Dear Users:

1. Setting a value to the function Element like as

   Element[keyword, ele] = value ,

now automatically distribute the value to all components whose name is "ele.*".
You may see how it is done by looking at Definition[Element] .

					K. Oide

From:	KEKVAX::OIDE         22-NOV-1995 13:10:26.04
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   A new command SPLIT.

   Dear Users:

1. A new command SPLIT is added in FFS.

Usage: SPLIT component length

splits the component into two pieces at the point where the distance from
the entrance is length.   The new components have the same name as the
original, and the strengths are proportional to the new lengths.
Only magnets and cavities can be split.   You should CALCULATE(CAL) after
SPLIT to get optical parameters after SPLIT.   Matching using SPLIT element
as a variable may degrades the speed of convergence. 

   SPLIT may be useful to do fitting or making a bump at a location within a 
magnet or a drift space, etc.
					K. Oide

From:	KEKVAX::OIDE         27-NOV-1995 02:15:20.37
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   ListPlot, etc.

   Dear Users:

1. The graphic system in FFS with ListPlot becomes somewhat close to
Mathematica's.   ListPlot now returns a Graphics object which can be redrawn by
Show together with other Graphics objects.

Graphics represents an object for 2D graphics with the form
Graphics[primitives, options].   Up to now available primitives are:

Points[{{x1,y1} .. {x2,y2}}, options]   : Points.
Line[{{x1,y1} .. {x2,y2}}, options]     : Line.
Text[{string, {x,y}}, options]          : Text-string at {x,y}.

Possible options and their defaults values of Graphics are:

option           default         optional values
------------------------------------------------
AspectRatio      GoldenRatio     any positive number
DisplayFunction  Default         Null to suppress display
Epilog           {}              List of primitives
FrameLabel       {"","","",""}   List of strings
PlotLabel        ""              string
PlotRange        Automatic       {ymin,ymax} or {{xmin,xmax},{ymin,ymax}}
Prolog           {}              List of promitives
Scale            {Linear,Linear} Log

Options for primitives:

For Text:
option           default         optional values
------------------------------------------------
TextAlign        ""              "CENTER"
TextCases        ""              string to represent CASES of TopDrawer
TextPosition     ""              "DATA" to represent the position by data
                                 coordinates
TextRotate       0
TextSize         1               relative size of a character

For Point
option           default         optional values
------------------------------------------------
PointSize        1               relative size of a point
PointSymbol      "1P"            Symbol for PLOT of TopDrawer

For Line
option           default         optional values
------------------------------------------------
Dashing          "1"             character string or a list of numbers to represent dashing

   ListPlot accepts options for Graphics, Point, and Line.   Show accepts
options for Graphics.   The output is written to file #9 (fort.9 in OSF1 and
ftn09 in HP-UX) in TopDrawer commands.   If SAD is running on X, the plot is
also done immediately.

Examples:
  g1=ListPlot[{{1,2},{10,20}},Scale->Log,PlotJoined->True,
    DisplayFunction->Null];
  g2=ListPlot[{{1,15},{10,3}},Scale->Log,PlotJoined->True,Dashing->"1 0.3",
    DisplayFunction->Null];
  g3=ListPlot[{{1,2.5},{5,10},{10,12}},Scale->Log,
    DisplayFunction->Null];
  Show[g1,g2,g3,FrameLabel->{"X (mm)","Log(Y)"},PlotLabel->"Test Plot",
      AspectRatio->1];

							K. Oide

From:	KEKVAX::OIDE         29-NOV-1995 15:32:01.17
To:	@SADUSERS.
CC:	OIDE
Subj:	SAD Update.   Plot.

   Dear Users:

1. A new function Plot has been defined.   This is same as Mathematica's, but
the options and the default values are different.   Unlike Mathematica, it
automatically choose Dashing when a list of functions is given.

Usage: Plot[fun, range, options] or Plot[{fun1, .. }, range, options]

options        defaults
-----------------------------------------
MaxBend        0.04
PlotPoints     25
PlotDivision   250
Dashing        {"1","0.8 0.24","0.4 0.12","0.2 0.08","0.1 0.08",
                  "0.8 0.08 0.08 0.08","0.4 0.08 0.08 0.08"}

   Up to now there is a constraint on the function so that it must be 
explicitly given as an expression which contains the independent variable.
Also the independent variable should have been cleared (i.e., no value should
not be set) when Plot is called. 

Example:  Plot[{Cos[x],Check[Sin[x]/x,1]}, {x,0,10}]

					K. Oide