Solving Nonlinear Klein-Gordon Equations via PyDEns: A Neural Network-Based PDE Solver

Soumaya Nouna, Ilyas Tammouch, Assia Nouna, Mohamed Mansouri

Abstract


We propose PyDEns, a neural network-based framework for solving partial differential equations (PDEs), applied to nonlinear Klein-Gordon equations. The method uses a deep feedforward neural network with four hidden layers containing 30, 40, 50, and 60 neurons respectively. The training process employs a composite loss function integrating the residuals of the PDE, initial, and Neumann boundary conditions. Optimization is carried out using stochastic gradient descent (SGD). Dataset generation is performed by sampling collocation points across the spatiotemporal domain. The model achieves high accuracy, with a maximum relative L2 error of 2.3 × 10−4 and RMSE as low as 0.0021, depending on the test case. Results show excellent agreement with known analytical solutions and fast convergence within 600 training iterations, demonstrating PyDEns’ potential as an efficient and generalizable solver for nonlinear PDEs.

Full Text:

PDF


DOI: https://doi.org/10.31449/inf.v49i28.8912

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.