Page 1 of 1

w_p_limit

Posted: Mon 15 Mar 2021 04:16
by wtam
Colleagues,

I am not able to use w_p_limit twice in a model. For example:

drift 10 10
w_p_limit 0 10
drift 10 10
w_p_limit 0 0
drift 10 10

The above doesn't seem to work in the sense that after the command "w_p_limit 0 0", particles having a phase larger than 10 degree are still considered lost. Any idea?

Best regards,
Wai-Ming

Re: w_p_limit

Posted: Mon 15 Mar 2021 14:09
by Didier
Dear Wtam,

I noticed a kind of shift between command and the element where it is applied, explaining your issue.
I fixed this issue and you can so upgrade your code

Regards,

Didier

Re: w_p_limit

Posted: Mon 15 Mar 2021 19:06
by wtam
Dear Didier,

I have upgraded the code. But I think the issue has not been fixed completely. For example:

drift 10 10
w_p_limit 0 10
drift 10 10
w_p_limit 0 12
drift 10 10
w_p_limit 0 0
drift 10 10

The first and second ones will work. But the third one won't work. I think it is a problem with "w_p_limit 0 0", specifically when you put two zeros.

Best regards,
Wai-Ming

Re: w_p_limit

Posted: Tue 16 Mar 2021 13:05
by Didier
Dear Wai-Ming,

Indeed 0 has no effect at all, but first I don't see the point of such a command. If you want to stop the whole beam, there are many other ways and then try 0.0001, it will work.

Regards,

Didier

Re: w_p_limit

Posted: Fri 26 Mar 2021 05:01
by wtam
Dear Didier,

I believe "w_p_limit 0 0" means no limit.

drift 10 10
w_p_limit 0 10
drift 10 10
w_p_limit 0 0
drift 10 10

By doing the above, I want to set a limit to the phase (+/- 10 deg) at a specific location, and then cancel the limit with "w_p_limit 0 0". If "w_p_limit 0 0" has no effect, then the limit of +/-10deg will be there for the rest of the beam line, which is not what I want.

Best regards,
Wai-Ming

Re: w_p_limit

Posted: Fri 26 Mar 2021 14:17
by Didier
Dear Wai-Ming,

I understand, so why not just put, "w_p_limit 0 100000" ?

Regards,

Didier