From: KEKVAX::OIDE 14-JAN-1993 15:18:42.86 To: @SADUSERS. CC: OIDE Subj: SAD Update. Working Area. Dear Users: 1. The size of working area is now extended from 14.4 MB to 19.2 MB. K. Oide From: KEKVAX::OIDE 28-JAN-1993 09:47:43.53 To: @SADUSERS. CC: OIDE Subj: SAD Update. Acceleration flag. Dear Users: 1. A change is made so that the optics calculation with acceleration by rf cavities is turned off by RING and/or CELL flags. It used be that only the RING flag turned off the acceleration. The old situation may have been inconvenient for most users. K. Oide From: KEKVAX::OIDE 29-JAN-1993 11:03:41.48 To: @SADUSERS. CC: OIDE Subj: SAD Update. Touchek lifetime for correlated aperture. Dear Users: 1. The touchek lifetime for an aperture given by Jx/(Nx**2 emitx') + Jz(Nz**2 emitz) < 1 and Jy/(Ny**2 emitx') + Jz(Nz**2 emitz) < 1 has become available in the emittance calculation. The simple transverse lifetime is abandoned. K. Oide From: KEKVAX::OIDE 4-FEB-1993 14:15:31.07 To: @SADUSERS. CC: OIDE Subj: SAD Update. New fit code for bump orbits. Dear Users: 1. New fit codes are added for bump orbits. The shifts of orbit by a bump are now specified by DDX, DDPX, DDY DDPY in place of DX, DPX, DY, DPY. New codes PDEX, PDEPX, PDEY, PDEPY are added for changes of dispersion in the physical coordinate K. Oide From: KEKVAX::OIDE 8-FEB-1993 11:33:02.24 To: @SADUSERS. CC: OIDE Subj: SAD Update. RING, etc. Dear Users: 1. The correction on the RING flag issue, which I did last month, was imperfect. Now CELL flag cancels the acceleration optics as stated before. 2. SVD routine TSOLVG is replaced to use only the given area of the matrix as the work space. K. Oide From: KEKVAX::KIKUCHIM 8-FEB-1993 15:50:16.08 To: OIDE CC: Subj: conditioned correction Conditioned correction is now available. Usage: COR [variable] [method] COND This will find corrector strength under some conditions that are given by matching conditions. DDX,DDPX,DDY,DDPY,PDEX,PDEPX, PDEY, and PDEPY are taken as conditions. Example: FIT p1 DDY 0 DDPY 0 KILL C p2 p1 COR Y COND will make so called "local orbit correction" in the interval [p1,p2]. By the same manner we can construct "local dispersion correction". See manual for details. From: KEKVAX::OIDE 9-FEB-1993 08:40:45.74 To: @SADUSERS. CC: OIDE Subj: SAD Update. Kikuchi's new commands. Dear Users: 1. Information on Kikuchi's new commands follows. K. Oide Conditioned correction is now available. Usage: COR [variable] [method] COND This will find corrector strength under some conditions that are given by matching conditions. DDX,DDPX,DDY,DDPY,PDEX,PDEPX, PDEY, and PDEPY are taken as conditions. Example: FIT p1 DDY 0 DDPY 0 KILL C p2 p1 COR Y COND will make so called "local orbit correction" in the interval [p1,p2]. By the same manner we can construct "local dispersion correction". See manual for details. From: KEKVAX::OIDE 12-FEB-1993 17:42:10.04 To: @SADUSERS. CC: OIDE Subj: SAD Update. Coordinate transformation element. New. Dear Users: 1. A new element is added for coordinate transformation in a beam line. This element can be used to express an off-axis element. Usage: COORD name=(DX=dx DY=dy CHI1=chi1 CHI2=chi2 CHI3=chi3); The transformation of the coordinate by this element is {x1 {c3 -s3 0 {1 0 0 {c1 0 s1 {x-dx y1 = s3 c3 0 0 c2 s2 0 1 0 y-dy z1} 0 0 1}. 0 -s2 c2}. -s1 0 c1}. z } where {x1,y1,z1} is the new coordinate and c1=cos(chi1), s1=sin(chi1), etc. To use this element, you have to calculate the values of those parameters carefully. DISP G may help you but there is no automatic way to get them. You may also have to be careful when you use a line with this element in the reverse direction. I also notice you that thousands of bugs are waiting you in this new element. K. Oide From: KEKVAX::OIDE 12-FEB-1993 18:24:03.20 To: @SADUSERS. CC: OIDE Subj: SAD Update. Coordinate transformation. Change. Dear Users: 1. The COORD element has been changed as Usage: COORD name=(DX=dx DY=dy DZ=dz CHI1=chi1 CHI2=chi2 CHI3=chi3); The transformation of the coordinate by this element is {x1 {c3 -s3 0 {1 0 0 {c1 0 s1 {x-dx y1 = s3 c3 0 0 c2 s2 0 1 0 y-dy z1} 0 0 1}. 0 -s2 c2}. -s1 0 c1}. z-dz} where {x1,y1,z1} is the new coordinate and c1=cos(chi1), s1=sin(chi1), etc. K. Oide From: KEKVAX::OIDE 16-FEB-1993 06:55:05.90 To: @SADUSERS. CC: OIDE Subj: SAD Update. direction of COORD. Dear Users: 1. A new keyword DIR is added to the element COORD. If DIR is nonzero, the transformation from the opposite side is done. The normal transformation is R(chi3)R(chi2)R(chi1)D(dx,dy,dz), and the transformation for DIR != 0 is D(-dx,dy,dz)R(chi1)R(-chi2)R(chi3), D=displacement, R=rotation. Note that these are not the inverese to each other. K. Oide From: KEKVAX::OIDE 17-MAR-1993 12:20:43.23 To: @SADUSERS. CC: OIDE Subj: TopDraw of actco2 file at KEKVAX. Dear users: 1. A command file [oide]ftop.com is made for TopDrawing an actco2 file on KEKVAX. Usage: Copy [oide]ftop.com into your directory. At the first time in a day, say $ @ftop to allocate the TEMPDISK. TEMPDISK is killed in 24 hours. You have to place your TopDraw file in a special directory /users/ftp/td/ in actco2. Then say $ @ftop filename TopDraws /users/ftp/td/filename. From: KEKVAX::OIDE 17-MAR-1993 12:27:04.13 To: @SADUSERS. CC: OIDE Subj: ftop.com. File name must be capitalized. Dear users: 1. You have to use an ALL CAPITALIZED NAME for the TopDraw file in actco2, otherwise ftop.com never transfers. I am still looking a way to enable non-capital names. K. Oide From: KEKVAX::OIDE 18-MAR-1993 08:03:39.86 To: @SADUSERS. CC: OIDE Subj: TopDraw. You may be able to use lower case letters for the file name. Dear users: 1. Noboru may have found the answer: Try $@ftop "foo" i.e. use quotation mark to pass lower case characters to command procedure. Noboru From: KEKVAX::OIDE 29-MAR-1993 18:07:17.10 To: @SADUSERS. CC: OIDE Subj: SAD Update. File name in lower case. Dear Users: 1. A file name specification with lower case characters has become available in FFS. You have to use either sigle or double quote to specify that. The closing quote must be the same one as the opening quote. K. Oide From: KEKVAX::OIDE 5-APR-1993 14:17:38.91 To: @SADUSERS. CC: OIDE Subj: Extension for tune survey, etc. New! Dear users: 1. As we have got new work stations, now we do not have to worry about the CPU time limit for a job. Thus I present you a new tool to do a big job, especially for a survey of a dynamic aperture in the tune space. Let me decribe the new functions using the following example. Suppose you want to do a tune survey between (0.05 < nx <0.5)*(0.05 < ny 0.5) plane. This big job writes as FFS USE=RING; !Now you can do DAPERT tracking inside FFS. ring cell nx .25 ny .25 free q* go !make the initial value of quads. save !save it for reuse when matching is failed. norfsw nxr 1 3 1 !these 3 lines specify the intila conditions for DAPERT. nyr 1 3 1 !those play the same role as NX, NY, NZ of DAPERT, done nzr 1 3 1 !outside of FFS. np 100 turns 100 !this specifies TURNS. survey init !initialize the survey table. dapert !you have to turn on DAPERT flag. ny 0.05 !initial value of the vertical tune. repeat 10 !repeat the following 10 times. nx 0.05 !initial value of the horizontal tune. repeat 10 !repeat 10 times. go !do matching. if conv !if matching is successful, emit ! calculate emittance. track ! do DAPERT tracking. survey ! store the score of DAPERT tracking. else !else matching fails, reset ! reset quadrupoles. survey skip ! mark the survey table 'skip'. endif ! end of if structure. nx + .05 !increase horizontal tune by 0.05. until ny + .05 !increase vertical tune by 0.05. until survey result !Output the survey table. The above input results as ..... ..... (output from each step) .... ..... Scale: 2.55/character ----|----1 1 *ZZZZ***** 2 ZZZZZ***** 3 ZZZZZ***** 4 ZZZZZ***** 5 ZZZZZ***** 6 ZZZZZ***** 7 ZZZZZZ**** 8 ZZZZZZ**** 9 ZZZZZZ**** 10 ********** where the horizontal axis means the step of the inner repeat loop, the vertical axis steps the outer loop. Each character represents the score divided by 2.55, in this case. The character order is '0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz', which is same as the output of DPAERT result. The asterisk means the point was skipped by the 'survey skip' command. The '+' syntax in the matching condition is valid for all condition names. You have to put at least one space between '+' and the number. The IF command accepts only a name of a flag or its negative form(NOflag). The UNTIL command also accepts flags as the argument. You can net the if structure. K. Oide From: KEKVAX::OIDE 7-APR-1993 11:57:10.15 To: @SADUSERS. CC: OIDE Subj: New script for background job. Dear users: 1. A new shell script has appeared to run SAD in background of emacs. The script, /proj/oldsad/gsb, automatically determines the most vacant CPU among ahsad{1,2,3,4} and run the background job on the most vacant CPU. You do not have to care about which CPU the job is actually running at all. This script gives you a very efficient way of the usage of our workstation system. Setup: 1. Copy /proj/oldsad/.rhosts into your home directory. 2. Set search path to /proj/oldsad . Put it into .cshrc . 3. Eliminate stty in .login or .cshrc in the case of non-interactive job. Usage: From emacs with classic.elc --- Pressat the window which contains the input deck of SAD. The output is seen in &shell<#> From shell --- gsb You can olso use /proj/oldsad/rlc script to execute any command on the lightest load CPU. Usage: rlc Please try it and send me any trouble or request. K. Oide From: KEKVAX::OIDE 7-APR-1993 11:59:52.53 To: @SADUSERS. CC: OIDE Subj: Delete your old gsb. Dear users: 1. Before you run the new gsb, delete old gsb. The old gsb is not run properly under the new of emacs-classic.elc . K. Oide From: KEKVAX::OIDE 9-APR-1993 14:22:24.16 To: @SADUSERS. CC: OIDE Subj: SAD Update. Flag name CONV. Dear Users: 1. The name of the flag CONV is changed to ?CONV, since CONV conflicts CONV command to specify the magnitude of residual convergence. 2. You should login only ahsad0 (130.87.69.2), because now it automatically redirects your login CPU to the most vacant one. K. Oide From: KEKVAX::OIDE 12-APR-1993 11:57:15.90 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in INPUT. Dear users: 1. A bug in INPUT or READ at FFS was fixed. The bug causes a infinite loop when an undefined file number is given. This was not a propblem in HITACHI. I wondoer why. K. Oide From: KEKVAX::YAMAMOTO "Noboru" 12-APR-1993 16:46:53.21 To: @[OIDE]SADUSERS. CC: Subj: remps command on SAD-computer. I wrote tiny command "remps" for SAD computer. remps stands for remote-ps, i.e. you can get list of processes on any SAD computer without rlogin. Syntax of remps is, remps [hosts] [options] If no host name is given, all sad hostnames are assumed. If no option is given, -e is assumed. Enjoy! Noboru From: KEKVAX::OIDE 15-APR-1993 10:47:47.46 To: @SADUSERS. CC: OIDE Subj: SAD Update. Acceleration optics and cell flag. Dear Users: 1. Several months ago I changed so that CELL flag disables the acceleration optics. Although this change may have been confortable for people who are only interested in ring optics, some application really requires condition of matching both periodic and acceleration. Therefore I have reverted the meaning of CELL flag again. Now only RING disables the acceleration optics. For a compromise with ring people, I also set RING default. Presumably ring people do not have to change their deck. If you see some strange effect in a matching with rf cavities, please try RING flag. K. Oide From: KEKVAX::OIDE 22-APR-1993 07:10:02.24 To: @SADUSERS. CC: OIDE Subj: SAD Update. Space charge. Dear Users: 1. A space charge effect is now installed in tracking. If you turn on SPAC flag, it works. The estimation of the force is done by a Gaussian approximation, i.e., assuming the whole bunch has Gaussian distribution in all dimensions. Yokoya's routine is used in the calculation of the force. The space charge kick is applied at all elements. In an accelerationg structure, the structure is divided into pieces, but other elements is not automatically divided. Please try. K. Oide From: KEKVAX::OIDE 23-APR-1993 07:58:13.23 To: @SADUSERS. CC: OIDE Subj: SAD Update. Error for "power source". Dear Users: 1. A new syntax is added to specify errors of "power source", not magnets. [R_ELATIVE][RA_NDOM][keyword] value Example: QC* r ra 0.01 sets K1 values (saved K1)*(1+0.01*GAUSSIANRANDOMNUMBER) to K1 of all power sources which match QC*. B* ra DDK 0.001 sets 1 mrad to DDK of power sources B*. Please try and report bugs. K. Oide From: KEKVAX::YAMAMOTO "Noboru" 26-APR-1993 09:52:36.44 To: @[OIDE]SADUSERS. CC: Subj: Large files on /scratch1 and /scratch2 will be removed. Hi, The directories /scratch1 and /scratch2 are prepared for large temporary files. Sizes of the files in these directory are checked every midnight (0:00 am) and if one of following conditions is satisfied , the file will be removed. The conditions are, size > 200MB size > 20MB and 1day old or size > 2 MB and 2days old or size > 200KB and 3days old or 4days old. Noboru Yamamoto From: KEKVAX::OIDE 18-MAY-1993 08:56:09.65 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in PLOT. Dear users: 1. Several bugs related PLOT with TRACK has been fixed. a) PLOT has been out of function since moved to HP. b) Specturm plot was still crazy after fixing a). The source of the bug was not serious. It was related to the transfer from Hitachi to HP. K. Oide From: KEKVAX::KIKUCHIM 18-MAY-1993 10:49:58.57 To: @[OIDE]SADUSERS. CC: Subj: SAD/FFS/COR update New flag ZSUMX and ZSUMY in COR command are available. If ZSUMX/ZSUMY is on, correction will do the job under the condition that the summation of correctors is zero in the horizontal/vertical plane. See manual for detailes. From: KEKVAX::OIDE 28-MAY-1993 11:25:56.90 To: @SADUSERS. CC: OIDE Subj: Submit. Dear users: 1. We are now able to use the submit tool, "task broker", on HP. I explain how to use it, assuming you use classic.elc. 1) Go to the SAD input buffer to calculate. 2) Hit . 3) A window *Submit* appears as --- Submit---Fill items and hit to submit--- Submit Command: Class (a:1h, b:5h, c:Infinite): Buffer for Stdin Data: (your buffer name) Input Files: Output Files: Spool Directory: Options: 4) Fill each item if necessary. Submit Command: sad1.exe Class (a:1h, b:5h, c:Infinite): a (Do not use CAPITAL letters!!!) Buffer for Stdin Data: (your buffer name) Input Files: Output Files: ftn11, etc. (Put output file for TD, etc.) Spool Directory: (you may specify /users/ftp/td/) Options: 5) Hit . The job is submitted. 6) Hit M to see the status of jobs. 7) In the job status window, you can hit k (kill) t (terminate) d (delete) h (hold) r (release) on the line where your job is displayed. 8) The output is spooled in /scratch2/spool/(YOURID)/jobname/ . You can change the spool directory in the *Submit* window. This tool is quite useful, since you can reproduce the spooling environment like mainframes on the workstation. Please try to use it and complain it as quick as possible, because only one month is the period to make clim to HP. (The emacs part is done by myself and you can complain forever.) From: KEKVAX::YAMAMOTO "Noboru" 28-MAY-1993 16:01:08.51 To: @[OIDE]SADUSERS. CC: Subj: A bug in errmsg. A bug in errmsg routine was fixed( I hope). It had caused "Bus error" in some situation ( read EOF, for example). Noboru From: KEKVAX::KIKUCHIM 28-MAY-1993 22:16:19.21 To: @[OIDE]SADUSERS. CC: Subj: SAD/FFS/COR update New commands READMON, READSTE, WRITEMON, and WRITESTE are available for corrections in the actual machine. See manual for details. From: KEKVAX::OIDE 4-JUN-1993 11:32:00.08 To: @SADUSERS. CC: OIDE Subj: SAD Update. Radiation in bend in solenoid in tracking. Dear Users: 1. Radiation in bend in solenoid in tracking is added. In EMIT, it has been installed since a long time ago. K. Oide From: KEKVAX::OIDE 5-JUN-1993 11:14:15.27 To: @SADUSERS. CC: OIDE Subj: SAD Update. Home directory in IN and OUT file name. Dear Users: 1. Now you can use ~ sign to specify the home directory in IN, OUT, APPEND commands in FFS. Kikuchi san will also make it possible in other parts. K. Oide From: KEKVAX::OIDE 17-JUN-1993 08:07:54.39 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in EMIT. Dear Users: 1. I have found a bug in EMIT. A calculation of the equilibrium beam matrix, especially related to the off-diagonal part, was factor 2 wrong in an intermeadiate internal matrix in the calculation. This bug was created around August 1991. Even with this problem, in an actual situation when tunes are far from linear coupling resonances, the result does not change greatly. K. Oide From: KEKVAX::OIDE 6-JUL-1993 14:35:35.72 To: @SADUSERS. CC: OIDE Subj: SAD Update. SVD. Dear Users: 1. I have modified the SVD, tsolva.f, very slightly. If you notice any difference in matching, emit, bump, correction, etc., please let me know. K. Oide From: KEKVAX::YAMAMOTO "Noboru" 6-JUL-1993 19:49:08.06 To: @[OIDE]SADUSERS. CC: Subj: Top Drawer on AHSAD. Dear Users, "Test version" of Top Drawer program was installed on ahsads. The command name to invoke Top Drawer is "tdr". When you wants to display output of TOPDRAW data in the file "topd.data" on your VT-Pro screen, use: tdr topd.data See below for more information on tdr command. TDR(N) Osaka City Univ. TDR(N) September 10, 1991 NAME tdr - topdrawer: histgram display SYNOPSIS tdr [-v device] [-p] DESCRIPTION TDR is a subset of TOPDRAWER, which displays histgrams. Currently available devices are "tek4010", "necpc100", "pc98vt", "canonlbp", "psl" and "X", where "psl" is a PostScript with a landscape format. Kermit users should specify "tek4010". The default device is "tek4010". If the -p option is specified, a pre-processor routine is envoked and it tries to emulate TOPDRAWER as much as possible, but it takes time. EXAMPLE tdr -v X data.tdr will display the topdrawer picture on the X terminal using the input data: data.tdr. FILES /usr/usrs/ocu/topdraw/pf/* - source files /usr/local/bin/tdr - exacutable file BUGS If TEXTUREs are specified, the -p option has to be specified. If the -p option is specified and the program is interrupted, a temporary file will be left. Multiple plots on a printer may not work. COPYRIGHT Copyright (c) 1986 The Board of Trustees of the Leland, Stanford Junior University. All rights reserved. This version was modified by Y.Teramoto, Dept. of Physics, Osaka City University. So far the devices 'tek4010', 'X' and 'psl' were tested on ahsad. Some of routines used in tdr are also available for Fortran/C programers. pf(n) Osaka City Univ. pf(n) March 1, 1991 NAME pf - Fortran callable plot package DESCRIPTION "pfxxx" is a Fortran callable plot package. "plxxx" is a C callable package. The following is the list of library subroutines with arguments. (i),(r),(s) indicate 'integer', 'real' and 'character string' variables, respectively. This uses the UGS fonts and their driver program to draw texts. pfclos - Close the display device. call pfclos pflush - Flush X draw call pflush pfgdev - Get GDEVICE name if( pfgdev( device ) ) then device:(s) Currently setenv GDEVICE name. pfine - Draw a line. call pfine( x1, y1, x2, y2 ) x1:(r) Starting X coordinate y1:(r) Starting Y coordinate x2:(r) End X coordinate y2:(r) End Y coordinate pfopen - Open the display device. call pfopen( device ) device:(s) Device name can be "necpc100", "pc98vt", "kermit", "tek4010", "lbp8", "canonlbp", "X", "psl", "psp", "gdevice". "lbp8" will print the picture on CANON laser printer in the 1st floor. "canonlbp" will print it on the 2nd floor. "psl" will print it on the LaserWriter in landscape, "psp" will print it on the LaserWriter in portrait. pfoine - Draw line with option call pfoine( opt, x1, y1, x2, y2 ) opt:(i) 0 for solid line, 1 for dashed line x1:(r) Starting X coordinate y1:(r) Starting Y coordinate x2:(r) End X coordinate y2:(r) End Y coordinate pfovect - Draw vector with option call pfovect( opt, x, y, vis ) opt:(i) 0 for solid line, 1 for dashed line x:(r) X coordinate y:(r) Y coordinate vis:(i) 0 for dark vector, 1 for visible vector pfpr - Print out saved plot. "pfpr" prints the saved plot on the CANON laser printer in the 1st floor. This has to be called after "pfclos". call pfpr pfsave - Save the plot. "pfsave" specifies plot-save option. The saved plot can be printer by "pfpr". This has to be called before "pfopen". call pfsave pfscrn - Specify the screen area. call pfscrn( xl, yl, xh, yh ) xl:(r) Lower X corner coordinate ( 0.0 - 1.0 ) yl:(r) Lower Y corner coordinate ( 0.0 - 1.0 ) xh:(r) Upper X corner coordinate ( 0.0 - 1.0 ) yh:(r) Upper Y corner coordinate ( 0.0 - 1.0 ) Full screen is pfscrn( 0.0, 0.0, 1.0, 1.0 ). pftext - Display texts. call pftext( x, y, angle, size, font, text ) ( x, y ):(r) Coordinate of the 1st character of the text. angle:(r) Display angle in degrees. size:(r) Size of the text display. font:(i) 1 simplex, 2 duplex fonts, 3 UBC, 4 Greek. text:(s) Text string to display. pfvect - Draw a vector call pfvect( x, y, vis ) x:(r) X coordinate y:(r) Y coordinate vis:(i) 0 for dark vector, 1 for visible vector pfxtext - Display extended texts. call pfxtext( x, y, angle, size, font, ptext, stext ) ( x, y ):(r) Coordinate of the 1st character of the text. angle:(r) Display angle in degrees. size:(r) Size of the text display. font:(i) 1 simplex, 2 duplex fonts, 3 UBC. ptext:(s) Primary text string to display. stext:(s) Secondary text string. pfwdow - Specify the display window call pfwdow( xl, yl, xh, yh ) xl:(r) Lower X corner coordinate yl:(r) Lower Y corner coordinate xh:(r) Upper X corner coordinate yh:(r) Upper Y corner coordinate FILES You have to link the following library, Library: /usrs/local/lib/ocu/plot/libsplot.a Plotting on CANON laser printer will make a file CANONLBP in the default directory. AUTHOR This modification was done by Yoshiki Teramoto, Dept. of Physics, Osaka City University. Copyright of the UGS fonts belong to The Board of Trustees of the Leland, Stanford Junior University. If you find the any troble please contact system managers of ahsad. Noboru Yamamoto One of system managers on AHSAD. From: KEKVAX::YAMAMOTO "Noboru" 7-JUL-1993 18:56:01.85 To: @[OIDE]SADUSERS. CC: Subj: TopDrawer on ahsad, again. Dear users, As you already know, you cannot use tdr command directly in the emacs environment. You can: 1) escape from emacs to shell by CTRL+z and issue tdr command. 2) start up two sessions on your terminal( I mean vt-pro/telnet on Mac) and use one session for emacs and another for shell. 3) Use MacX (or other X-window server program) together. In *shell* buffer in emacs, type in setenv DISPLAY :0 tdr -v X then you will find output in MacX window. (If you use shell other than csh/tcsh, replace setenv by appropriate command.) tdr command with psl option will produce the file named POSTSCRIPT in your current working directly. You can get hardcopy of the output drawing by lpr -dlwsad POSTSCRIPT This command prints it on the lwsad printer. If you wants print it on an Apple Laser Writer, lw3g4f for example, lpr -dlw3g4f POSTSCRIPT will do. Use lpstat command to get available printer names. Because of unkown reason, psl option can hadle just one page of drawing. If your topdrawer data contains several pages, POSTSCRIPT code only for last page will be produced. lpr command fails to print out POSTSCRIPT file when size is too big. From: KEKVAX::OIDE 9-JUL-1993 14:39:09.39 To: @SADUSERS. CC: OIDE Subj: SAD Update. Output of smear in tracking. Dear users: 1. I have changed the output of the tracking done every several hundred turns. The old one used to output the average of the "radius" in the phase space as 2J's, i.e., **2. The new version has changed to calculate <2J> simply. K. Oide From: KEKVAX::OIDE 13-JUL-1993 17:31:01.45 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in quad in solenoid. Dear Users: 1. A bug was found in a routine tsgeo.f which determined the design orbit in a solenoid. Only a quadrupole in a solenoid is affected by this bug. It is not possible to say when this bug was created. I thank to Toge san for pointing out this bug. K. Oide From: KEKVAX::OIDE 15-JUL-1993 11:01:03.75 To: @SADUSERS. CC: OIDE Subj: SAD Update. Emit and track with NORFSW. Dear Users: 1. When RFSW is turnd off, emit and track has been simply ignoring cavities. I have made a change to give an acceleration just compensate the enrgy loss due to radiation. It is effective when RADCOD is on and RFSW is off. The modified routines are temit.f tcod.f tturne.f temits.f tturn.f tcav.f tcave.f K. Oide From: KEKVAX::OIDE 16-JUL-1993 17:45:10.98 To: @SADUSERS. CC: OIDE Subj: SAD Update. DISKIN for QUAD. Dear Users: 1. A new parameter DISKIN is added to QUAD. If nonzero, the kinematical term is turned off in tracking and emittance calculation. 2. A bug was found in kinematical term of quad in tracking. The magnitude of the kinematical term was 0.5/N smaller, where N is the number of division of a quad. The default of N is 1+10 sqrt(|K1 L|). I think this bug should be minor. K. Oide From: KEKVAX::OIDE 4-AUG-1993 09:34:01.78 To: @SADUSERS. CC: OIDE Subj: SAD Update. File input, etc. Dear Users: 1. A problem in input a file in FFS is solved. In some special cases when IN file is done, and the file does not have TERM IN at the end, and the last command has an optional numerical parameter which is omitted in the file, FFS falls in an infinite loop. This bug was found by Fukuma san. Modified routines: getval.f, getbuf.f, getwrd.f, word.f 2. Most parameters set in FFS is now transferred to the MAIN level at the exit of FFS, except NPART, TURNS, and CHARGE. Modified routine: track.f K. Oide From: KEKVAX::OIDE 17-AUG-1993 16:27:16.10 To: @SADUSERS. CC: OIDE Subj: SAD Update. Scale. Dear Users: 1. The commands EXSCALE, EPXSCALE, EYSCALE, EPYSCALE, DXSCALE, DPXSCALE, DYSCALE, DPYSCALE are now effective in the DISP command. Those have been ineffective by mistake. Other keywords with SCALE have been effective. USAGE: DXSCALE unit After saying this, all input and output on DX is devided by unit. EXAMPLE: DXSCALE 1E-3 This changes the unit of DX to 1 mm. K. Oide From: KEKVAX::OIDE 18-AUG-1993 12:09:04.53 To: @SADUSERS. CC: OIDE Subj: SAD Update. DISP D. Dear Users: 1. A new option for DISP is added: DISP D_UMPOPTICS .... prints out the current optics data in 255 characters/line format. This format is suitable for passing optics data to other programs, e.g., Mathematica. The first line contains the 19 units of the following functions. After the 2nd line, the values of functions follow. Each line consists of AX BX NX AY BY NY EX EPX EY EPY R1 R2 R3 R4 DX DPX DY DPY S id value name where id is the idcode of each element. The column of the values are fixed. Values are also separated one or more spaces. K. Oide From: KEKVAX::OIDE 27-AUG-1993 02:04:50.03 To: @SADUSERS. CC: OIDE Subj: SAD Update. Unit of variables. Dear Users: 1. A change is made to specify the unit of variable for input and display in FFS. Example: (Specifying a unit) Q* unit 6.43331455E-3 specifies the unit of K1 of Q* in 1/brho at 46.6 GeV. At this time you can write just a constant number for the unit. The unit can be different for each variable. (Input the value) QF 200 sets K1 of QF to 200 in the current unit. (Output value) Output of values by VAR and DISP are in the current unit. VARS also displays the current unit for each variables. Changed routines: tffs,tfinit,tffsa,tfdisp,tfvars,tfgetv K. Oide From: KEKVAX::OIDE 9-SEP-1993 10:01:07.51 To: @SADUSERS. CC: OIDE Subj: SAD Update. SVD. Dear users: 1. A new routine tsvd is added for a professional use. Nothing is supposed to happen by this change, so please report anything you noticed. Added: tsvd Modified: tsolva K. Oide From: KEKVAX::YAMAMOTO "Noboru" 14-SEP-1993 11:40:47.00 To: @[OIDE]SADUSERS. CC: Subj: mathematical expression on SAD toplevel. Dear Users, Now you can use mathematical expression on SAD toplevel ( not in FFS, yet) to specify numbers. For example, You can say, L0=1 m; quad q=(l=2*L0+0.5 cm); Restrictions: When you need to start math expressio with '(', '(' shoud be proceeded by '+', otherwise rest of expression is read as list. a=( 1 2 3); ! a is a list (1 2 3). b=+(1+2+3); ! b = 6 Supported Operators: + - * / ^ (power) ~ (not) < > = <= >= <> (not equal) & | Logical values. logical expression returns 0d0 it the expression is false, 1d0 otherwise. Person to Cantact: Noboru Yamamoto From: KEKVAX::YAMAMOTO "Noboru" 17-SEP-1993 18:27:39.04 To: @USER$DISK1:[OIDE]SADUSERS. CC: Subj: Bug report. Dear Users, Koiso-san reported the bug related to the introduction of math-expression capability at toplevel of SAD. The bug reported was fixed. However, it introduces some restriction on use of list format. In this version, you cannot omit comma to separate items in the list (in some case). For example, NX=(1 2 3) NY=(1 ,-3+5, +1+2); is accepted as you expect, however, NX=(1 2 +3) NY=(1 -3+5 +1+2); is interpreted as NX=(1 5) NY=(6); Noboru From: KEKVAX::OIDE 20-SEP-1993 11:34:10.84 To: @SADUSERS. CC: OIDE Subj: SAD Update. Expression in FFS. New. Dear Users: 1. Now expression capability is released in FFS. At this time, you can write an expression anywehre you can write a number in all FFS commands. You can also use a character-string expression. The description follows. An expression consists of operators, constants, variables, function references, and expressions. At this time, there are only two types of expression, double precision floating number and character string. ***Operators*** Arithmetic: unary -, +, -, *, /, ^ Comparison: == (equal, for real and string) <> or >< (unequal, for real and string) > (greater than, for real only) < (less than, for real only) >= or => (greater or equal, for real only) <= or =< (less than or equal, for real only) Logical: ~ (not) & (and) | (or) String: // (character-string concatenation) Set: = (set the value of r.h.s. to l.h.s., then return the value.) Parenthesis: ( and ) The operators ==, <>, ><, // converts a real number into string, before operation, if one of the operands is string. ***Constants*** Real: fortran-readable format String: characters enclosed by either ' or " ***Variables*** (R=Readable, W=writable, D=definable) SAD-MAIN variables: Real: R, W. Integer: R. Others: Ignored. FFS flags: R. The character ? must be prepended to the flag name. FFS matching variables: R, W. The character # must be prepended to the variable name. FFS variables: R, W, D. In this version, variables defined in a FFS session are kept in all FFS sessions. Up to 32 characters are allowed as the FFS variable name. Predefined: pi, speedoflight ***Functions*** A function is refered as name[arguments]. At this time, only the following intrinsic functions are supplied: sin, cos, tan, sinh, cosh, tanh, exp, log, atan, atan2, sqrt, floor, ceiling, min, max, mod. 2. The PRI_NT command is updated. PRI_NT expression1 [expression2...] now prints any result of expressions. 3. According to the above expression capability, some (not all) of FFS parameters which has been specified by individual commands are abandoned. These setting can be done by the set operation. The abandoned commands are: EMIX (use EMITX=value instead) EMIY (use EMITY=value) NP (use NP=value) CHARGE (use CHARGE=value) MOMENTUM (use MOMENTUM=value) PBUNCH (use PBUNCH=value) MINCOUP (use MINCOUP=value) EMITDIV (use EMITDIV=value) EMITDIVB (use EMITDIVB=value) EMITDIVQ (use EMITDIVQ=value) EMITDIVS (use EMITDIVS=value) DLENG (use FSHIFT=df/f0) GCUT (use GCUT=value) Other similar commands remain untouched, but will be abandoned in near future. Because of this change, most of the old input decks become incompatible with the expression capability. Although you may complain a lot on this change, I have to ask you accept this, because this is the only one way to introduce the expression without further complexity in the command syntax. 4. I also have to ask you to report any problem introduced by this change. I will be ready to debug. Any comments and sugestions are also welcome. K. Oide From: KEKVAX::OIDE 20-SEP-1993 13:27:42.03 To: @SADUSERS. CC: OIDE Subj: SAD Update. More on expression. Dear Users: 1. Please use CONVERGENCE=value instead of the command CONV value , which has been abandoned. K. Oide From: KEKVAX::OIDE 20-SEP-1993 15:42:34.85 To: @SADUSERS. CC: OIDE Subj: SAD Update. Today's bugs. Dear Users: 1. Several problems have been pointed out and fixed: 1) Semicolon right after a variable name made a problem. 2) Unary + is added to the operators. 3) Asterisk as the default matching value made a problem. 4) Keywords MIN and MAX for a matching variable setting was wrong. K. Oide From: KEKVAX::OIDE 21-SEP-1993 11:25:26.35 To: @SADUSERS. CC: OIDE Subj: SAD Update. More expressions. Dear Users: 1. Substring has become to be specified by string[i1,i2] 2. New functions are added: len[string] length of string index[string1,string2] position of string2 in string1. zero is returned when string2 is not found. 3. Some commands are abandoned: DP -> use DP=value The unit is now 1, not percent!!! DP0 -> use DP0=value The unit is now 1, not percent!!! DPM -> use DPM=value The unit is now 1, not percent!!! XIX -> use XIX=value XIY -> use XIY=value TITLE -> use TITLE=string CASE -> use CASE=string K. Oide From: KEKVAX::OIDE 22-SEP-1993 11:15:22.14 To: @SADUSERS. CC: OIDE Subj: SAD Update. Arrays in FFS. Dear Users: 1. Now we can define numerical arrays and perform operations on the arrays. The function ARRAY[1,n1,n2...]; returns an numerical array with the size (n1,n2,...), and all components are initialized to zero. The first argument of ARRAY must be 1, and meaningless at this time. You can do all numerical operations on arrays like as scalar variables. You refer the component of an array a by a[i1,i2,...] If number of subscripts is smaller than the definition of a, the correspoding sub-array is returned. K. Oide From: KEKVAX::OIDE 23-SEP-1993 10:41:13.74 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug of ';'. Dear Users: 1. There was a bug of semicolon at the end of an exprssion. The next expression after the semicolon was not recognized as an exprssion. It is fixed. K. Oide From: KEKVAX::OIDE 24-SEP-1993 18:15:00.87 To: @SADUSERS. CC: OIDE Subj: SAD Update. ELSEIF, etc. Dear Users: 1. ELSEIF command is added. This is very similar to FORTRAN's ELSEIF. 2. A new function ELEMENT is added. ELEMENT['LENGTH'] returns number of elements in the current line. ELEMENT['NAME',n] returns name of n-th element. ELEMENT['VALUE',n] returns value of n-th element. ELEMENT['VALUE',name] returns value of the element whose name is name. ELEMENT['POSITION',name] returns the position of the element whose name is name, in the element table. 3. A bug with == operation has been fixed. K. Oide From: KEKVAX::OIDE 27-SEP-1993 15:54:03.45 To: @SADUSERS. CC: OIDE Subj: SAD Update. SetDelayed, etc. Dear Users: 1. A new operator := is added. This operator's function is very similar to Mathematica's SetDelayed (:=). The left hand side of := is limited to FFS variables. Neither MAIN variables and the matching variables are not allowed. 2. Trouble with semicolon is solved. 3. String expression can be written for the file name of INPUT/OUTPUT/APPEND command. K. Oide From: KEKVAX::OIDE 28-SEP-1993 17:17:01.33 To: @SADUSERS. CC: OIDE Subj: SAD Update. TWISS function, etc. Dear Users: 1. A new function TWISS is released to enable access to calculated twiss parameters. TWISS[keyword] returns an array of function specified by keyword for the entire line. TWISS[keyword,i] returns i-th value of the function specified by keyword. TWISS[keyword,elementname] returns the value of function specified by keyword at elementname. TWISS['LENGTH'] returns the number of elements of the line. The format of the character-string elementname is same as most FFS commands, i.e., 'name.nth+-offset' . The keyword is a character string and one of 'AX', 'BX', 'NX', 'AY', 'BY', 'NY', 'EX', 'EPX', 'EY', 'EPY', 'R1', 'R2', 'R3', 'R4', 'DX', 'DPX','DY', 'DPY' . Note that the unit of 'NX' and 'NY' is radian. At this time off-momentum values of twiss parameters cannot be accessed, but you can get them by changing DP0. 2. Now an array can be printed by print command. 3. A bug with the IF structure is corrected. K. Oide From: KEKVAX::OIDE 29-SEP-1993 11:10:50.24 To: @SADUSERS. CC: OIDE Subj: SAD Update. More functions, etc. Dear Users: 1. More functions are added: LENGTH[array] returns the major size of an array. DIMENSIONS[array] returns the dimensions of an array. These two above are very similar to Mathmatica's counterparts. LINE['S'] returns an array of orbit length s of the line. LINE['S',name] returns s of the element specified by name. LINE['S',i] returns s of the i-th element. LINE['TYPE'] returns an array of type of elements in the line. LINE['TYPE',name] returns the type of the element specified by name. LINE['TYPE',i] returns the type of the i-th element. LINE['NAME',name] returns the name of the element specified by name. LINE['NAME',i] returns the name of the i-th element. LINE['LENGTH',i] returns the number of elements in the line. LINE['POSITION',name] returns an array of positions of elements which match name. 2. The execution speed is somewhat improved. K. Oide From: KEKVAX::OIDE 29-SEP-1993 20:35:38.08 To: @SADUSERS. CC: OIDE Subj: SAD Update. Functions for array, etc. Dear Users: 1. The following functions can be applied for n numeric array. SIN, COS, TAN, SINH, COSH, TANH, ATAN, EXP, LOG, SQRT, FLOOR, CEILING. 2. Twiss[keyword,array] stores values of array into twiss parameter buffer of FFS (and also returns array itself.) K. Oide From: KEKVAX::KIKUCHIM 1-OCT-1993 14:37:10.61 To: @[OIDE]SADUSERS. CC: Subj: FFS/COR updates: ADD and SUB changes MON/STE number. Dear users, SUB and ADD operation in "c" and "m" stacks now changes the number of Corrector dipoles and BPMs respectively. These operation always produce a reduced set of Corrector/ BPM in their numbers. I believe this will be convenient especially for OPERATE mode. DROP may need similar changes, but I have no good idea. Please let me know any complaints on this subject. M. Kikuchi From: KEKVAX::OIDE 1-OCT-1993 17:59:42.91 To: @SADUSERS. CC: OIDE Subj: SAD Update. End of line. Dear Users: 1. The roll of the end of line is changed. Now an expression continues to the next line, if it is not complete. For example, 1+2*(3 +4) is legal and returns 15. On the other hand, semicolon always terminates an expression: 1+2*(3; +4) is illegal. This rule is quite similar to Mathematica's. This change was done by a deep reconstruction of the input routine of FFS, thus any unexpected side effect can be induced. (You can guess the reason why we need the change of the end of line rule.) 2. The execution speed of expressions is significantly improved, nearly one orde faster than it was two weeks ago. K. Oide From: KEKVAX::OIDE 4-OCT-1993 14:56:11.88 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in TYPE. Dear Users: 1. A bug in TYPE command was found by Kikuchi san and has been corrected. This bug was created last week, maybe on Friday. K. Oide From: KEKVAX::OIDE 5-OCT-1993 14:14:19.02 To: @SADUSERS. CC: OIDE Subj: SAD Update. List, new functions, etc. Dear users: 1. I would like to introduce a list in FFS. The list in FFS is very similar to that of Mathematica. A list is an ordered set of elements. For example, you can define a list by a={1,2,'abc',{b,c,3},4} . A component of a list is accessed by subscripts enclosed in brackets []. In the above example, a[1] returns 1 a[4] returns {b,c,3} a[4,2] returns c a[4][2] returns c . You can also substitute into an element of a list. a[4,2]=0 sets a to {1,2,'abc',{b,0,3},4} a[4]=0 sets a to {1,2,'abc',0,4} . Functions for a list in Mathematica such as Table, Append, Prepend, etc. will come in future. The usage of a list is quite broad and hard to explain entirely. The simplest example is COD={TWISS['DX'],TWISS['DPX'],TWISS['DY'],TWISS['DPY']} stores a closed orbit in COD. Thus you can do any arithmetic operation on COD. (You may realize that the above should be able to written as COD=TWISS[{'DX','DPX','DY',DPY'}] . Actually this automatic-mapping is under implementation and will be available this evening.) There remain a lot of unclear points in the code of the list, so unexpected side effects are inevitable. 2. New functions ASIN, ACOS, ASINH, ACOSH, ATANH are installed. 3. A bug in WAKE command is fixed. K. Oide From: KEKVAX::OIDE 5-OCT-1993 15:33:55.54 To: @SADUSERS. CC: OIDE Subj: SAD Update. Automatic mapping. Dear Users: 1. Some functions now do 'automatic mapping' to their list-arguments. At this time the first and the second arguments of functions TWISS, LINE, ELEMENT have the automatic-mapping attribute. (Actually other built-in functions already have this capability for a numeric array.) For example, TWISS[{'BX','BY'}] is equivalent to {TWISS['BX'],TWISS['BY']} and TWISS[{'BX','BY'},{2,3}] is equivalent to {{TWISS['BX',2],TWISS['BX',3]},{TWISS['BY',2],TWISS['BY',3]}} . The element of the last argument changes faster like as array suffices. This capability is quite useful as explained in the last mail. I know what you need next. That is Transpose, isn't it? K. Oide From: KEKVAX::OIDE 5-OCT-1993 18:15:56.17 To: @SADUSERS. CC: OIDE Subj: SAD Update. TWISS[keyword,'SET',array] Dear Users: 1. Say TWISS[keyword,'SET',array] to set values of array to the Twiss buffer of FFS. K. Oide From: KEKVAX::OIDE 7-OCT-1993 12:33:05.65 To: @SADUSERS. CC: OIDE Subj: SAD Update. DO, TABLE, bugs. Dear Users: 1. New functions DO and TABLE are installed. Those are very similar to Mathematica's couterparts. 2. There has been a bug on SEED command since last month, so that setting SEED has been mulfunctioned. It is fixed today. 3. Setting an undefined variables with leading # character now causes an error. 4. Execution speed is somewhat improved, but still slower than Mathematica. You can ask why FFS is slower in spite of less functions than Mathematica's. K. Oide From: KEKVAX::OIDE 8-OCT-1993 15:02:49.87 To: @SADUSERS. CC: OIDE Subj: SAD Update. Format, etc. Dear Users: 1. You can specify the output format of a number by $FORM=format where format is a character string either one of 'columns.fraction', 'Scolumns.fraction', or ' '. For example, '10.7' specifies the total width 10 characters and the number of fractional digits 7. If you say 'S10.7', the leading spaces and trailing zeros are supressed and the total length may be smaller than 10. If you say ' ', it uses the default setting 'S17.15'. The setting of $FORM lasts until the next setting. If you want to change the format in one print statement, say as print ($FORM='10.7';x) ($FORM='12.5';y) ($FORM=' ';z) Since this spec of $FORM is different from Mathematica's, it is subject to change in future. K. Oide From: KEKVAX::OIDE 10-OCT-1993 12:37:47.68 To: @SADUSERS. CC: OIDE Subj: SAD Update. ABS. Dear Users: 1. A new function ABS and RANDOM is installed. ABS[x] .... absolute value of x. RANDOM[] .... uniform random number between 0 and 1. K. Oide From: KEKVAX::OIDE 26-OCT-1993 15:50:39.93 To: @SADUSERS. CC: OIDE Subj: SAD Update. EXEC command. Dear Users: 1. A new command EXEC_UTE is added. Usage: EXEC filename executes commands in the file specified by filename, and after the file is terminated by TERM IN command of end of file, the control returns to the NEXT LINE of the original input stream. The rest of line after the filename is ignored. Most people may have believed that the IN_PUT command did what EXEC_UTE does, but actually not, since IN_PUT simply changes the input stream to another file and after return to the original file, the contents from the stream remains as the part of the stream. This difference is revealed when you use IN_PUT inside of REPEAT-UNTIL loop. Anyway I will make this change in 10 minutes. K. Oide From: KEKVAX::OIDE 26-OCT-1993 16:10:00.68 To: @SADUSERS. CC: OIDE Subj: SAD Update. Use IN_PUT. Dear Users: 1. Please simply use IN_PUT for the purpose of the EXEC command in the previous mail. The IN_PUT is changed to mean EXEC, and EXEC does not exist anymore. (Please laugh at my stupidness.) K. Oide From: KEKVAX::YAMAMOTO "Noboru" 26-OCT-1993 17:23:03.57 To: @USER$DISK1:[OIDE]SADUSERS. CC: Subj: sad1.exe was rebuild. Dear Users, /proj/oldsad/sad1.exe was rebuild just a few minutes ago. When you find any trouble, please contact Noboru Yamamoto. Noboru From: KEKVAX::YAMAMOTO "Noboru" 27-OCT-1993 11:43:01.82 To: @USER$DISK1:[OIDE]SADUSERS. CC: Subj: sad1.exe was rebuild, again. Dear Users, sad1.exe is rebuild this morning because of lack of msortn routine in the previous sad1.exe. Noboru From: KEKVAX::OIDE 27-OCT-1993 15:51:19.02 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in element specification. Dear Users: 1. A bug in the element specification is fixed. Rule: name.number+-order where number can be any expression which does not contain + or - signs. order can be any expression. K. Oide From: KEKVAX::KIKUCHIM 28-OCT-1993 12:24:07.69 To: @[OIDE]SADUSERS. CC: Subj: FFS/COR bug. I have found a bug in COR in the case of OPERATE mode. COR X Y has not worked properly. COR X or COR Y has been OK. The bug was found during NISSMR study. The bug was fixed. From: KEKVAX::OIDE 28-OCT-1993 19:00:21.38 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in array reference. Dear Users: 1. A bug when an array reference is at the end of an expression is found. example: a=a+b[i] It is corrected. K. Oide From: KEKVAX::OIDE 30-OCT-1993 07:32:37.10 To: @SADUSERS. CC: OIDE Subj: SAD Update. Update of internal logic. Dear Users: 1. The logic of the internal stack operation is simplified in the way that making stack and the stack pointer static, as suggested by Yamamoto. Actually this should have been so from the beginning, since it is stack. As the result the detection of "Too deep recursive call" works perfectly, and the maximum length of a list which can be input at one is increadse to nearly 20000. K. Oide From: KEKVAX::OIDE 31-OCT-1993 16:24:17.34 To: @SADUSERS. CC: OIDE Subj: SAD Update. LINE[keyword...]. Dear Users: 1. LINE function is extended to get values of components, specified by a keyword, in the line: LINE[keyword] returns a list of value of keyword for the entire line. LINE[keyword,i] returns the value of i-th component. LINE[keyword,name] returns the value of the element specified by name. If the element does not have the keyword, 0 is returnd. Example: LINE['K0'] returns a list of kick angles (B l/Brho) of the line. K. Oide From: KEKVAX::OIDE 5-NOV-1993 08:33:50.34 To: @SADUSERS. CC: OIDE Subj: SAD Update. Change in internal logic, and EXEC command. Dear Users: 1. A new command EXEC_UTE is added to execute a string expression as an FFS command. Usage: EXEC string_expression The string_expression can contain any FFS commands. Multiple commands separated by semicolons are allowed. 2. Internal logic of expression evaluation is deeply changed. As the result, a) Length of variable name now has no limit. b) Speed of Do and Table becomes 10 times faster, even faster than Mathematica. This change was more ncessary for future extension than its explicit appearences. K. Oide From: KEKVAX::OIDE 6-NOV-1993 11:28:27.87 To: @SADUSERS. CC: OIDE Subj: SAD Update. Internal logic, etc. Dear Users: 1. An internal logic of evaluation of expressions is changed. Nothing should not be noticed in the appearence. 2. A bug in a character string ending with spaces, which has been ignored when printed, is fixed. K. Oide From: KEKVAX::OIDE 8-NOV-1993 12:00:24.16 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in list. Dear Users: 1. A bug in list operations is fixed. An explicit list specification like {1,2,3} has caused an error since last Saturday. K. Oide From: KEKVAX::OIDE 9-NOV-1993 17:51:16.61 To: @SADUSERS. CC: OIDE Subj: SAD Update. Functions. New. Dear Users: 1. Now defined functions are available. The syntax is very similar to Mathematica's. example: f[x_,y_]:=sin[x/2]^2+sin[y] f[2]=3 f[f[2]]=f[pi,pi], etc. At this time, only a simple named pattern like x_ is available as the pattern. K. Oide From: KEKVAX::OIDE 10-NOV-1993 15:05:53.27 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in FFS. Dear Users: 1. There has been a bug since last Friday. Setting to MAIN variables like MOMENTUM, GCUT, etc., in FFS has been out of order. All calculations depending on them were wrong. K. Oide From: KEKVAX::OIDE 10-NOV-1993 22:00:07.97 To: @SADUSERS. CC: OIDE Subj: SAD Update. Module and Timing. Dear Users: 1. New functions MODULE and TIMING are added. These are very similar to Mathematica's. K. Oide From: KEKVAX::OIDE 11-NOV-1993 17:32:40.17 To: @SADUSERS. CC: OIDE Subj: SAD Update. Improvement in routine of dipole. Dear Users: 1. The routine of optics calcuration in FFS for a "flat dipole", which I mean a bend with zero design bending angle like a dipole corrector, is improved to include the edge focus. It is necessary to include that to apply to a wiggler, otherwise it is inconsistent with EMIT or TRACK routines. K. Oide From: KEKVAX::YAMAMOTO "Noboru" 12-NOV-1993 09:51:36.92 To: @USER$DISK1:[OIDE]SADUSERS. CC: Subj: new location of old execution modules. Dear SAD users, Old execution modules (sad1.exe.xxxxxxxx) were moved into new location, /proj/oldsad/OLDEXE. Noboru From: KEKVAX::OIDE 12-NOV-1993 11:05:37.24 To: @SADUSERS. CC: OIDE Subj: SAD Update. Pure functions. Dear Users: 1. Now pure function is available. It is very similar to Mathematica's except ## and ##n are not allowed as the dummy argument at this time. Example: a=1+sin[#]&[0.5] 2. Due to the pure function, the operator '&' no longer means logical AND. Please use '&&' insead. Actually this is a very unconfortable change for you,, but I have no idea to manage it. Similar change may happen in future concerning to the sign '!', '|', '//', etc, which have different meaning from Mathematica. K. Oide From: KEKVAX::OIDE 12-NOV-1993 17:20:32.27 To: @SADUSERS. CC: OIDE Subj: Interrupt handling. Dear Users: 1. N. Yamamoto has realized that the reason why an interrupt signal has been causing a trouble in FFS. Actually the answer was quite simple that the "gs" command should have used the exec command to envoke sad1.exe rather than call it directly. The "gs" command is changed, and you can interrupt the sad output. Please make sure that your .cshrc file contains stty intr ^C . You can interrupt in the shell window of emacs by typing ^C^C. K. Oide From: KEKVAX::OIDE 16-NOV-1993 09:38:33.29 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in array operation. Dear Users: 1. There has been a bug in the array operation (real) (op.) (array) such as 2/{1,2,3} . K. Oide From: KEKVAX::OIDE 16-NOV-1993 10:10:21.68 To: @SADUSERS. CC: OIDE Subj: SAD Update. Zero length steering in FFS. Dear Users: 1. According to the change on 11/11, All steering become to have fringe field. This is very inconvenient when the length is zero, thus a change is made to turn off the fringe when the length is zero. If the length is very small but finite, the fringe is on. K. Oide From: KEKVAX::OIDE 18-NOV-1993 13:56:05.07 To: @SADUSERS. CC: OIDE Subj: SAD Update. New functions. Block, If, While, Select, Flatten, Take, etc. Dear Users: 1. The following new functions are available. Those are similar to or subset of Mathematica's. Block If While Flatten ..... levelspec is not installed Take Select Map ..... levelspec is not installed Apply K. Oide From: KEKVAX::OIDE 18-NOV-1993 14:42:57.30 To: @SADUSERS. CC: OIDE Subj: SAD Update. Result of tracking is kept in a variable RESULTSOFTRACKING. Dear Users: 1. The result of tracking, which means at this time the coordinates of each particle at every turn, is stored in a variable RESULTSOFTRACKING. This is only valid for the tracking by TRACK command in the MAIN level with the DAPERT flag OFF. The variable RESULTSOFTRACKING is a list of depth 3, whose first level is the particle number, the second level is coordinates {x,px,y,py,z,dp}, and the last level is the value at each turn, i.e., RESULTSOFTRACKING[i,3,j] is the value of y of the i-th particle at j-th turn. If the tracking is preceded by RESULTSOFTRACKING=0, the result is not stored. K. Oide From: KEKVAX::OIDE 22-NOV-1993 15:05:50.86 To: @SADUSERS. CC: OIDE Subj: SAD Update. More functions. JOIN,APPEND,DOT,INNER,TRANSPOSE,etc. Dear Users: 1. The following functions are added. Description is attached if usage is different from Mathematica's. Join Append Prepend Clear ---- Only an explicit specifications of variables are valid. No character string nor wildcards are allowed. Protect ---- Same as above. UnProtect --- Same as above. Drop Dot Inner Transpose SingularValues --- SingularValues[a] returns a list of {U,1/W,V}. The matrix a = Transpose[U].DiagonalMatrix[1/W].V . DiagonalMatrix 2. Dot sign (.) is available for an inner product of matrices. K. Oide From: KEKVAX::OIDE 22-NOV-1993 15:08:30.89 To: @SADUSERS. CC: OIDE Subj: SAD Update. SingularValues. Dear Users: p.s. The threshold of SingularValues can be specified the optional second argument. The default is 1E-8. K. Oide From: KEKVAX::OIDE 24-NOV-1993 10:24:32.47 To: @SADUSERS. CC: OIDE Subj: SAD Update. New functions. LinearSolve,IdentityMatrix,Eigensystem. Dear Users: 1. New functions LinearSolve IdentityMatrix Eigensystem are added. Eigensystem returns {eigenvalue,eigenvector}, where eigenvalue is a list whose [n,1] componet is the real part of the n-th eigen value and the [n,2] is its impaginary part. At this time no complex number can be handled. K. Oide From: KEKVAX::OIDE 24-NOV-1993 15:59:06.88 To: @SADUSERS. CC: OIDE Subj: SAD Update. Mathematica format, etc. Dear Users: 1. You can specify Mathematica format for output of a number by setting as $FORM='M' or $FORM='Mcolumns.fractions' . 'M' is equal to 'M17.15'. The output uses ' 10^' instead of 'E' for the exponent. 2. Setting to an FFS variable like #QF=0.1 had a bug since last week. It has been corrected. K. Oide From: KEKVAX::OIDE 25-NOV-1993 11:17:07.69 To: @SADUSERS. CC: OIDE Subj: SAD Update. New function: Position. Dear Users: 1. A new function Position is added. The usage is same as Mathematica's excpet the level cannot be specified at this time. The order of the result of this function is a little bit different from Mathematica's. Please try. 2. There has been a problem related to SEED. The SEED command has been working but a strange message appears. It is corrected. K. Oide From: KEKVAX::OIDE 26-NOV-1993 14:14:19.43 To: @SADUSERS. CC: OIDE Subj: SAD Update. New functions. Sum, Product, Range, etc. Dear Users: 1. New functions Sum Product Range are released. Those are very similar to Mathematica's. 2. Bugs are found in EXEC and OUT commands. The OUT commands may have caused a floating exception error. K. Oide From: KEKVAX::KIKUCHIM 27-NOV-1993 12:22:06.41 To: @[OIDE]SADUSERS. CC: Subj: SAD/COR update: COUPLESTE Rather old fashioned command COUPLESTE is released. This command is used to impose a linear combination of correctors on the corrections. This command will be convenient for the orbit analysis of MR. Usage: COUPLESTE c1 z1 c2 z2 ... cn zn d This impose a condition that c1*z1 + c2*z2 + .... + cn*zn ==d where c1,...,cn and d are constants and z1,...,zn are correctors. ci is able to be abbreviated if it is equal to 1. Examples: (1) COUPLESTE 1 zy -1 zy.2 0 This is equal to COUPLESTE zy -1 zy.2 (2) COUPLESTE zy zy.2 zy.3 0 COUPLESTE zy.3 2 zy.3 0 COR y These commands corrects y orbit under the conditions that zy -zy.2 == 0 && zy.3 + 2*zy.3 == 0. (3) COUPLESTE COUPLESTE having no argunment displays current conditions on correctors. (4) COUPLESTE zy -1 zy.2 0 ...... STE ZY*;COR y This is unconditioned correction because STE command removes all the accumulated conditions. (5) COUPLESTE zy 2 zy.2 3 zy.3 0 KILL zy.2 COR y This is a correction under the condition that zy + 3*zy.3 == -2*zy.2, where zy.2 has the value given before issueing the KILL command. COUPLESTE is not yet published because some SAD modules are locked. On Monday afternoon it will go public. M. Kikuchi From: KEKVAX::OIDE 30-NOV-1993 14:24:43.72 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in tracking in bend with F1. Dear Users: 1. There has been a bug in the tracking routine for non-combined bend when the linear fringe parameter F1 is nonzero. This bug induced an unrealistic tune-shift in y-direction. This bug has not been found for years until Kikuchi san did it today. K. Oide From: KEKVAX::OIDE 30-NOV-1993 23:30:02.05 To: @SADUSERS. CC: OIDE Subj: SAD Update. Comlplex, new functions, result of tracking, etc. Dear Users: 1. Now a complex number can be used like as Mathematica. The symbol I is used for the imaginary unit. (You may realize that how it is inconvenient not to distinguish I from i.) The built-in functions applicable to complex are limited to Sin, Cos, Exp, Log, Sqrt at this time. The function Eigensystem returns a complex value as the eigenvalues. 2. New functions Re, Im, Comjugate, and Complex are added. 3. You can use a space as the operator for Times inside of (), {}, [] . For example, 1 2 3 means three separate numbers, but (1 2 3) means a number 6. This is not same as Mathematica, but necessary to be compatible with the old FFS command syntax. 4. A new thing for tracking at the main level: if you define a function of two arguments named RESULTSOFTRACKING[n_,x_], the TRACK command calls the function after every turn. The first argument passes the number of the turn, and the second passes a matrix which contain the physical coordinates of the particles. It is [7,np] array for np initial particles. The element x[1...6,n] contains x...dp/p coordinate of the n-th particle. The element x[7,n] is 1 if the n-th particle survives, and 0 otherwise. Thus you can write your own routine to process the results of the tracking by yourself. For example, if you define as RESULTSOFTRACKING[n_,x_]:=Module[{sx,sa}, nt=n; sx=Table[Apply[Operation["+"] ,x[i]],{i,7}]; sa=Take[sx,6]/sx[7]; If[n==1, average={sa}, average=Append[average,sa]]]; you will get the total turns in "nt" and a list of average of coordinates over all surviving particles in the variable "average" after the tracking. Here the function Operation["+"] is equivalent to the function Plus in Mathematica. K. Oide From: KEKVAX::OIDE 1-DEC-1993 14:04:58.86 To: @SADUSERS. CC: OIDE Subj: SAD Update. Case sensitivity in variables and function names. Dear Users: 1. Now all variables and function names have become case-sensitive. Old FFS commands and element names are still insensitive. The name of functions are unified to Mathematica's. Up to now the built-in functions are ARRAY Abs Append Apply ArcCos ArcCosh ArcSin ArcSinh ArcTan ArcTan2 ArcTanh Block C Ceiling Clear Complex Conjugate Cos Cosh DiagonalMatrix Dimensions Do Dot Drop Eigensystem Element Exp Flatten Floor I IdentityMatrix If Im Index Inner Join Len Length LinearSolve List Log Map Max Min Mod Module Operation Peek Pi Position Prepend Product Protect Random Range Re Select Sin SingularValues Sinh SpeedOfLight Sqrt Sum Table Take Tan Tanh Timing Transpose Twiss Unprotect While LINE . Note that the function ARRAY and LINE have all capital letters because it does not look like Mathematica's Array and Line. K. Oide From: KEKVAX::OIDE 2-DEC-1993 11:59:02.31 To: @SADUSERS. CC: OIDE Subj: SAD Update. Bug in if command. Dear Users: 1. The if command has been wrong since yesterday's change of case-sensitivity. It is corrected. K. Oide From: KEKVAX::OIDE 4-DEC-1993 15:20:16.70 To: @SADUSERS. CC: OIDE Subj: SAD Update. Levelspec in Map and Apply, etc. Dear Users: 1. Now you can specify levelspec as the third argument of Map and Apply. This is very similar to those of Mathematica. Execercise: What do you get by the following example of levelspec in Map? a={b,c,{d,{e,f}}}; Map[f,a] Map[f,a,0] Map[f,a,1] Map[f,a,-1] Map[f,a,{1,2}] Map[f,a,{2,1}] Map[f,a,{1,-2}] Map[f,a,{-2,1}] Map[f,a,{-3,-1}] Map[f,a,{-1,-3}] Map[f,a,{-1,0}] Answer can be obtained by cut-and-pasting the above into either SAD or Mathematica. Can you understand the rule as a reasonable one? Do you argue the result especially in the last case? 2. New functions Level and Depth are added. These are similar to Mathmatica's. 3. A bug is found in a list-handling routine. 4. I strongly recommend you to use functions Do, If, While in place of the repeat and if commands whenever possible. These functions work more than 10 times faster than repeat and if commands. The difference becomes even bigger when the statements inside the loop or the block are long. K. Oide From: KEKVAX::KIKUCHIM 10-DEC-1993 16:33:27.02 To: @[OIDE]SADUSERS. CC: Subj: SAD/COR Bugs in MICADO. Dear users, 1. Fukuma-san has found a bug in the correction with MICADO method. In some case this bug destroyed memory allocations. This bug has been lived since the MICADO was written. 2. In the course of debugging of 1. I found another bug in the MICADO. This bug made some influence in the finding of 'best correctors' if ALL the corrector have very small responses. The bug was created in this summer. M. Kikuchi From: KEKVAX::OIDE 10-DEC-1993 19:55:46.31 To: @SADUSERS. CC: OIDE Subj: SAD Update. I/O functions, Replace, Rule, ListPlot, Same, etc. Dear Users: 1. Several I/O functions are introduced: OpenWrite OpenAppend Write WriteString Print Flush Close Get OpenWrite[file] and OpenAppend[file] returns the logical file number to be used in Write, WriteString, Flush, and Close. OpenWrite[lfn,object1,...] writes object1,... to the file of number lfn. The record length is given by PageWidth=length. The default of PageWidth is 132. At the end, Write outputs newline. WriteString[lfn,string1,...] writes character strings without newlines. Print[...] is same as Write[6,...], i.e., it writes to the standard output. Close[lfn] closes the file of lfn. Those functions are similar to Mathematica's except that SAD uses logical file number instead of stream id. Flush[lfn] is a unique function to SAD. It flushes out the output data in buffer, but does not close the file. For input, at this time only Get[file] is available. This is same as Mathematica's. 2. ReplaceAll (/.) and Rule (->) become available, although the power of replacing is still poor. 3. Pattern matching is extended. Now the forms x__ and x___ are possible. The two-blank form (x__) matches one or more sequential data. Threee blank form (x___) matches zero or more sequential data. 4. The special form [x1,x2,...] now represents a sequence of data. It is similar to Sequence[x1,x2,...] of Mathematica. 5. New relational operations Same (===) and Unsame (<=>) are introduced. 6. Function GetEnv[env] is defined to obtain the environment parameter env, which must be a character string. 7. Now SAD reads an initialization file at the beginning. The initialization file init.n is read from a directory specified by an environment parameter SAD$PACKAGES. The default is /proj/oldsad/Packages/ . Please look at the file, if you are interested in. Now the initialization is so poor that a few variables and functions are defined. 8. A defined function ListPlot is loaded at the initialization. This is an example of what a SAD function looks like, but olso useful to make a simple plot. Unlike Mathematica, ListPlot[list,options] just creates a TopDrawer file as ftn09. At this time only the following options are available: Scale->Log Set scale of y logarithmic Scale->{Log,Linear} Set scale of x logarithmic Scale->{Log,Log} Set scale of x and y logarithmic PlotRange->{ymin,ymax} Set range of y PlotRange->{{xmin,xmax},{ymin,ymax}} Set ranges of x and y AspectRatio->ratio Set the aspect ratio. The default is 1/GoldenRatio . The options will be upgraded, or you can modify the code in ListPlot.n in the directory /proj/oldsad/Packages/ . K. Oide From: KEKVAX::OIDE 10-DEC-1993 20:28:21.72 To: @SADUSERS. CC: OIDE Subj: SAD Update. Dear Users: 1. ListPlot has one more option PlotJoined->True to join points. The default is PlotJoined->False. K. Oide From: KEKVAX::OIDE 13-DEC-1993 13:16:57.11 To: @SADUSERS. CC: OIDE Subj: SAD Update. Emittance, RuleDelayed, etc. Dear Users: 1. Now you can handle results of emittance calculation in an expression. The new function Emittance[option] returns a set of rules as {keyword1->value1,keyword2->value2,...} . There are three options, Matrix, Orbit, and OneTurnINformation. If none of options are given, the resulting keywords are Stable True if all modes are stable. Tunes {nux,nuy,nuz} . EnergyLossU0 RfVoltageVc EquilibriumPosition dz in meter. MomentumCompaction OrbitDilation ds in meter. BucketHeight dV/E0 DampingRate {T0/taux,T0/tauy,T0/tauz} Emittances {emitx,emity,emitz} MomentumSpread sigma p/p0 BunchLength HarmonicNumber TuneShiftByRadiation {dnux,dnuy,dnuz} If OneTurnInformation->True, or Orbit->True, or Matrix->True, the followings are added. OrbitAtEntrance physical c.o.d. at the entrance of the ring. OneTurnTransferMatrix symplectic part of the one-turn transfer matrix. OneTurnDampingMatrix deviation of transfer matrix due to radiation. NormalCoordinates conversion matrix from physical to normal coords. OneTurnExcitation excitation matrix by radiation. EquilibriumBeamMatrix equilibrium beam matrix. If Orbit->True or Matrix->True, ClosedOrbit List of physical closed orbit at every element in the ring. joins. If Matrix->True, TransferMatrices List of physical transfer matrix from the entrance to every element in the ring. joins the result. The function Emittance is actually defined in emit.n . Which calls the built-in function CalculateEmittance. Please do not forget to put semicolon at the end of Emittance[] function, otherwise the output will be huge especially when Orbit or Matrix is True. 2. A new function Det is added. Det[m] returns the determinant of m. 3. Several defined-functions are introduced (by emit.n) . Inverse[m] SymplecticJ[n] The matrix J.J=-I of n dimension. n must be an even number. SymplecticInverse[m] -J.Transpose[m].J 4. A new operation RuleDelayed (:>) is defined. cf. Mathematica. K. Oide From: KEKVAX::KIKUCHIM 15-DEC-1993 17:29:12.99 To: @[OIDE]SADUSERS. CC: Subj: SAD/COR update: ZSUMX and ZSUMY are unified to ZSUM Dear users, Condition options ZSUMX and ZSUMY for CORrection are abondoned. They are unified to ZSUM. M. Kikuchi From: KEKVAX::OIDE 18-DEC-1993 12:23:02.63 To: @SADUSERS. CC: OIDE Subj: SAD Update. Function for tracking. Dear Users: 1. A new function TrackParticles is installed to make it possible to build your own tracking routine. At this time only a primitive built-in function is released. TrackParticles[beam,destination] returns a beam after the tracking at the upstream of the element destination. The destination can be specified by a number of a name. If destination is omitted, the end of the line is assumed. The variable beam and what is returned by TrackParticles are lists of the form {location, coordinates} where location is the number or the name of the starting point. If location is same as or in the downstream of destination, the tracking is done by folding to the beginning of the line. The coordinates is a list of {7,np} form, where np is the number of particles. The first argument of coordinates specifies the {x,px/p0,y,py/p0,z,dp/p0} in this order. The {7,i} is the flag which is True when the particle is alive, and False has been lost. TrackParticles does only less than one turn tracking. You can do multi-turns tracking by repeating this function. Actually on implementing this function, a minor modifications are made for existing routines, so there may appear an unwilling side-effects. Please be carefull, even if you do not use this function. K. Oide From: KEKVAX::OIDE 23-DEC-1993 21:35:42.37 To: @SADUSERS. CC: OIDE Subj: SAD Update. Partition, Catch, Throw. Bug in steering. Dear Users: 1. New functions Partition, Throw, and Catch are released. Those are same as Mathematica's. 2. A bug is found in steering. If a steering magnet is vertically misaligned, orbit calculation has been wrong. Tracking and emittance are OK. K. Oide