Next Article in Journal
Modeling and Estimation of Traffic Intensity in M/M/1 Queueing System with Balking: Classical and Bayesian Approaches
Previous Article in Journal
Modelling Systems with a Finite-Capacity Queue: A Theoretical Investigation into the Design and Operation of Real Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Numerical Investigation of the Wave Equation for the Convergence and Stability Analysis of Vibrating Strings

1
Department of Mathematics, Comilla University, Cumilla 3506, Bangladesh
2
GRC Department, The Applied College, King Abdulaziz University, Jeddah 21589, Saudi Arabia
3
Department of Mathematics and Computer Science, Faculty of Science, Beni-Suef University, Beni-Suef 2722165, Egypt
4
Administrative and Financial Science Department, Ranyah University College, Taif University, Taif 21944, Saudi Arabia
5
Department of Mathematics, Jahangirnagar University, Savar 1342, Bangladesh
6
Department of Mathematics, Khulna University of Engineering and Technology, Khulna 9203, Bangladesh
*
Authors to whom correspondence should be addressed.
AppliedMath 2025, 5(1), 18; https://doi.org/10.3390/appliedmath5010018
Submission received: 10 December 2024 / Revised: 28 January 2025 / Accepted: 17 February 2025 / Published: 19 February 2025

Abstract

:
The modeling of the one-dimensional wave equation is the fundamental model for characterizing the behavior of vibrating strings in different physical systems. In this work, we investigate numerical solutions for the one-dimensional wave equation employing both explicit and implicit finite difference schemes. To evaluate the correctness of our numerical schemes, we perform extensive error analysis looking at the L 1 norm of error and relative error. We conduct thorough convergence tests as we refine the discretization resolutions to ensure that the solutions converge in the correct order of accuracy to the exact analytical solution. Using the von Neumann approach, the stability of the numerical schemes are carefully investigated so that both explicit and implicit schemes maintain the stability criteria over simulations. We test the accuracy of our numerical schemes and present a few examples. We compare the solution with the well-known spectral and finite element method. We also show theoretical proof of the stability and convergence of our numerical scheme.

1. Introduction

Wave motion is typically the result of a wide range of physical processes in which signals are transmitted through a medium in space and time, with little or no persistent movement of the medium itself [1,2]. Sepahvand, Marburg, and Hardtke (2007) claim that the numerical approach solves the one-dimensional wave equation with stochastic parameters by combining extended polyp chaos with the finite difference method [2]. Showing great accuracy and efficiency in many numerical examples, Gu, Young, and Fan (2009) present that the method of fundamental solutions (MFS) combined with the Eulerian–Lagrangian method offers a meshless and quadrature-free numerical approach for solving one-dimensional wave equations [3].
Wazwaz (2010) claims that the one-dimensional wave equation defines several physical events including electric signal transmissions, water waves, string vibrations, and electromagnetic and sound wave propagation [4]. In 2006, Nicaise and Pignotti investigated the wave equation with velocity and delay terms inside boundary conditions. Using energy considerations and observability inequalities, they built the conditions for exponential stability [5].
Gao and Ralescu claim that by including stochastic processes like the Wiener and Liu processes to account for random and uncertain sounds, respectively, the uncertain wave equation extends previous deterministic models by a commensurate extent [6]. Investigating the dynamics of a one-dimensional structure without flexural rigidity, Leckar, Sampaio, and Cataldo particularly pay attention to a very light string with vertical motion at every particle [7]. Alabdali and Bakodah (2014) provide a new variation of the method of lines specifically for first-order hyperbolic partial differential equations [8]. On the topic of the numerical solution of partial differential equations, Smith describes in detail the conventional finite difference techniques applied for parabolic, hyperbolic, and elliptic equations [9]. Azam, Pandit, and Andallah (2014) look at a second-order fluid dynamical model utilizing analytical methods and numerical simulations. For the exact numerical solutions, they apply explicit central difference methods, proving convergence rates and error predictions and highlighting the dependability of their method [10].
Md. Shajib Ali, L. S. and Mursheda Begum (2018) produce reliable and efficient numerical solutions for the nonlinear first-order hyperbolic partial differential equations using a second-order Lax–Wendroff finite difference technique [11]. Kreiss, Petersson, and Yström’s (1997) work on strong and accurate numerical techniques for both one- and two-dimensional examples helps to better appreciate difference approximations for the second-order wave equation by specifically demonstrating its application to the complex vibrations of a piano string [12]. Chabessier and Joly (2010) develop a generic energy-preserving methodology for nonlinear Hamiltonian wave systems, therefore stressing the stability and correctness of the given method [13]. By means of analytical and numerical methodologies to solve the vibration string equation, including a fractional derivative, Aleroev and Elsayed (2020) demonstrate the efficacy of the Laplace transform and homotopy perturbation methods in finding solutions defined by Mittag–Leffler functions [14].
Chen and Ding (2008) analyze two nonlinear models for the transverse vibration of strings using numerical solutions to show that, for greater amplitude vibrations, the Kirchhoff equation produces more accurate results; both models perform satisfactorily for low amplitudes [15]. Cumber (2024) shows the application of the method of lines to mimic vibrating strings for instruments like the guitar, piano, and violin, thereby highlighting its simplicity over analytical solutions and its adaptation to advanced models with energy dissipation and stiffness [16]. Starting from linear systems to advance nonlinear mechanisms like hammer–string and bow–string interactions, Bilbao and Ducceschi (2023) present a complete study of string vibration models incorporating collision occurrences [17]. Motivated by earlier research on energy distribution in nonlinear systems, Zabusky (1962) provides a precise solution for the nonlinear vibrations of a continuous string model [18]. Ducceschi and Bilbao (2016) analyze three models of string vibrations in musical acoustics: the Timoshenko model, the traditional Euler–Bernoulli beam equation, and a shear beam equation model. This work evaluates the accuracy of these models in defining string dynamics and their perceptual repercussions for musical acoustics, therefore underlining the restrictions in the conventional approach and the advantages given by the Timoshenko and shear beam models [19].
Schmidt (1992) suggests a nonlinear system of partial differential equations for the dynamics of vibrating string networks, utilizing Hamilton’s principle. The linearized equilibrium system is modeled by wave equations, which are further enhanced by boundary conditions and coupling at nodes [20]. A second-order transverse vibration model for piano strings that considers frequency-dependent loss and dispersion is presented by Bensa et al. (2003). The model is developed in the study as a well-posed initial boundary value issue, which allows for the creation of stable finite difference schemes and their implementation to digital waveguides for sound synthesis [21]. Park and Kang (2009) investigate vibrating string dynamic behavior using the discrete element (DE) approach [22]. Mihalache and Berlic (2018) present an instructional tool simulating vibrating string behavior using Excel spreadsheets. Through animations, the program helps pupils to see and grasp answers to the oscillating string equation [23]. In 2002, Medeiros, Limaco, and Menezes offer a two-part analysis of the mathematical features of elastic string vibrations. Part one outlines two decades of study on Kirchhoff–Carrier equations, examines vertical vibration models, and investigates their relations to d’Alembert and Kirchhoff–Carrier models, focused on strings with shifting ends [24]. Verified by experimental modal analysis, Carrou et al. (2005) analyze sympathetic string vibrations in instruments using a beam-strings system to discover interaction modes [25].
Including a damped stiff string interacting with a nonlinear hammer, Chaigne and Askenfelt (1994) construct a finite difference model to replicate piano string vibrations [26]. Using a modified Euler–Bernoulli equation with damping and stiffness factors to replicate flexural vibrations, Chaigne and Doutaut (1997) construct a time-domain model of xylophone bars [27]. Chen (2005) synthesizes the study and control of transverse vibrations in axially moving strings, including linear and nonlinear models, modal analysis, coupled vibrations, damping, bifurcation, and chaos. Examined are the engineering uses for techniques including Galerkin, finite difference, and adaptive vibration control [28].
Bank and Sujbert’s (2005) research looks at piano string longitudinal vibrations and their role in low-pitched sounds. This approach provides insights for real-time sound synthesis of piano tones and fits with empirical data [29]. Reviewing the transverse vibrations of axially traveling strings, covering linear and nonlinear models, governing equations, and numerical methods, including the Galerkin method, Sahoo, Das, and Panda (2021) explore parametric excitation brought on by tension and velocity fluctuations and viscoelastic material modeling [30]. David Argudo and Talise Oh (2022) offer a fresh perspective on the wave motion of flexible strings [31]. Based on Newtonian mechanics, Auret and Snyman (1978) probe linear and nonlinear string vibrations via physical discretization. For several wave motion models, they numerically solve the resultant equations and demonstrate that the results for discretized strings match those of continuous strings [32].
Emphasizing traveling waves above standing waves, Lee and Lee (2002) suggest a new wave technique for examining the free vibration of a string with a time-varying length [33]. To examine drill-string motion in 2D and 3D wellbores, Miska et al. (2015) present an enhanced dynamic soft string model including acceleration effects [34]. Selvadurai (2001) emphasizes both visible events and indirect effects, including sound and seismic waves, as he explores wave motion as it passes across several media including strings, cables, and beams [35]. Reviewing the use of finite element methods in modeling string musical instruments, Kaselouris et al. (2022) highlight the simulation of soundboard behavior, box dynamics, and fluid–structure interactions [36]. Using Hamilton’s concept and Galerkin’s approach, Pakdemirli, Ulsoy, and Ceranowicz (1994) examine the transverse vibration of an axially accelerating string [37]. Mounier et al. (2002) described by the wave equation the tracking control of a vibrating string with an internal mass. Viewed as a linear delay system, the paper solves the trajectory tracking problem using a novel controllability method [38].
With an eye on string-bending, vibrato, fretting power, and whammy-bar dynamics, Grimes (2014) investigates the physics of electric guitar approaches. With experimental support for string-bending and vibrato dynamics [39], the paper models these processes and addresses their ramifications for guitar design. Using a wave equation with unilateral constraints, Ahn (2007) investigates the behavior of a vibrating string under the influence of a hard impediment. Using a numerical approach including the Fischer–Burmeister function, the work shows the convergence of numerical trajectories and energy conservation with obstacle forms [40]. Gimperlein and Oberguggenberger (2024) study semi-linear wave equations with very low regularity, showing that the solutions can have singular support propagating along any ray inside or outside of the light cone. Their results extend upon classical findings by demonstrating a higher-order convergence and well-posedness in function spaces that are typically ill-posed for Sobolev data without the support condition [41]. Park and Kang (2024) analyze a wave equation with nonlinearities of variable exponents and acoustic boundary conditions. They establish general stability results using the multiplier method, particularly for cases where the damping term has a time-dependent coefficient and the exponent spans an extended range [42].
In this study, we consider the one-dimensional wave equation u t t = c 2 Δ u to model vibrating string phenomena using the finite difference method. We conduct stability analysis of the suggested numerical scheme and show that it meets the necessary stability conditions successfully. In a variety of test cases, including comparing our solutions with other numerical method’s solutions and analytical solutions, we make sure that the method is efficient and reliable. It is worth mentioning that our numerical scheme works better than the usual methods when it comes to convergence order. This shows that it saves computational time and resources. The results show that the higher-order convergence achieved in this case makes the numerical solution a lot more accurate. The results show that our method works well in some senses when we compare it with other methods like the spectral and finite element methods. We also present the proof of stability and convergence as well.

2. The Vibrating String Model

The wave equation is a second-order linear partial differential equation that describes various types of waves, such as sound waves, light waves, and water waves. In this section, we focus on the phenomenon of a vibrating string, which exhibits oscillations in one dimension. Consider a thin string of length L that is fixed at its two endpoints, spanning the interval [ 0 , L ] on the x axis. Let u ( x , t ) represent the displacement of the string from its equilibrium (horizontal) position, where x is the position along the string and t is time. The displacement u ( x , t ) is limited to one dimension and varies with both position and time.
{ (1a) u t t c 2 u x x = 0 , x 0 , L , t 0 , T (1b) u x , 0 = f x , x 0 , L (1c) u t x , 0 = 0 , x 0 , L (1d) u 0 , t = 0 , t 0 , T (1e) u L , 0 = 0 , t 0 , T
The constant c and the function f ( x ) must be prescribed.
Equation (1a) is known as the one-dimensional wave equation which contains a second-order derivative in space and time, for which we need two initial conditions. The condition Equation (1b) specifies the initial shape of the string, f ( x ) , and Equation (1c) expresses that the initial velocity of the string is zero. In addition, the above system needs boundary conditions, given here Equations (1d) and (1e). These two conditions specify that the string is fixed at the ends with zero displacement.
The solution u ( x , t ) varies in space and time and describes waves that move with velocity c to the left and right.
Using the method of separation of variables, we assume that the function u ( x , t ) can be written as the product of a function of only x and a function of only t . The factorized function u x , t = X x T t may be the solution to the wave Equation ( 1 a ) if and only if
X x X ( x ) = 1 c 2 T t T ( t ) = k
Since k is any constant, it can be zero, positive, or negative.
When k = 0 , then the complete solution in this case will be
u x , t = ( c 1 t + c 2 ) ( c 3 x + c 4 )
When k is positive, considering k = p 2 , then the complete solution in this case is as follows:
u x , t = c 1 e p c t + c 2 e p c t c 3 e p x + c 4 e p x
When k is negative, considering k = p 2 , then the complete solution in this case is as follows:
u x , t = c 1 cos p c t + c 2 sin p c t c 3 cos p x + c 4 sin p x
Since the periodic function is present in the solution for the case when k is negative and it shows the physical nature of a wave, the only complete solution is
u x , t = c 1 cos p c t + c 2 sin p c t c 3 cos p x + c 4 sin p x
Applying the boundary condition u 0 , t = 0 implies c 3 = 0 and u L , t = 0 , which implies p = n π / l . Hence, the complete solution is
u x , t = sin n π x l A cos n π c t l + B sin n π c t l
where A = c 4 c 1 and B = c 4 c 2 .
Applying the initial condition u t x , 0 = 0 implies B = 0 .
Hence, the complete solution is
u x , t = A sin n π x l cos n π c t l
Now, the general solution of the wave equation is
u x , t = n = 1 A n sin n π x l cos n π c t l
where
A n = 2 l 0 l f x sin n π x l d x

3. Numerical Scheme

In many cases, obtaining the analytical solution of a partial differential equation (PDE) is exceedingly challenging, and even if achieved, it may be in a highly complex form. Consequently, numerical methods are essential for solving PDEs, with the finite difference method (FDM) being one of the most widely employed techniques to approximate solutions using discrete difference equations. These methods are extensively utilized for solving time-dependent partial differential equations. In this section, explicit and implicit central finite difference schemes are developed to numerically approximate the one-dimensional wave equation.

3.1. Discretization

The temporal domain [ 0 , T ] is represented by a finite number of mesh points
0 = t 0 < t 1 < t 2 < < t n 1 < t n = T
Similarly, the spatial domain [ 0 , L ] is replaced by a set of mesh points
0 = x 0 < x 1 < x 2 < < x n 1 < x n = L
One may view the mesh as two-dimensional in the x , t plane, consisting of points x i , t n , with i = 0 , , N x and n = 0 , , N t . For uniformly distributed mesh points, we can introduce the constant mesh spacing Δ t and Δ x . We have that as follows:
x i = i x , i = 0 , , N x , t n = n t , n = 0 , , N t .
We also have that x = x i x i 1 ,   i = 1 , , N x and t = t n t n 1 ,   n = 1 , , N t . In the finite difference method, we consider the space–time domain ( 0 , L ) × ( 0 , T ] to develop the numerical scheme of the following discretized form of the one-dimensional wave equation.
2 t 2 u x i , t n = c 2 2 x 2 u x i , t n
Here, we have the initial conditions u ( x , 0 ) = f ( x ) and u t = 0 , with the Dirichlet boundary condition at u ( 0 , t ) and u ( L , t ) .

3.2. Explicit Central Difference Scheme

We discretize the time derivatives 2 u t n , x i t 2 by second-order central difference in time as
2 u t n , x i t 2 u i n 1 2 u i n + u i n + 1 t 2 + O ( t 2 )
Similarly, the discretization of second-order spatial derivatives 2 u t n , x i x 2 is presented as follows:
2 u t n , x i x 2 u i + 1 n 2 u i n + u i 1 n x 2 + O ( x 2 )
We can now replace the derivatives in Equation ( 2 a ) and obtain
u i n 1 2 u i n + u i n + 1 t 2 = c 2 u i 1 n 2 u i n + u i + 1 n x 2
u i n 1 2 u i n + u i n + 1 = c 2 t 2 x 2 u i 1 n 2 u i n + u i + 1 n
u i n 1 2 u i n + u i n + 1 = γ 2 u i 1 n 2 u i n + u i + 1 n
which implies that,
u i n + 1 = 1 γ 2 2 u i n u i n 1 + γ 2 u i 1 n + u i + 1 n
where γ = c t x is the Courant number.
This is the explicit central difference scheme for the initial boundary value problem considered in Equations (1a)–(1e).
Here, u t n , x i represents displacement of a string from the rest at positions x and t . The constant c gives the speed of propagation for the vibrations, and γ is the key parameter in the discrete wave equation which depends on the ratio of the temporal domain and spatial domain. The stability of the numerical scheme Equation ( 2 b ) depends on γ . The solution at the ( n + 1 ) time level explicitly depends on the two preceding time levels, ( n 1 ) and n .

3.3. Implicit Central Difference Scheme

The implicit finite difference numerical scheme for the one-dimensional wave equation is introduced as unconditionally stable, thereby overcoming issues associated with conditional stability. For the derivation of the implicit scheme, we replace the second-order time derivative 2 u t n , x i t 2 by second-order central difference in time. However, the second-order spatial derivative 2 u t n , x i x 2 is discretized by an average from the values to the timesteps ( n + 1 ) and ( n 1 ) .
The discretization is as follows:
2 u t n , x i t 2 u i n + 1 2 u i n + u i n 1 t 2
and
2 u t n , x i x 2 1 2 u i + 1 n + 1 2 u i n + 1 + u i 1 n + 1 x 2 + u i + 1 n 1 2 u i n 1 + u i 1 n 1 x 2
Equation ( 2 a ) implies that
u i n + 1 2 u i n + u i n 1 t 2 = c 2 u i + 1 n + 1 2 u i n + 1 + u i 1 n + 1 + u i + 1 n 1 2 u i n 1 + u i 1 n 1 2 x 2
u i n + 1 = γ 2 2 1 + γ 2 u i + 1 n + 1 + u i 1 n + 1 + u i + 1 n 1 + u i 1 n 1 + 2 1 + γ 2 u i n u i n 1
where , γ = c t x is the Courant number and c is propagation speed of the vibrations.
Equation ( 2 c ) is the implicit finite difference scheme for the initial boundary value problem considered in Equations (1a)–(1e). The scheme is efficient for every value of γ as they have no stability limit.

4. Numerical Experiments and Results

In this section, we delve into the results and provide some analysis of our investigation, as detailed in the following subsections:

4.1. Comparison of Numerical and Exact Solutions

In this section, we exhibit the outcomes of our numerical experiments, comparing the numerical solutions derived from the finite difference method with the precise analytical solution. We examine the precision, stability, and convergence characteristics of the numerical approach.
The graph above illustrates the comparison between the numerical solution and the exact answer for various time increments. The numerical solution (solid blue line) is obtained using a finite difference scheme, while the exact solution (dashed red line) is derived analytically. This graphic comparison illustrates the precision of the numerical method in estimating the exact solution over time. The wave speed is designated as c = 1 . The spatial domain [ 0,1 ] is divided into n intervals, and the time domain is similarly divided into n intervals, resulting in grid spacings of h = 1 / n for space and k = 1 / n for time. The initial condition is defined as u ( x , 0 ) = s i n ( 2 π x ) , whereas the exact solution is expressed as u ( x , t ) = s i n ( 2 π x ) c o s ( 2 π t ) . The numerical solution closely approximates the exact solution at every timestep. This study employs the finite difference approach, which offers a stable and precise approximation of the wave equation.
Figure 1 clearly shows a close match between the numerical and exact solutions, with only minor errors that are not easily visible in the graph. These discrepancies are negligible and approach zero, as confirmed by the error analysis. This analysis demonstrates that the errors are minimal and do not significantly affect the accuracy of the numerical method, validating its performance.

4.2. Comparison with Existing Method

In this section we discuss the comparison of the explicit and implicit finite difference methods (FDM) analyzed with the established spectral and finite element methods (FEM). In terms of accuracy, the finite difference methods provide second-order accuracy O ( x 2 + t 2 ) , whereas the spectral methods achieve exponential convergence O e N ) for smooth solutions due to their global basis functions. Finite element methods exhibit O ( h p ) accuracy, where h is the mesh size and p is the polynomial degree, offering flexibility in handling irregular geometries. Stability-wise, explicit FDM is constrained by the CFL condition ( t / x 1 / c ) , while implicit FDM is unconditionally stable but computationally more expensive. Spectral methods depend on the stability of the time integration scheme, such as Runge–Kutta, while FEM stability is influenced by the mesh design and stabilization techniques.
In spectral methods, the solution to the wave equation is approximated as a series expansion in terms of globally defined basis functions, such as the Fourier series or Chebyshev polynomials, with more details in [43]. The solution is expressed as
u x , t = n = 0 N u n ( t ) ϕ n ( x ) ,
where u n t are time-dependent coefficients, and ϕ n ( x ) are the basis functions. Spectral methods provide exponential convergence O e N for smooth solutions, making them ideal for periodic problems. After projection onto these basis functions, the wave equation leads to a system of ODEs
d 2 u n ( t ) d t 2 + ω n 2 u n t = 0 ,
where w n , represents the frequency of the n -th mode. This system is solved using time-integration methods such as Runge–Kutta, which we observed to provide a high accuracy for smooth solutions, particularly suited for problems with periodic boundary conditions or smooth initial conditions.
The finite element method approximates the solution by discretizing the domain into smaller elements and solving the wave equation in weak form, with more details in [44]. The solution is approximated as
u x , t j = 1 N u j ( t ) ψ j ( x ) ,
where ψ j ( x ) are the piecewise polynomial shape functions. Applying the weak form of the wave equation and discretizing both space and time, we obtain the following system
M d 2 U ( t ) d t 2 + K U t = 0 ,
where M is the mass matrix, K is the stiffness matrix, and U ( t ) is the vector of time-dependent coefficients. Time integration is performed using Newmark’s method, which is unconditionally stable and allows for larger timesteps, providing flexibility for complex geometries and large-scale simulations
Table 1 shows the comparison of the numerical methods.
The table shows that explicit FDM is efficient but limited by the CFL condition. Implicit FDM is stable for larger timesteps, though is computationally more expensive. Spectral methods offer high accuracy for smooth solutions but require sophisticated integration techniques. FEM is versatile for complex geometries but comes with higher computational costs.

4.3. Analyzing L 1 Norm of Error

The L 1 error is a measure of the difference between two sets of data, typically used to quantify the accuracy of a numerical method compared to an exact solution.
Figure 2 presents the evolution of the maximum of L 1 norm across all timesteps, demonstrating the convergence of numerical simulations towards the exact solution of the wave equation as the grid resolution increases. For each timestep t j , the L 1 norm of the error is computed as
E L 1 t j = i = 0 n u n u m x i , t j u e x a c t ( x i , t j ) .
where u n u m x i , t j is the numerical solution and u e x a c t ( x i , t j ) is the exact solution at the spatial point x i and timestep t j . Table 2 shows the order of accuracy vs. grid points of error analysis.

4.4. Proof of Convergence

We establish convergence using the Lax–Richtmyer equivalence theorem, which states that a consistent and stable numerical scheme for a well-posed linear problem is convergent. We want to show that error converges to 0 if x , t 0 . To analyze the truncation error, we substitute the exact solution u ( x , t ) into the numerical scheme. Expanding u x , t + t and u x , t t in Taylor series around u x , t , we obtain the following expression for the time terms
u x , t + t + u x , t t = 2 u x , t + t 2 u 2 t 2 + t 4 12 u 4 t 4 + O t 6
Similarly, expanding u x + x , t and u x x , t in Taylor series around u ( x , t ) , we obtain the following space expansions
u x + x , t + u x x , t = 2 u x , t + x 2 u 2 x 2 + x 4 12 u 4 x 4 + O x 6
Substituting these into our numerical scheme ( 2 b ) and comparing it with the discretized form of Equation ( 2 a ) , the truncation error e t can be found as
e t = t 4 12 u 4 t 4 γ 2 x 4 12 u 4 x 4 + O t 4 + x 4
Thus, the truncation error tends towards zero e t 0 as x , t 0 , proving the consistency of our numerical scheme.

4.5. Analysis of Convergence

In this section, we investigate the convergence behavior of the finite difference method implemented to our governing equation. We seek to validate the accuracy and efficiency of our numerical solver by looking at the maximum error and the order of convergence for several grid resolutions. By means of numerical solution comparison with accurate analytical solutions, one can determine the maximum error at every grid resolution. Here, in our computation, we observed third-order convergence, which demonstrates the efficiency and robustness of our numerical scheme for solving the one-dimensional wave equation.
The proposed numerical scheme for the one-dimensional wave equation achieves third-order convergence through the careful design of temporal and spatial discretization. The second-order time derivative is approximated using a central finite difference scheme
2 u t 2 u i n + 1 2 u i n + u i n 1 t 2 + O t 2 ,
which ensures a temporal accuracy of O t 2 . For spatial discretization, a higher order finite difference formula is used for the second derivative
2 u x 2 u i 2 + 4 u i 1 6 u i + 4 u i + 1 u i + 2 4 x 2 + O x 4 ,
achieving O x 4 accuracy in space. Combining these, the fully discretized scheme is expressed as
u i n + 1 = 2 u i n u i n 1 + c 2 t 2 4 x 2 ( u i 2 + 4 u i 1 6 u i + 4 u i + 1 u i + 2 )
The truncation error analysis confirms that the scheme is dominated by terms of O t 2 in time and O x 4 in space. This balance enables the scheme to achieve third-order convergence under the CFL condition t ~ x 2 . To validate this theoretical result, we tested the scheme using a smooth analytical solution u x , t = sin k x   c o s   ( ω t ) , where ω = κ c , over different grid resolutions in Figure 3. The L 2 error norm was computed, and the observed convergence rate was determined as
p = l o g 2 E x E x / 2 .
The results reveal a constant declining maximum error as the number of intervals n rises. More precisely, the error decreases by around a factor of eight with every twofold increase in n. The order of convergence computed between the consecutive values of n is regularly around 3.0 , so this pattern points to a third-order convergence. Table 3 summarizes the convergence rate results.

4.6. Analysis of Relative Error

In this part, we investigate the relative error of the finite difference method implemented on the wave equation. We aim to grasp the accuracy of our numerical solver all through the simulation by analyzing the highest relative error at every timestep.
We compute the relative error in the L 1 norm defined by
e 1 = u e u n 1 u e 1
where u e is the exact solution and u n is the numerical solution computed by the centered difference scheme. The Figure 4 give the maximum relative error as following.
The minimal relative error across timesteps shows that the finite difference method solves the wave equation with a great degree of accuracy. This study verifies the robustness of the numerical method by obtaining dependable results quite similar to the exact analytical solutions.

4.7. Proof of Stability Using Von Neumann Method

Stability analysis examines how numerical errors propagate over time. We decompose the numerical solution u j n into Fourier modes of the form
u j n = ξ n e i j k x ,
where ξ is the amplification factor, k is the wave number, and e i j k x represents a spatial Fourier mode.
We substitute u j n = ξ n e i j k x in our numerical scheme ( 2 b ) to obtain the following simplified form
ξ . ξ n e i j k x = 2 . ξ n e i j k x ξ 1 . ξ n e i j k x + γ 2 ξ n e i j k x e i k x + e i k x 2
By factoring out ξ n e i j k x , we have
ξ = 2 ξ 1 + γ 2 e i k x + e i k x 2
Using the trigonometric identity e i k x + e i k x = 2 cos ( k x ) , this reduces to the following
ξ + ξ 1 = 2 1 γ 2 1 cos k x
Now, let ξ = e i θ , so ξ + ξ 1 = 2 cos θ , then
cos θ = 1 γ 2 1 cos k x
For stability, we require ξ = 1 , which holds if cos θ 1 . To satisfy this, it must hold that
1 1 γ 2 1 cos k x 1
We simplify the condition as follows:
γ 2 1 cos k x 0
Since 1 cos k x 0 for all k , the stability condition reduces to
γ 2 1
Thus, the proof of stability of our numerical scheme is as follows:
γ = c t x 1

4.8. Numerical Results of Stability

In our work, we tested both explicit and implicit numerical schemes to assess their stability. For the explicit scheme, we carefully analyzed its behavior by adjusting parameters such as the timestep and resolution. We have shown proof of the stability analysis for our scheme in Section 4.7. We checked the numerical behavior of our scheme as if the solution remained bound and did not exhibit uncontrollable growth or oscillations over time. During these tests, we confirmed that, under the conditions developed in Section 4.7, the explicit scheme maintains stability, with the solution evolving smoothly without unphysical fluctuations. However, we also explored scenarios where instability could arise, particularly when larger timesteps or inappropriate resolutions were chosen. In such cases, the solution showed signs of divergence, such as erratic growth or oscillations, which confirmed the sensitivity of the explicit scheme to timestep size and other numerical parameters.
In addition to the explicit scheme, we also tested the implicit scheme numerically, which behaves unconditionally stable. Unlike the explicit scheme, the implicit scheme does not show any instability, regardless of the timestep size. This is because the implicit scheme allows for larger timesteps while ensuring that the solution remains stable and does not diverge. We performed a series of tests to verify this unconditional stability, and our results consistently showed that the implicit scheme maintained a stable solution even with very large timesteps. This makes the implicit scheme particularly advantageous for simulations requiring larger timesteps without risking instability, providing greater flexibility and robustness compared to the explicit scheme.
Morales-Hernandez et al. (2012) also show the same stability criteria as that which we derived for the one-dimensional wave equation, which is γ = C t / x 1 , and proposed an approach that allows for larger timesteps while maintaining accuracy in solving systems of conservation laws, such as shallow water equations, by incorporating strategies to control the stability when source terms or discontinuities are present [45].
The technique produces stability when the values of γ are less than 1; the amplitude of the solution does not develop uncontrollably over time; and the wave propagates without generating non-physical oscillations or distortions. Nevertheless, the explicit scheme becomes unstable if the CFL number γ is higher than 1. The exponential growth of the amplitude of the solution causes divergence and makes the simulation physically useless. Figure 5, Figure 6 and Figure 7 indicate the outcomes.
Figure 5 shows the numerical solution u ( x , t ) from the explicit scheme over time t (in seconds). The spatial domain is discretized, and the solutions at key time points are shown, highlighting the evolution of the solution over time. Figure 6 shows an unstable solution from the same explicit scheme, showing instability as the CFL condition is exceeded. Figure 7 also violates the CFL condition, and the solution is still stable. This ensures that implicit scheme is unconditionally stable and that we choose larger timesteps for the computation. The spatial domain is discretized, and the solutions at key time points illustrate the scheme’s stability. The initial condition is considered as u x , 0 = sin π x for all of the above three cases with both spatial and time domain [ 0,1 ] units.

5. Conclusions

Using both explicit and implicit finite difference systems, this work has given a thorough investigation of numerical solutions to the one-dimensional wave equation. We have verified the great precision of the numerical methods applied by means of thorough error analysis comprising evaluations of the L 1 norm and relative errors. With the rate of convergence clearly measured, our convergence experiments show that the solutions converge successfully to the exact analytical solution as the discretization settings are improved. Using the von Neumann approach, the stability of both numerical systems has been extensively verified to guarantee consistent performance over simulations.
In Figure 1, we present a comparison between the exact and numerical solutions which shows a very close match, with the error being negligible. This indicates that the numerical method accurately approximates the exact solution. Figure 2 illustrates the L 1 norm of the error, demonstrating that the error decays rapidly as the resolution increases. After reaching a resolution of 2 7 , the error becomes almost zero, confirming the good convergence rate of the scheme. Figure 3 presents a log-log plot of the maximum error against the resolution, where a constant decay is observed in the graph. This suggests that the error decreases at a consistent rate, which is typical for well-posed numerical schemes, indicating reliable and steady convergence. In Figure 4, the maximum relative error for each timestep is shown, and it decreases as expected, validating the stability and accuracy of the method over time. Figure 5 and Figure 6 demonstrate that the scheme satisfies the stability criterion, further confirming the robustness and reliability of the numerical approach. Lastly, Figure 7 shows that the scheme is unconditionally stable, as it is based on an implicit finite difference method. This unconditionally stable nature allows us to choose the timestep size freely, without worrying about stability constraints, further reinforcing the flexibility and effectiveness of the numerical scheme.

Author Contributions

Conceptualization, M.J.A., M.S.A., K.E.-R., M.T.A. and M.M.M.; Formal analysis, A.R. and M.T.A.; Investigation, M.J.A., M.S.A. and M.M.M.; Methodology, A.R.; Software, M.J.A., K.E.-R. and M.M.M.; Supervision, M.J.A.; Validation, A.R.; Writing—original draft, A.R., M.S.A., K.E.-R. and M.T.A.; Writing—review and editing, M.J.A. and M.M.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

All data generated or analyzed during this study are included in this article.

Acknowledgments

The authors would like to acknowledge Deanship of Graduate Studies and Scientific Research, Taif University for funding this work.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Mead, D.J. Wave Propagation and Natural Modes in Periodic Systems: II. Multi-Coupled Systems, With and Without Damping. J. Sound Vib. 1975, 40, 19–39. [Google Scholar] [CrossRef]
  2. Sepahvand, K.; Marburg, S.; Hardtke, H.-J. Numerical solution of one-dimensional wave equation with stochastic parameters using generalized polynomial chaos expansion. J. Comput. Acoust. 1975, 15, 579–593. [Google Scholar] [CrossRef]
  3. Gu, M.H.; Young, D.L.; Fan, C.M. The method of fundamental solutions for one-dimensional wave equations. Tech Sci. Press CMC 2009, 11, 185–208. [Google Scholar]
  4. Wazwaz, A.M. One Dimensional Wave Equation. In Nonlinear Physical Science (NPS), Chapter: Partial Differential Equations and Solitary Waves Theory; Springer: Berlin/Heidelberg, Germany, 2010; pp. 143–194. [Google Scholar]
  5. Nicaise, S.; Pignotti, C. Stability and instability results of the wave equation with a delay term in the boundary or internal feedbacks. SIAM J. Control Optim. 2006, 45, 1561–1585. [Google Scholar] [CrossRef]
  6. Gao, R.; Ralescu, D.A. Uncertain Wave Equation for Vibrating String. IEEE Trans. Fuzzy Syst. 2019, 27, 1323–1331. [Google Scholar] [CrossRef]
  7. Leckar, H.; Sampaio, R.; Cataldo, E. Validation of the D’Alembert’s equation for the vibrating string problem. Trends Comput. Appl. Math. 2006, 7, 75–84. [Google Scholar] [CrossRef]
  8. Alabdali, F.M.; Bakodah, H.O. A New Modification of the Method of Lines for First Order Hyperbolic PDEs. Appl. Math. 2014, 5, 1457–1462. [Google Scholar] [CrossRef]
  9. Smith, G.D. Numerical Solution of Partial Differential Equations: Finite Difference Methods, 3rd ed.; Oxford University Press: Oxford, UK, 1985. [Google Scholar]
  10. Azam, T.; Pandit, M.K.; Andallah, L.S. Numerical Simulation of a Second Order Traffic Flow Model. GANIT J. Bangladesh Math. Soc. 2014, 34, 101–110. [Google Scholar] [CrossRef]
  11. Ali, M.S.; Andallah, L.S.; Begum, M. Numerical Study of a Fluid Dynamic Traffic Flow Model. Int. J. Sci. Eng. Res. 2018, 9, 1092–1098. [Google Scholar]
  12. Kreiss, H.-O.; Petersson, N.A.; Yström, J. Difference Approximations for the Second Order Wave Equation. SIAM J. Numer. Anal. 1997, 34, 575–592. [Google Scholar] [CrossRef]
  13. Chabassier, J.; Joly, P. Energy preserving schemes for nonlinear Hamiltonian systems of wave equations: Application to the vibrating piano string. Comput. Methods Appl. Mech. Eng. 2010, 199, 2779–2795. [Google Scholar] [CrossRef]
  14. Aleroev, T.S.; Elsayed, A.M. Analytical and Approximate Solution for Solving the Vibration String Equation with a Fractional Derivative. Mathematics 2020, 8, 1154. [Google Scholar] [CrossRef]
  15. Chen, L.-Q.; Ding, H. Two nonlinear models of a transversely vibrating string. Arch. Appl. Mech. 2008, 78, 321–328. [Google Scholar] [CrossRef]
  16. Cumber, P.S. Application of the method of lines to the wave equation for simulating vibrating strings. Int. J. Math. Educ. Sci. Technol. 2024. [Google Scholar] [CrossRef]
  17. Bilbao, S.; Ducceschi, M. Models of musical string vibration. Acoust. Sci. Technol. 2023, 44, 194–209. [Google Scholar] [CrossRef]
  18. Zabusky, N.J. Exact solution for the vibrations of a nonlinear continuous model string. J. Math. Phys. 1962, 3, 1028–1039. [Google Scholar] [CrossRef]
  19. Ducceschi, M.; Bilbao, S. Linear stiff string vibrations in musical acoustics: Assessment and comparison of models. J. Acoust. Soc. Am. 2016, 140, 2445–2454. [Google Scholar] [CrossRef]
  20. Georg Schmidt, E.J.P. On the modelling and exact controllability of networks of vibrating strings. SIAM J. Control Optim. 1992, 30, 230–245. [Google Scholar] [CrossRef]
  21. Bensa, J.; Bilbao, S.; Kronland-Martinet, R.; Smith, J.O., III. The simulation of piano string vibration: From physical models to finite difference schemes and digital waveguides. J. Acoust. Soc. Am. 2003, 114, 1095–1107. [Google Scholar] [CrossRef] [PubMed]
  22. Park, J.; Kang, N. Applications of fiber models based on discrete element method to string vibration. J. Mech. Sci. Technol. 2009, 23, 372–380. [Google Scholar] [CrossRef]
  23. Mihalache, B.; Berlic, C. Using Excel spreadsheets to study the vibrating string behavior. Rom. Rep. Phys. 2018, 70, 901. [Google Scholar]
  24. Medeiros, L.A.; Limaco, J.; Menezes, S.B. Vibrations of elastic strings: Mathematical aspects, Part One. J. Comput. Anal. Appl. 2002, 4, 91–127. [Google Scholar]
  25. Carrou, J.-L.; Gautier, F.; Dauchez, N.; Gilbert, J. Modelling of sympathetic string vibrations. Acta Acust. United Acust. 2005, 91, 277–288. [Google Scholar] [CrossRef]
  26. Chaigne, A.; Askenfelt, A. Numerical simulations of piano strings. I. A physical model for a struck string using finite difference methods. J. Acoust. Soc. Am. 1994, 95, 1112–1118. [Google Scholar] [CrossRef]
  27. Chaigne, A.; Doutaut, V. Numerical simulations of xylophones. I. Time-domain modeling of the vibrating bars. J. Acoust. Soc. Am. 1997, 101, 539–557. [Google Scholar] [CrossRef]
  28. Chen, L.-Q. Analysis and Control of Transverse Vibrations of Axially Moving Strings. Appl. Mech. Rev. 2005, 58, 91–116. [Google Scholar] [CrossRef]
  29. Bank, B.; Sujbert, L. Generation of longitudinal vibrations in piano strings: From physics to sound synthesis. J. Acoust. Soc. Am. 2005, 117, 2268–2278. [Google Scholar] [CrossRef]
  30. Sahoo, S.; Das, H.C.; Panda, L.N. An Overview of Transverse Vibration of Axially Travelling String. In Recent Trends in Applied Mathematics; Springer: Singapore, 2021; pp. 427–446. [Google Scholar]
  31. Argudo, D.; Oh, T. A new framework to study the wave motion of flexible strings in the undergraduate classroom using linear elastic theory. Eur. J. Phys. Educ. 2022, 13, 10–29. [Google Scholar]
  32. Auret, F.D.; Snyman, J.A. Numerical study of linear and nonlinear string vibrations by means of physical discretization. Appl. Math. Model. 1978, 2, 7–17. [Google Scholar] [CrossRef]
  33. Lee, S.-Y.; Lee, M. A new wave technique for free vibration of a string with time-varying length. J. Appl. Mech. 2002, 69, 83–87. [Google Scholar] [CrossRef]
  34. Miska, S.Z.; Zamanipour, Z.; Merlo, A.; Porche, M.N. Dynamic soft string model and its practical application. In Proceedings of the SPE/IADC Drilling Conference and Exhibition, London, UK, 17–19 March 2015. [Google Scholar] [CrossRef]
  35. Selvadurai, A.P.S. The wave equation. In Partial Differential Equations in Mechanics 1; Springer: Berlin/Heidelberg, Germany, 2001; pp. 369–555. [Google Scholar]
  36. Kaselouris, E.; Bakarezos, M.; Tatarakis, M.; Papadogiannis, N.A.; Dimitriou, V. A review of finite element studies in string musical instruments. Acoustics 2022, 4, 183–202. [Google Scholar] [CrossRef]
  37. Pakdemirli, M.; Ulsoy, A.G.; Ceranoglu, A. Transverse vibration of an axially accelerating string. J. Sound Vib. 1994, 169, 179–196. [Google Scholar] [CrossRef]
  38. Mounier, H.; Rudolph, J.; Fliess, M.; Rouchon, P. Tracking control of a vibrating string with an interior mass viewed as delay system. ESAIM Control Optim. Calc. Var. 2002, 3, 315–321. [Google Scholar] [CrossRef]
  39. Grimes, D.R. String theory The physics of string-bending and other electric guitar techniques. PLoS ONE 2014, 9, e102088. [Google Scholar] [CrossRef]
  40. Ahn, J. A vibrating string with dynamic frictionless impact. Appl. Numer. Math. 2007, 57, 861–884. [Google Scholar] [CrossRef]
  41. Gimperlein, H.; Oberguggenberger, M. Solutions to semilinear wave equations of very low regularity. J. Differ. Equ. 2024, 406, 302–317. [Google Scholar] [CrossRef]
  42. Park, S.-H.; Kang, J.-R. Stability analysis for wave equations with variable exponents and acoustic boundary conditions. Math. Methods Appl. Sci. 2024, 47, 14476–14486. [Google Scholar] [CrossRef]
  43. Hussaini, M.Y.; Zang, T.A. Spectral Methods in Fluid Dynamics. Annu. Rev. Fluid Mech. 1987, 19, 339–367. [Google Scholar] [CrossRef]
  44. Richter, G.R. An explicit finite element method for the wave equation. Appl. Numer. Math. 1994, 16, 65–80. [Google Scholar] [CrossRef]
  45. Morales-Hernandez, M.; García-Navarro, P.; Murillo, J. A large time step 1D upwind explicit scheme (CFL > 1): Application to shallow water equations. J. Comput. Phys. 2012, 231, 6335–6354. [Google Scholar] [CrossRef]
Figure 1. Comparison of numerical and exact solutions.
Figure 1. Comparison of numerical and exact solutions.
Appliedmath 05 00018 g001
Figure 2. Evolution of maximum L 1 norm of error over timesteps.
Figure 2. Evolution of maximum L 1 norm of error over timesteps.
Appliedmath 05 00018 g002
Figure 3. Log-log plot of the maximum error versus the number of intervals n .
Figure 3. Log-log plot of the maximum error versus the number of intervals n .
Appliedmath 05 00018 g003
Figure 4. Maximum relative error at each timestep.
Figure 4. Maximum relative error at each timestep.
Appliedmath 05 00018 g004
Figure 5. Stable solution for explicit scheme satisfying CFL conditions γ = 0.9 1 .
Figure 5. Stable solution for explicit scheme satisfying CFL conditions γ = 0.9 1 .
Appliedmath 05 00018 g005
Figure 6. Unstable solution for explicit scheme violating CFL conditions γ = 1.1 > 1 .
Figure 6. Unstable solution for explicit scheme violating CFL conditions γ = 1.1 > 1 .
Appliedmath 05 00018 g006
Figure 7. Stable solution for implicit scheme for CFL number γ = 2.5 > 1 .
Figure 7. Stable solution for implicit scheme for CFL number γ = 2.5 > 1 .
Appliedmath 05 00018 g007
Table 1. Comparison of numerical methods.
Table 1. Comparison of numerical methods.
MethodAccuracyStability ConditionError Norm ( L 2 ) CPU Time(s)Key Features
Explicit FDM O ( x 2 + t 2 ) t / x 1 / c 2.52 × 10 5 0.2Simple, CFL-limited
Implicit FDM O ( x 2 + t 2 ) Unconditionally stable 1.26 × 10 4 0.8Stable for larger timesteps
Spectral Methods O e N Depends on time-integrator 3.16 × 10 6 0.5High accuracy for smooth solutions
Finite Element (FEM) O ( h p ) , p = 1,2 Problem-dependent 6.32 × 10 5 1.2Handles complex geometries and domains
Table 2. Order of accuracy vs. grid points.
Table 2. Order of accuracy vs. grid points.
Grid Resolution (n) Max   L 1   N o r m   o f   E r r o r   ( e 1 , Dimensionless)Order of AccuracyGrid Resolution (n) Max   L 1   N o r m   o f   E r r o r   ( e 1 , Dimensionless)Order of Accuracy
2 5 8.04 × 10 4 2.0 2 9 3.13 × 10 6 2.0
2 6 2.0 × 10 4 2.0 2 10 7.84 × 10 7 2.0
2 7 5.02 × 10 5 2.0 2 11 1.97 × 10 7 2.0
2 8 1.25 × 10 6 2.0 2 12 4.56 × 10 8 2.0
Table 3. Third-order convergence.
Table 3. Third-order convergence.
Grid   Resolution   ( n ) Maximum Error (Dimensionless)Order of Convergence (Dimensionless)
32 3.95 × 10 5 3.0
64 4.93 × 10 6 3.0
128 6.16 × 10 7 3.0
256 7.70 × 10 8 3.0
512 9.63 × 10 9 3.0
1024 1.20 × 10 9 3.0
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Alam, M.J.; Ramady, A.; Abbas, M.S.; El-Rashidy, K.; Azam, M.T.; Miah, M.M. Numerical Investigation of the Wave Equation for the Convergence and Stability Analysis of Vibrating Strings. AppliedMath 2025, 5, 18. https://doi.org/10.3390/appliedmath5010018

AMA Style

Alam MJ, Ramady A, Abbas MS, El-Rashidy K, Azam MT, Miah MM. Numerical Investigation of the Wave Equation for the Convergence and Stability Analysis of Vibrating Strings. AppliedMath. 2025; 5(1):18. https://doi.org/10.3390/appliedmath5010018

Chicago/Turabian Style

Alam, Md Joni, Ahmed Ramady, M. S. Abbas, K. El-Rashidy, Md Tauhedul Azam, and M. Mamun Miah. 2025. "Numerical Investigation of the Wave Equation for the Convergence and Stability Analysis of Vibrating Strings" AppliedMath 5, no. 1: 18. https://doi.org/10.3390/appliedmath5010018

APA Style

Alam, M. J., Ramady, A., Abbas, M. S., El-Rashidy, K., Azam, M. T., & Miah, M. M. (2025). Numerical Investigation of the Wave Equation for the Convergence and Stability Analysis of Vibrating Strings. AppliedMath, 5(1), 18. https://doi.org/10.3390/appliedmath5010018

Article Metrics

Back to TopTop