# Modeling of Characteristics of Complex Microstructure and Heterogeneity at the Core Scale
## 2 Methods
### Random Medium Model  
As shown in Figure 2, numerical simulations are important when proposing a new model because they can check whether the new model captures the key factors of physical phenomena. The method above is used to describe the complex pore structure, while the inhomogeneity of the matrix is described using the random medium model presented in this section.  
For a generally uniform, isotropic elastic medium, the velocity and density at spatial coordinates (x, y) can be expressed as  
\[v(x,z)=v_{0}+\delta v(x,z), \tag{23}\]\[\rho(x,z)=\rho_{0}+\delta\rho(x,z), \tag{24}\]  
where, the variables \(v_{0}\) and \(\rho_{0}\) represent the velocity and density of a macroscopic nonuniform medium, respectively, while perturbations \(\delta v\) and \(\delta\rho\) represent the velocity and density of a microscopic nonuniform medium, respectively. According to [PERSON]'s theory [51], it can be postulated that the relative perturbations of longitudinal and shear wave velocities are equivalent, while the relative perturbations of density and velocity exhibit a linear relationship. To represent small-scale inhomogeneous bodies within a random medium, a perturbation parameter can be employed. For instance, the velocity perturbation can be mathematically expressed as follows:  
\[\sigma(x,z)=\frac{\delta v}{v_{0}}=\frac{1}{\kappa}\frac{\delta\rho}{\rho_{0}}, \tag{25}\]  
where \(v_{0}\) is the background velocity, \(\sigma(x,z)\) is the relative velocity perturbation in space, and \(\kappa\) is a scale factor ranging from 0.3 to 0.8. Then,  
\[v(x,z) =v_{0}+\delta v(x,z)=v_{0}(1+\sigma), \tag{26}\] \[\rho(x,z) =\rho_{0}+\delta\rho(x,z)=\rho_{0}(1+\sigma). \tag{27}\]  
The process used to construct the random medium \(\sigma(x,z)\) with autocorrelation function \(\varphi(x,z)\)[52; 53] is as follows.  
1. The power spectral density of a stationary stochastic process \(\sigma\) can be obtained from the Fourier transform of its autocorrelation function \(\varphi(x,z)\): \[\Phi(k_{x},k_{z})=\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\varphi(x,z )e^{-i(k_{x}x+k_{z}z)}dxdz.\] (28)  
The autocorrelation function is  
\[\varphi(x,z)=e^{-\left[\frac{(x\cos\theta+z\sin\theta)^{2}}{a^{2}}+\frac{(x \sin\theta-z\cos\theta)^{2}}{b^{2}}\right]^{n}}, \tag{29}\]  
where, \(a\) and \(b\) are the autocorrelation length, and the angle factor \(\theta\) describes the orientation of the reconstructed rock particles.  
Figure 2: Workflow for benchmarking published analytical models and ensuring the quality of future models.  
2. The initial random medium \(\xi(k_{x},k_{y})\) is generated with a uniform distribution using a random number generator with the interval [0, 2\(\pi\)].
3. A random medium power spectrum is generated: \[\Psi(k_{x},k_{z})=\sqrt{\Phi(k_{x},k_{z})}e^{i\xi(k_{x},k_{z})}.\] (30)
4. The random disturbance in the space domain is obtained with the inverse Fourier transform of the random power spectrum function \(\Psi(k_{x},k_{z})\), \[\psi(x,z)=\frac{1}{(2\pi)^{2}}\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty} \Psi(k_{x},k_{z})e^{i(k_{x}x+kz)}dk_{x}dk_{z},\] (31) and its mean and variance are \[E=\langle\psi(x,z)\rangle,\] (32) \[D=\Big{\langle}(\psi(x,z)-E)^{2}\Big{\rangle},\] (33) where \(\langle\cdots\rangle\) indicates the mean.
5. Based on the above mean and variance, a spatial domain random medium distribution with \(\varphi(x,z)\) as the autocorrelation function is generated: \[\sigma(x,z)=\frac{\varepsilon}{\sqrt{D}}[\psi(x,z)-E].\] (34) Its mean is zero, and its variance is \(\varepsilon^{2}\).