1 Introduction

Homogeneous cosmological models have successfully explained many important features of our universe. However, we know that the distribution of matter is not homogeneous and so these models are only an approximation. In the last decade modelling of inhomogeneity in cosmology has become a topic of substantial interest. There are several different approaches to the problem. Due to the nonlinear nature of Einstein equations one should not rely on perturbation theory completely therefore  exact models with nonuniform distribution of matter should be considered as well. Among the most studied exact inhomogeneous solutions of Einstein equations belong Lemaitre-Tolman-Bondi (LTB) metric [1], Szekeres solution [2], Szafron family of solutions [3], Stephani solution [4] or Lemaitre metric [1], which is a generalization of LTB for a fluid with nonzero pressure. An overview of inhomogeneous cosmological solutions can be found in [5].

LTB metric was extensively studied by Krasinski and Hellaby to model structure formation [68]. Together with Bolejko they used the solution to describe formation of voids in the universe [9]. LTB metric is a special case of the Szekeres solution that was discovered by Szekeres [2] and was developed by Hellaby and Krasinski in a series of papers [1013]. They gave a geometrical interpretation of the metric functions in all three different types of geometry that are quasi-spherical, quasi-pseudospherical and quasi-planar. The quasi-spherical case is currently the best understood of all three types. It has found a cosmological application in the study of Bolejko who focused on structure formation [14, 15] and constructed models of a void with an adjourning supercluster. Bolejko also investigated Buchert averaging of the quasispherical Szekeres metric [16], constructed a Szekeres-Swiss-cheese model that he used to estimate the impact of inhomogeneity on the propagation of light [17] and CMB observations [18].

Walters and Hellaby showed in a recent paper [19] how to model inhomogeneity in quasispherical Szekeres metric using initial and final data. They constructed three models where they specified initial and final radial density profile and one extreme value of the density on the final time slice in terms of a deviation function along with the position of the extreme. In this way they set up all 5 degrees of freedom in the Szekeres metric and worked out an algorithm to calculate all other metric functions in the model.

For practical purposes it would be desirable to consider the evolution of inhomogeneities in Szekeres spacetime determined only by initial data. In our approach we specify the curvature function \(f\) and the radial density profile with one extreme value at the initial time. Thus we set up only 3 degrees of freedom which is however sufficient to model the density contrast. To make an appropriate choice for the initial density extreme we investigate the shell crossing conditions in terms of the density extremes and show that the resulting constraints are preserved throughout the evolution (for the assumed value of \(f\)).

The paper is organized as follows. In the next section we give an overview of the Szekeres metric and describe its basic properties. In sect. 3 we derive conditions that the density extremes have to satisfy in order to avoid a shell crossing singularity. In sect. 4 we show that if these conditions are met at the initial time, then they are fulfilled at later times if the curvature function vanishes. In sect. 5 we derive an analytical formula for the density contrast defined as the difference of the extreme values and for the case \(f=0\) we show that if the initial radial inhomogeneity is small, then the density contrast is proportional to \({t^{-3}}\) and the radial dependence of the function does not evolve substantially in time. In sect. 6 we set up the model by specifying two more functions and show the time evolution of the density contrast in a specific example. We conclude in sect. 7.

2 Szekeres spacetime

The Szekeres spacetime is an exact dust solution of Einstein equations without any symmetries. It was found by Szekeres [2] and generalized by Szafron [3] for an energy momentum tensor describing a perfect fluid. The LT type of Szekeres metric can be written as [20]

$$\begin{aligned} \mathrm{d}s^{2}=-\mathrm{d}t^{2}+\frac{\left( R'-R\frac{E'}{E}\right) ^2}{\epsilon +f\left( r\right) }\mathrm{d}r^2+\frac{R^2}{E^2}\left( \mathrm{d}p^2+\mathrm{d}q^2\right) , \end{aligned}$$
(1)

where

$$\begin{aligned}&E\left( r,p,q\right) \equiv \frac{S}{2}\left[ \left( \frac{p-P}{S}\right) ^2 +\left( \frac{q-Q}{S}\right) ^2+\epsilon \right] ,\end{aligned}$$
(2)
$$\begin{aligned}&E'=\frac{S'}{2}\left[ 1-\frac{\left( p-P\right) ^2}{S^2} -\frac{\left( q-Q\right) ^2}{S^2}\right] -\frac{P'}{S}\left( p-P\right) -\frac{Q'}{S}\left( q-Q\right) \end{aligned}$$
(3)

and \(f, P, Q, S\) are arbitrary functions of \(r\). The parameter \(\epsilon \) can have only three values \(-1, 0, 1\) and it determines the geometry of the two-spaces of constant \(t\) and \(r\). From Einstein equations it follows a dynamical equation for the function \(R\)

$$\begin{aligned} {\dot{R}}^2=\frac{2M\left( r\right) }{R}+f\left( r\right) +\frac{\varLambda R^2}{3} \end{aligned}$$
(4)

and an equation for the density evolution

$$\begin{aligned} \rho =\frac{2}{\kappa c^{2}}\frac{M'-3M\frac{E'}{E}}{R^2\left( R'-R\frac{E'}{E}\right) }, \end{aligned}$$
(5)

where prime denotes a derivative with respect to \(r, M\) is another arbitrary function and \(\varLambda \) is cosmological constant. So we have two Einstein Eqs. (4) and (5) and by solving the first one we obtain one more arbitrary function \(t_B\left( r\right) \), which enters the solution in the form \(t-t_B\). From now on we will use a redefined form of the density \(\bar{\rho }\equiv \kappa c^{2}\rho \) and for the sake of simplicity we will drop the bar.

As mentioned above, the metric does not have any symmetries, in other words it has no Killing vectors. Nevertheless the three spaces of constant \(t\) are conformally flat [21].

The parametrization of the metric involves 6 arbitrary functions however the number of physical degrees of freedom is 5, because we can still rescale the radial coordinate (the metric is invariant with respect to the transformation \(r'=g(r)\)).

2.1 Interpretation of \(f\) and \(t_B\)

The sign of the function \(f\) effects the solution of the Einstein Eq. (4). It is a dynamical equation for \(R\) and it looks very similar to the Friedman equation, except that here the functions \(f\) and \(M\) depend on \(r\). We will assume only the case when \(\varLambda =0\). There are three different types of evolution [22]. If \(f<0\) the evolution is elliptic which means that the universe is first expanding and at some point the expansion stops and the universe is collapsing to a final singularity. The solution is given in a parametric form

$$\begin{aligned} R=\frac{M}{\left( -f\right) }\left( 1-\cos \eta \right) , \quad \eta -\sin \eta =\frac{\left( -f\right) ^{\frac{3}{2}}\left( t-t_B\right) }{M}. \end{aligned}$$
(6)

For \(f>0\) the evolution is hyperbolic in the sense that the sign of the expansion does not change, the universe either expands or collapses depending on initial conditions and the parametric solution to the equation (4) is

$$\begin{aligned} R=\frac{M}{\left( -f\right) }\left( \cosh \eta -1\right) , \quad \sinh \eta -\eta =\frac{f^{\frac{3}{2}}\left( t-t_B\right) }{M}. \end{aligned}$$
(7)

For \(f=0\) the evolution is parabolic and is given by equation

$$\begin{aligned} R=\left( \frac{9}{2}M\right) ^{\frac{1}{3}}\left( t-t_B\right) ^{\frac{2}{3}}. \end{aligned}$$
(8)

Since \(f\) is a function of \(r\), the universe may have different evolution in different regions. The parabolic evolution can be on the boundary between two regions, one having elliptic evolution and the other one hyperbolic. So the sign of \(f\) determines the sign of scalar curvature of the three-spaces of constant \(t\) and when \(f=0=f'\), the three-spaces are flat which corresponds to a presence of pure decaying modes as was shown in [23].

The function \(t_B\) is called the bang time function, because \(t=t_B\) is the moment when big bang happened. So unlike in homogeneous models, the initial moment of evolution is position dependent.

The interpretation of the other metric functions (\(R, M, P, Q, S\) ) depends on \(\epsilon \) and from now on we will only consider the case \(\epsilon =+1\) which is often called the quasi-spherical case.

2.2 Coordinate transformation and interpretation of \(R\)

We can make a coordinate transformation [10]

$$\begin{aligned} \frac{p-P}{S}=\cot \frac{\theta }{2}\cos \phi , \quad \frac{q-Q}{S}=\cot \frac{\theta }{2}\sin \phi \end{aligned}$$
(9)

and rewrite the induced two-metric of the surfaces of constant \(t\) and \(r\) into coordinates \(\theta \) and \(\phi \). After applying the transformation we get

$$\begin{aligned} \mathrm{d}s^2=\frac{4}{S^2}\sin ^4\frac{\theta }{2}\left( \mathrm{d}p^2+\mathrm{d}q^2\right) =\mathrm{d}\theta ^2+\sin ^2\theta \mathrm{d}\phi ^2, \end{aligned}$$
(10)

which is a metric on a unit sphere. The transformation (9) is nothing but a stereographic projection and the function \(E\) describes how the \((p,q)\) plane is mapped onto a unit sphere. Every sphere is multiplied by \(R^2\) and the function is sometimes called the areal radius, because it is actually the radius of a sphere on a comoving coordinate \(r\).

2.3 Geometrical meaning of \(E\)

In order to understand more about the geometrical properties of the metric (1) it is important to investigate the function \(E\). We can see that this function appears in the metric and in the equation for the density (5) in the form \(\frac{E'}{E}\). Particularly, we can investigate when the function is equal to zero and what are its extreme values. Using the transformation (9) in (2) and (3) we can write \(\frac{E'}{E}\) as

$$\begin{aligned} \frac{E'}{E}=-\frac{S'\cos \theta +\sin \theta \left( P'\cos \phi +Q'\sin \phi \right) }{S}. \end{aligned}$$
(11)

The equation \(\frac{E'}{E}=0\) now becomes

$$\begin{aligned} S'\cos \theta +P'\sin \theta \cos \phi +Q'\sin \theta \sin \phi =0 \end{aligned}$$
(12)

and after realizing that \(\cos \theta =z, \sin \theta \cos \phi =y\) and \(\sin \theta \sin \phi =x\), the equation (12) becomes

$$\begin{aligned} S'z+P'x+Q'y=0, \end{aligned}$$
(13)

which is an equation of a plane that goes through the origin of the spherical coordinate system and intersects the \(r=t=const\) sphere in a great circle. Now calculating the derivatives of (11) with respect to \(\theta \) and \(\phi \) and putting it equal to zero we can find that there are two extreme values and they are located at opposite sites on the sphere, in other words if one extreme is at the coordinates \(\left( \theta _{1},\phi _{1}\right) \), the other one is at \(\left( \pi -\theta _{1}, \phi _{1}+\pi \right) \) and they are located symmetrically with respect to the plane \(\frac{E'}{E}=0\), because the coordinates of the extremes are exactly the components of the unit normal to the plane \(\frac{E'}{E}=0\). The values of the extremes are

$$\begin{aligned} \begin{aligned} \left( \frac{E'}{E}\right) _{max}&= \frac{\sqrt{\left( S'\right) ^2+\left( P'\right) ^2+\left( Q'\right) ^2}}{S}, \\ \left( \frac{E'}{E}\right) _{min}&= -\frac{\sqrt{\left( S'\right) ^2 +\left( P'\right) ^2+\left( Q'\right) ^2}}{S}, \end{aligned} \end{aligned}$$
(14)

where max and min refers to maximum and minimum respectively. So the extremes have opposite values and the function \(\frac{E'}{E}\) behaves on the sphere like a dipole [10].

3 Shell crossing conditions in terms of the density extremes

We are now going to study the formula for the density (5). We can see that under certain circumstances the density can change sign or possibly diverge if the denominator becomes zero. Those points where this happens are called the shell crossing singularity. The conditions that the metric functions \(M, f, t_{B}\) and \(R\) have to satisfy in order to avoid shell crossing singularity can be found in [10]. In this section we will derive the conditions that the extreme values of the density \(\rho _{max}\) and \(\rho _{min}\) have to satisfy in order to avoid the shell crossing singularity.

We can rewrite (5) as

$$\begin{aligned} \rho \left( t,r,\theta , \varphi \right) =2\frac{M'-3M\frac{E'}{E}}{R^{2}\left( R'-R\frac{E'}{E}\right) }=\frac{R'\rho _{LT}-R\frac{E'}{E}\rho _{AV}}{R'-R\frac{E'}{E}}, \end{aligned}$$
(15)

where we define

$$\begin{aligned} \rho _{LT}\left( t,r\right) \equiv \frac{2M'}{R^{2}R'} \end{aligned}$$
(16)

and

$$\begin{aligned} \rho _{AV}\left( t,r\right) \equiv \frac{6M}{R^{3}}. \end{aligned}$$
(17)

Here \(\rho _{LT}\) is the density that we get from (5) if we set \(\frac{E'}{E}=0\). It is also a radial density in the sense that on a given \(r\) it is the value of the density around the great circle that lies in the plane that defines the dipole on the sphere. The index \(LT\) refers to Lemaitre-Tolman-Bondi metric, because its density is given with exactly the same formula as (16). If we make the choice

$$\begin{aligned} R\left( t_{i}\right) \equiv r \end{aligned}$$
(18)

and use the fact that the function \(M\) depends only on \(r\), we can express it on the initial time slice when \(\frac{E'}{E}=0\) as

$$\begin{aligned} M=\frac{1}{2}\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r', \end{aligned}$$
(19)

where the index \(0\) refers to the value of the function at the initial time \(t_{i}\). In that case the definitions (16) and (17) can be further rewritten as

$$\begin{aligned} \rho _{LT}\left( t,r\right) = \frac{1}{R^{2}R'}\rho _{LT0}r^{2}, \quad \quad \rho _{AV}\left( t,r\right) = \frac{3}{R^{3}}\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'. \end{aligned}$$
(20)

The initial condition (18) and formulas (19)–(20) will however not be used in the following calculations (with the exception of Eq. (44) giving critical point position) and the main results of this section are independent of it, thus giving us generally applicable criteria.

It is good to take a look at the derivative of the density with respect to \(\frac{E'}{E}\)

$$\begin{aligned} \frac{\partial \rho }{\partial \frac{E'}{E}}=RR'\frac{\rho _{LT} -\rho _{AV}}{\left( R'-R\frac{E'}{E}\right) ^{2}}. \end{aligned}$$
(21)

From the derivative we can see, that if \(R'\left( \rho _{LT}-\rho _{AV}\right) >0\) the derivative is positive and the density is growing as \(\frac{E'}{E}\) increases. On the other hand if \(R'\left( \rho _{LT}-\rho _{AV}\right) <0\) the density will decrease as \(\frac{E'}{E}\) increases. Either way we can see that the density behaves on each sphere also like a dipole in the sense that it has two extreme values, maximum and minimum and they are located at the same position as extreme values of the function \(\frac{E'}{E}\). In the case when \(R'\left( \rho _{LT}-\rho _{AV}\right) <0\) we can write for the density maximum

$$\begin{aligned} \rho _{max}=\frac{R'\rho _{LT}-R\left( \frac{E'}{E}\right) _{min}\rho _{AV}}{R'-R\left( \frac{E'}{E}\right) _{min}} \end{aligned}$$
(22)

and for the minimum

$$\begin{aligned} \rho _{min}=\frac{R'\rho _{LT}-R\left( \frac{E'}{E}\right) _{max}\rho _{AV}}{R'-R\left( \frac{E'}{E}\right) _{max}}. \end{aligned}$$
(23)

In the case when \(R'\left( \rho _{LT}-\rho _{AV}\right) >0\) the role of \(\left( \frac{E'}{E}\right) _{max}\) interchanges with \(\left( \frac{E'}{E}\right) _{min}\) in the last two equations.

We split the investigation of the density into three parts, in the first part we investigate when both the numerator and the denominator are positive, in the second case we check when they are both negative and in the last case we take a look at the special case when they are both zero. It will be convenient to split the first part into three more subcases depending on the value of \(R'\left( \rho _{LT}-\rho _{AV}\right) \). For the investigation we will also need a formula for the function \(\frac{E'}{E}\) given in terms of \(\rho _{LT}\) and \(\rho _{AV}\) which we can derive from (15)

$$\begin{aligned} \frac{E'}{E}=\frac{R'}{R}\frac{\rho -\rho _{LT}}{\rho -\rho _{AV}}. \end{aligned}$$
(24)

3.1 First case: numerator and denominator of the density are both positive

3.1.1 Subcase A: \(R'\left( \rho _{LT}-\rho _{AV}\right) <0\)

From the positivity of the denominator in (15) we get

$$\begin{aligned} \frac{R'}{R}>\left( \frac{E'}{E}\right) _{max}=\frac{R'}{R} \frac{\rho _{min}-\rho _{LT}}{\rho _{min}-\rho _{AV}}, \end{aligned}$$
(25)

because as follows from (21) if \(R'\left( \rho _{LT}-\rho _{AV}\right) <0\) we can see that \(\frac{E'}{E}\) has maximum where the density has minimum. From the dipole property

$$\begin{aligned} \left( \frac{E'}{E}\right) _{max}=-\left( \frac{E'}{E}\right) _{min} \end{aligned}$$
(26)

we know that \(\left( \frac{E'}{E}\right) _{max}\) is non-negative and (25) implies that \(R'>0\) and therefore we have to consider \(\rho _{LT}<\rho _{AV}\). We can now set conditions for \(\rho _{min}\) so that the right hand side in (25) is non-negative. Inequality (25) simplifies to

$$\begin{aligned} 1>\frac{\rho _{min}-\rho _{LT}}{\rho _{min}-\rho _{AV}} \end{aligned}$$
(27)

It is reasonable to require \(\rho _{min}\le \rho _{LT}\), because the minimum should be the smallest value on each sphere (\(\rho _{min}=\rho _{LT}\) corresponds to the case when the density is homogeneously distributed on the whole sphere). Since we consider \(\rho _{LT}<\rho _{AV}\) it follows that \(\rho _{min}<\rho _{AV}\) and the right hand side of (25) is non-negative. It means that besides the obvious condition \(\rho _{min}\le \rho _{LT}\) we don’t have any other restriction for the minimum.

Due to the dipole property we can try to derive a condition for the maximum

$$\begin{aligned} \frac{R'}{R}>\left( \frac{E'}{E}\right) _{max}=-\frac{R'}{R} \frac{\rho _{max}-\rho _{LT}}{\rho _{max}-\rho _{AV}}. \end{aligned}$$
(28)

Since \(\rho _{max}\) should be greater than or equal to \(\rho _{LT}\) it implies that \(\rho _{max}<\rho _{AV}\) in order for the right hand side in (28) to be non-negative. This condition is reasonable since \(\rho _{AV}\) is not true value of the density as follows from its definition (17). Taking this into consideration we can solve the inequality (28) and the solution is

$$\begin{aligned} \rho _{max}<\frac{1}{2}\left( \rho _{LT}+\rho _{AV}\right) \end{aligned}$$
(29)

and this condition is clearly more restrictive than \(\rho _{max}<\rho _{AV}\).

For the numerator of (15) we need

$$\begin{aligned} \frac{R'}{R}\rho _{LT}>\frac{E'}{E}\rho _{AV} \end{aligned}$$
(30)

which can be rewritten as

$$\begin{aligned} \frac{R'}{R}\frac{\rho _{LT}}{\rho _{AV}}>\left( \frac{E'}{E}\right) _{max} =\frac{R'}{R}\frac{\rho _{min}-\rho _{LT}}{\rho _{min}-\rho _{AV}}. \end{aligned}$$
(31)

It again follows that \(R'>0\) and \(\rho _{LT}<\rho _{AV}\). The right-hand side of (31) has to be non-negative and we know that \(\rho _{min}\le \rho _{LT}\) and since \(\rho _{LT}<\rho _{AV}\) we also have \(\rho _{min}<\rho _{AV}\) so the inequality (31) is always true and we don’t get any new condition for \(\rho _{min}\). We now use the property (26) and look for a condition for \(\rho _{max}\)

$$\begin{aligned} \frac{\rho _{LT}}{\rho _{AV}}>-\frac{\rho _{max}-\rho _{LT}}{\rho _{max} -\rho _{AV}}. \end{aligned}$$
(32)

We know that \(\rho _{max}\ge \rho _{LT}\) so to make the right hand side non-negative we need \(\rho _{max}<\rho _{AV}\). The solution to the inequality (32) is

$$\begin{aligned} \rho _{max}<2\frac{\rho _{AV}\rho _{LT}}{\rho _{LT}+\rho _{AV}}. \end{aligned}$$
(33)

The conditions for the denominator and the numerator have to be satisfied simultaneously, so for the maximum we have (29) and (33) and (as can be seen from Fig. 1) the condition (33) is stronger in the case of \(\rho _{LT}<\rho _{AV}\) and has to be fulfilled in order for the density to be positive. As far as the minimum is concerned, apart from the obvious condition \(\rho _{min}\le \rho _{LT}\) it is not constrained at all.

Fig. 1
figure 1

In this figure we can see 4 different surfaces that constrain the density extremes. In the right part of the figure they are from the bottom to the top: \(\rho _{AV}, 2\frac{\rho _{AV}\rho _{LT}}{\rho _{AV}+\rho _{LT}}, \frac{1}{2}\left( \rho _{AV}+\rho _{LT}\right) , \rho _{LT}\)

3.1.2 Subcase B: \(R'\left( \rho _{LT}-\rho _{AV}\right) >0\)

The subcase B will be investigated similarly. The only difference is that from (21) we know that if \(R'\left( \rho _{LT}-\rho _{AV}\right) <0\) the function \(\frac{E'}{E}\) has maximum where the density has maximum and this modifies (22) and (23) accordingly. From the denominator of (15) we have

$$\begin{aligned} \frac{R'}{R}>\left( \frac{E'}{E}\right) _{max}=\frac{R'}{R} \frac{\rho _{max}-\rho _{LT}}{\rho _{max}-\rho _{AV}}, \end{aligned}$$
(34)

which again implies \(R'>0\) and \(\rho _{LT}>\rho _{AV}\) because \(\left( \frac{E'}{E}\right) _{max}\ge 0\) and it simplifies to

$$\begin{aligned} 1>\frac{\rho _{max}-\rho _{LT}}{\rho _{max}-\rho _{AV}}. \end{aligned}$$
(35)

The analysis is basically the same, we again need the right-hand side to be non-negative. We know that \(\rho _{max}\ge \rho _{LT}\) and therefore \(\rho _{max}>\rho _{AV}\) as well, so the inequality (35) will be always true as long as \(\rho _{LT}>\rho _{AV}\) and we don’t get any further condition for the maximum. For the minimum we have

$$\begin{aligned} \frac{R'}{R}>\left( \frac{E'}{E}\right) _{max}=-\frac{R'}{R} \frac{\rho _{min}-\rho _{LT}}{\rho _{min}-\rho _{AV}}. \end{aligned}$$
(36)

In order for the right-hand side to be non-negative we need \(\rho _{min}>\rho _{AV}\) which is a valid condition for the density minimum, because as mentioned above \(\rho _{AV}\) is not true value of the density. The inequality (36) has the solution

$$\begin{aligned} \rho _{min}>\frac{1}{2}\left( \rho _{AV}+\rho _{LT}\right) . \end{aligned}$$
(37)

From the numerator of (15) we have the condition

$$\begin{aligned} \frac{R'}{R}\frac{\rho _{LT}}{\rho _{AV}}>\left( \frac{E'}{E}\right) _{max} =\frac{R'}{R}\frac{\rho _{max}-\rho _{LT}}{\rho _{max}-\rho _{AV}}. \end{aligned}$$
(38)

It again implies \(R'>0\) and \(\rho _{LT}>\rho _{AV}\) and it does not give us any constraint for the maximum, because we know that \(\rho _{max}\ge \rho _{LT}\) and therefore \(\rho _{max}>\rho _{AV}\). So (38) holds as long as \(R'>0\) and \(\rho _{LT}>\rho _{AV}\). For the minimum we can write

$$\begin{aligned} \frac{R'}{R}\frac{\rho _{LT}}{\rho _{AV}}>\left( \frac{E'}{E}\right) _{max} =-\frac{R'}{R}\frac{\rho _{min}-\rho _{LT}}{\rho _{min}-\rho _{AV}}. \end{aligned}$$
(39)

The right-hand side will be positive if \(\rho _{min}>\rho _{AV}\) and the solution to (39) is

$$\begin{aligned} \rho _{min}>2\frac{\rho _{LT}\rho _{AV}}{\rho _{LT}+\rho _{AV}}. \end{aligned}$$
(40)

All together in the case of \(R'\left( \rho _{LT}-\rho _{AV}\right) >0\) we have two conditions (37) and (40) for the minimum and as can be seen from Fig. 1 the first one is stronger. For the maximum, except for the obvious \(\rho _{max}\ge \rho _{LT}\), we don’t have any constraint so the density will be positive as long as (37) holds and \(\rho _{max}\ge \rho _{LT}\).

3.1.3 Subcase C: \(R'\left( \rho _{LT}-\rho _{AV}\right) =0\)

Before we consider this special case we can first rewrite (15) as

$$\begin{aligned} \rho =\frac{R'\left( \rho _{LT}-\rho _{AV}\right) +\rho _{AV} \left( R'-R\frac{E'}{E}\right) }{R'-R\frac{E'}{E}} \end{aligned}$$
(41)

Now using \(R'\left( \rho _{LT}-\rho _{AV}\right) =0\) we can see that the formula for the density simplifies

$$\begin{aligned} \rho =\rho _{AV}\frac{R'-R\frac{E'}{E}}{R'-R\frac{E'}{E}}=\rho _{AV}, \end{aligned}$$
(42)

in other words the value of the density is independent of \(\theta \) and \(\phi \) and the density is homogeneously distributed on the whole sphere as follows also from (21) because the derivative of the density is now zero. Using the same argument as in subcase A and B we have \(R'>0\) and therefore \(\rho _{LT}=\rho _{AV}\). For the extreme values of the density we obviously need in this case

$$\begin{aligned} \rho _{max}=\rho _{min}=\rho _{AV}=\rho _{LT}. \end{aligned}$$
(43)

The point where \(\rho _{LT}=\rho _{AV}\) is especially interesting because the shell-crossing conditions for \(\rho _{max}\) and \(\rho _{min}\) change here and the location of \(\rho _{max}\) and \(\rho _{min}\) interchanges by passing through the plane \(\frac{E'}{E}=0\). The position of this critical point \(r_{c}\) generally evolves and we can get its value as the solution to the equation

$$\begin{aligned} 3\frac{R'}{R}\int _{0}^{r_{c}}\rho _{LT0}r^{2}\mathrm{d}r=\rho _{LT0}r_{c}^{2}, \end{aligned}$$
(44)

where we used the initial condition (18) and formulas (20) in order to express \(\rho _{LT}\) and \(\rho _{AV}\). So the time evolution of the critical point will depend on the time evolution of the function \(\frac{R'}{R}\).

3.2 Second case: numerator and denominator of the density are both negative

In order for the denominator of the density (15) to be negative, we need

$$\begin{aligned} \frac{R'}{R}<\left( \frac{E'}{E}\right) _{min}. \end{aligned}$$
(45)

This condition will not be fulfilled unless \(R'<0\) because \(\left( \frac{E'}{E}\right) _{min}\le 0\). The investigation is than similar as in the first case and leads to the same conditions for \(\rho _{min}\) and \(\rho _{max}\) as can be easily verified.

On the other hand if \(R'>0\) and we allow the denominator to be negative on a given \(r\), it will be also positive on that \(r\) for some specific \(\theta \) and \(\phi \). This behaviour may or may not be correct, depending on the behaviour of the numerator and specifically depending on whether or not the numerator changes sign at the same \(\theta , \phi \). For the numerator we have inequality

$$\begin{aligned} R'\rho _{LT}-R\frac{E'}{E}\rho _{AV}<0. \end{aligned}$$
(46)

This can be rewritten as

$$\begin{aligned} \frac{R'}{R}\frac{\rho _{LT}}{\rho _{AV}}<\left( \frac{E'}{E}\right) _{min}. \end{aligned}$$
(47)

The same argument as in the case of denominator tells us that this will be satisfied only if \(R'<0\). So if the numerator is negative on a given \(r\) but \(R'>0\), there is a region on this \(r\) where it is positive too. For the positiveness of the denominator in a region \((\theta , \phi )\) we have

$$\begin{aligned} \frac{R'}{R}>\frac{E'}{E} \end{aligned}$$
(48)

and for the numerator the condition is

$$\begin{aligned} \frac{R'}{R}\frac{\rho _{AV}}{\rho _{LT}}>\frac{E'}{E}. \end{aligned}$$
(49)

Clearly the conditions are not the same unless \(\rho _{LT}=\rho _{AV}\), so except for this special case, there will always be a region on a given \(r\) where the numerator and the denominator will have different signs. The places where the sign changes are in both cases circles on the sphere, that are parallel to the great circle that defines the plane of the dipole. The order in which the circles go are seen in Fig. 2, where the parallel circles are mapped as parallel lines.

So if in the second case \(R'>0\) there are no conditions for the density extremes that would prevent shell crossing.

Fig. 2
figure 2

The behaviour of the density for \(\rho _{AV}>\rho _{LT}\) in a and \(\rho _{AV}<\rho _{LT}\) in b when the conditions for no shell-crossing are not met. The circle represents a sphere on a given \(r\), the solid line represents the plane \(\frac{E'}{E}=0\). The dashed line represents a plane \(\frac{E'}{E}\frac{\rho _{LT}}{\rho _{AV}}=\frac{R'}{R}\), that is parallel to the plane \(\frac{E'}{E}=0\), the density becomes zero here. The dotted line is the plane \(\frac{E'}{E}=\frac{R'}{R}\) and it is the plane where the density diverges. The density is negative between the dashed and dotted line

3.3 Third case: numerator and denominator of the density are both zero

The denominator is zero when

$$\begin{aligned} \frac{R'}{R}=\frac{E'}{E}, \end{aligned}$$
(50)

but this equation will be satisfied on a given \(r\) for all \(\theta \) and \(\phi \) only if both \(\frac{R'}{R}\) and \(\frac{E'}{E}\) are zero. This consequently means that \(E'=P'=Q'=S'=R'=0\). The same arguments are valid for the numerator of the density. As was discussed in [10] and in the context of LTB metric in [22] this point will not be a singularity if also \(M'=0\). Since \(M'\) and \(E'\) are independent of time it implies that \(R'\) cannot evolve and we need stationary configuration in order to avoid shell crossing.

The Table 1 summarizes the conditions for the extreme values of the density that we obtained so that shell crossing would be avoided. From the dipole property (26) it follows that there is a constraint between the density extremes

$$\begin{aligned} \frac{\rho _{min}-\rho _{LT}}{\rho _{min}-\rho _{AV}}=-\frac{\rho _{max} -\rho _{LT}}{\rho _{max}-\rho _{AV}}, \end{aligned}$$
(51)

which means that knowing one extreme value allows us calculate the other one with a formula

$$\begin{aligned} \rho _{max}=\frac{\rho _{min}\left( \rho _{AV}+\rho _{LT}\right) -2\rho _{LT}\rho _{AV}}{2\rho _{min}-\rho _{LT}-\rho _{AV}} \end{aligned}$$
(52)

that follows from (51). And for the other extreme we just interchange min for max in the last equation. Consequently it is sufficient to ensure that just one of the extremes satisfies the conditions in table 1 and the constraint (51) ensures that the other density extreme has a value that does not break the conditions in Table 1.

Table 1 The list of shell crossing conditions for density extremes in terms of \(\rho _{LT}\) and \(\rho _{AV}\)

4 Time dependence of the shell crossing conditions, case \(f=0\)

In the previous section we derived conditions that \(\rho _{max}\) and \(\rho _{min}\) have to satisfy in order to avoid shell crossing singularity. To find out if a shell crossing occurs at a given time, we need to calculate \(\rho _{max}\) or \(\rho _{min}\) at that time and then check if the conditions are met. It would be useful to have conditions in terms of the initial \(\rho _{LT0}\) and \(\rho _{min0}\) or \(\rho _{max0}\) that would ensure no shell crossing at any time during the evolution. In this section we show that in the special case when \(f=0\), if we avoid shell crossing at the initial time, it is guaranteed that no shell crossing occurs during the time evolution.

First we show that if on the initial time slice \(\rho _{AV0}>\rho _{LT0}\), then this condition holds at any later time. We will use the initial condition (18) and start with the inequality that we want to prove \(\rho _{AV}>\rho _{LT}\)

$$\begin{aligned} \frac{3}{R^{3}}\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'>\frac{1}{R^{2}R'}\rho _{LT0}r^2, \end{aligned}$$
(53)

this can be rewritten as

$$\begin{aligned} \frac{R'}{R}r\,\frac{3\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'}{\rho _{LT0}r^{3}}>1 \end{aligned}$$
(54)

and the inequality sign depends on the sign of \(R'\) and here we assumed \(R'>0\). We can see that the time dependence in the last inequality is hidden in the function \(\frac{R'}{R}r\). The choice \(f=0\) has parabolic evolution and the solution to the Eq. (4) is given by (8). If we substitute in (8) for \(M\) from (19) we get

$$\begin{aligned} R(t,r)=\left( \frac{9}{4}\right) ^{\frac{1}{3}}\left( \int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'\right) ^{\frac{1}{3}}\left( t-t_{B}\right) ^{\frac{2}{3}}. \end{aligned}$$
(55)

We can fix the bang time function \(t_{B}\) using (18) to be

$$\begin{aligned} t_{B}=\left[ t_{i}-\frac{2}{3}\left( \frac{r^{3}}{\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'}\right) ^{\frac{1}{2}}\right] , \end{aligned}$$
(56)

where \(t_{i}\) is the initial moment of the evolution. By calculating the radial derivative of (55) we can express \(\frac{R'}{R}r\) as

$$\begin{aligned} \frac{R'}{R}r=\frac{\rho _{LT0}r^{3}}{3\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'}-\frac{2}{3}\frac{t_{B}'}{t-t_{B}}r. \end{aligned}$$
(57)

After calculating radial derivative of the bang time function (56) and substituting it in the last formula we obtain

$$\begin{aligned} \frac{R'}{R}r=\frac{\rho _{LT0}r^{3}}{3\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'}+\frac{2}{3}\frac{\frac{3\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'}{\rho _{LT0}r^{3}}-1}{\left( \frac{3\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'}{\rho _{LT0}r^{3}}\right) ^{\frac{3}{2}}}\,\frac{1}{t-t_{B}}\sqrt{\frac{3}{\rho _{LT0}}}. \end{aligned}$$
(58)

Now we define

$$\begin{aligned} A\equiv \frac{\rho _{AV0}}{\rho _{LT0}}=\frac{3\int _{0}^{r}\rho _{LT0}r'^{2}\mathrm{d}r'}{\rho _{LT0}r^{3}} \end{aligned}$$
(59)

and using this definition we can rewrite (58) as

$$\begin{aligned} \frac{R'}{R}r=\frac{1}{A}+\frac{2}{3}\frac{A-1}{A^{\frac{3}{2}}} \frac{1}{t-t_{B}}\sqrt{\frac{3}{\rho _{LT0}}}. \end{aligned}$$
(60)

From this formula it can be shown that \(\frac{R'}{R}r\) is a monotonic function of \(t\). For \(t=t_{i}\), its value is 1, which follows from our initial condition \(R\left( t_{i}\right) =r\) and for \(t\rightarrow \infty , \frac{R'}{R}r\rightarrow \frac{1}{A}\) so it is increasing if \(\rho _{AV0}>\rho _{LT0}\) and it is decreasing if \(\rho _{AV0}<\rho _{LT0}\). In any case the function is positive which implies \(R'>0\) so our assumption of the inequality sign in (54) is justified. Using the definition (59) and substituting for \(\frac{R'}{R}r\) into (54) we get

$$\begin{aligned} \frac{2}{3}\frac{A-1}{\sqrt{A}}\frac{1}{t-t_{B}}\sqrt{\frac{3}{\rho _{LT0}}}>0. \end{aligned}$$
(61)

Since \(t>t_{B}\) the last inequality will be satisfied as long as \(A>1\), which is equivalent to \(\rho _{AV0}>\rho _{LT0}\) as can be seen from the definition of \(A\). So we can see exactly what we wanted to prove, if \(\rho _{AV0}>\rho _{LT0}\) than \(\rho _{AV}>\rho _{LT}\) at any time. Similarly we could prove that if \(\rho _{AV0}<\rho _{LT0}\) than \(\rho _{AV}<\rho _{LT}\) at any time. Next we will assume that \(\rho _{AV0}>\rho _{LT0}\) and we will express the shell crossing condition \(\rho _{min}<\rho _{LT}\) in terms of initial data. For the function \(\frac{E'}{E}\) we have formula (24) and since the function does not depend on time, we can express it on the initial time slice

$$\begin{aligned} \frac{E'}{E}_{max}=\frac{1}{r}\frac{\rho _{min0}-\rho _{LT0}}{\rho _{min0} -\rho _{AV0}}. \end{aligned}$$
(62)

We plug the last formula into (23) and after some calculations we get

$$\begin{aligned} \rho _{min}=\frac{r^{3}}{R^{3}}\rho _{LT0}\frac{\frac{\rho _{min0}}{\rho _{LT0}}\left( 1-\frac{\rho _{AV0}}{\rho _{LT0}}\right) }{\frac{R'}{R} r\left( \frac{\rho _{min0}}{\rho _{LT0}}-\frac{\rho _{AV0}}{\rho _{LT0}}\right) -\frac{\rho _{min0}}{\rho _{LT0}}+1} \end{aligned}$$
(63)

and we used \(\frac{\rho _{AV}}{\rho _{LT}}=\frac{R'}{R}r\frac{\rho _{AV0}}{\rho _{LT0}}\) which follows from its definitions (16) and (17). We will now define

$$\begin{aligned} C\equiv \frac{\rho _{min0}}{\rho _{LT0}} \end{aligned}$$
(64)

and using this definition with (59) we can rewrite (63) as

$$\begin{aligned} \rho _{min}=\frac{r^{3}}{R^{3}}\rho _{LT0}\frac{C\left( 1-A\right) }{\frac{R'}{R}r\left( C-A\right) +\left( 1-C\right) }. \end{aligned}$$
(65)

The inequality \(\rho _{min}<\rho _{LT}\) can now be rewritten as

$$\begin{aligned} \frac{R'}{R}r\frac{\left( 1-A\right) C}{\frac{R'}{R}r\left( C-A\right) +\left( 1-C\right) }<1. \end{aligned}$$
(66)

We need to multiply the last inequality by the denominator, but in order to do that we need to find out its sign. From (59) and (64) it follows

$$\begin{aligned} C-A=-\frac{1}{\rho _{LT0}}\left( \rho _{AV0}-\rho _{min0}\right) <0, \end{aligned}$$
(67)

next using the minimal value of \(\frac{R'}{R}r\) to be \(\frac{1}{A}\) we can write for the denominator of (66)

$$\begin{aligned} \left( 1-C\right) -\frac{R'}{R}r\left( A-C\right) \le 1-C-\frac{1}{A}\left( A-C\right) =C\left( \frac{1}{A}-1\right) <0, \end{aligned}$$
(68)

because we assume \(\rho _{AV0}>\rho _{LT0}\), i.e \(A>1\). So the denominator is negative and when we multiply by it in (66), we get after some calculations

$$\begin{aligned} \frac{R'}{R}rA>1, \end{aligned}$$
(69)

which is inequality (54) written in terms of \(A\) and we already proved that it holds as long as \(A>1\). So we can see that if \(\rho _{AV0}>\rho _{LT0}\) than \(\rho _{min}<\rho _{LT}\) is fulfilled and the shell crossing will be avoided at any time. Similarly it could be shown that in the case \(\rho _{AV0}<\rho _{LT0}\), i.e. \(A<1\), if \(\rho _{max0}>\rho _{LT0}\) than \(\rho _{max}>\rho _{LT}\) at any time.

We can also see that if \(\rho _{AV0}=\rho _{LT0}\) at some point \(r_{c}\), it means that we have \(A=1\) and from (60) it follows \(\frac{R'}{R}r=1\). So the position of the critical point \(r_{c}\) as defined in (44) is time independent.

5 Density contrast, case \(f=0\)

We will choose \(\rho _{LT0}\) in such a way that \(\rho _{LT0}<\rho _{AV0}\). We already expressed \(\rho _{min}\) in terms of \(\rho _{LT}\) and \(\rho _{min0}\) in (65). Similarly we can express \(\rho _{max}\) in terms of \(\rho _{LT0}\) and \(\rho _{max0}\) as

$$\begin{aligned} \rho _{max}=\frac{r^{3}}{R^{3}}\rho _{LT0}\frac{D\left( 1-A\right) }{\frac{R'}{R}r\left( D-A\right) -\left( D-1\right) }, \end{aligned}$$
(70)

where we define

$$\begin{aligned} D\equiv \frac{\rho _{max0}}{\rho _{LT0}}. \end{aligned}$$
(71)

We are now interested in the time evolution of the difference of the extreme values of the density, so we define

$$\begin{aligned} \Delta \rho \equiv \rho _{max}-\rho _{min}&= \frac{r^{3}}{R^{3}}\rho _{LT0} \left( 1-A\right) \nonumber \\&\times \left[ \frac{D}{\frac{R'}{R}r\left( D-A\right) -\left( D-1\right) } -\frac{C}{\frac{R'}{R}r\left( C-A\right) -\left( C-1\right) }\right] \nonumber \\ \end{aligned}$$
(72)

We can now substitute for \(R\) from (55) and after some more calculations it can be rewritten in the form

$$\begin{aligned} \Delta \rho \left( t,r\right) =\frac{4}{3}\frac{1}{\left( t-t_{B}\right) ^{2}} \frac{\Delta \rho _{0}}{\rho _{LT0}}h\left( t,r\right) , \end{aligned}$$
(73)

where we have defined \(\Delta \rho _{0}\equiv \rho _{max0}-\rho _{min0}\),

$$\begin{aligned} h\left( t,r\right) \equiv \frac{1-A}{A}\ \frac{1-\frac{R'}{R}rA}{\left( \frac{R'}{R}r\right) ^{2}\left( D-A\right) \left( C-A\right) +\left( D-1\right) \left( C-1\right) }, \end{aligned}$$
(74)

and we used

$$\begin{aligned} 2\left( CD+A\right) -\left( C+D\right) \left( A+1\right) =0, \end{aligned}$$
(75)

which can be derived from the constraint (52). We will now investigate the behaviour of the function \(h\).

We set \(A=1+\epsilon \) and take a look at how the function \(h\) behaves in the case when \(\epsilon <<1\), which corresponds to the situation when the radial derivative of \(\rho _{LT0}\) is small. First we approximate \(\frac{R'}{R}r\) that is given by (60),

$$\begin{aligned} \frac{R'}{R}r&= \frac{1}{1+\epsilon }\left( 1+\frac{2}{3}\frac{1}{t-t_{B}} \sqrt{\frac{3}{\rho _{LT0}}}\frac{\epsilon }{\sqrt{1+\epsilon }}\right) \approx \nonumber \\&\approx 1+\left( \frac{2}{3}\frac{1}{t-t_{B}}\sqrt{\frac{3}{\rho _{LT0}}} -1\right) \epsilon +\left( 2-\frac{1}{3}\frac{1}{t-t_{B}}\sqrt{\frac{3}{\rho _{LT0}}}\right) \epsilon ^{2}+o\left( \epsilon ^{3}\right) .\nonumber \\ \end{aligned}$$
(76)

So in the numerator on the right hand side of (74) we get

$$\begin{aligned} \left( 1-A\right) (1-\frac{R'}{R}rA)=-\left( 1-\frac{R'}{R}r\right) \epsilon +\frac{R'}{R}r\epsilon ^{2}\approx \frac{2}{3}\frac{1}{t-t_{B}} \sqrt{\frac{3}{\rho _{LT0}}}\epsilon ^{2}+o\left( \epsilon ^{3}\right) .\nonumber \\ \end{aligned}$$
(77)

In order to simplify the denominator in (74) we set \(D=1+\delta \) and \(C=1-\xi \) and we assume that \(\Delta \rho _{0}<<\rho _{LT0}\) in which case \(\delta <<1\) and \(\xi <<1\). In this case the approximation of the denominator reads

$$\begin{aligned}&A\left[ \left( \frac{R'}{R}r\right) ^2\left( C-A\right) \left( D-A\right) +\left( C-1\right) \left( D-1\right) \right] \approx \nonumber \\&\quad \approx \left( C-A\right) \left( D-A\right) +\left( C-1\right) \left( D-1\right) \end{aligned}$$
(78)

and for the function \(h\) we get

$$\begin{aligned} h\approx \frac{2}{\sqrt{3}}\frac{1}{t-t_{B}}\frac{1}{\sqrt{\rho _{LT0}}}\frac{\left( A-1 \right) ^{2}}{\left( C-A\right) \left( D-A\right) +\left( C-1\right) \left( D-1\right) }. \end{aligned}$$
(79)

From (75) it follows

$$\begin{aligned} 2CD=AC+AD-2A+C+D. \end{aligned}$$
(80)

Using (71) we can rewrite the denominator in (79)

$$\begin{aligned} \left( C-A\right) \left( D-A\right) +\left( C-1\right) \left( D-1\right) =A^{2}-2A+1=\left( A-1\right) ^{2}. \end{aligned}$$
(81)

So for \(h\) we can write

$$\begin{aligned} h\approx \frac{2}{\sqrt{3}}\frac{1}{t-t_{B}}\frac{1}{\sqrt{\rho _{LT0}}} \end{aligned}$$
(82)

and for \(\Delta \rho \) we have

$$\begin{aligned} \Delta \rho \approx \frac{8\sqrt{3}}{9}\frac{1}{\left( t-t_{B}\right) ^{3}} \frac{\Delta \rho _{0}}{\rho _{LT0}^{\frac{3}{2}}}. \end{aligned}$$
(83)

From the last equation we can see that if the radial derivative of \(\rho _{LT0}^{-\frac{3}{2}}\) is small then it does not effect much the shape of the initial difference of the density extremes. Also if at late time \(t\) the bang time function is small compared to \(t\) we can see that \(\Delta \rho \) is proportional to \(\frac{1}{t^{3}}\). We can try to evaluate (83) at the initial time \(t=t_{i}\)

$$\begin{aligned} \Delta \rho \left( t=t_{i}\right) \approx \frac{8\sqrt{3}}{9}\frac{27}{8} \frac{\left( \int \rho _{LT0}r^{2}\mathrm{d}r\right) ^{\frac{3}{2}}}{r^{\frac{9}{2}}}\frac{\Delta \rho _{0}}{\rho _{LT0}^{\frac{3}{2}}}=A^{\frac{3}{2}}\Delta \rho _{0}, \end{aligned}$$
(84)

so we can see that if A is close to 1 the approximation gives us what we expect.

6 Model specification

The Szekeres spacetime has 5 degrees of freedom, so to fully specify the model we need to set up 5 functions. But since we are only interested in the density contrast, it is sufficient to specify just three functions, which is the curvature function \(f\) that we assume to be zero, the initial radial profile \(\rho _{LT0}\) and one extreme value of the density. We will set up two models \(a\) and \(b\). For the initial radial profile we choose

$$\begin{aligned} \begin{aligned}&a:&\quad \rho _{LT0}=\rho _{b0}\left( 1+\frac{1}{10}e^{-\frac{r^{2}}{500}}\right) ,\\&b:&\quad \rho _{LT0}=\rho _{b0}\left( 1+\frac{1}{5}e^{-\frac{r^{2}}{500}}\right) . \end{aligned} \end{aligned}$$
(85)

Both of them are peaked at the origin and \(\rho _{b0}\) is the background density at the initial time. The \(\rho _{LT0}\) is chosen in such a way that besides the origin it is less then \(\rho _{AV0}\), therefore for the extreme value we specify the density minimum since the only requirement for it is that it has to be equal to \(\rho _{LT0}\) at the origin and less everywhere else. We choose \(\rho _{min0}\) as

$$\begin{aligned} \begin{aligned}&a:&\quad \rho _{min0}=\rho _{b0}\left( 1+\frac{1}{10}e^{-\frac{r^{2}}{400}}\right) , \\&b:&\quad \rho _{min0}=\rho _{b0}\left( 1+\frac{1}{5}e^{-\frac{r^{2}}{400}}\right) . \end{aligned} \end{aligned}$$
(86)

The models differ by the size of the radial inhomogeneity that is in the model \(b\) twice as big as in the model \(a\) and we want to demonstrate, that the approximation formula will work better for the model \(a\), because the function \(A\) is closer to 1 than in the model \(b\). The functions \(\rho _{LT0}, \rho _{min0}, \rho _{max0}\) and \(\rho _{AV0}\) for the model \(a\) are shown in Fig. 3a. The function \(A\) for both models is shown in Fig. 3b. The initial time is chosen as \(t_{i}=5\cdot 10^{5}y\) that approximately corresponds to the time of last scattering. The final time \(t_{f}=13.7\cdot 10^{9}y\) which is approximately present time. The initial density contrast \(\frac{\Delta \rho _{0}}{\rho _{b0}}\) and the final density contrast \(\frac{\Delta \rho }{\rho _{b}}\) for both models are shown in Fig. 4, \(\rho _{b}\) denotes the background density at the final time. The impact of the time evolution on the initial shape is minimal as we expected since \(A\) is close to \(1\), on the other hand the magnitude of the density contrast drops significantly because of the factor \(t^{-3}\) in (83). We can also see in the Fig. 4 that the formula (83) approximates the density contrast better for the model \(a\), that corresponds to the lower peak, because we chose the radial inhomogeneity lower than in model \(b\).

Fig. 3
figure 3

a The functions \(\rho _{min0}, \rho _{max0}, \rho _{LT0}\) and \(\rho _{AV0}\) for the model \(a\). The dotted line represents the chosen initial density minimum \(\rho _{min0}\) according to (86). The dashed line is the initial density maximum \(\rho _{max0}\) computed according to (52). The solid line between the dotted and dashed lines is the chosen initial radial density profile \(\rho _{LT0}\) as specified in (85). The top solid line is the computed \(\rho _{AV0}\). All values on the vertical axis are divided by \(\rho _{b}\). b The function \(A\) as defined in (59) for both models. The lower curve corresponds to the model \(a\), the upper curve corresponds to the model \(b\)

Fig. 4
figure 4

a The behaviour of the initial density contrast \(\frac{\Delta \rho _{0}}{\rho _{b0}}\) for both models. b the behaviour of the final density contrast \(\frac{\Delta \rho }{\rho _{b}}\) for both models. The solid curve represents the exact formula (73). The dotted curve is the density contrast as calculated according to the approximation formula (83). The lower and upper curves correspond to the model \(a\) and \(b\) respectively. The lower curve is apparently approximated better, because the radial inhomogeneity was chosen smaller

7 Conclusion

We studied model of inhomogeneity in quasispherical Szekeres model. We set up only 3 of 5 degrees of freedom, which is sufficient for studying the evolution of the density contrast. The lack of specification of the last two degrees of freedom means that we do not have the detailed information about the density distribution, particularly we do not know the position of the extreme values on the spheres. We specify the initial radial density profile \(\rho _{LT0}\) which is the value of the density around the great circle that lies in the plane that defines the dipole. Next, we choose one extreme value of the density at the initial time, either \(\rho _{min0}\) or \(\rho _{max0}\), and the last function that we choose is the curvature function \(f\). In order to choose an appropriate value for the density extremes, we investigated the shell crossing conditions in terms of density \(\rho _{max}, \rho _{min}, \rho _{LT}\) and \(\rho _{AV}\). We derived conditions that \(\rho _{max}\) and \(\rho _{min}\) have to satisfy in order to avoid shell crossing and we showed that in the special case \(f=0\), if the conditions are fulfilled on the initial time slice, then they will hold at any time.

Next, we derived an analytical formula for the density contrast \(\Delta \rho \) as a function of \(t\) and \(r\). In the special case \(f=0\), we derived an approximation formula that is valid if the initial inhomogeneity is small and we showed that in this approximation the density contrast is proportional to the initial density contrast and depends on time as \(t^{-3}\), so there is a decrease in magnitude during time evolution, however the shape of the function is preserved. It shows that the dynamics is very simple and close to homogeneous one for small inhomogeneity confirming the expected behaviour. In this sense one may argue that a small inhomogeneity can be successfully treated in perturbation theory and the influence of nonlinearity is negligible.

The next research will be focused on the situation when the curvature function is chosen more generally and is not equal to zero.