w_p_limit

https://www.dacm-logiciels.fr/tracewin
Post Reply
United States of Americawtam
Skilled
Skilled
Posts: 142
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

w_p_limit

Post by United States of Americawtam »

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
User avatar
FranceDidier
Administrator
Administrator
Posts: 1235
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: w_p_limit

Post by FranceDidier »

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
United States of Americawtam
Skilled
Skilled
Posts: 142
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

Re: w_p_limit

Post by United States of Americawtam »

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
User avatar
FranceDidier
Administrator
Administrator
Posts: 1235
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: w_p_limit

Post by FranceDidier »

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
United States of Americawtam
Skilled
Skilled
Posts: 142
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

Re: w_p_limit

Post by United States of Americawtam »

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
User avatar
FranceDidier
Administrator
Administrator
Posts: 1235
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: w_p_limit

Post by FranceDidier »

Dear Wai-Ming,

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

Regards,

Didier
Francebradpaul559
Novice
Novice
Posts: 1
Joined: Sat 4 Apr 2026 20:51
Country:
France (fr)
France

Re: w_p_limit

Post by Francebradpaul559 »

Bonjour,

Ça ressemble à un problème de réinitialisation de la limite. Il est possible que la première commande w_p_limit 0 10 reste active et ne soit pas correctement écrasée par w_p_limit 0 0, un peu comme dans certains systèmes où une règle continue d’influencer le comportement (on retrouve ce type de logique dans le jeu Monopoly Roulette par exemple.

Vous pouvez vérifier si une réinitialisation explicite est nécessaire.

Cordialement.
Post Reply