An error about insert_sceffects

Moderators: cyao, michael_borland

Post Reply
hongjin
Posts: 4
Joined: 06 Nov 2017, 10:03

An error about insert_sceffects

Post by hongjin » 29 Jul 2018, 05:50

Hello, everyone

I want to use the command &insert_sceffects to inspect the tune shift by space charge effect, but an error occurred:

“error: bad initial parameter offset for element type SCMULT”

And the .ele and .lte files see attachment

How can I cure it?

Many thanks in advance

Hongjin
Attachments
emittance_test1.lte
(2.02 KiB) Downloaded 211 times
emittance_test1.ele
(1.27 KiB) Downloaded 205 times

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

Re: An error about insert_sceffects

Post by michael_borland » 30 Jul 2018, 09:13

Hongjin,

That is a source code error. Are you compiling from source or using an old version of elegant? If so, please update to the latest release and let us know the outcome.

--Michael

hongjin
Posts: 4
Joined: 06 Nov 2017, 10:03

Re: An error about insert_sceffects

Post by hongjin » 01 Aug 2018, 01:09

michael_borland wrote:
30 Jul 2018, 09:13
Hongjin,

That is a source code error. Are you compiling from source or using an old version of elegant? If so, please update to the latest release and let us know the outcome.

--Michael
Hi, Michael

Thank your reply firstly.

The error is resolved by replacing matched_to_cell by specified twiss arguments in &bunched_beam.

In the manual, the important notes"Some users use matched_to_cell in the bunched_beam command. This will erase SCMULT assignments along the beamline. In this case, issue another twiss_output command just before tracking." illustrate the reason, but I didn't noticed it at first.

But I find a tune difference in the ring lattice between ELEGANT and formula. I calculate the tune shift with space charge about -0.1 by formula,ELEGANT gives the growth of tune by 0.1. I think the result is wrong, but how to fix it?

Tune calculation:
'sddsregroup W1.sdds -pipe=out -newParameters=particleID -newColumns=Pass|sddsnaff -pipe -column=Pass -pair=x,xp -pair=y,yp -terminateSearch=frequencies=1|sddsprintout -pipe=in W1naff.csv -spreadsheet=csv -column=*'

&insert_sceffects disable = 0, tune map:
disable=0.png
&insert_sceffects disable = 1, tune map:
disable=1.png
The .lte and .ele files see in attachment:
Attachments
SC_test.zip
(1.42 KiB) Downloaded 205 times

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

Re: An error about insert_sceffects

Post by michael_borland » 01 Aug 2018, 10:05

Hongjin,

This is another bug. The sign of the particle charge is included in the calculation, which it shouldn't be. Since I only tested it for electrons, I didn't see this. To work around the bug, please use

Code: Select all

&change_particle
	name = "custom",
	charge_ratio = 1,
	mass_ratio = 1836.180638972992938
&end
instead of the pre-defined option for "proton". (Basically, this switches to anti-protons, which have the same charge as electrons and thus works around the bug.) I tried this and obtain a negative tune change, but the magnitude is not as large as you expect. However, the particles seem to be unstable and reach quite large amplitudes, so I'm not sure how reliable the results are.

The bug will be fixed in the next release. Thanks for reporting it.

--Michael

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

Re: An error about insert_sceffects

Post by michael_borland » 01 Aug 2018, 13:35

Hongjin,

I noticed another issue with this simulation. Because the emittance is so large, the integrator has accuracy issues that result in spurious non-conservation of the emittances. I don't have a solution for this at present other than using first-order matrix-based tracking, which is adequate if all you want to do is determine the tune spread.

--Michael

Post Reply