Page 1 of 1

modulate_elements command

Posted: 29 Nov 2022, 07:38
by Pradeep
I need help to know about the expression of modulation amplitude expressed in RPN in modulate_elements command as follows:

&modulate_elements name = Q, item = TOTAL, expression="3.68e-6 / 5000 / 1 min2 abs" multiplicative=1 differential=0 &end

What is the value of RPN expression "3.68e-6 / 5000 / 1 min2 abs" ? (this modulate_elements command is used in one of example file of elegant, Q is charge)

With regards,
Pradeep Kumar

Re: modulate_elements command

Posted: 29 Nov 2022, 09:45
by michael_borland
Pradeep,

To understand the expression, you should first realize that before the expression is executed, the beam arrival time (Ct) is pushed onto the stack. In the example, T0=3.68e-6 is the revolution time, so "3.68e-6 /" results in the turn number (Ct/T0) being on the top of the stack. We then divide that by 5000 and take the minimum of that result and 1. This gives a function that ramps from 0 to 1 over 5000 turns, then stays at 1.

You can always copy such expressions to the rpn calculator (executed by typing "rpn") and play with them to get better understanding.

--Michael

Re: modulate_elements command

Posted: 29 Nov 2022, 23:12
by Pradeep
Dear Dr. Michael,

Thanks for kind reply of rpn expression explanation.

With regards,
Pradeep Kumar