How to consider "macro-particle" weight

Moderators: cyao, michael_borland

Post Reply
Demurtas
Posts: 7
Joined: 19 Apr 2023, 09:03

How to consider "macro-particle" weight

Post by Demurtas » 20 Apr 2023, 04:36

Dear all,

I have to simulate a beam where, in the SDDS input file, there is a column indicating the weight (i.e. the charge if multiplied by e) of each row/ macro-particle. I am very new to elegant, and looking at the examples and the other requests on the forum I didn’t find how to consider this weight. Each of the output files does not have the weight column, and elegant is still considering each “macro-particle” with the same weight.
How can I take into account the weight column with elegant?

Thanks for the answer and best regards.
Attachments
lattice_new.lte
(447 Bytes) Downloaded 345 times
elegant_data.ele
(874 Bytes) Downloaded 349 times
beam1_tail.sdds
(692.92 KiB) Downloaded 317 times

michael_borland
Posts: 1959
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: How to consider "macro-particle" weight

Post by michael_borland » 02 Jun 2023, 10:29

Unfortunately, elegant doesn't presently allow particle weighting. We simply vary the number of particles to indicate regions/bunches with higher or lower charge.

Support for variable weights is planned as a future project.

--Michael

Demurtas
Posts: 7
Joined: 19 Apr 2023, 09:03

Re: How to consider "macro-particle" weight

Post by Demurtas » 08 Jun 2023, 07:36

Thanks for the answer, I will find another way to use them.

Demurtas
Posts: 7
Joined: 19 Apr 2023, 09:03

Re: How to consider "macro-particle" weight

Post by Demurtas » 19 Jun 2023, 07:55

Hi, I have a question about the same topic. To simulate the bunch in the previously attached file, where all the macroparticles have different charges, I tried to write an SDDS input file with one page for each macroparticle, giving another input file a list with the various charges. I followed the attached example varyCharge, which allows simulating beams with different charges but doing this for every macroparticle, and in the .ele file I specified, in sdds_beam, track_pages_separately = 0. I would like to know if it can be a solution to simulate a beam composed by macroparticles with different charges according to the capabilities of elegant and how it handles such an input.

Thank you in advance for the answer!
Attachments
charge420.sdds
(38.93 KiB) Downloaded 341 times
beam420.sdds
(163.1 KiB) Downloaded 309 times

Demurtas
Posts: 7
Joined: 19 Apr 2023, 09:03

Re: How to consider "macro-particle" weight

Post by Demurtas » 19 Jun 2023, 07:59

Here is the example vary Charge I followed and the .ele file.
Attachments
run420.ele
(967 Bytes) Downloaded 322 times
varyCharge.zip
(16.64 MiB) Downloaded 318 times

michael_borland
Posts: 1959
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: How to consider "macro-particle" weight

Post by michael_borland » 19 Jun 2023, 11:54

This is a workable approach if you only have one bunch at a time, since for each simulation step the macroparticles have the same charge.

--Michael

Demurtas
Posts: 7
Joined: 19 Apr 2023, 09:03

Re: How to consider "macro-particle" weight

Post by Demurtas » 19 Jun 2023, 13:11

Yes, in this case, I have only one bunch at a time; thank you for the answer!

Post Reply