Page 1 of 1

Print or save rpn expressions in lattice file?

Posted: 18 Jan 2013, 17:36
by lewellen
Hello,

I have a feeling this should be a simple thing, but I can't seem to find how to do it...

I'm setting several rpn variables in the lattice file. These are used to compute parameters for use in various elements. For instance, I'm saving the phase shift per cell, frequency, and number of cells in a TW linac tank; these are then used to compute the total length of the tank in the element.

Example:

! set basic linac parameters
% 3e8 sto c
% 2 pi * 3 / sto phaseShiftPerCell
% 2.856e9 sto frequency
% 84 sto numberOfCells

% c frequency / phaseShiftPerCell * 2 pi * / sto cellLength
% cellLength numberOfCells * sto tankLength

...

cavity: RFCW, L="tankLength", CELL_LENGTH="cellLength" ...

My question is this: Is there a way to save the variables' values to a file (ideally an sdds file with the rpn variable names as parameters), so I can double-check later that I'm getting the expected results?

Thanks much,

- John Lewellen

Re: Print or save rpn expressions in lattice file?

Posted: 18 Jan 2013, 17:58
by michael_borland
John,

There isn't a way to do this presently. My suggestion is to use &save_lattice to save the lattice to a new file, then examine that file to check for the expected result.

--Michael