Dear all,
I used Elegant for beta beating and coupling correction in the presence of errors with the wonderful and great support of
Vadim Sajaev and I think It could be helpful for others so I share the process and steps here. The method is precious and much faster than the simplex method. I try to explain it by all the details, so I did as below:
1. Get the "SR LOCO Response Matrix Fitting"
APS website.
2. Copy all the command files in the SRLOCOFitting to the
bin of your Elegant or alternatively add the parent folder of these files to the PATH environment variable using your own preferred method, e.g. from
CalculateLOCOFit to
SRLOCOFitting.
3. Add these lines to the .bashrc or run it in the terminal that you want to use srlocofitting:
Code: Select all
export LOCO_BINDIR=path_to_where_you_placed_CalculateLOCOFit_and_other_command_files
export LOCO_CONFDIR=path_to_where_you_placed_SRLOCOFitting/SRLOCOFitting/work
4. Now the system is prepared for LOCOFitting to do beta and coupling correction, so get the files from the attachment.
5. Copy the "calculateTwissCorrection" file in the attachment to the Elegant bin.
Now, You can do the correction with the attached files, each file can be explained as below:
calculateTwissCorrection -- correction program
converted.lte -- the lte file
elements.sdds -- list of elements to use by correction program for correction created by step 2 in running procedure.
elettra.ele -- the closed orbit correction in the presence of errors
errors.param -- the error files
fittingProcedures.tcl -- required file for calculateTwissCorrection
makeElementListFile -- short script to create elements.sdds file
result.beta.param -- quadrupole corrections calculated by the correction program created by step 3 in the running procedure.
result.coupling.param -- contains skew quadrupole corrections created by step 4 in the running procedure.
runCorrection -- short script to run calculateTwissCorrection
/tmp -- subdirectory with results of the correction calculations created during the correction.
For running the correction, do as below:
1. elegant elettra.ele
2. ./makeElementListFile -listFile elements.sdds
3. Beta function correction: ./runCorrection -workDir `pwd` -correctionMode beta -measLatticeParamFile step3.param -outputFile result.beta.param
4. Coupling correction: ./runCorrection -workDir `pwd` -correctionMode coupling -measLatticeParamFile "step3.param result.beta.param" -outputFile result.coupling.param
The corrected lattice is presented by three files: "step3.param result.beta.param result.coupling.param". I should mention that I worked in ubuntu with Elegant version of 2021.4.0.
I hope you find it helpful.
Regards,
Sara