duplicating a mmap file

Moderators: cyao, michael_borland

Post Reply
marlibgin
Posts: 54
Joined: 15 Mar 2011, 12:43

duplicating a mmap file

Post by marlibgin » 19 May 2021, 18:53

Hi,
it is probably already answered somewhere, and I may think there is an sdds command doing that. Anyway the problem is the following
I calculate the mmap for a cell and I want then to create a mmap file by duplicating this cell Ntimes, so in the end I have the enre, symmetric lattice.

Sorry for the naive question

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

Re: duplicating a mmap file

Post by michael_borland » 20 May 2021, 08:47

Can you tell me what the application is? That may affect how you want to do this.

--Michael

marlibgin
Posts: 54
Joined: 15 Mar 2011, 12:43

Re: duplicating a mmap file

Post by marlibgin » 20 May 2021, 09:02

Sure Michael
I am using the mmap to calculate the Touschek Lifetime of a ring, formed of 20 identical cells. I use one RF and perform a full 6D tracking.
I just want to speed up the procedure, assuming that every cell behaves the same, which should be even more true without errors.
So I do a tracking on the whole ring, but I require a momentum_aperture calculation between 0 and Lcell.
This produces a cell-wise OUT.mmap file, Lcell = 26m.
Then I want to do N * OUT.mmap and obtain the full ring L = 520m or so.
At that point I use touschekLifetime to compute the TLT

... hope it makes sense :o)

Marco

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

Re: duplicating a mmap file

Post by michael_borland » 20 May 2021, 10:28

Marco,

Yes, that makes sense. If your mmap file covers a full cell (s=0 to s=Lcell) and your twiss file covers the same region, then touschekLifetime will give the correct results. There's no need to duplicate the mmap data.

--Michael

marlibgin
Posts: 54
Joined: 15 Mar 2011, 12:43

Re: duplicating a mmap file

Post by marlibgin » 23 May 2021, 08:30

Many Thanks Michael,
the principle is clear, yet I have some problem implementing it
What I do is the following
run over the entire ring (ringrf) and produce the run1.twi file. The ring1.mmap is run over the full ringrf
BUT the calculation of the LMA is exactly limited to the 1st achromat (cell). Also run1.mmap is calculated
on a subset of elements, namely at quads, sexts, octupoles, dipole and at the markers of the achromat ('ZZ')

when calculation is over I try to compute touschekLifetime,

touschekLifetime -charge=2.5 -emityInput=10e-12 -length=8.8 TEST.life -twiss=run1.twi -aper=run1.mmap
element1 "STR0050" and elem2 "OXXO" at s1 2.599999999999999e+00 s2 2.599999999999999e+00 don't match
error: Twiss and Aperture file are not for same beamline


If I examine the run1.twi against run1.mmap I see the problem seem due to


run1.twi

s ElementName ElementOccurence ElementType
m
-----------------------------------------------------------
0.000000e+00 _BEG_ 1 MARK
0.000000e+00 ZZ 1 MARK
5.000000e-01 STR0500 1 DRIF
....
2.529000e+00 STR0025 4 DRIF
2.550000e+00 STR0021 1 DRIF
2.600000e+00 STR0050 2 DRIF
2.600000e+00 OXXO 1 MULT

2.650000e+00 STR0050 3 DRIF
2.675000e+00 STR0025 5 DRIF
2.925000e+00 QFEND 1 KQUAD
...

run1.mmap
s ElementName ElementType ElementOccurence
m
---------------------------------------------------------------------
0.000000e+00 ZZ MARK 1
2.600000e+00 OXXO MULT 1
2.925000e+00 QFEND KQUAD 1
3.000000e+00 OXYO MULT 1
3.400000e+00 QDEND KQUAD 1
3.456080e+00 DS6 CSBEND 1
3.506080e+00 DS5 CSBEND 1

so, in the run1.twi file, the drift before the octupole OXX0 at 2.6m seems to cause the clash. This never happened to me when running over the full ring for both the twi and mmap calculations, whencomputing the mmap only at the sextupoles.
I wonder if modelling OXX as (drift, OXX0, drift), where OXX0 is a L=0 multipole, could be the cause of the problem. I have tried also to remove the dimensionless octupole and use a (dimesionless) marker. Same issue.

Just in case someone has time and will, I attach my files while I am trying other ways to dribble the problem
Thanks Marco
Attachments
TEST.tar.gz
(2.65 KiB) Downloaded 486 times

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

Re: duplicating a mmap file

Post by michael_borland » 23 May 2021, 11:28

Marco,

Yes, touschekLifetime is a bit finicky about lining up the s values and names for elements. You can work around that by subselecting from the .twi file only those entries found in the .mom file

Code: Select all

sddsselect run.twi run.mom run.twi1 -equate=s
Then, use run.twi1 in place of run.twi in your touschekLifetime run, but give the -ignoreMismatch option.

This will only give the right answer if run.mom covers a N full cells, where N=1, ...

--Michael

marlibgin
Posts: 54
Joined: 15 Mar 2011, 12:43

Re: duplicating a mmap file

Post by marlibgin » 24 May 2021, 07:47

Thank you so much Michael, sddsselect was exactly what I was missing, it seems all more reasonable now
Marco

Post Reply