# Simulation of Wave Propagation Using Finite Differences in Oil Exploration
## 3 Results  
Indeed, when simulations involving partial differential equations were performed, apart from the errors of rounding and truncation of the series (remember that the finite difference expressions were derived from a Taylor series development to the second order), there were errors associated with the limitations of adapting the physical model to accurately describe the realistic physical system and the limitations of the boundary conditions. However, convergence and stability tests ensured that the finite difference approximations used in the discretization were correct. There are ways to calculate the convergence of a code when the analytical solutions are known. For example, by knowing the value of \(\Delta x\), the minimum number of nodes required to find a numerical solution for Equation (5) could be determined. Furthermore, the Courant-Friedrichs-Lewy (CFL) condition was necessary for converging the numerical solution of partial differential equations in partial derivatives. To study the stability, it was sufficient that the solutions of the differential equations did not present oscillations (are regular), considering that the solutions depended on time. Let the physical variables p and \(p\) evolve over a long period of time to verify that they do not present oscillations or jagged peaks. This was performed for a time of 30 s. Figure 2 shows the evolution of the acoustic pressure as a function of time for different meshes \(\Delta x\). The development remained smooth without showing irregular behaviors during this evolution. In Figure 2, the peak observed around 10 s occurs when the wave passes from the first to the second layer. We attempted to mitigate this effect by employing a highly refined mesh (consisting of many points). However, due to the limitations of the machine, some code runs could not effectively smooth out these peaks. Figure 3 shows the density behavior as a function of distance \(x\) for different meshes \(\Delta x\). The density shows a typical behavior during the simulation for different \(x\) values. In some cases, when the analytical solution was not known, one way to perform the convergence was to take as the analytical solution the numerical value of the first iteration of the program and compare it with the numerical value of the second iteration. Then, the value of the second iteration was taken as the analytical solution and compared with the numerical value of the third iteration, and so on. The convergence consisted of checking how close the numerical solution obtained was to a known analytical solution. To perform the convergence of the code implemented in Fortran 90, we proceeded as follows: because the finite difference approximation method used in the Taylor series development was of a second order, the error was postulated to also be of the second order in \(\Delta x\). \[error=\Delta x^{2} \tag{11}\]  
Applying logarithm and its properties to both members of Equation (16):  
\[\log\left(error\right)=2\log\Delta x \tag{12}\]  
Equation (16) presented the behavior of a straight slope line equal to two. Plotting Log(error) vs. Log(\(\Delta x\)) presented the error between a known analytical solution and the numerical solution for the acoustic wave equation. A slope approximately equal to two  
Figure 3: Density behavior as a function of distance \(x\) for different meshes \(\Delta x\). The density shows a typical behavior during the simulation for different values of \(x\) and remains smooth without showing irregular behavior. Figure 2: Acoustic pressure behavior as a function of time for different meshes \(\Delta x\). The development remains smooth without showing irregular behaviors during the transition. implied that the numerical solution converged with the analytical solution.