impact-lbl/IMPACT-Z

tracking through a drift

Eothred opened this issue · 5 comments

I was trying to do some initial comparison with tracewin, and as a first test I tried a long drift with no space-charge. I got very close but slightly different results. Then I tried to define the drifts in different ways in impact, and came across this.

If I define it as a drift (type 0), I get the same result regardless if I select the linear or non-linear integrator. If I instead define it as a 0-strength quad, I get the same result as for the drift if I select the non-linear integrator, while if I select the linear integrator I actually get the same result as in tracewin for the same drift and input beam.

Here is a test ImpactZ.in (long drift and a quad for fun):

1 1
6 10000 1 0 1
32 32 64 1 0.02 0.02 0.1
3 0 0 1
10000
0.0625
1.064629e-9
-0.051805615 0.20954703 0.25288e-6 1 1 0 0
-0.30984478 0.37074849 0.251694e-6 1 1 0 0
-0.48130325 0.92564505 0.361573 1 1 0 0
0.0 3.62e6 938.2731e6 1.0 352.21e6 0.0
0.0 0 42 -2  1/
3.0 300 1 1 0.0 0 0.5 0. 0. 0. 0. 0./
!3.0 300 1 0 0.5/
0.2 8 1 1 -16.3007 0 0.5 0. 0. 0. 0. 0./
0.0 0 43 -2  1/

Which, based on how I define the integrator or the drift I get these results for the transversal RMS beam size (zoomed plot, difficult to see but 3 of 4 lines are overlapping, with the last blue line being identical to what tracewin gives):
integrator_comparison

Naively I would think that tracking through a drift or a 0-length quad should be the same, even more naively I would think that maybe without space-charge any integrator should give same results for a drift.

Is this expected behaviour? (and if so, could someone explain it to me?)
Can someone reproduce the difference?

Is it just that maybe the default RMS-size cutoff is different for the linear and non-linear cases? It looks like the discrepancy is present from the beginning of the lattice.

difference

Fair point, and thanks for the feedback. It was a bad way of displaying the difference perhaps. Here is a plot of the difference of the curves both in horizontal and vertical (the previous plot was only showing vertical for each case). It grows linearly with the drift it seems.

Another disclaimer: I am not an experienced Impact user, there is a good likelihood I am just misunderstanding something trivial in the configuration.

The 0 strength quadrupole uses a linear transfer map for the drift. It gives different results
in compared with a real drift element. For a real drift element, using either linear or nonlinear integrator gives the same results.
driftcmp

Also, if you use a 0 strength quadrupole, but with the k value as an input, it will also give the same results
as the real drift element. The input line for this element is like:
3.0 300 1 1 0.0 -1.0 0.5 0. 0. 0. 0. 0./

Thank you for the explanation Ji!