large field maps

https://www.dacm-logiciels.fr/tracewin
Post Reply
ChinaJieLi
Neophyte
Neophyte
Posts: 12
Joined: Thu 14 Apr 2022 11:29
Country:
China (cn)
China

large field maps

Post by ChinaJieLi »

Dear Sir,
I use field maps to learn beam optics in exact magnetic field of my element. I input dense data in the magetic field, so the calculation speed is low. I need to repeat my element several times. Twice is OK. However, if I let the beam pass through the same element 3 times, the software tells me that "Reference particle outside the field map, from [element]... from [calc]... ". I wonder what is the reason behind this errror. Maybe 3 elements needs a large amount of calculation. 3 elements are separate. Once the particle come out from one, it enters the next element. All particles are not lost in my element. Why is this error related to the reference paricle?
BTW, I find the field map is so fast and convenient. Could you please clarify the algorithm? Is it diffrential algebra or Lie algebra? If the mesh of my field is 1mm, what is the accuracy of my results?
Kind regards,
Jie Li
User avatar
FranceDidier
Administrator
Administrator
Posts: 976
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: large field maps

Post by FranceDidier »

Dear Jie,

I think it very difficult to help you with so little information. Could you send me your project including all the files so that I understand exactly what you are doing?

Regards,

Didier
ChinaJieLi
Neophyte
Neophyte
Posts: 12
Joined: Thu 14 Apr 2022 11:29
Country:
China (cn)
China

Re: large field maps

Post by ChinaJieLi »

Dear Didier,

Just in my project, the file of field map is very dense. The mesh is 2mm. Focusing the last several lines in my code, if I repeat the same field map part 2 times, the result is OK. However, three times returns error. The function of each part is bending the beam 90 degree, while focusing or defocusing with mixed fields. The picture shows the error information. This problems makes frustrated for many days.
And I wonder the algorithm of the field map.I know it uses PIC. Is it based on differential algebra or Lie algebra? What is accuracy of the results if the mesh is 2 mm?

Thank you

With Regards
Jie Li
Attachments
error.png
error.png (26.41 KiB) Viewed 4039 times
laserplasma.zip
(32.82 MiB) Downloaded 239 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 976
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: large field maps

Post by FranceDidier »

Dear Jeili,

Fist, I strongly suggest you to tranform you file form ASCII to Binary format using Field_map tool from "chart" page. After that, simulation is 10 time faster and it's easier to try different configurations.
Secondly, I don't understand some points:
  • What is the function of the "dipole" field map, I don't quite understand,
  • Obviously the "drift" card can be removed, it doesn't seem to serve any purpose,
  • Finally, do you have a scheme of what you want to simulate?
Now, for the moment I'm like you I can't figure out why this error message is happening. What I can tell you is that it only means that the reference particle (the one normally on the axis) is outside the dimensions of the field map. The ones defined in the file headers. That said, they are not very large especially in vertical (+/- 30 mm)
I will continue to look into this and discuss it with a colleague, I will keep you informed.

Regards,

Didier

I attach your modified project with binary field maps:
laserplasma.zip
(34.22 MiB) Downloaded 272 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 976
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: large field maps

Post by FranceDidier »

Dear Jeili,

Finally, I found the problem and it is fixed in the latest version of TraceWin available

Regards,

Didier
ChinaJieLi
Neophyte
Neophyte
Posts: 12
Joined: Thu 14 Apr 2022 11:29
Country:
China (cn)
China

Re: large field maps

Post by ChinaJieLi »

Dear Didier,

Thanks for your detailed reply, which gives me much help indeed. According to your idea, my problem can be solved by the latest version of TraceWin.
  1. The elemet consists of two parts, entrance and exit. And then I want to repeat it 3 times.
  • In the entrance, the mixed field maps are 2mm_D_CCT(bending), 2mm_L_CCT(focusing or defocusing in the left) and 2mm_R_CCT(focusing or defocusing in the right).
  • In the exit, the mixed field maps are 2mm_D_CCT(bending), 2mm_L_CCT(focusing or defocusing in the left) and 2mm_R_CCT(focusing or defocusing in the right).
  • There is a drift between the entrance and the exit. Maybe the drift is not necessary to claim in my file.
  • As for the dipole, I want to provide a steerer for my particle. I know this part can be done by your defied element 'steerer' now.
  • Could you please tell the algorithm and accuracy of the field map?
  • And I do not know how the reference orbit is determined. Is it the arc linking the exit and entrance which also meets the tangent angle requirement of the exit?
  • Are you sure that the version 2.18.01 is OK for my code? If so, maybe I need to buy this software right now.

Thank you

Kind Regards
Jie Li
User avatar
FranceDidier
Administrator
Administrator
Posts: 976
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: large field maps

Post by FranceDidier »

Dear JieLi,

For the field map, a quadratic interpolator is used and particle movement is provided by Runge-Kutta methods. The accuracy is therefore normally very good but may obviously depend on the mesh size of your field map.
I confirm that using a dipole field map for steering is a very bad idea.
Yes, I confirm that the latest version is able to simulate your example, see the image below.
But, I put today, a new version : 2.18.0.2, cocnerning another issue but including some minor improvements contributing to your problem.
Last point, I don't understand your remark about buying the code! Normally, you already have a licence, if you are able to perform this kind of simulation, right? And if so, you can update freely since your licence is still valid.

Regards,

Didier
xy.png
xy.png (18.18 KiB) Viewed 4004 times
ChinaJieLi
Neophyte
Neophyte
Posts: 12
Joined: Thu 14 Apr 2022 11:29
Country:
China (cn)
China

Re: large field maps

Post by ChinaJieLi »

Dear Didier,

Your answer gives me much confidence for my work. Indeed tracewin is a powerful tool for simulating beam dynamics.I will appeal to more colleages to buy and use it. To be honest, I have learned beam physics for just 9 months. Now I just ask another person who have bought it to run my code and he returns the results. Sorry for infringing on your copyright. I do not have the right to use this software now. But I decide to communicate with my tutor to have a licensed one.

Thank you

With Regards
Jie Li
User avatar
FranceDidier
Administrator
Administrator
Posts: 976
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: large field maps

Post by FranceDidier »

Dear Jie Li,

Ok, no problem.

Didier
Post Reply