OptiM can be run from the command line. This is useful when execution is initiated from a batch file or by an other program. Upon exit the program returns 0 for successful completion or 1 if an error has been encountered. Depending on the specified argument(s), the program will perform different actions which are described below.
optim InputFileNameThe program reads the file InputFileName and the GUI is ready for interactive operation. On the MS Windows platform, this mechanism makes it possible to launch OptiM by double clicking on a file of type (*.opt) from Windows Explorer by associating the .opt extension with optim.exe (use View | Option | File types in Windows Explorer).
All the modes described below are meant for non-interactive program execution, i.e. the program is used to generate output files from input files. The command line arguments correspond to menu parameters in interactive program operation. The following switches can be used:
-f : save a table of Twiss functions (beta-functions, dispersions etc.) -s : save a table of Twiss functions to a file with MAD like structure -c : save a table of coupled Twiss funtions -i : save a table of Twiss functions computed with accounting beam space charge -t : save a table of beam centroid positions (trajectory) -o : save a table of orbit positions -r : read BdL from .snap file and create new OptiM file -w : create a .snap file -p : multi-particle tracking
optim -f InputOptimFileName OutputTwissFileName ‹filter› ‹MatchCase› ‹HideFirstLetter› ‹Comment› ‹step› ‹CloseLattice› The default values for unspecified arguments are: filter=* MatchCase=Y HideFirstLetter=Y Comment=# step=0 CloseLattice=Y (the periodic solution will be used)‹Comment› is added on a separate line, pre-pended to the output file. For the CEBAF recirculator, the comment is used to keep track of the pass number.
optim -s InputOptimFileName OutputTwissFileName ‹filter› ‹MatchCase› ‹HideFirstLetter› ‹Comment› ‹step› ‹CloseLattice› The default values for unspecified arguments are: filter=*, MatchCase=Y, HideFirstLetter=Y, Comment=# step=0, CloseLattice=Y (the periodic solution will be used).
optim -c InputOptimFileName OutputTwiss4DFileName ‹filter› ‹MatchCase› ‹HideFirstLetter› ‹step› ‹CloseLattice› defaults: filter=* MatchCase=Y HideFirstLetter=Y step=0 CloseLattice=N
optim -i InputOptimFileName OutputTwiss4DFileName ‹filter› ‹MatchCase› ‹HideFirstLetter› ‹step› ‹CloseLattice› defaults: filter=* MatchCase=Y HideFirstLetter=Y step=0 CloseLattice=N
optim -t InputOptimFileName OutputTrajFileName ‹filter› ‹MatchCase› ‹CloseLattice› ‹OutputType› ‹step› Defaults: filter=* MatchCase=Y HideFirstLetter=Y CloseLattice=Y (N - No closure, Y - linear closure, E - nonlinear closure OutputType=T (T - text, B - binary) step=0
optim -o InputOptimFileName OutputTrajFileName ‹filter› ‹MatchCase› ‹CloseLattice› ‹OutputType› ‹step› Defaults: filter=* MatchCase=Y HideFirstLetter=Y CloseLattice=Y (N - No closure, Y - linear closure, E - nonlinear closure OutputType=T (T - text, B - binary) step=0
optim -r InputOptimFileName OutputOptimFileName InputSnapFile ‹filter› ‹MatchCase› ‹NamePrefix› ‹Scale› ‹StartTwissFile› Default values are: filter=* MatchCase=Y NamePrefix="" Scale=1 If StartTwissFile is used, the initial Twiss parameters will be taken from the END line of this file, otherwise values from initial OptiM file will be used.
optim -w InputOptimFileName OutputSnapFileName ‹filter› ‹MatchCase› ‹HideFirstLetter› Default values: filter=* MatchCase=Y HideFirstLetter=Y
optim -p InputOptimFileName OutputTrackingFileName InputPartPosFileName ‹filter› ‹MatchCase› ‹Nturn› ‹ring› Default are: filter=* MatchCase=Y Nturn=1 ring=L (should be R or L)