Preprint
Article

This version is not peer-reviewed.

Physics-Informed Neural Networks for Solving Second-Order Boundary Value Problems: A Comparative Study with Fem and Finit Difference Methods

Submitted:

05 April 2026

Posted:

07 April 2026

You are already at the latest version

Abstract
Physics-Informed Neural Networks (PINNs) have emerged as a powerful paradigm for solving partial differential equations (PDEs) by embedding physical laws directly into the neural network training process. This paper presents a comprehensive comparative study of PINNs against traditional numerical methods—Finite Element Method (FEM) and Finite Difference (FD)—for solving second-order boundary value problems. We focus on the canonical problem u″(x)=e-x on the domain [0,1] with Dirichlet boundary conditions u(0)=1 and u(1)=e-1, which admits the exact analytical solution u(x)=e-x. The PINN architecture employs a trial solution formulation that automatically satisfies boundary conditions, utilizes automatic differentiation for computing derivatives, and leverages the L-BFGS optimizer with Sobol quasi-random collocation points. We provide rigorous mathematical derivations of the PINN loss function, trial solution construction, automatic differentiation chain rules, FEM weak formulation with stiffness matrix assembly, and FD central difference schemes. Numerical experiments demonstrate that PINNs achieve comparable accuracy to FEM and FD methods while offering mesh-free flexibility and the ability to incorporate physical constraints naturally. The relative L2 error for all three methods remains below 10-3, validating the effectiveness of physics-informed learning for boundary value problems. This work contributes to the growing body of evidence supporting PINNs as a viable alternative to classical numerical methods in computational physics and engineering.
Keywords: 
;  ;  ;  ;  ;  ;  
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated