modulate_elements command

Moderators: cyao, michael_borland

Post Reply
Pradeep
Posts: 17
Joined: 04 Jun 2019, 07:33

modulate_elements command

Post by Pradeep » 29 Nov 2022, 07:38

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

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

Re: modulate_elements command

Post by michael_borland » 29 Nov 2022, 09:45

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

Pradeep
Posts: 17
Joined: 04 Jun 2019, 07:33

Re: modulate_elements command

Post by Pradeep » 29 Nov 2022, 23:12

Dear Dr. Michael,

Thanks for kind reply of rpn expression explanation.

With regards,
Pradeep Kumar

Post Reply