Page 1 of 1

How to consider "macro-particle" weight

Posted: 20 Apr 2023, 04:36
by Demurtas
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.

Re: How to consider "macro-particle" weight

Posted: 02 Jun 2023, 10:29
by michael_borland
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

Re: How to consider "macro-particle" weight

Posted: 08 Jun 2023, 07:36
by Demurtas
Thanks for the answer, I will find another way to use them.

Re: How to consider "macro-particle" weight

Posted: 19 Jun 2023, 07:55
by Demurtas
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!

Re: How to consider "macro-particle" weight

Posted: 19 Jun 2023, 07:59
by Demurtas
Here is the example vary Charge I followed and the .ele file.

Re: How to consider "macro-particle" weight

Posted: 19 Jun 2023, 11:54
by michael_borland
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

Re: How to consider "macro-particle" weight

Posted: 19 Jun 2023, 13:11
by Demurtas
Yes, in this case, I have only one bunch at a time; thank you for the answer!