1 Introduction

People search for evidence of dynamical scaling in systems such as the Ising model of magnetic spins, binary alloys [1, 2] and Bose-Einstein Condensates (BECs) [3]. A key prediction of the dynamical scaling hypothesis is that the correlation function, G(rt), between two points separated by a distance r, changes in time, t, only by a rescaling in length scale by \(L_{c}(t)\), where \(L_{c}(t)\) is a correlation length that depends on time only.

$$\begin{aligned} G(r,t)=G(r/L_{c}(t)). \end{aligned}$$
(1)

To test if this prediction is met, the correlation functions at different times are rescaled by \(L_{c}(t)\) and plotted on the same axes. If they collapse onto a single curve, this is evidence of dynamical scaling. Typically, this collapse is checked visually; however, a more rigorous, algorithmic test is preferable in order to determine the times at which dynamical scaling applies. In this paper, we outline an approach that makes use of the Mahalanobis distance [4] to quantify the deviation of a curve from the mean, eliminate outliers and identify the scaling region.

When dynamical scaling holds, the dependence of correlation length on time is predicted to be a power law of the form:

$$\begin{aligned} L_{c}(t)\sim t^{1/z}, \end{aligned}$$
(2)

where z is the dynamical critical exponent and is expected to have a value of two for a two-dimensional system with a non-conserved order parameter [1, 2].

A recent numerical study of coarsening dynamics, following the rapid quench of a Bose gas into the ordered phase, found clear evidence of dynamical scaling [3]. The values of z found were close to two but dependent upon dissipation, parameterized by a dimensionless constant, \(\gamma\). The authors of this work observed that for non-conservative dynamics, the relevant universality class is Model A, with \(z=2\) [5] but for energy-conserving dynamics at zero dissipation, the choice of universality class remains an open question. This study used the projected Gross–Pitaevskii equation (PGPE) and the stochastic projected Gross–Pitaevskii equation (SPGPE) to model the evolution of the wavefunction \(\psi ({\textbf{r}},t)\), both in the absence and the presence of dissipation. They observed growing regions of constant phase following the quench, as quantum vortices and antivortices annihilated, as shown in Fig. 1. They found the correlation functions at different times using the wavefunction and observed them to collapse, within a given scaling window, onto a single curve once rescaled by \(L_{c}(t)\). Their method for identifying the scaling window was to judge by eye initially and later check that the maximum discrepancy between rescaled correlation functions was sufficiently small.

An earlier study [6], simulating a similar system using a truncated Wigner approach, also found evidence of universal scaling behaviour in the time evolution of the single-particle momentum spectrum. They selected a scaling window by inspecting the rescaled spectra and found a value of \(z=1.8(3)\). They also observed that different choices of initial conditions can access different scaling regimes. For instance, when starting with a rectangular lattice of alternating, multiply charged vortex clusters, they observed scaling behaviour at a non-thermal fixed point with an anomalous exponent of \(z \approx 5\).

Fig. 1
figure 1

Evolution of the phase of the field \(\psi\) of a BEC in the case of zero dissipation, reproduced from [3] under CC-BY\(-\)4.0 international license (https://creativecommons.org/licenses/by/4.0/). Distances are quoted in terms of the healing length, \(\xi =\hbar /\sqrt{m\mu }\), and times are given in terms of \(\tau =\hbar /\mu\). These are the characteristic length and time scales used when solving the Gross–Pitaevskii equation, where m is the atomic mass, \(\hbar\) is the reduced Planck constant, and \(\mu\) is the chemical potential. The BEC was modelled using the projected Gross–Pitaevskii equation (PGPE) in a doubly periodic square box of width \(\approx 363\xi\). The BEC was created in a far from equilibrium configuration with a high density of quantized vortices and antivortices. It then “relaxes”, in this case through annihilation of vortex-antivortex pairs. (a), (b) and (c) correspond to times \(t \approx \{ 200,2000,20000 \}\tau\), respectively. The open white squares show the positions of vortices (positive circulation), the filled black squares show the positions of antivortices (negative circulation) and the background colour indicates the phase

To illustrate our method to test for the collapse of rescaled correlation functions, we also consider a two-dimensional quantum fluid. However, rather than simulate the system using the Gross–Pitaevskii equation (GPE) [7, 8], we use the point vortex model (PVM) instead [9, 10]. The PVM is often used to simulate dynamics in two-dimensional quantum fluids [11,12,13] such as those formed in ultracold atomic gases [14, 15]. Although vortices in atomic gases are not point-like and the gas itself is compressible, the PVM can give reasonably accurate predictions for vortex behaviour. It also benefits over the more directly applicable GPE because only the coordinates of the vortices need tracking and not the quantum mechanical wavefunction at every grid-point. Consequently, it is computationally less expensive and makes simulations of larger systems possible. The structure of this paper is as follows: Sect. 2 describes how data for the out of equilibrium dynamics of a two-dimensional quantum fluid is generated using a dissipative PVM. Section 3 details how a two-point correlation function is calculated and rescaled and how the scaling region is determined using a method based on the Mahalanobis distance. Section 4 summarises the main findings and suggests some possibilities for future work using this method.

2 Generating Data Using the Point Vortex Model (PVM)

2.1 The PVM on an Infinite Plane

The PVM applies to two-dimensional incompressible fluids with zero viscosity and assumes that vorticity is confined to delta-function-like points [9]. Each vortex is advected by its local fluid velocity, which is made up of contributions from each of the other vortices. Consequently, the equations of motion for vortex i, of circulation, \(\kappa _{i}\), at position \((x_{i},y_{i})\), in a system of \(N_{v}\) point vortices are:

$$\begin{aligned} \frac{d x_{i}}{dt} =-\frac{1}{2\pi }\sum _{j=1,j\ne i}^{N_{v}}\frac{\kappa _{j}y_{ij}}{|{\textbf{r}}_{ij}|^2},\,\, \frac{d y_{i}}{dt} =\frac{1}{2\pi }\sum _{j=1,j\ne i}^{N_{v}}\frac{\kappa _{j}x_{ij}}{|{\textbf{r}}_{ij}|^2}. \end{aligned}$$
(3)

Where \(\kappa _{j}\) and \((x_{j},y_{j})\) are the circulations and positions of all the vortices other than i and \(x_{ij}=x_{i}-x_{j}\), \(y_{ij}=y_{i}-y_{j}\) and \({\textbf{r}}_{ij}=(x_{ij},y_{ij})\). This result may also be derived from the Hamiltonian [10]:

$$\begin{aligned} H=-\frac{1}{4\pi } \sum _{i=1}^{N_{v}}\sum _{j=1,j\ne i}^{N_{v}}\kappa _i\kappa _j \ln {|{\textbf{r}}_{ij}|}, \end{aligned}$$
(4)

in which the double sum adds contributions from all pairs of vortices.

In the case of quantum fluids, vortex circulations are quantized and take only the values of \(\pm h/m\), where h is the Planck constant, and m is the mass of an atom. When modelling with the GPE, the natural units to use are the healing length units. Distances are measured in terms of the healing length, \(\xi =\hbar /\sqrt{m\mu }\), and times in terms of, \(\tau =\hbar /\mu\), where \(\mu\) is the chemical potential. In these units, the circulations are \(\pm 2\pi\). We refer to a vortex of circulation \(+2\pi\) as a vortex and a vortex of circulation \(-2\pi\) as an antivortex.

2.2 A Dissipative PVM in a Doubly Periodic Square Box

To model the dynamics of the vortices, we use a doubly periodic square box of length \(L=2048\xi\). To account for interactions between vortices across the periodic boundaries, we use the following equations [16]:

$$\begin{aligned} \frac{d{{\tilde{x}}_{i}}}{dt}= & {} \sum _{j=1,j\ne i}^{N_{v}} \kappa _j\sum _{m=-\infty }^{\infty } \frac{-\sin ({\tilde{y}}_{ij})}{\cosh ({\tilde{x}}_{ij}-2\pi m)-\cos ({\tilde{y}}_{ij})}\,. \end{aligned}$$
(5)
$$\begin{aligned} \frac{d{{\tilde{y}}_{i}}}{dt}= & {} \sum _{j=1,j\ne i}^{N_{v}} \kappa _j\sum _{m=-\infty }^{\infty } \frac{\sin ({\tilde{x}}_{ij})}{\cosh ({\tilde{y}}_{ij}-2\pi m)-\cos ({\tilde{x}}_{ij})}\,. \end{aligned}$$
(6)

As above, the circulation of vortex i is \(\kappa _{i}\) but its coordinates, \((x_{i},y_{i})\), are rescaled by \(2\pi /L\) to give \(({\tilde{x}}_{i},{\tilde{y}}_{i})\), so that in these units, the box has a length of \(2\pi\). \({\tilde{x}}_{i}-{\tilde{x}}_{j}\) and \({\tilde{y}}_{i}-{\tilde{y}}_{j}\) are written as \({\tilde{x}}_{ij}\) and \({\tilde{y}}_{ij}\). The time units are also scaled to give \(\kappa _{i}=\pm 1\). The first sum is over all vortices except for vortex i and the second is over the integer m. Since the term in this second sum falls with increasing m, an excellent level of precision is achieved by curtailing the sum to be from \(m=-10\) to \(m=+10\).

We use a Dormand-Prince 8th Order Runge–Kutta algorithm [17] to solve these equations of motion, with an absolute tolerance of \(1\times 10^{-8}\). This gives us a non-dissipative velocity, \({\textbf{v}}_{i}=(d{\tilde{x}}_{i}/dt,d{\tilde{y}}_{i}/dt)\), for each vortex. To include the effects of dissipation, we add a dissipative component at right angles to this to give the overall velocity, including dissipation, \({\textbf{v}}_{i}^{{\textrm{diss}}}={\textbf{v}}_{i}-\gamma \kappa _{i}\hat{{\textbf{z}}}\times {\textbf{v}}_{i}\), [12]. The values of \(\gamma\) we use are \(\{2^{-8},2^{-7},...,2^{-1},1,\infty \}\), where \(\gamma \rightarrow \infty\) is the purely dissipative case. For the purposes of our simulations, in order to mimic the effect of infinite dissipation, we keep \(\gamma = 1\) but remove the non-dissipative velocity so that \({\textbf{v}}_{i}^{{\textrm{diss}}}=-\kappa _{i}\hat{{\textbf{z}}}\times {\textbf{v}}_{i}\).

A final key aspect of vortex dynamics that we add to the simulation is the annihilation of vortices and antivortices that come into too close proximity. This is observed in experiments [18] and GPE simulations [19], is a feature of other point vortex models [20, 21] and is the main mechanism by which phase ordering takes place. To include this in our dissipative PVM, at each time-step, we remove any vortex-antivortex pair that are within \(1\xi\) of each other.

2.3 Generating Initial Conditions

The initial arrangement of vortices and antivortices affects the dynamics that follow. For example, an isolated vortex-antivortex pair, known as a dipole, will move in a straight line, perpendicular to the line joining the vortices. Alternatively, a cluster made up only of vortices (or only of antivortices) will tend to rotate about its centre, so long as no other vortices are near. The effect of dissipation on dipoles is to draw the constituent vortex and antivortex closer together over time, whereas it tends to scatter clusters apart. Therefore, when generating multiple realisations of the initial conditions for repeat runs of the point vortex simulations, it is vital to ensure they have similar distributions of dipoles, clusters and free vortices. To achieve this, we note that the Hamiltonian, \(H_{\square }\), for a system of point vortices in a doubly periodic square box [16], gives an unambiguous parameter for measuring vortex configurations:

$$\begin{aligned} H_{\square }=-\sum _{i=1}^{N_{v}}\sum _{j=1,j \ne i}^{N_{v}} \frac{\kappa _i \kappa _j}{2}\sum _{m=-\infty }^{\infty } \ln {\left( \frac{\cosh {{\tilde{x}}_{ij}-2\pi m}-\cos {{\tilde{y}}_{ij}}}{\cosh {2\pi m}}\right) }-\frac{{\tilde{x}}_{ij}^2}{2\pi }\,. \end{aligned}$$
(7)

In this equation, all symbols have the same meanings as in Eq. 5 & 6. The double sum at the beginning adds contributions from all pairs of vortices and, as before, an excellent level of precision is achieved by curtailing the sum over m to be from \(m=-10\) to \(m=+10\). Calculating this value for the initial configuration and dividing the result by the number of vortices, \(N_{v}\), gives the initial energy per vortex \(E^{0}/N_{v}\). Large positive values of \(E^{0}/N_{v}\) are associated with the formation of clusters of like-signed vortices and large negative values correspond to the pairing of vortices and antivortices into dipoles.

To create initial conditions with specified values of \(E^{0}/N_{v}\), we follow an approach similar to [22, 23] by first scattering 2069 vortices and 2069 antivortices in the box, then employing a biased random walk algorithm. In this algorithm, the positions of vortices are updated at random and these updated positions accepted only if they bring \(E^{0}/N_{v}\) closer to the desired value. Once the desired values are achieved to within a \(1\%\) tolerance, further steps are undertaken in order to thermalize the configuration. In each step, two vortices are randomly selected and moved by different, random amounts. If \(E^{0}/N_{v}\) remains within the tolerance, the step is accepted. Throughout all of this process, changes that bring vortices closer than \(1\xi\) are rejected.

Using this approach, we create 100 stochastic realisations of vortex coordinates for each value of \(E^{0}/N_{v}=\{-4,-3,-2,-1,0.001,1,2,3,4\}\pm 1\%\). These provide the initial conditions for our dissipative PVM.

3 A Method for Determining the Scaling Region

3.1 Constructing the Velocity Field and Correlation Function

In order to demonstrate dynamical scaling, a two-point correlation function is generally calculated using a relevant scalar order parameter. In GPE simulations, this may be the quantum mechanical phase or the fluid density; in the Ising model, it is the magnetization; in our case, we use the speed of the fluid. To find this, we first construct the velocity field from the coordinates of the point vortices. We consider a \(100\times 100\) grid of points \(({\tilde{x}}_{g},{\tilde{y}}_{g})\), filling the square box of length \(2\pi\) and find the velocity of the fluid at each grid point, \({\textbf{v}}=(v_{{\tilde{x}}},v_{{\tilde{y}}})\). This is done by summing the contributions, at that location, of all of the point vortices, whilst accounting for the periodic boundary conditions [16]:

$$\begin{aligned} v_{{\tilde{x}}}({\tilde{x}}_{g},{\tilde{y}}_{g})= & {} \sum _{i} \kappa _i\sum _{m=-\infty }^{\infty } \frac{-\sin ({\tilde{y}}_{g}-{\tilde{y}}_{i})}{\cosh ({\tilde{x}}_{g}-{\tilde{x}}_{i}-2\pi m)-\cos ({\tilde{y}}_{g}-{\tilde{y}}_{i})}, \end{aligned}$$
(8)
$$\begin{aligned} v_{{\tilde{y}}}({\tilde{x}}_{g},{\tilde{y}}_{g})= & {} \sum _{i} \kappa _i\sum _{m=-\infty }^{\infty } \frac{\sin ({\tilde{x}}_{g}-{\tilde{x}}_{i})}{\cosh ({\tilde{y}}_{g}-{\tilde{y}}_{i}-2\pi m)-\cos ({\tilde{x}}_{g}-{\tilde{x}}_{i})}. \end{aligned}$$
(9)

Eq. 8 & 9 are almost the same as the non-dissipative point vortex equations of motion, Eq. 5 & 6, except for two differences; the sum is over all of the vortices and the coordinates, \(({\tilde{x}}_{g},{\tilde{y}}_{g})\), are those of a grid point and not those of a vortex. This is because the point vortex equations arise from considering the contributions of all other vortices to the fluid velocity at that point and asserting that, in the absence of dissipation, the vortex moves at the local fluid velocity. See Fig. 2a–c for examples of the velocity field constructed from the point vortex coordinates in this fashion .Footnote 1

Using the velocity, \({\textbf{v}}=(v_{{\tilde{x}}},v_{{\tilde{y}}})\), we find the corrected speed at each grid point, \(v_{c}\), from the difference between the speed, \(|{\textbf{v}}|\), and the mean speed taken across the whole grid, \(\langle |{\textbf{v}}|\rangle\):

$$\begin{aligned} v_{c}=|{\textbf{v}}|-\langle |{\textbf{v}}| \rangle . \end{aligned}$$
(10)

This is the scalar order parameter we use to find the two-point correlation function and ultimately provides the basis for demonstrating dynamical scaling.

Fig. 2
figure 2

Fluid velocity calculated from point vortex configurations and two-point correlation functions for the initial conditions \(\gamma =1\), \(E^{0}/N_{v}=4\). ac Open (white) circles show the locations of vortices and filled (blue) circles show the locations of antivortices. The pale red streamlines show the fluid velocity at the times \(t=\{4200,13200,32700\}\tau\). df Are the two-point correlation function G(r) calculated from the corrected speed at the same times

The correlation function, G, for the corrected speed, \(v_{c}\), between two points separated by a displacement \(({\tilde{x}},{\tilde{y}})\), is given by:

$$\begin{aligned} G({\tilde{x}},{\tilde{y}})=\frac{\sum _{i}\sum _{j} v_{c}({\tilde{x}}_{i},{\tilde{y}}_{j}) v_{c}({\tilde{x}}_{i}-{\tilde{x}},{\tilde{y}}_{j}-{\tilde{y}})}{\sum _{i}\sum _{j} v_{c}({\tilde{x}}_{i},{\tilde{y}}_{j})^{2}}. \end{aligned}$$
(11)

Where the sum over i is across all grid points in the \({\tilde{x}}\) direction, the sum over j is for all those in the \({\tilde{y}}\) direction and the denominator ensures normalisation such that \(G(0,0)=1\). The Wiener–Khinchin theorem [24] provides a more succinct, and computationally more efficient, formula in terms of Fourier transforms:

$$\begin{aligned} G({\tilde{x}},{\tilde{y}})={\mathcal {F}}^{-1}[|{\mathcal {F}}(v_{c})|^2]. \end{aligned}$$

To convert from \(G({\tilde{x}},{\tilde{y}})\) to a one-dimensional \(G({\tilde{r}})\), we consider nested annuli of thickness, \(\delta {\tilde{r}}\), where \(\delta {\tilde{r}}\) is the distance between adjacent grid points and \({\tilde{r}}^{2}={\tilde{x}}^{2}+{\tilde{y}}^{2}\). We then find \(G({\tilde{r}})\) by calculating the mean value of \(G({\tilde{x}},{\tilde{y}})\) across all the grid points in the annulus from \({\tilde{r}}\) to \({\tilde{r}}+\delta {\tilde{r}}\). Finally, we multiply the distances by \(L/2\pi\) to return to the original length scale used for our system and recover G(r). We repeat this for each time-step, for all 100 stochastic realisations and for the whole ensemble of initial conditions.

3.2 Rescaling the Correlation Function and Testing for Dynamical Scaling

The theory of dynamical scaling predicts that the correlation function, G(rt), should vary only by a change in length scale as time progresses. If this is the case, finding a suitable length at each time-step and rescaling the distances by this length, should cause the plots of G(r) at different times to collapse onto a single curve.

The process we use to rescale the correlation function for a given set of initial conditions is as follows:

  1. 1.

    Consider one time-step and find the mean values of G(r) across the 100 stochastic realisations (from here on G should be understood as the average over these realisations).

  2. 2.

    Use cubic spline interpolation to find the radius at which \(G(r)=0.1\). We define this as the correlation length at this time-step, \(L_{c}(t)\). (We use 0.1 for our data as it gives sufficient points, at both smaller and larger radii, to ensure a reliable interpolation).

  3. 3.

    Rescale the values of radius by dividing them by \(L_{c}(t)\).

  4. 4.

    Repeat the steps 1-3 for all time-steps.

This gives arrays of data for G and \(r/L_{c}\) at each time-step. Simply plotting G against \(r/L_{c}\) allows us to check visually if the curves for different time-steps collapse. However, a more systematic approach is desired to determine the start and end of any period of dynamical scaling in a robust and reliable fashion. The method we implement to test for collapse of the different curves is:

  1. 1.

    For every time-step, use spline interpolation to find the values of G on the same uniform grid of values of \(r/L_{c}\). Use \(N_{g}\) points in the range from the smallest value of \(r/L_{c}(t)\) for any time-step up to \(r/L_{c}(t)=5\). By this point, the values of G should be very close to zero in all cases, so continuing further is unnecessary. We use \(N_{g}=40\).

  2. 2.

    For each time-step, there are now \(N_{g}\) values of G. Therefore, each time-step can now be represented by a point in an \(N_{g}\)-dimensional Euclidean space:

    $$\begin{aligned} {\textbf{G}}^{i}=(G_{1}^{i},G_{2}^{i},...,G_{N_{g}}^{i}), \end{aligned}$$
    (12)

    where \({\textbf{G}}^{i}\) is the vector position representing the correlation function at time-step i and \((G_{1}^{i},G_{2}^{i},...,G_{N_{g}}^{i})\) are the coordinates in each of the dimensions (i.e. the values of G on the grid of \(N_{g}\) radii). The problem is now one of determining which time-steps are outliers and which are not, see Fig. 3.

  3. 3.

    Find the mean, \(\varvec{\mu }\), and the covariance, \({\textbf{C}}\), of \({\textbf{G}}^{i}\) across all of the time-steps. \(\varvec{\mu }\) is a vector of length \(N_{g}\), and \({\textbf{C}}\) is a matrix of size \(N_{g}\times N_{g}\).

  4. 4.

    The squared deviation of a point, \({\textbf{G}}^{i}\), from the mean, \(\varvec{\mu }\), normalised by the covariance between the data from the original curves, is given by the Mahalanobis distance squared, \(MD_{i}^{2}\), [4]:

    $$\begin{aligned} MD_{i}^{2}=({\textbf{G}}^{i}-\varvec{\mu }) {\textbf{C}}^{-1}({\textbf{G}}^{i}-\varvec{\mu })^{T}. \end{aligned}$$
    (13)

    Calculate \(MD_{i}^{2}\) for each time-step and order them from largest to smallest. Then, to identify and eliminate outliers:

  5. 5.

    Choose the time-step with the largest value of \(MD_{i}^{2}\) and recalculate \(\varvec{\mu }\) and \({\textbf{C}}\) without it (i.e. treat it as an outlier).

  6. 6.

    Recalculate \(MD_{i}^{2}\) for the suspected outlier using the new \(\varvec{\mu }\) and \({\textbf{C}}\). If the value is below a cutoff (see discussion below), this time-step is not an outlier and the process is stopped. If it is above the cutoff, this time-step is identified as an outlier and removed from future consideration.

  7. 7.

    Recalculate \(MD_{i}^{2}\) for all the other points, with the previously identified outlier(s) excluded and order these values from largest to smallest.

  8. 8.

    Identify the time-step with the new largest value of \(MD_{i}^{2}\) and repeat steps 5-7.

  9. 9.

    Continue iteratively until a suspected outlier has \(MD_{i}^{2}\) less than the cutoff, at which point all outliers have been identified.

  10. 10.

    All remaining time-steps are considered to overlap. The scaling region is then the longest stretch of uninterrupted time-steps not containing any outliers. See Fig. 4 for an example.

Fig. 3
figure 3

Representing curves as points in an \(N_{g}\)-dimensional Euclidean space. a Five curves G(r) plotted on a grid of three points \({r_{1},r_{2},r_{3}}\). b The same curves represented by points in a three-dimensional Euclidean space. Similar curves, such as those shown with red circles, green squares, blue diamonds and magenta triangles, become points that are clustered close together; whilst a very different curve, like the one shown with orange stars, becomes a point very far from the others. To identify an outlier, we need to quantify the deviation, \(\Delta\), of a suspected point from the mean position of all the other points. We use the Mahalanobis distance, in the \(N_{g}\)-dimensional Euclidean space, to do this

Fig. 4
figure 4

Identifying the scaling region and determining z for the initial conditions \(\gamma =1,\,E^{0}/N_{v}=4\). a Shows the two-point correlation function G(r) for each time-step. b Shows G(r) with the distances rescaled by \(L_{c}\), where \(L_{c}\) is the value of r when the unscaled \(G(r)=0.1\). In both (a) and (b) those time-steps identified as within the scaling region are plotted as solid red lines, getting darker as time progresses, and those outside of the scaling region are plotted as grey dashed lines. In the rescaled plots, (b), all curves in the scaling region overlap. c Shows the data for correlation length against time plotted as grey crosses, the bars show the standard error in \(L_{c}\) calculated across the 100 stochastic realisations at each time-step. The red line is a power law \(L_{c}\sim t^{1/z}\), with \(z=1.985\pm 0.003\) determined using a bootstrap method [25] in which we resample \(L_{c}(t)\) 100 times, conduct a power law fit each time and find the mean and standard error in z across the resamplings. (d) Illustrates the time-steps identified as outliers as black blocks in the bottom line and those in the scaling region as red blocks on the top line

The choice of cutoff for determining outliers is a slightly subtle one. For example, the \(\chi ^{2}\) distribution for \(N_{g}\) degrees of fredom is the distribution of the sum of the squares of \(N_{g}\) independent, standard normal random variables. If the values of \({\textbf{G}}^{i}\) at each radius were independent and normally distributed, then, we would expect \(MD_{i}^{2}\) to follow a \(\chi ^{2}\) distribution and the critical \(\chi ^{2}\) value for a suitable significance level with \(N_{g}\) degrees of freedom would be an appropriate choice of cutoff. However, our data are not normally distributed, so instead we use a cutoff of \(4\times N_{g}\), where \(N_{g}\) is the number of grid points. The logic behind this decision is that for the case in which \({\textbf{G}}^{i}\) at each radius varies independently of every other radius, the covariance matrix is diagonal and \(MD_{i}^{2}\) becomes a sum of similar terms:

$$\begin{aligned} MD_{i}^{2}=({\textbf{G}}^{i}-\varvec{\mu }) \begin{pmatrix} 1/\sigma _{1}^{2} &{} 0 &{}. &{}. &{} 0\\ 0 &{} 1/\sigma _{2}^{2} &{}. &{}. &{} 0\\ . &{}. &{}. &{}. &{}.\\ . &{}. &{}. &{}. &{}.\\ 0 &{} 0 &{}. &{}. &{} 1/\sigma _{N_{g}}^{2} \end{pmatrix} ({\textbf{G}}^{i}-\varvec{\mu })^{T}\,= \sum _{k=1}^{N_{g}}\left( \frac{G^{i}_{k}-\mu _{k}}{\sigma _{k}}\right) ^2. \end{aligned}$$
(14)

So, if a hypothetical curve has every point one standard deviation from the mean, then \(MD^{2}=\sum _{k=1}^{N_{g}}1^{2}=N_{g}\), whereas if each point is two standard deviations from the mean then \(MD^{2}=\sum _{k=1}^{N_{g}}2^{2}=4N_{g}\). We consider this a reasonable choice of cutoff, whilst recognising that our values of \({\textbf{G}}^{i}\) at each radius are not, in general, independent. However, a lower value could be used if a stricter definition of collapse is preferred. The cutoff is the one free parameter in this approach and plays a similar role to the significance level in hypothesis testing. Figure 5a shows how the choice of cutoff affects the percentage of time-steps identified as within the scaling region and consequently the values of dynamical critical exponent determined from the scaling region data.

3.3 The Dynamical Critical Exponent

To calculate values for the dynamical critical exponent, z, we conduct a least squares fit of the power law \(L_{c}\sim t^{1/z}\) to the data \(L_{c}(t)\) for just the times within the scaling region. By identifying the scaling region in a robust fashion, with a suitable choice of cutoff, prior to conducting the fit, we can be more confident that the predicted power law relationship is valid and the value of z found is an accurate measure of the dynamical critical exponent of the system. Figure 5b shows how the value of z, determined in this way, varies with the level of dissipation, \(\gamma\), for initial conditions with \(E^{0}/N_{v}=4\). In this case, we observe qualitatively similar results to those reported in [3], namely that there is a change in the critical exponent as we move from dissipative dynamics at high \(\gamma\) towards energy-conserving behaviour as \(\gamma \rightarrow 0\). As described in [3], there is no agreement in the literature as to what is the correct scaling model for a zero dissipation, two-dimensional quantum fluid. However, it seems likely that any change in z as \(\gamma \rightarrow 0\) is linked to the introduction of energy as a conserved quantity and the different dynamics at low \(\gamma\), in which each vortex interacts with many other vortices prior to annihilation.

Fig. 5
figure 5

Determining the dynamical critical exponent, z, for \(E^{0}/N_{v}=4\). a The black crosses (left-hand axis) show how the value of z varies with the choice of cutoff for \(\gamma =1\) (errorbars are not shown as they are either too large, for cutoff \(< 3N_{g}\), or too small, for cutoff \(\ge 3N_{g}\)). The red diamonds (right-hand axis) show how the % of time-steps identified as within the scaling region varies. Using a cutoff of less than \(3N_{g}\) is problematic as only a tiny fraction of time-steps are within the scaling region and the fit is unreliable. b The black crosses (left-hand axis) show how the value of z varies with the dissipation, \(\gamma\), for a cutoff of \(4N_{g}\) (errorbars would be too small to see on this scale). The red diamonds (right-hand axis) show the corresponding % of time-steps in the scaling region. A large scaling region is identified for all \(\gamma\) and \(z\approx 2\) but dependent upon \(\gamma\), a qualitatively similar result to that reported in [3]. In all cases, we determine z using the same bootstrap method described in Fig. 4

4 Conclusions

The main aim of this paper has been to introduce a robust, algorithmic method for determining the scaling region when investigating phase-ordering behaviour. To this end, we have described an approach, based on the concept of Mahalanobis distance, for identifying outliers when comparing graphs of rescaled correlation functions. By eliminating those times for which the curves do not collapse onto one single curve, our method gives a reliable identification of the scaling region. Any further analysis of the data, such a power law fit, may then be conducted with confidence that only scaling data is being used.

We have demonstrated how our method may be applied to the phase-ordering behaviour of a quantum fluid following a rapid quench by using data generated using a dissipative PVM. This produced results that correspond qualitatively and quantitatively with those from other studies that make use of GPE simulations and visual identification of the scaling region (with subsequent checks) [3, 6]. In particular, our method proved suitable for probing the effects of varying dissipation on the dynamical critical exponent. It should also allow investigation of the impact of changing initial conditions, similar to the results found in [6]. Further work could include an application of this approach to the correlation functions for a wider ensemble of initial conditions, to the results of GPE simulations or to studies of non-equilibrium behaviours of systems outside of the field of quantum fluids.