Field map implementation
-
- Initiated
- Posts: 50
- Joined: Tue 23 Feb 2021 08:37
- Country:
Russia (ru)
Field map implementation
Dear Didier,
please look at my project with field maps usage .
It was obtained the next program message when I run my project. Unfortunately it is not clear for me how describe element locations if its field maps does not overlap.
What is wrong and what will be right in my case?
Also I cannot understand description of the Quad field file of the program example in contrast to Dipole one as it is illustrated below. vs Is the file structure for Quad description is the same as for Dipole?
please look at my project with field maps usage .
It was obtained the next program message when I run my project. Unfortunately it is not clear for me how describe element locations if its field maps does not overlap.
What is wrong and what will be right in my case?
Also I cannot understand description of the Quad field file of the program example in contrast to Dipole one as it is illustrated below. vs Is the file structure for Quad description is the same as for Dipole?
- Attachments
-
- Field_map.zip
- (13.17 MiB) Downloaded 186 times
Re: Field map implementation
Dear Vyacheslav,
I have no way of knowing what your different field maps contain, so I proceed as follows and this method can help you in the future for simple cases. For more complicated things you have to do the work of drawing the expected central trajectory and putting the SUPERPOSED_MAP commands according to the different position of the elements. So, for your case, I remove all the SUPERPOSE_MAP and SUPERPOSE_MAP_OUT commands and I get the following path:
Point (1) gives me the coordinates of the input position of the quad, so the first SUPERPOSED_MAP. Point (2) gives me the input coordinates of the dipole, so the second SUPERPOSED_MAP. Finally, the third point (3) gives me the expected output coordinates, so the SUPERPOSED_MAP_OUT.
Finally I have this:
DRIFT 0 100 0 0 0
SUPERPOSE_MAP_OUT 1500 -368. 0 0 0 33.25
SUPERPOSE_MAP 0 0 0 0 0 0
FIELD_MAP 70 300 0 100 1.0 0 0 0 QuadT
SUPERPOSE_MAP 300 0 0 0 0 0
FIELD_MAP 0070 1200 0 1000 1.0 0 0 0 dipoleT
DRIFT 0 500 0 0 0
END
It's not perfect and it's normal because my first aproximation (without SUPERPOSE...) the central particle does not pass through the centre of the dipole and the field is therefore different. I just have to adjust Xout and X'out by hand and with :
SUPERPOSE_MAP_OUT 1500 -368.1 0 0 0 30.15
Here I get a central trajectory in the centre of the elements
A last point,I think the quad file is in binary format, that's why you can't read it. You can switch to binary or back to ascii using the FIELD_MAP tools. I advise you to switch to binary for the simulations, it is much faster.
Regards,
Didier
I have no way of knowing what your different field maps contain, so I proceed as follows and this method can help you in the future for simple cases. For more complicated things you have to do the work of drawing the expected central trajectory and putting the SUPERPOSED_MAP commands according to the different position of the elements. So, for your case, I remove all the SUPERPOSE_MAP and SUPERPOSE_MAP_OUT commands and I get the following path:
Point (1) gives me the coordinates of the input position of the quad, so the first SUPERPOSED_MAP. Point (2) gives me the input coordinates of the dipole, so the second SUPERPOSED_MAP. Finally, the third point (3) gives me the expected output coordinates, so the SUPERPOSED_MAP_OUT.
Finally I have this:
DRIFT 0 100 0 0 0
SUPERPOSE_MAP_OUT 1500 -368. 0 0 0 33.25
SUPERPOSE_MAP 0 0 0 0 0 0
FIELD_MAP 70 300 0 100 1.0 0 0 0 QuadT
SUPERPOSE_MAP 300 0 0 0 0 0
FIELD_MAP 0070 1200 0 1000 1.0 0 0 0 dipoleT
DRIFT 0 500 0 0 0
END
It's not perfect and it's normal because my first aproximation (without SUPERPOSE...) the central particle does not pass through the centre of the dipole and the field is therefore different. I just have to adjust Xout and X'out by hand and with :
SUPERPOSE_MAP_OUT 1500 -368.1 0 0 0 30.15
Here I get a central trajectory in the centre of the elements
A last point,I think the quad file is in binary format, that's why you can't read it. You can switch to binary or back to ascii using the FIELD_MAP tools. I advise you to switch to binary for the simulations, it is much faster.
Regards,
Didier
-
- Initiated
- Posts: 50
- Joined: Tue 23 Feb 2021 08:37
- Country:
Russia (ru)
Re: Field map implementation
Thanks a lot, dear Didier! I'll try to tune my project.
-
- Initiated
- Posts: 50
- Joined: Tue 23 Feb 2021 08:37
- Country:
Russia (ru)
Re: Field map implementation
Dear Didier,
what shall i do if I use the scheme like as in the picture bellow and which was obtained by "specular reflection" of the BendT and QuadT? Should I export beam passed throughout the first Quad and bend with indicated SUPERPOSE_MAP_OUT parameters and then put the beam in a new channel (second half of the line) with the new SUPERPOSE_MAP_OUT for it?
May be another way exist?
Thanks in advance.
what shall i do if I use the scheme like as in the picture bellow and which was obtained by "specular reflection" of the BendT and QuadT? Should I export beam passed throughout the first Quad and bend with indicated SUPERPOSE_MAP_OUT parameters and then put the beam in a new channel (second half of the line) with the new SUPERPOSE_MAP_OUT for it?
May be another way exist?
Thanks in advance.
Re: Field map implementation
Dear Vyacheslav,
You must have a SUPERPOSE_MAP_OUT at each start of a set of overlapped field_map elements (if they curve the trajectorey).
If your two sections are well separated, then yes 2 superposed_map_outs are needed and moreover it's much easier to implement as you can build your line section after section
Regards,
Didier
You must have a SUPERPOSE_MAP_OUT at each start of a set of overlapped field_map elements (if they curve the trajectorey).
If your two sections are well separated, then yes 2 superposed_map_outs are needed and moreover it's much easier to implement as you can build your line section after section
Regards,
Didier
-
- Initiated
- Posts: 50
- Joined: Tue 23 Feb 2021 08:37
- Country:
Russia (ru)
Re: Field map implementation
Dear Didier,
can you explain why z-coordinates on the following pictures are different (without and with FIELD_MAP)? vs Project files is attached.
can you explain why z-coordinates on the following pictures are different (without and with FIELD_MAP)? vs Project files is attached.
- Attachments
-
- test.zip
- (6.25 MiB) Downloaded 186 times
Re: Field map implementation
Dear Vyacheslav,
In the first case (case 1), the reference trajectory is considered going straight through the magnet. 700 mm is the length of the magnet in this direction.
In the second case (case 2), the reference trajectory follows the reference beam trajectory in the magnet. This is an arc of circle of radius R with exit angle teta of about 0.4 rad.
The difference in length between both cases are:
- Case 1: L1 = R*sin(teta) (= 0.7 m)
- Case 2: L2 = R*teta
The ratio is :
L2/L1 = teta/sin(teta) ~ 1.027
This explains why :
D2 = 0.3 m (DRIFT) + L2(=1.027*L1 m) = 1.019 m.
I hope it is clear.
Best regards.
Nicolas.
In the first case (case 1), the reference trajectory is considered going straight through the magnet. 700 mm is the length of the magnet in this direction.
In the second case (case 2), the reference trajectory follows the reference beam trajectory in the magnet. This is an arc of circle of radius R with exit angle teta of about 0.4 rad.
The difference in length between both cases are:
- Case 1: L1 = R*sin(teta) (= 0.7 m)
- Case 2: L2 = R*teta
The ratio is :
L2/L1 = teta/sin(teta) ~ 1.027
This explains why :
D2 = 0.3 m (DRIFT) + L2(=1.027*L1 m) = 1.019 m.
I hope it is clear.
Best regards.
Nicolas.
-
- Initiated
- Posts: 50
- Joined: Tue 23 Feb 2021 08:37
- Country:
Russia (ru)
Re: Field map implementation
Dear Nicolas,
thanks for the answer.
Can you clarify how to use FIELD_MAP of the dipole, which is a sector bend as in this example?
It is length by s-path (not z one) should be equal to R*teta=700 mm. It is needed to compare beam dynamics in meander (square wave) approximation of sector bend with that is for "real" field.
thanks for the answer.
Can you clarify how to use FIELD_MAP of the dipole, which is a sector bend as in this example?
It is length by s-path (not z one) should be equal to R*teta=700 mm. It is needed to compare beam dynamics in meander (square wave) approximation of sector bend with that is for "real" field.
-
- Initiated
- Posts: 50
- Joined: Tue 23 Feb 2021 08:37
- Country:
Russia (ru)
Re: Field map implementation
Dear Didier and Nicolas, one more question.
Why in my case for the first dipole program uses B-field along cartesian z-coordinate and for the second one it uses B-field along the reference trajectory (look at attached pictures)? How does it find them and how put into structure file indication on B-field along the reference trajectory utilization? Thanks in advance.
Why in my case for the first dipole program uses B-field along cartesian z-coordinate and for the second one it uses B-field along the reference trajectory (look at attached pictures)? How does it find them and how put into structure file indication on B-field along the reference trajectory utilization? Thanks in advance.
Re: Field map implementation
Dear Vyacheslav,
Please detail how you got these curves, in particular the second curves as field map viewer is not able to plot the field along the reference trajectory.
The basis are :
- the field map is given in a cartesian frame (it can be plotted with field map viewer),
- the magnet is positionned with respect to the upstream linac with its input position and its input angle with SUPERPOSE_MAP command,
- the downstream linac reference trajectory at the exit of the magnet is given by SUPERPOSE_MAP_OUT command,
This is all what is needed to define the position of the accelerator.
- The curved trajectory of the reference particle is calculated in the field map as positionned before.
- In the magnet the particle's position are plotted (envelopes...) in planes orthogonal to this reference trajectory.
- The exit position of the reference particle is compared to the theoretical exit (given by SUPERPOSE_MAP_OUT) in order to calculate the possible misalignment of the beam in the downstream linac.
For better explanation (with drawing), please consult the documentation "Field map with curved reference trajectory".
Best regards.
Nicolas & Didier
Please detail how you got these curves, in particular the second curves as field map viewer is not able to plot the field along the reference trajectory.
The basis are :
- the field map is given in a cartesian frame (it can be plotted with field map viewer),
- the magnet is positionned with respect to the upstream linac with its input position and its input angle with SUPERPOSE_MAP command,
- the downstream linac reference trajectory at the exit of the magnet is given by SUPERPOSE_MAP_OUT command,
This is all what is needed to define the position of the accelerator.
- The curved trajectory of the reference particle is calculated in the field map as positionned before.
- In the magnet the particle's position are plotted (envelopes...) in planes orthogonal to this reference trajectory.
- The exit position of the reference particle is compared to the theoretical exit (given by SUPERPOSE_MAP_OUT) in order to calculate the possible misalignment of the beam in the downstream linac.
For better explanation (with drawing), please consult the documentation "Field map with curved reference trajectory".
Best regards.
Nicolas & Didier