NonLinearDynamics#
Functions
quantitative representation of RDT fluctuations |
|
computes tune shift with amplitude |
|
Computes Hamiltonian resonance driving terms (RDTs) |
|
Computes Hamiltonian resonance driving terms (RDTs) |
|
draws a tune diagram |
- RDTbuildupFluct()#
- RDTfluctuationIndicator(ring, varargin)#
- quantitative representation of RDT fluctuationsThis function calls computeRDTfluctuation(ring, varargin) to computeRDT fluctuations, and provides one example to quantitatively representsthe RDT fluctuations.[h3ave,h4ave,h3chroave,adts]=RDTfluctuationIndicator(ring,varargin)ring is the AT latticeThe additional argument:nslices: number of slices of each sextupole, which affects thecrossing terms. default: 4.h3ave and h4ave quantitatively represents 3rd- and 4th-order geometricRDT fluctuations, respectively.h3ave + w * h4ave can be used to represents geometric RDT fluctuations.The coefficient w can be estimated by action of particle at theanticipated DA, w ~ (2J_x)^0.5 = x / betax^0.5, usually 0.01 is OK.h3chroave is the fluctuation of 3rd-order chromatic RDTs,defined similarly to h3ave.adts is the sum of three ADTS terms, which are also used in onlinear optimization.The fluctuations of ADTS terms are not considered.It is calculated here to avoid duplicate computation.Noting:1.This function provides one example to quantitatively represents theRDT fluctuations similar to that in Ref.[1]. But in Ref.[1], onlythe RDTs at the locations of nonlinear magnets are considered.We think the differences are small and it’s more important tokeep the function simple.2.People can call computeRDTfluctuation(ring, varargin) directly,and try other quantitative representations.3.The build-up RDT fluctuation can also be used, see Ref.[1].If the build-up RDT fluctuations are used, it is better to calculatethe RDT build-up fluctuations for multiple periods to havebetter convergence of calculation.REFERENCE:[1] B. Wei, Z. Bai, J. Tan, L. Wang, and G. Feng, Phys. Rev. Accel. Beams 26, 084001 (2023)
- atnuampl(ring, amplitude)#
- computes tune shift with amplitude[nux,nuz]=atnuampl(ring,amplitude)[nux,nuz]=atnuampl(ring,amplitude,1)Computes tunes for the specified horizontal amplitudes[nux,nuz]=atnuampl(ring,amplitude,3)Computes tunes for the specified vertical amplitudesatnuampl(…)Plots the computed tunes in the current axesatnuampl(…,name,value)Uses additional options specified by one or more Name,Value pairs.Possible values are:orbit: initial closed orbitnturns: specify the number of turns for tracking (default 256)method: specify the method for tune determination1: Highest peak in fft2: Interpolation on fft results3: Windowing + interpolation (default)4: NAFFOther options are transmitted to the plot function
- computeRDT(ring, index, varargin)#
- Computes Hamiltonian resonance driving terms (RDTs)This function calls RDTElegantAT mex function and returns thehamiltonian resonance driving terms, using the elegant c++function computeDrivingTerms().rdt=computeRDT(ring, index, varargin)ring is the AT latticeindex is the vector of indexes where one wants to compute RDTsThe additional arguments can be up to five strings:chromatic, coupling, geometric1, geometric2 and tuneshiftsexample:rdt=computeRDT(ring, indexbpm, ‘geometric1’, ‘tuneshifts’);creates an array of structs (the length of the array is the number ofindexes where you want to compute driving terms) with first ordergeometric driving terms and tune shifts with amplitude.The driving terms are complex numbers, the tune shifts are real.
- computeRDTfluctuation(ring, varargin)#
- Computes Hamiltonian resonance driving terms (RDTs)This function is based on simplestoragering and returns the RDTsand their longitudinal fluctuations.[rdt,buildup_fluctuation,natural_fluctuation]=computeRDTfluctuation(ring, varargin)ring is the AT latticeThe additional arguments:nslices: number of slices of each sextupole, which affects the crossingterms. default: 4.nperiods: number of periods. RDTs and RDT build-up fluctuations will becomputed for n periods. default: 1.natural RDT fluctuation of different periods are the same.So the results contain only one period.RDT: struct, RDTs (complex numbers) andamplitude-dependent tune shifts (real)(ADTS are calculated using h22000, h11110 and h00220)buildup_fluctuation: a struct of complex arrays,accumulated RDTs from s=0,showing the build-up and cancellation of RDTs along thelongitudinal position.natural_fluctuation: a struct of double arrays,absolute values of one-period RDTs observed at differentlongitudinal starting position.same as s_dependent_driving_terms in ELEGANT.REFERENCES[1] Johan Bengtsson, SLS Note 09/97, (1997)[2] S. C. Leemann, A. Streun, Phys. Rev. ST Accel. Beams 14, 030701 (2011)[3] A. Franchi, L. Farvacque, F. Ewald, G. Le Bec, and K. B. Scheidt, Phys. Rev. ST Accel. Beams 17, 074001 (2014)[4] B. Wei, Z. Bai, J. Tan, L. Wang, and G. Feng, Phys. Rev. Accel. Beams 26, 084001 (2023)
- tunespaceplot()#
- draws a tune diagramresonance lines: m*nu_x + n*nu_y = p