1 Introduction

For the design and operation of modern circular particle accelerators, understanding the complex dynamics that characterises the beam-halo formation and evolution is of paramount importance. Indeed, several phenomena leading to particle loss and beam-quality degradation, crucial to determine the performance of a particle accelerator, are closely linked to the evolution of the beam halo.

This is particularly true for present and future colliders based on superconducting magnets, such as LHC [1], its upgrade HL–LHC [2], or the proposed FCC-hh [3]. Beam losses have a direct impact on the accelerator performance.

Beam-halo dynamics is governed by a multitude of effects, such as the unavoidable nonlinear field errors of the superconducting magnets, as well as ripples in the magnets’ power converters. In general, the beam dynamics of hadron machines is accurately described in terms of a Hamiltonian from which the equations of motion can be derived. If the system under consideration includes time-dependent effects, this turns into a radical change of the character of the beam dynamics. For instance, the presence of modulation of the characteristic frequencies of the Hamiltonian system implies the existence of extended weakly chaotic layers in phase space [4]. In these regions, it is possible to model the orbit diffusion by a stochastic process. The situation worsens in case the periodic modulations themselves resemble stochastic processes since the diffusive behaviour might involve the whole of the accessible phase space.

Recently, a framework has been developed and proposed [5, 6], in which the long-term behaviour of the beam dynamics and particle losses in circular accelerators is described by means of a diffusive model. In this framework, the evolution of the beam distribution can be described by a Fokker–Planck (FP) equation, in which the diffusion coefficient represents the key quantity to describe the beam dynamics. The development of diffusive models of the transverse dynamics of charged particles is not at all new for accelerator physics, and a rather broad literature exists (see, e.g. Refs.  [7,8,9,10,11,12,13,14,15,16,17,18,19] and references therein). However, the model that we developed has a very peculiar feature, since we assume that the functional form of the diffusion coefficient is derived from the optimal estimate of the perturbation series provided by the Nekhoroshev’s theorem [20,21,22].

The FP equation is suitable to study the evolution of a beam distribution in the presence of collimators, whose jaws can be represented by the absorbing boundary conditions needed to solve the FP equation. Furthermore, so-called collimator scans can be used to probe the beam-halo dynamics and, in particular, to reconstruct the behaviour of the diffusion coefficient as a function of transverse amplitude [8, 15, 23, 24]. The method of collimator scans has been intensively used at the LHC: it is based on small displacements of the jaws combined with the measurement of the beam losses. The displacements can be either inward or outward, and depending on the direction, the local losses feature different behaviour. The interpretation of the experimental data relies on a number of assumptions that are closely linked to the form of the FP equation that is used to model the beam dynamics.

A first attempt to validate the proposed model of the diffusion coefficient by means of experimental data has been carried out by re-analysing data collected during past collimator scans at the LHC and is presented in Ref. [25]. An encouraging agreement, corresponding to an error on the model parameters of the order of 10–15\(\%\), has been found between the FP model predictions and the experimental data. However, some limitations have been observed that are linked to the protocol used to perform the collimator scans. Indeed, the strongly nonlinear form of the diffusion equation implies that particular care should be taken in the way the amplitude dependence of the diffusion coefficient is probed experimentally. Furthermore, the experimental protocol should be as much as possible independent from the knowledge of the detail of the transverse beam distribution, as the accurate measurement of the beam tails might be challenging. In this paper, the properties of the FP equation, in particular that of the outgoing current at a boundary condition, are studied in detail by means of analytical models and even more by means of numerical simulations. These analyses lead to the definition of an optimal protocol to extract the information about the diffusion coefficient by performing a sequence of well-chosen variations of the position of the boundary condition. An important part of our analyses focuses on the determination of the accuracy and robustness of the proposed protocol, which are key aspects for an experimental determination of the form of the diffusion coefficient.

The plan of the paper is the following. In Sect. 2, we present the theoretical framework that defines the Nekhoroshev-like diffusive model, along with some considerations on the special form of the diffusion coefficient and its implications on the dynamics. In Sect. 3, we analyse the main characteristics of a FP process, with focus on the outgoing current, its behaviour in various conditions, such as in stationary or semi-stationary equilibrium. In Sect. 4, we discuss how the outgoing currents obtained from outward or inward changes of the position of the boundary condition can be described by our model, and how such currents can be split in two processes with distinct time scales. In Sect. 5, the results presented in the previous sections are used to define a protocol to reconstruct the diffusion coefficient of the FP process. The results of detailed numerical simulations are presented and discussed, quantifying the performance of the proposed method. Finally, in Sect. 6 some conclusions are drawn, whereas detail about the numerical integration of the FP process is discussed in Appendix A and some analytical computations are presented in the Appendixes B and C.

2 The diffusion approach to non-linear dynamics

From Hamiltonian systems theory, we know that orbit diffusion in phase space is related to the presence of extended weakly chaotic regions [26]. Otherwise, the presence of invariant Kolmogorov–Arnol’d–Moser tori ensures long-term stability of the dynamics [27].

In circular particle accelerators, the transverse dynamics is affected by a multitude of unavoidable small random perturbations [28], as well as slow modulation of magnet currents and transverse tune ripples that could lead to the formation of these weakly chaotic regions. Therefore, it is reasonable to assume that the particle motion is described by models of the form

$$\begin{aligned} H(\theta , I, t)=H_{0}(I)+ \xi (t) H_{1}(\theta , I) \,, \end{aligned}$$
(1)

where \((I, \theta )\) are action-angle variables and \(\xi (t)\) is a continuous stationary stochastic noise with zero mean that represents the effect of the chaotic dynamics. In the case of a small stochastic perturbation if the correlation time scale of the noise \(\xi (t)\) is much shorter than the evolution time scale of the unperturbed system, it is possible to describe the evolution of the action density function \(\rho (I,t)\) by the FP equation (see, e.g. Ref. [6] for the mathematical details and Ref. [29] for an application to a stochastic symplectic map)

$$\begin{aligned} \frac{\partial \rho (I, t)}{\partial t}={\frac{1}{2}} \frac{\partial }{\partial I} {D}(I) \frac{\partial }{\partial I}\, \rho (I, t) \,, \end{aligned}$$
(2)

where the diffusion coefficient reads

$$\begin{aligned} D(I)=\sqrt{\left\langle \left( \frac{\partial H_1}{\partial \theta } \right) ^2 \right\rangle } \end{aligned}$$
(3)

and the operator \(\langle \,\rangle \) denotes the average value with respect to the angle variables. Equation (2) is invariant with respect to a rescaling of the time, provided the diffusion coefficient is also rescaled, i.e. if \(t \rightarrow \epsilon t \) and \(D \rightarrow \epsilon D\), then the FP equation does not change. This arbitrariness is removed by imposing a normalisation to the diffusion coefficient, e.g. that it has unitary norm.

The stochastic perturbation in Eq. (1) models the effect of a large weakly chaotic region in phase space and its amplitude should be related to the non-integrability of the dynamics. We assume, therefore, that its amplitude is related to the functional form provided by the optimal estimate of the perturbative series, according to the Nekhoroshev’s theorem [21, 22]. Therefore, the diffusion coefficient has the form

$$\begin{aligned} D(I)\propto \exp \left[ -2\left( \frac{I_*}{I}\right) ^{\frac{1}{2\kappa }}\right] \,, \end{aligned}$$
(4)

and the two parameters \(\kappa , I_*\) in Eq. (4) have a physical meaning that stems from the Nekhoroshev’s theorem: the exponent \(\kappa \) is related to the analytic structure of the perturbative series and the dimensionality of the system, and is supposed to be independent from the intensity of the perturbation themselves [6]; \(I_*\) is related to the asymptotic character of the perturbative series.

The model based on the assumption that the beam dynamics is governed by a stochastic Hamiltonian, combined with a functional form of the diffusion coefficient derived from the estimate of the time stability from Nekhoroshev theorem, has been applied to the interpretation of intensity measurements in the LHC at top energy [6]. An excellent agreement between the data collected and the predictions from the FP model, where the approach consists in fitting the values of the model parameters \(I_*\) and \(\kappa \) to the collected data, has been observed. The same functional form of the stability time from Nekhoroshev theorem has been used to derive a scaling law for the time evolution of the dynamic aperture for the case of a system dominated by nonlinear, single-particle-like effects [30, 31]. This scaling law is also confirmed by the results of numerical simulations. Based on this scaling law, the functional form of the evolution of the beam intensity has been derived [32] and proposed as a technique to measure the dynamic aperture of a circular accelerator. Once again, the experimental validation of this approach was fully successful, as indicated by beam measurements performed at the LHC [33]. All these very encouraging results suggest that Nekhoroshev theorem provides an efficient description of several aspects of beam dynamics.

In the following, we consider 1DoF Hamiltonian systems and we introduce an absorbing boundary condition at \(I_{\mathrm {a}}\), i.e. the phase-space limit beyond which an initial condition is considered lost. Note that D(I) and \(\rho \) have dimensions \([I^2t^{-1}]\) and \([I^{-1}]\), respectively.

In Fig. 1 (top and centre), we consider the behaviour of D(I) from Eq. (4) for some values of \(\kappa \). We can distinguish three regions for this type of function: (i) a stable-core region for \(I \ll I_*\), for which D(I) has values decreasing to zero exponentially fast; (ii) a ramp-up region for \(I \lesssim I_*\), where D(I) starts to have non-negligible values and changes from an exponential growth to an almost linear one; (iii) a region for \(I > I_*\), where D(I) features an almost linear growth (in logarithmic scale a saturation appears).

These three regions are more or less distinguishable depending on the value of \(\kappa \). In Ref. [6], a value of \(\kappa \) around 0.33 was found as the best fit to the data measured during experimental studies at the LHC, and for this reason this value is used in the numerical simulations presented in this study, although this choice does not hint at any universality of this value.

In Fig. 1 (bottom) we also display the result of the numerical integration of Eq. (2) for some values of \(\kappa \), performed on an initial distribution \(\rho _0(I)=1\) with a Crank–Nicolson scheme [34] (see Appendix A for some detail on the integration scheme used in our studies). It is also possible to observe in the shape of the distribution function a stable-core region, corresponding to \(I/I_*\ll 1\), where D(I) starts having values very close to zero, a fast decrease region and, finally, a saturation region, for \(I/I_*= 1\) and beyond, where \(\rho (I, t)\) assumes small values.

Fig. 1
figure 1

Top and centre: plot of D(I) both in linear and logarithmic scale for three values of \(\kappa \) as a function of \(I/I_*\). Bottom: evolution of an uniform distribution (in grey) over the same time interval corresponding to \((t=10.0 \, [\text {a. u.}])\) for three values of \(\kappa \). (Simulations parameter: \((I_*= 1.0\,[\sigma ^2])\))

We treat our problem by using the 1D action variable I, representing the nonlinear invariant of the system. We consider the rescaled action variable \(I \rightarrow I/\sigma ^2\), and express the action in units of the rms beam emittance, and this action will therefore be a dimensionless quantity. A second natural scale of our problem is given by \(I_*\), as can be derived from the functional form of the diffusion coefficient (4), and, in fact, in several cases, the analyses presented in the rest of this paper will be carried out in terms of the dimensionless variable \(I/I_*\).

As for the initial condition for the beam distribution, we use the exponential distribution

$$\begin{aligned} \rho _0(I) = \exp (-I) \,, \end{aligned}$$
(5)

obtained by the transformation of the standard Gaussian distribution in physical variables. We also note that for future analysis, it might be interesting to consider beam distributions made of combinations of exponential distributions, as this could be used to simulate the behaviour of a beam with overpopulated tails.

3 Some considerations on FP processes

3.1 Outgoing current

In a generic diffusive process, the outgoing current at the absorbing boundary condition at \(I_{\mathrm {a}}\) is defined as

$$\begin{aligned} J_{\mathrm {a}}(t) = D(I_{\mathrm {a}})\frac{\partial \rho (I, t)}{\partial I} \Bigr |_{(I_{\mathrm {a}}, t)}. \end{aligned}$$
(6)

Equation (2) provides a means to obtain an analytical estimate of the current lost at the absorbing barrier (see Appendix B for the mathematical details). We consider the change of variable

$$\begin{aligned} x(I) = -\int _I^{I_{\mathrm {a}}} {\frac{1}{D^{1/2}(I')}}\,\mathrm {d}I' , \quad \rho _x(x,t) = \rho (I, t) \sqrt{D(I)} , \quad x_{\mathrm {a}}=x(I_{\mathrm {a}})=0 \,, \end{aligned}$$
(7)

and the FP problem in the Smoluchowsky form

$$\begin{aligned} \frac{\partial \rho _x}{\partial t} = {\frac{1}{2}}\frac{\partial }{\partial x} \frac{\mathrm{d}V(x)}{\mathrm{d}x} \rho _x+{\frac{1}{2}} \frac{\partial ^{2}\rho _x}{\partial x^{2}} \quad \text {where} \quad V(x) = -\ln \left( D^{1/2}(x)\right) \,. \end{aligned}$$
(8)

Assuming an initial distribution of the form \(\delta (x - x_0)\), where \(x_0 \in ] -\infty , 0]\), and approximating the potential V(x) at \(x_0\) as \(-\nu \, x\), the following expression for the outgoing current at \(x_a = 0\) is obtained

$$\begin{aligned} J_{\mathrm {a}}(x_0, t) = \frac{|x_0|}{t\sqrt{2\pi t}}\exp \left( -\frac{\left( x_0+\frac{\nu }{2}t\right) ^2}{2t}\right) , \end{aligned}$$
(9)

where \(\nu \), the linearisation of the potential (8) at \(x_0\) with D(I) given by Eq. (4) in the new coordinates, has the following expression

$$\begin{aligned} \nu ={\frac{1}{2\kappa }}\frac{1}{I(x_0)}\left( \frac{I_*}{I(x_0)}\right) ^{\frac{1}{2\kappa }}\exp \left[ -\left( \frac{I_*}{I(x_0)}\right) ^{\frac{1}{2\kappa }}\right] . \end{aligned}$$
(10)

We remark that Eq. (9) can be applied to a generic distribution \(\rho _0\) via a convolution

$$\begin{aligned} J_{\mathrm {a}}(t) = \int J_{\mathrm {a}}(x,t)\rho _x(x)\,\mathrm {d}x. \end{aligned}$$
(11)

We also note that Eqs. (9) and (10) provide inevitably an underestimate of the actual current lost [35], as the actual drift term is a positive increasing function for \(I\ll I_*\). However, we expect an accurate description of the local behaviour close to the absorbing boundary condition, i.e. we obtain a good estimate of the current lost for initial distributions that are close enough to the absorbing barrier at \(I=I_{\mathrm {a}}\).

3.2 Stationary system with a constant source

Let us consider a diffusive process within the region \([I_0, I_{\mathrm {a}}]\), with an absorbing boundary condition \(\rho (I_{\mathrm {a}}, t) = 0\), and \(\rho (I_0, t) = 1\) as a constant source over time. Regardless of the shape of the initial distribution \(\rho _0\), the system will eventually relax to its equilibrium distribution \(\rho _{\text {eq}}(I)\), characterised by a constant outgoing current at \(I_{\mathrm {a}}\). Such a distribution satisfies the following equation

$$\begin{aligned} \frac{\partial }{\partial I} D(I) \frac{\partial }{\partial I} \rho _{\text {eq}}(I) = 0 , \end{aligned}$$
(12)

whose solution is given by

$$\begin{aligned} \rho _{\text {eq}}(I) = \alpha \int _I^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x , \quad \alpha = \frac{1}{ \displaystyle {\int _{I_0}^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x}} \,. \end{aligned}$$
(13)

The relaxed system features a constant outgoing current given by

$$\begin{aligned} J_{\mathrm {a}}(t) = D(I_{\mathrm {a}})\frac{\partial \rho _{\text {eq}}}{\partial I}\Bigr |_{(I_{\mathrm {a}},t)} = \alpha , \end{aligned}$$
(14)

which is directly linked to the integral of the diffusion coefficient. For a Nekhoroshev-like diffusion coefficient, we have the analytical expression

$$\begin{aligned} \rho _{\text {eq}}(I) = \alpha \int _I^{I_{\mathrm {a}}} \exp \left[ 2\left( \frac{I_*}{x}\right) ^{\frac{1}{2\kappa }}\right] \,\mathrm {d}x = 2\alpha \ \kappa x \left[ -2\left( \frac{I_*}{x}\right) ^{\frac{1}{2\kappa }}\right] ^{2\kappa } \Gamma \left( -2\kappa , -2\left( \frac{I_*}{x}\right) ^{\frac{1}{2\kappa }}\right) \Bigg |_I^{I_{\mathrm {a}}}, \end{aligned}$$
(15)

where \(\Gamma \) is the upper incomplete gamma function

$$\begin{aligned} \Gamma (s,x) = \int _x^{\infty } t^{s-1}\,e^{-t}\,\mathrm{d}t . \end{aligned}$$
(16)

When the system is out of equilibrium, one can obtain an analytical description of the outgoing current by using the formula in Eq. (9), where, instead of performing a convolution between Eq. (9) and \(\rho _0\), we perform a convolution with \(\rho _0 - \rho _{\text {eq}}\). The resulting outgoing current is added to the constant value \(\alpha \) (the mathematical details of such procedures are illustrated in Appendix C).

3.3 Semi-stationary regime for a real system

When working with a Nekhoroshev-like diffusion coefficient, its exponentially small values for \(I \ll I_*\) generate a stable-core region with extremely low diffusion rates (see Fig. 1). This observation can be shown by computing the time of the maximum of the outgoing current for an initial distribution \(\delta (I - I_0)\). We consider the time derivative of Eq. (9)

$$\begin{aligned} \frac{\partial J_{\mathrm {a}}(x_0, t)}{\partial t} = \frac{\sqrt{2} x_0 \left[ 12 t + \left( \nu t - 2 x_0\right) \left( \nu t + 2 x_0\right) \right] }{16 \sqrt{\pi t^7}}\exp \left( -\frac{\left( x_0+\frac{\nu }{2}t\right) ^2}{2t}\right) , \end{aligned}$$
(17)

which is zero for two values of t of opposite sign, and the positive one is

$$\begin{aligned} t_{\text {max}}(x_0) = \frac{2 \left( \sqrt{\nu ^{2} x_0^{2} + 9} - 3\right) }{\nu ^{2}}. \end{aligned}$$
(18)

Considering the diffusion coefficient of Eq. (4) in the change of variable Eq. (7), we have that

$$\begin{aligned} x_0(I_0) = {-}\int _{I_0}^{I_{\mathrm {a}}} \exp \left[ \left( \frac{I_*}{I}\right) ^{\frac{1}{2\kappa }}\right] \,\mathrm {d}I. \end{aligned}$$
(19)

We observe that the modulus of the integral of Eq. (19) increases exponentially for \(I_0 \ll I_*\). Likewise, the value of \(\nu \), given in Eq. (10), decreases exponentially in the same range of values of \(I_0\), which characterise a strong exponential variation for \(t_{\text {max}}\) as a function of \(I_0\). This fact suggests that the contribution to the outgoing current at an absorbing barrier at time t is mainly determined by the initial conditions near \(I_0\), with \(t_{\text {max}}(I_0) \approx t\). Hence, given a generic initial distribution \(\rho _0(I)\) and an absorbing boundary condition at \(I_{\mathrm {a}}\), after a transient time t, the system relaxes to a condition where the current \(J_{\mathrm {a}}(t)\) is mainly determined by \(\rho _0(I_0)\), where \(I_0\) satisfies \(t_{\text {max}}(I_0) \approx t\). Considering the exponential increase of \(t_{\text {max}}(I)\), we have a core region that is slowly eroded by the diffusive process. Outside of this core region, the system behaves as in a semi-stationary regime, characterised by a very slowly varying source at \(I_0\).

The evolution of this semi-stationary process can be approximated by modifying the \(\alpha \) term in Eq. (13) as

$$\begin{aligned} \rho _{\mathrm {eq}}(I, t) = \alpha (t) \int _I^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x, \end{aligned}$$
(20)

where here \(\alpha (t)\) depends on the value of the initial distribution \(\rho _0(I_0)\), and can be estimated by

$$\begin{aligned} \alpha (t) = \frac{\rho _0\left( I_0(t)\right) }{\displaystyle { \int _{I_0(t)}^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x}}, \end{aligned}$$
(21)

in which \(I_0(t)\) is obtained by inverting Eq. (19) to determine \(I_0(x_0)\), and Eq. (18) to obtain \(x_0(t_{\mathrm {max}})\). By composing the two functions, \(I_0(t)\) is determined.

This behaviour can be observed in Fig. 2, where a Nekhoroshev-like diffusive process is simulated for a time long enough to reach the semi-stationary regime. Here, we consider the distribution obtained after prolonging the simulation of the system presented in Fig. 1 with \(\kappa =0.33\), and we compare it to \(\rho _{\mathrm {eq}}\) from Eq. (13), using \(\alpha \) obtained from Eq. (21). A global offset between the two curves is observed, which clearly highlights the limits of the approximation.

Fig. 2
figure 2

Initial uniform distribution for the simulation shown in Fig. 1 after numerical integration at \(t=1000 \, [\text {a. u.}]\), compared to the estimate of \(\rho _{\mathrm {eq}}\) from Eq. (13), with \(\alpha (t)\) computed with Eq. (21). (Simulations parameters: \((I_*= 1.0\,[\sigma ^2],\, \kappa = 0.33)\))

4 Reconstruction of the diffusion coefficient of a FP process

We consider now the problem of modelling the variation of the outgoing current after a change of the position \(I_{\mathrm {a}}\) of the absorbing boundary condition, under the hypothesis that the movement is fast enough to be considered instantaneous and the movement is performed over a short distance while the system is in the semi-stationary regime described in the previous section. The ultimate goal consists in defining a method for probing the information about the shape of the diffusion coefficient D(I) contained in the outgoing current measured after the instantaneous movement of the boundary condition. This, in view of reconstructing the characteristics of the FP process under analysis, which corresponds to evaluating the values of the two parameters \(I_*\) and \(\kappa \) defining D(I).

We define two types of outgoing current, namely global current, i.e. the outgoing current observed from a slow core erosion process while keeping the absorbing boundary condition fixed, and recovery current, i.e. the current observed after the absorbing boundary condition is instantaneously moved and the system relaxes to a new semi-stationary regime.

We start by modelling the shape of the recovery current for a stationary system with a fixed source, both for inward and outward movements of the absorbing boundary. We recall that this mimics what is done experimentally when attempting to measure the diffusion equation by performing scans of the position of some collimators jaws  [8, 9, 11, 15, 19, 23, 24]. Afterwards, we try to adapt the models to a system in semi-stationary regime, characterised by a source evolving with time.

4.1 Moving the absorbing boundary condition inwards

Let us consider a system in equilibrium with a constant source \(\rho (I_0, t)=1\), and an absorbing boundary condition \(\rho (I_{\mathrm {a}}, t)=0\), and assume that the boundary condition is instantaneously moved inwards to \(\rho (I'_{\mathrm {a}}, t)=0\), with \(I_0< I'_{\mathrm {a}} < I_{\mathrm {a}}\). After this change, the equilibrium distribution varies and the new equilibrium distribution is given by

$$\begin{aligned} \rho '_{\text {eq}}(I) = \beta \int _I^{I'_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x, \end{aligned}$$
(22)

where \(\beta \) is a constant such that \(\rho '_{\text {eq}}(I_0)=1\), and when compared with the constant \(\alpha \) from Eq. (13), we have that \(\alpha < \beta \). The graphs of \(\rho _{\mathrm {eq}}\) and \(\rho '_{\mathrm {eq}}\) are shown in Fig. 3 (top).

To apply the analytical formulae presented in the previous section, we need to compute the difference distribution \(\rho ^*(I)\). Assuming that the original system starts from the equilibrium distribution in Eq. (13), we obtain

$$\begin{aligned} \rho ^*(I) = \rho _{\text {eq}}(I) - \rho '_{\text {eq}}(I)&= \alpha \int _I^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x - \beta \int _I^{I'_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x \nonumber \\&= \alpha \left( \int _{I}^{I'_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x + \int _{I'_{\mathrm {a}}}^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x \right) - \beta \int _I^{I'_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x \nonumber \\&= \alpha \int _{I'_{\mathrm {a}}}^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x \, - (\beta - \alpha ) \int _{I}^{I'_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x \nonumber \\&= \rho ^*_{\text {app}} - (\beta - \alpha ) \int _{I}^{I'_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x \, . \end{aligned}$$
(23)

The shape of \(\rho ^*(I)\) is shown in Fig. 3 (bottom). This function, restricted to the interval \(I \in [I_0, I'_{\mathrm {a}}]\), is monotonously increasing, with the maximum in \(I'_{\mathrm {a}}\). Given the Nekhoroshev-like form of the diffusion coefficient, the decrease to zero when \(I \rightarrow I_0\) is exponentially fast, while in the region close to \(I'_{\mathrm {a}}\), the function remains almost constant to the value \(\rho ^*_{\text {app}}\) that can be used as the lowest-order approximation of \(\rho ^*(I)\).

Fig. 3
figure 3

Top: Equilibrium distribution for \(I_{\mathrm {a}}/I_*= 1.0\) compared with the equilibrium distribution for \(I'_{\mathrm {a}}/I_*= 0.95\). Bottom: Difference between the two equilibrium distributions. (Simulations parameters: \(I_*= 1.0\,[\sigma ^2],\, \kappa = 0.33,\, I_0/I_*= 0.4\))

In Fig. 4, we compare the simulated current with its analytical estimate, obtained by computing the convolution with the distribution \(\rho ^*(I)\) of Eq. (23), which are in very good agreement (i.e. with a difference not greater than \(10\%\)). In the same figure, the analytical approximation based on the convolution with \(\rho ^*_{\text {app}}\) is shown, and even in this case the agreement is very good (i.e. with a difference not greater than \(10\%\)).

Fig. 4
figure 4

Comparison between the current generated by the inward displacement of the absorbing boundary condition shown in Fig. 3, its analytical estimate based on \(\rho ^*(I)\), and the analytical estimate based on \(\rho ^*_{\text {app}}\)

4.2 Moving the absorbing boundary condition outwards

Let us now consider a system in equilibrium with a constant source \(\rho (I_0, t)=1\), and an absorbing boundary condition \(\rho (I_{\mathrm {a}}, t)=0\), and assume that this boundary condition is instantaneously moved outwards to \(\rho (I''_{\mathrm {a}}, t)=0\), with \(I_0< I_{\mathrm {a}} < I''_{\mathrm {a}}\). The new equilibrium distribution is given by

$$\begin{aligned} \rho ''_{\text {eq}}(I) = \gamma \int _I^{I''_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x, \end{aligned}$$
(24)

where \(\gamma \) is a constant such that \(\rho ''_{\text {eq}}(I_0)=1\), and when compared with the constant \(\alpha \) from Eq. (13), we have that \(\gamma < \alpha \). The graphs of \(\rho _{\text {eq}}(I)\) and \(\rho ''_{\text {eq}}(I)\) are shown in Fig. 5 (top).

To define properly the difference distribution in the new interval \([I_0, I''_{\mathrm {a}}]\), we need to extend the definition of the equilibrium distribution \(\rho _{\text {eq}}(I)\), namely

$$\begin{aligned} \rho _{\text {eq}}(I) = \left\{ \begin{array}{lr} \alpha \displaystyle {\int _I^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x} \qquad &{} \text {if } \, I \le I_{\mathrm {a}} \\ \\ 0 \qquad &{} \text {if } \, I > I_{\mathrm {a}}, \end{array}\right. \end{aligned}$$
(25)

which leads to the following expression for the difference distribution

$$\begin{aligned} \rho ^*(I) = \left\{ \begin{array}{lr} - \gamma \displaystyle {\int _{I_{\mathrm {a}}}^{I''_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x + (\alpha - \gamma ) \int _{I}^{I_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x}\ \quad &{}\text {if} \, I \le I_{\mathrm {a}}\\ \\ - \gamma \displaystyle {\int _{I}^{I''_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x} \quad &{}\text {if} \, I > I_{\mathrm {a}}, \end{array}\right. \end{aligned}$$
(26)

which is a negative distribution, with a minimum at \(I_{\mathrm {a}}\) and with \(\rho ^*(I_0) = \rho ^*(I''_{\mathrm {a}}) = 0\).

A plot of \(\rho ^*(I)\) is shown in Fig. 5 (bottom), and we remark that this distribution leads to a negative outgoing current that needs to be combined with the stationary current from the equilibrium process for obtaining the actual outgoing current.

While in the interval \([I_0, I_{\mathrm {a}}]\) a constant approximated distribution function can be a reasonable assumption, in the interval \([I_{\mathrm {a}}, I''_{\mathrm {a}}]\) a different approximation is needed. Under the assumption that the outward step \(I''_{\mathrm {a}} - I_{\mathrm {a}}\) is small, a linear approximation from \(\rho ^*(I_{\mathrm {a}})\) to \(\rho ^*(I''_{\mathrm {a}})\) can be considered, namely

$$\begin{aligned} \rho ^*_{\text {app}}(I) = \left\{ \begin{array}{lr} - \gamma \displaystyle {\int _{I_{\mathrm {a}}}^{I''_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x} \quad &{}\text { if } \, I \le I_{\mathrm {a}}\\ \\ - \gamma \displaystyle {\left( \frac{I''_{\mathrm {a}} - I}{I''_{\mathrm {a}} - I_{\mathrm {a}}} \right) } \displaystyle {\int _{I_{\mathrm {a}}}^{I''_{\mathrm {a}}} \frac{1}{D(x)}\,\mathrm {d}x} \quad &{}\text { if } \, I > I_{\mathrm {a}} . \end{array}\right. \end{aligned}$$
(27)
Fig. 5
figure 5

Top: Equilibrium distribution for \(I_{\mathrm {a}}/I_*= 1.0\) compared with the equilibrium distribution for \(I''_{\mathrm {a}}/I_*= 1.05\). Bottom: Difference between the two distributions. (Simulations parameters: \(I_*= 1.0\,[\sigma ^2],\, \kappa = 0.33,\, I_0/I_*= 0.4\))

In Fig. 6, we compare the simulated current with its analytical estimate, obtained by computing the convolution with the distribution \(\rho ^*(I)\) of Eq. (26), which are in good agreement (i.e. with a difference not greater than 10–15\(\%\)). In the same figure, the analytical approximation based on the convolution with \(\rho ^*_{\text {app}}\) is shown, and even in this case the agreement is excellent (i.e. with a difference not greater than \(5\%\)).

Fig. 6
figure 6

Comparison between the current generated by the outward displacement of the absorbing boundary condition shown in Fig. 5, its analytical estimate based on \(\rho ^*(I)\), and the analytical estimate based on the approximation \(\rho ^*_{\text {app}}\)

4.3 Moving the absorbing boundary condition in a semi-stationary system

In Sect. 3.3, we have seen how it is possible to describe a diffusive process, after a transient time, as a semi-stationary process in which a stable core is being slowly eroded over an exponentially long time, with an approximated time scale given by Eq. (19). If the position of the absorbing boundary condition is changed when the system is in this semi-stationary state, and the new position is close to the original one, so that it is characterised by a time scale of the same order of magnitude, the stationary part of the system, i.e. the relaxed part outside of the stable core, will relax to a new configuration in a time that is short compared to the time scale of the stable-core erosion.

Being the time scale of the recovery current process orders of magnitude shorter than the evolution of the global current, the variation of the shape of the core is so slow that it can be neglected. Hence, one can treat this situation as a source at a fixed position with a slow-varying intensity \(\alpha (t)\).

4.3.1 Normalising a recovery current

Thanks to the previous assumptions, one can define a normalisation procedure to be applied to the recovery current to make it independent of the characteristics of the global current. We are interested in reducing the problem to the ideal case of a constant source at \(I_0\) and a constant unitary outgoing current at the absorbing boundary condition \(I_{\mathrm {a}}\), instead of a system with a slow-varying global current \(\alpha (t)\). This approach is tested by simulating the same Nekhoroshev-like FP system twice: firstly, by keeping the absorbing boundary fixed; secondly, by executing some instantaneous changes of the absorbing boundary position. With this approach, we gather information on the value of the semi-stationary current \(\alpha (t)\), thus enabling the transformation of the process with a moving boundary to a system with a fixed source.

We define the normalised recovery current as the current obtained in the measurement with the moving absorbing barrier divided by the current \(\alpha (t)\), obtained in the measurement with fixed boundary. The normalised recovery current has a unitary value when the absorbing boundary condition is not changed, and has normalised maximum and minimum, respectively, for the inward and outward movements of the absorbing boundary condition. The behaviour of the normalised recovery current can be related to the ideal stationary systems described above, for which analytical approximations are known.

In Fig. 7, an example of such a procedure is displayed (centre) together with the evolution of the outgoing current (top) and the corresponding variation of the position of the boundary condition (bottom). It is worth mentioning that for every change of \(I_{\mathrm {a}}\) the value of \(\alpha (t)\) changes according to Eq. (21), although for small variations of the absorbing boundary condition, a Taylor expansion can be applied.

Fig. 7
figure 7

Top: Evolution of the outgoing current for three diffusive processes with different boundary conditions. Middle: Evolution of the normalised outgoing current. Bottom: Changes to the absorbing boundary condition in the three scenarios. (Simulations parameters: \(I_*= 1.0\,[\sigma ^2], \, \kappa = 0.33\))

4.3.2 Normalising a recovery current without knowledge of the global current

Whenever it is not possible to repeat two complete measurements on the same process, i.e. one with and one without changes of the boundary condition position, the normalisation procedure defined previously needs to be adapted.

Ideally, the best strategy consists in waiting long enough after each change of the position of the absorbing boundary to reach an equilibrium and to accomplish the recovery process so that the outgoing current measured before the change of boundary position and after the long wait is a pure global current. This would approximately correspond to a complete relaxation of the difference distribution resulting from the boundary movement. Hence, in this way, the outgoing current can be used for reconstructing the shape of the global current and for the normalisation procedure.

However, some extra hurdles should be considered: since we do not have a prior knowledge of the value of D(I), we do not know the time scales of the recovery currents or those of the core-eroding process. Moreover, even though a good fraction of the recover process is achieved very quickly, a full recover, corresponding to a full relaxation of the difference distribution \(\rho ^*\), might take an exponentially long amount of time, possibly beyond computing capabilities. Hence, it might not be possible to perform such a long measurement in a particle accelerator. Therefore, it is necessary to define a protocol that enables quantitative criteria to establish whether or not an assumed recovery time is long enough to ensure a meaningful reconstruction of the behaviour of the FP process, possibly including an estimate of the uncertainty in the reconstruction of the global current.

A possible solution, compatible with these constraints, consists in the combination of three movements of the boundary condition, where, for each value of the action to be probed, an outward–inward–outward sequence of movements is performed. These three steps must be performed with a fixed movement size \(\Delta I\) and with a fixed relaxation time \(\Delta t\) between a boundary condition movement and the next one. The optimal values for \(\Delta I\) and \(\Delta t\) are discussed in the next section. A visualisation of this protocol is provided in Fig. 8 (bottom), where the three-step boundary condition change is highlighted and repeated three times, and the corresponding evolution of the outgoing current is given (top), as computed from numerical simulations. As a comparison, the situation corresponding to the constant position of the boundary condition is also shown.

We remark that variants of the proposed three-step movement are indeed possible, and that this proposal is also motivated by the wish not to introduce unnecessary complications. It is also important to stress that the assumption of performing small and equal movements of the absorbing barrier position for the three steps implies that also \(\Delta t\) should be the same for the steps, as the relaxation time should be approximately the same for all steps.

This three-step sequence of absorbing barrier changes is performed at different values of the global current, and this basic sequence can be repeated by performing it at different action values. The resulting sequence of alternating recovery currents provides an approximation of the evolution of the global current with a sequence of upper- and lower-bound values at different times, which can be interpolated and used for the construction of a global current estimate. These bounds provide a degree of uncertainty directly linked to the chosen value \(\Delta t\), as the longer \(\Delta t\) is, the lower the degree of uncertainty in the reconstruction of the global current is. A more detailed discussion on a possible quantitative definition of the optimal choice of the relaxation time scale \(\Delta t\), together with the effects of using shorter relaxation times, is discussed in the next section.

To reconstruct the global current, an upper- and lower-bound estimate are derived by considering the last values of the inward and outward recovery currents, respectively. Two extra points are added to the upper- and lower-bound estimate, with the goal of covering the maximum time span for reconstructing the global current: the last measured global current value before the first boundary movement is added to both estimates; the last value of the last recovery current measured, which, being an outward recovery current, was already part of the lower-bound estimate, is added also to the upper-bound estimate. This explains why in Fig. 9 (centre) the estimates coincide at the beginning and end of the interpolation interval. The two sets of upper-bound and lower-bound points are each interpolated with an univariate cubic spline and the average function of these two interpolating functions is taken as the estimate of the global current.

We remark that the univariate cubic spline is taken with a number of knots so that the second derivative does not change in sign. This ensures that the resulting global current estimate fulfils the expected features of the actual global current. In particular, it avoids local oscillations that might be generated by a simple interpolation of the upper-bound and lower-bound points. The result of such an approach is shown in Fig. 9 where a fraction of the data presented in Fig. 8 is used for reconstructing the global current, and an excellent overall agreement (i.e. with a difference not greater than \(5\%\)) with the actual global current is clearly visible.

Fig. 8
figure 8

Example of the proposed three-step protocol with a direct comparison between the condition with and without the variations in the position of the absorbing boundary condition. In this figure, the protocol is executed three times. The top plot shows the evolution of the outgoing current, while the bottom one shows the corresponding evolution of the position of the absorbing boundary condition. Note how the repetition of the three-step protocol moves progressively the absorbing boundary outwards. (Simulations parameters: \(I_*= 1.0\,[\sigma ^2],\,\kappa = 0.33\))

Fig. 9
figure 9

Example of the reconstruction process of the global current applied to a fraction of the data shown in Fig. 8. Top: Outgoing current from the process with constant boundary (dark blue) and with varying boundary conditions (light blue), along with the three components of the interpolation process. Middle: Relative difference, between the lower, average, or upper estimate of the global current and the true global current, of the interpolation procedure. Bottom: Comparison between the actual recovery current and the reconstructed one

4.4 Reconstructing D(I) from the normalised recovery currents

After performing the proposed reconstruction protocol, a series of normalised recovery currents, obtained for different positions of the boundary condition, are available. All these curves are then used to reconstruct the shape of D(I) via a fit procedure.

Thanks to the normalisation procedure, every normalised recovery current can be considered as an individual and independent relaxation process, as in a system in equilibrium with a fixed source. Therefore, we can consider as expected current the convolution of the analytical current, presented in Eq. (9), with one of our approximated difference distribution \(\rho ^*\), according to Eq. (11). From a normalised recovery current obtained from an inward movement, we expect a relaxation curve characterised by an equivalent process with an initial distribution given by Eq. (23), where the value of \(\rho ^*_{\text {app}}\) is computed considering \(\alpha =1\), due to the normalisation performed, the integral being computed over the appropriate action interval. Likewise, for a recovery current from an outward movement, we expect a curve characterised by an equivalent process with an initial distribution given by Eq. (27), where we consider \(\gamma =1\), due to the normalisation performed, the integral being computed over the appropriate action interval. Assuming a Nekhoroshev-like form for D(I), the goal is to determine the values of the two parameters \(I_*\) and \(\kappa \), which is obtained by a standard nonlinear least squares algorithm applied to the currents obtained during the execution of the proposed protocol. The strong nonlinearity of the functions involved in the least-square fit make the reconstruction of \(I_*\) and \(\kappa \) a difficult task, and alternative approaches have been tried. A possibility consists in performing a coarse scan of the \((I_*, \kappa )\) parameter space to identify an initial guess of the model parameters, and then perform a finer scan around the initial guess. In this approach, the distance between the numerical value of the recovery current and the one obtained from the analytical model for a given pair of \((I_*, \kappa )\) values is evaluated and the minimum provides either the initial guess of the parameters or their optimal value. This strategy has been successfully applied to the analysis of beam data reported in Ref. [25]. Another aspect of the fit is the strong correlation between the model parameters, typically of the order of a Pearson’s product-moment coefficient of 0.9, which is likely linked with the strongly nonlinear function to be minimised. The impact of the strong correlation between the model parameters can be indeed mitigated by the approach based on parameters scanning rather than searching for the minimum with standard routines to perform numerical optimisation.

5 Numerical results

To test the validity of the proposed procedure and to obtain a complete overview of its performance and limitations in the reconstruction of D(I), several numerical simulations of diffusive processes with a Nekhoroshev-like diffusion coefficient have been performed by using the protocol described in Sect. 4. Particular emphasis is given to establishing the reliability of the proposed procedure as a function of the values of \(\Delta I\) and \(\Delta t\) used in the protocol of variation of the position of the boundary conditions.

5.1 Simulation parameters

As an initial condition, we consider the distribution in Eq (5), and we remark that all action variables are dimensionless, and expressed either in units of beam sigma or in units of \(I_*\). We then consider a Nekhoroshev-like diffusive system characterised by the parameters obtained from the studies reported in Ref. [6], namely \(I_*= 20.0\,[\sigma ^2]\), \(\kappa = 0.33\). Such a system, as it can be seen from Figs. 1 and 2, is compatible with the semi-stationary regime and hence to the application of the proposed procedure.

Different values of the starting position \(I_{\mathrm {a}}/I_*\) of the absorbing boundary condition have been considered. Even though most of our assumptions are valid for the \(I_{\mathrm {a}}/I_*< 1\) regime, we consider also starting positions near \(I_*\) and beyond \(I_*\), i.e. in the saturation region of D(I), to evaluate how robust the method is in non-ideal conditions.

For each configuration, after an initial time delay when a semi-stationary regime is reached, ten repetitions of the three-step protocol (outward–inward–outward), displayed in Fig. 8, have been performed. Several values of \(\Delta I\), i.e. the action change of the boundary condition position, have been used to assess the presence of an optimal value for the reconstruction procedure. We remark that at the end of a simulation, the position of the absorbing boundary condition has moved from \(I_{\mathrm {a}}/I_*\) to \((I_{\mathrm {a}} + 10\Delta I) / I_*\).

Several values of the relaxation time \(\Delta t\) have been considered to assess the reconstruction performance under different levels of equilibrium. We remark that an empirical relaxation time has been defined as the time for which a normalised recovery current is expected to recover the \(99.9\%\) of the value of the original global current. Such an ideal time is computed using the full knowledge of D(I), using our analytic current estimate Eq. (9), and considering an outward movement of the absorbing boundary condition of size \(\Delta I\) from the initial position of the absorbing boundary. It is stressed that, in general, we should assume that such relaxation time is not known when reconstructing the value of the diffusion coefficient. It is also worth mentioning that a criterion based on a complete \(100\%\) recover of the global current cannot be used in practice, as this would require exponentially long simulation times, needed to reach the relaxation of the inner part of the distribution, with negligible differences with respect to the \(99.9\%\) case. Different fractions of this ideal time have been used when performing our procedure, and we evaluate how times shorter than the ideal relaxation time impact the quality of our final fit, as the system is still in a non-equilibrium regime when the next absorbing boundary movement occurs.

When working with the datasets generated by the various numerical simulations, a post-processing step on the normalised recovery currents is performed before executing the final fit procedure for reconstructing D(I). It consists in selecting a fraction of the data representing the normalised recovery currents, i.e. only the normalised recovery current data up to a given percentage of the full recovery. For example, if we decide to filter out the normalised data beyond the \(90\%\) recovery, it means that we discard values that are lower than 1.1 for inward normalised recovery currents and values that are higher than 0.9 for outward normalised recovering currents. We recall that, in the context of a normalised recovery current, a full recovery implies a value of 1.0 as normalised recovery current.

This post-processing step is displayed in Fig. 10, where two different values of the fraction of the relaxation time between boundary movements are used in the numerical simulations. In both simulations, the boundary movement starts after an equal waiting time. In the left plot, the normalised recovery currents, reported already in Fig. 9, are shown together with two different filtering levels. In the right plot, the same system is simulated using a shorter fraction of the relaxation time, and the recovery currents are shown together with the same filtering levels presented in the left plot. The much shorter time leads to only a partial recovery of the currents between boundary condition changes. For these sets of normalised recovery currents, the filtering levels displayed lead to almost no data reduction.

Fig. 10
figure 10

Left: normalised recovery current, shown already in Fig. 9, together with two filtering levels. The boundary movements are performed after an initial evolution time \(t=0.4 \, [\text {a. u.}]\), and the relaxation time \(\Delta t\) between one boundary movement and the next one is equal to \(\Delta t=0.58 \, [\text {a. u.}]\). Right: the same system is simulated with the same initial evolution time \(t=0.4 \, [\text {a. u.}]\) and one order of magnitude shorter relaxation time \(\Delta t=0.058 \, [\text {a. u.}]\), the resulting normalised recovery currents have not relaxed long enough to reach the \(95\%\) filtering level. When the selected filtering level is not reached by the normalised recovery currents, the whole dataset is used for the fit reconstruction and no parts are discarded

By selecting different levels of filtering data, it is possible to evaluate how this choice affects the accuracy of the D(I) reconstruction. It should be noted that our analytical approximation of Eq. (9) performs best when describing the evolution of a distribution near the absorbing boundary condition [35]. Furthermore, the recovery current features an exponential-like decay that makes the analytical approximation less accurate over long time scales. For this reason, probing the dependence of the reconstruction performance on the fraction of data selected is very relevant.

5.2 Analysis of the reconstruction performance

The numerical exploration of the FP process entails a scan over several simulation parameters, leading to a large hyperspace of possible configurations. For this reason, we focus on the most ideal configurations, i.e. those that provide the best reconstruction performance, and then show how the other parameters affect the reconstruction accuracy of \(I_*\) and \(\kappa \).

After each execution of the proposed three-step protocol described in Sect. 4 and shown in Fig. 8, we end up with two outward and one inward recovery currents. In every configuration explored, we observe better reconstruction results when considering only the recovery currents from the outward step. On the other hand, considering only the inward recovery currents or all currents simultaneously, poorer performance and numerical instabilities are observed. This is explained by the fact that when the position of the absorbing boundary is moved inwards, we are cutting in a distribution that is not necessarily in the perfect equilibrium configuration defined in our approximations. On the other hand, when we move the boundary condition outwards, we obtain a much more reliable observable of the distribution that populates the new available action interval, when evolving towards the new equilibrium state. It is possible to observe this behaviour in Fig. 11, where the relative error in the reconstruction of \(\kappa \) and \(I_*\) is shown for the three types of fit as a function of the fraction of the ideal relaxation time \(\Delta t\) for two values of \(I_{\mathrm {a}}/I_*\), representing the inner part of the stable-core region (left) and close to the change of regime of D(I) (right). In the inner region, even small fractions of the relaxation time provide a good reconstruction of the fit parameters (i.e. with a difference not greater than \(10-15\%\)). Furthermore, the three types of analysis, based on outward only, inward only, and inward and outward recovery currents, provide results with comparable accuracy for longer fractions of the relaxation time.

Fig. 11
figure 11

Fit results for \(I_*\) and \(\kappa \) as a function of the relaxation time \(\Delta t\) for two values of \(I_{\mathrm {a}}/I_*\), using different subsets of the numerical data. Left: for \(I_{\mathrm {a}}/I_*=0.4\), a good reconstruction performance (i.e. with a difference not greater than \(20\%\)) is observed even for short fractions of the ideal relaxation time. A rather similar performance is observed for the three types of analysis, the one based on the outward currents having the best performance. Right: for \(I_{\mathrm {a}} / I_*=0.8\), only the cases corresponding to longer fractions of the relaxation time feature a good performance. Moreover, only the analysis based on the outward currents is displayed, as the other two feature either failures or large errors in the fit. (Simulation parameters: initial \(I_{\mathrm {a}}/I_*=0.4\), boundary step \(\Delta I =0.1 \sigma ^2\), 10 repetitions of the three-step procedure, data up to a maximum current recovery of \(90\%\))

In the transition region, however, only longer fractions of the relaxation time provide a good reconstruction of the fit parameters (i.e. with a difference not greater than \(20\%\)) and the only applicable type of analysis is the one based on the outward recovery currents. The other two analyses feature either failures or larger errors in the fit, which are generated by the behaviour of the inward recovery current. Based on the observed behaviour, in the next plots we will only display results from the reconstruction based on the outward recovery currents. The reasons for the poor performance of the reconstruction of \(I_*\) and \(\kappa \) whenever inward recovery currents are considered is at least twofold. The first reason stems from the fact that by cutting the distribution with the inward movement of the boundary condition the system enters a non-equilibrium regime, in which the recovery current features sizeable variations. If enough time is elapsed, the system reaches a new equilibrium and the recovery current is much more reliable for the reconstruction of \(I_*\) and \(\kappa \), as observed in Fig. 11. The second reason is of purely numerical origin, but somewhat linked to the first one, as when an inward step is performed, the equilibrium distribution is cut and the sharp edge needs to be smoothed by applying a logistic function to the cut distribution (see the discussion in Appendix A). This has potential harmful effects on the generated recovery current, subsequently used to reconstruct the model parameters. Note that the first argument is even more applicable to the case of data from beam experiments, as observed from the data analyses carried out recently and discussed in Ref. [25].

In Fig 12, the reconstruction error for the two fit parameters as a function of the starting position of the absorbing boundary \(I_{\mathrm {a}}/I_*\) is shown.

Fig. 12
figure 12

Fit results for \(I_*\) and \(\kappa \) as a function of the initial value of \(I_{\mathrm {a}}/I_*\). The reconstruction performance is excellent for \(I_{\mathrm {a}}/I_*\le 1\), while for larger values the relative error increases. (Simulation parameters: boundary step \(\Delta I=0.1 \sigma ^2\), relaxation time \(\Delta t=0.5\), 10 repetitions of the three-step procedure, data up to a maximum current recovery of \(90\%\))

The performance is excellent for \(I_{\mathrm {a}}/I_*\le 1\) (i.e. with a difference not greater than \(5\%\)), whereas outside this region the reconstruction error increases. This behaviour is to be expected, as a recovery current carries mainly local information about D(I). Hence, if only the region \(I_{\mathrm {a}}/I_*> 1\) is sampled, the information about D(I) reflects only its quasi-linear regime (see Fig. 1). Such incomplete information inevitably affects the performance of the final fit, as it prevents an accurate reconstruction of the strongly nonlinear part of the diffusion coefficient. This result suggests also that, after having determined the fit parameters, one can verify whether the action interval explored was suitable for an accurate reconstruction of the functional form of the diffusion coefficient.

The plots in Fig. 12 provide some insight on the dependence of the reconstruction performance as a function of a single parameter while the others are kept fixed. In the following figures, however, the relative error of the reconstruction procedure is shown as a function of two parameters. The colour code represents the relative difference between the reconstructed (from the proposed protocol) and the true (used in the numerical simulations of the FP processes) values of \(I_*\) and \(\kappa \) that describe D(I). The scale is limited to a \(20\%\) relative difference, which is assumed as a threshold to identify a poor performance. Note that white cells represent cases in which the reconstruction procedure failed.

Figure 13 shows the relative error as a function of the cut of the recovery current performed during the post-processing and \(I_{\mathrm {a}}/I_*\). The performance of the reconstruction approach improves when the recovery currents are cut. This depends on the fact that our approach is local, i.e. accurate to describe the system’s behaviour close to the boundary condition. The longer the recovery time, the less local is the information gathered from the current. For this reason, the plots concerning the reconstruction performance are based on recovery currents cut at \(90\%\).

Fig. 13
figure 13

2D view of the reconstruction performance as a function of the cut in the recovery current, as applied in Fig. 10, and of the initial value of \(I_{\mathrm {a}}/I_*\). It is clearly seen how certain values of the cut provide a consistent increase in reconstruction performance. White regions indicate a failure in convergence in the final fit procedure. (Simulation parameters: relaxation time \(\Delta t=1\), boundary step \(\Delta I=0.1 \sigma ^2\), 10 repetitions of the three-step, data up to a maximum current recovery of \(90\%\))

As for the reconstruction performance as a function of the relaxation time \(\Delta t\), Fig. 14 shows the behaviour including the dependence on \(I_{\mathrm {a}}/I_*\). In this case, the longer the relaxation time, the better is the performance of the reconstruction. In particular, longer relaxation times allow a better reconstruction even for large values of \(I_{\mathrm {a}}/I_*\). It is worth highlighting that in the case of short relaxation times, a good overall performance can be achieved only by working at \(I/I_*\ll 1\).

Fig. 14
figure 14

2D view of the reconstruction performance as a function of the relaxation time \(\Delta t\) and the initial value of \(I_{\mathrm {a}}/I_*\). It is clearly seen how the reconstruction performance improves for longer relaxation times. However, the method proves to be rather robust for fractions of ideal time up to \(5\%\) provided \(I_{\mathrm {a}}/I_*< 0.6\). White regions indicate a failure in convergence in the final fit procedure. (Simulation parameters: boundary step \(\Delta I=0.1 \sigma ^2\), 10 repetitions of the three-step procedure, data up to a maximum current recovery of \(90\%\), if smaller values of \(\Delta t\) lead to a normalised recovery below \(90\%\), all the normalised recovery current data are used for the reconstruction)

Combining the results of the last two analyses, one concludes that the best approach for an accurate determination of \(I_*\) and \(\kappa \) consists in increasing the relaxation time between successive changes of the position of the boundary condition and cutting the data from the recovery currents.

Figure 15 shows the 2D plot of the reconstruction performance as a function of the number of repetitions of the three-step procedure and \(I_{\mathrm {a}}/I_*\). It can be seen with the higher number of repetitions, how the performance improves. This is naturally linked to the fact that repeating the three-step procedure implies sampling a larger extent of phase space, thus probing more accurately the behaviour of the diffusion coefficient as a function of the action. It is also clearly visible that starting from six repetitions of the three-step procedure, a good reconstruction is obtained for \(I_{\mathrm {a}}/I_*< 1\).

Fig. 15
figure 15

2D view of the reconstruction performance as a function of the number of three-step movements and of \(I_{\mathrm {a}}/I_*\) starting positions. It is clearly seen how the performance increases with the number of three-step movements, as larger regions of phase space are explored (as in Fig. 8). White regions indicate a failure in convergence in the final fit procedure. (Simulation parameters: relaxation time \(\Delta t=0.5 \, [\text {a. u.}]\), boundary step \(\Delta I=0.1 \sigma ^2\), which is \(\Delta I / I_*= 0.005\), data up to a maximum current recovery of \(90\%\) is considered)

Finally, the impact of \(\Delta I\) is shown in Fig. 16, where the performance as a function of \(\Delta I\) and \(I_{\mathrm {a}}/I_*\) is depicted. We see how the performance is not strongly affected by the choice of \(\Delta I\), i.e. relative error fluctuations are less than \(10\%\) for differences of an order of magnitude in \(\Delta I\). However, it is important to highlight two facts that might suggest a choice in the size of the change of position of the absorbing boundary condition: (1) the ideal relaxation time is directly proportional to the size of the absorbing boundary movement; (2) a too small \(\Delta I\) might lead to a too local sampling in action space, thus negatively affecting the final reconstruction of D(I).

Fig. 16
figure 16

2D view of the reconstruction performance as a function of \(\Delta I\) and \(I_{\mathrm {a}}/I_*\). The best performance is achieved for \(\Delta I = 0.005 \sigma ^2\), but the dependence on \(\Delta I\) is very weak (Simulation parameters: relaxation time \(\Delta t=0.5 \, [\text {a. u.}]\), 10 repetitions of the three-step procedure, data up to a maximum current recovery of \(90\%\))

6 Conclusions

Beam-halo scans, performed with movable collimators jaws, have been used intensively for probing the diffusive behaviour of the beam halo in circular accelerators and seems a very useful tool for probing this special regime of beam dynamics in the absence of beam instrumentation capable of providing diagnostic tools to study beam-halo dynamics.

The main result of this paper is the identification of an efficient protocol for probing the shape of a diffusion coefficient consistent with the stability time estimate of Nekhoroshev theorem. The protocol has been scrutinised by means of detailed numerical simulations, but it is clear that eventually it should be tested with beam measurement data. Two aspects should be highlighted: although the framework presented in this article is one-dimensional, i.e. considering nonlinear beam dynamics in one degree of freedom, we believe that it can be applied to cases representing systems with two degrees of freedom (as shown in Ref. [6]). Furthermore, the proposed approach does not rely on a previous knowledge of the beam distribution, which is a clear advantage for applications.

The proposed protocol relies on the idea that it is possible to separate the measured outgoing current into a global current, i.e. the general outgoing current loss that is measured from the exponentially slow erosion of the stable core of the beam, and a recovery current, i.e. the current following a change of the position of the boundary condition, which corresponds to a non-equilibrium state. By performing an alternating three-step sequence of outward–inward–outward boundary condition changes, which can easily be done by means of collimator scans, it is possible to reconstruct the global current of the erosion process and use that to normalise the recovery currents. Each normalised recovery current ultimately contains local information on the diffusion coefficient without the need of prior knowledge on the form of the initial distribution in action space, and can be used for estimating its global shape.

The performance of this protocol has been tested by means of a large number of numerical simulations of Fokker–Planck processes performed in various configurations, to evaluate the reliability and limits of our approach. The protocol proved to be capable of reconstructing with precision and good accuracy (i.e. with an error not greater than 10–15\(\%\)) the parameters of the diffusion coefficient when it is performed in a phase-space region where the diffusion coefficient has an exponential evolution, i.e. for \(I/I_*< 1\), the relaxation time between boundary condition changes is long enough so that the system reaches an equilibrium state, and multiple amplitudes have been probed. For this last condition, the optimal number of amplitudes to be sampled is highly dependent on the detail of the diffusion process, however, from the simulations it appears that about six sequences of three-step absorbing boundary changes covering the \(I / I_*< 1\) region is a good choice.

The analysis also highlighted how a good reconstruction performance can be achieved by considering only the outgoing recovery currents in the final fitting reconstruction, and by discarding part of the recovery current data beyond a certain level, as it is more prone to reconstruction errors and more difficult to characterise with our analytical formulas. It is worth stressing that the reconstruction performance proves to be good even if the optimal conditions are not fully met. Most importantly, the procedure provides useful information about possible shortcomings present in the dataset under consideration, such as a high uncertainty band in the global current reconstruction, or a reconstructed value of \(I_*\) that indicates that the probed phase-space region is outside of the optimal interval \(I / I_*< 1\). In these cases, the protocol should be reapplied in better conditions, e.g. by adjusting the range of actions probed to satisfy the condition \(I / I_*< 1\).

Thanks to the positive and encouraging results of the analysis presented here, we are confident that the measurement protocol is a powerful tool for probing the nonlinear diffusive behaviour in an accelerator like the LHC, although it should be stressed that it is of general applicability in any circular accelerator. Therefore, the logical next step is the proposal of a dedicated beam measurement, at the LHC or elsewhere, performed in the optimal conditions considered in this paper, which will complete the investigations presented in this paper. In the meantime, available data from collimator scans collected at the LHC (but not with the proposed protocol) have been analysed under the assumption of the proposed functional form for the diffusion coefficient. Very promising results have been obtained [25] that support pursuing this line of research.