Print or save rpn expressions in lattice file?

Moderators: cyao, michael_borland

Post Reply
lewellen
Posts: 18
Joined: 19 Dec 2012, 18:14

Print or save rpn expressions in lattice file?

Post by lewellen » 18 Jan 2013, 17:36

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

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Print or save rpn expressions in lattice file?

Post by michael_borland » 18 Jan 2013, 17:58

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

Post Reply