Reading and creating .dst files

https://www.dacm-logiciels.fr/tracewin
Post Reply
Belgiumjarnovandewalle
Neophyte
Neophyte
Posts: 10
Joined: Mon 30 May 2022 22:23
Country:
Belgium (be)
Belgium

Reading and creating .dst files

Post by Belgiumjarnovandewalle »

Hello,

Two questions related to the reading / creating .dst files

1/ I'm trying to read in a .dst file with an input file which has several fieldmaps. There is no compression on the .dst file. In the manual (page 39) there is a loop over Ne (number of elements), but it seems that inside the fieldmaps, much more steps are output to the .dst file (which is good .. !). But so could it be that the documentation on page 39 is not fully correct ? Also when I place a LATTICE command in the input file, the reading of the .dst file is completely wrong ...

2/ I'm creating a .dst file with 100 particles (protons) which are all started on axis (x=x'=y=y'=0) and have only an energy spread (phi = 0). The file seems to be read correctly in TRACEWIN (see
input_dist.png
input_dist.png (125.35 KiB) Viewed 16205 times
). But when running TRACEWIN with this file, I get 'Particle with negative energy' ... The Twiss parameters are obviously not calculated from this simple input distribution, but are the actual correct Twiss parameters for this linac. The purpose here is to launch just a few 100 protons to verify the longitudinal beam dynamics and acceptance.
I attach the input .dst file ...

Thanks in advance for any help on these topics!
With kind regards
Jarno
Attachments
LB_long.dst
(4.72 KiB) Downloaded 766 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 869
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Reading and creating .dst files

Post by FranceDidier »

Dear Jarno,

1) I assumed you were talking about the plt file and not the dst file, in which case you're right that it's a bit more complex than explained in the manual because of the case of field maps. I've upgaded the manual to clarify this point.

2) Normally the code in the first stage of simulation will adjust the dst file given as input to the beam parameters requested in the "Main" page. With such a distribution, it is not able to do this and even stops on an error in your example. I have therefore modified the code so that it accepts this type of "exotic" distribution with a message specifying that it has not been able to fit it with the requested parameters, but that the simulation is nevertheless carried out with full knowledge of the facts.

A last remark, there is a procedure one shot showned un the manual allowing to calculate linac acceptance ; "Acceptance calculation using TraceWin and PlotWin" : https://dacm-codes.fr/Softwares/TraceWi ... ACCEPTANCE

Regards,

Didier
Belgiumjarnovandewalle
Neophyte
Neophyte
Posts: 10
Joined: Mon 30 May 2022 22:23
Country:
Belgium (be)
Belgium

Re: Reading and creating .dst files

Post by Belgiumjarnovandewalle »

Thank you !
Belgiumjarnovandewalle
Neophyte
Neophyte
Posts: 10
Joined: Mon 30 May 2022 22:23
Country:
Belgium (be)
Belgium

Re: Reading and creating .dst files

Post by Belgiumjarnovandewalle »

Dear Didier,

I tried to run the attached proton distribution with the lastest TRACEWIN version, but got a segmentation violation. I did get the message as you described (that the distribution cannot be fitted ...), but subsequently, there is a critical error and TRACEWIN crashes ...

There is no problem when I run my .ini and .dat file in PARTRAN mode with a uniform distribution. So the problem seems to be really related to the .dst file ...

1 small additional question on the 3 'CHAR' values which need to go in the header of the .dst file. It's not specified what those are supposed to be ...
I can only guess that the first 2 are related to the compression level ? But the third CHAR is not clear ...

With best regards
Jarno
Attachments
LB_long.dst
(155.7 KiB) Downloaded 763 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 869
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Reading and creating .dst files

Post by FranceDidier »

Dear Jarno,

Even though I'm using your latest dst file with or without a uniform distribution, I'm not encountering any problems. I conclude that I don't have the configuration that's causing the problem, so send me your project files (*.ini & *.dat) so that I can reproduce your problem.

The first 2 CHAR must be set to 125 & 100 respectively, I'll add it in the doc and for the third, whatever its value, it's not used but must be present (it's historical).

Regards,

Didier
User avatar
FranceDidier
Administrator
Administrator
Posts: 869
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Reading and creating .dst files

Post by FranceDidier »

Dear Jarno,

Ok it's fixed in the last version.
But you have to understand that set a beam current with such a distribution was necessarily going to cause problems in the space-charge calculation, hence the crash you had.
That said, you won't be able to calculate an acceptance with your method. I strongly suggest that you use the method I've given you in the manual (I've upgraded it a bit to take account of your rather specific case). For your information, I've made the calculation and below is the image of the longitudinal acceptance of your machine.

Regards,

Didier
acceptance.png
acceptance.png (1.02 MiB) Viewed 16172 times
Post Reply