Page 1 of 1

Unexpected behaviour of s_dependent_driving_terms_file of twiss_output

Posted: 09 Feb 2020, 16:36
by felix_armborst
Hello,

when using twiss_output and setting the s_dependent_driving_terms_file variable to a filename, I stumbled across a few problems:
  1. the output file is only filled with more than the header if also the filename variable for general twiss output is set
  2. zero length sextupoles and/or quadrupoles in the lattice lead to "Terminated by SIGSEGVProgram trace-back:"
Another somewhat related question:
  • is it also possible to get the elementwise contributions to the RDTs known from Bengtsson's work and calculated by Elegant when compute_driving_terms is set?

Thanks a lot in advance!
--Felix

Re: Unexpected behaviour of s_dependent_driving_terms_file of twiss_output

Posted: 17 Feb 2020, 13:27
by michael_borland
Felix,

I confirmed the issue with missing RDT output when the main output file was left blank; this will be flagged as an error in the next version. I couldn't confirm the issue with zero-length sextupoles or quadrupoles.

To get element-by-element RDT contributions, you can use sddsprocess to perform the arithmetic, e.g.,

Code: Select all

sddsprocess run01.sdt -define=col,delta%s,"i_row 0 == ? 0 : i_row 1 - &%s [ $ %s swap -",select=f* 
The deltaf* columns will be added.

The command is perhaps a bit cryptic. Basically, we first check whether we a processing the first row (row 0). If so, we push 0 on the stack, otherwise, we use rpn's array feature to get the value for the previous row. We then push the present value on the stack, swap positions with the previous value, then subtract.

--Michael