Algorithms for Solving Ordinary Differential Equations Based on Orthogonal Polynomial Neural Networks
Abstract
1. Introduction
2. Preliminaries
3. Neural Network Model Based on Orthogonal Polynomials
4. Problem Statement
5. Algorithms for Implementing Polynomial Neural Networks
| Algorithm 1 Neural Network Training for ODE Solution |
| 1: procedure MainTraining(, ) 2: Generate training data 3: Define exact solution: 4: 5: if then 6: 7: else if then 8: 9: else if then 10: 11: else 12: 13: end if 14: 15: 16: TrainModel(model, x_data) 17: 18: 19: Visualize loss history and results 20: Output comparative value table 21: return 22: end procedure |
| Algorithm 2 Model Training Procedure |
| 1: procedure TrainModel(, , , ) 2: Initialize Adam optimizer with learning rate 3: Initialize ReduceLROnPlateau scheduler 4: 5: 6: for to do 7: 8: ComputeLoss(net, x_data) 9: 10: 11: 12: 13: if then 14: Output current loss and learning rate 15: end if 16: end for 17: 18: return 19: end procedure |
| Algorithm 3 Polynomial Neural Network Forward Pass |
| 1: procedure Forward(x, ) 2: PolynomialBasis(x) 3: 4: return 5: end procedure |
| Algorithm 4 Loss Function Computation |
| 1: procedure ComputeLoss(, x) 2: Set 3: ComputeDerivatives(x, net) 4: 5: Compute equation components: 6: 7: 8: 9: if then 10: 11: else 12: 13: end if 14: 15: 16: 17: 18: 19: return 20: end procedure |
| Algorithm 5 Trial Solution Derivative Computation |
| 1: procedure ComputeDerivatives(x, ) 2: (with ) 3: TrialSolution(x_tensor, net) 4: 5: Compute first derivative: 6: (using automatic differentiation) 7: 8: Compute second derivative: 9: (using automatic differentiation) 10: 11: return 12: end procedure |
| Algorithm 6 Trial Solution with Boundary Conditions (The Cauchy Problem) |
| 1: procedure TrialSolution(x, ) 2: 3: 4: return y 5: end procedure |
| Algorithm 7 Trial Solution with Boundary Conditions (Boundary Value Problem) |
| 1: procedure TrialSolution(x, ) 2: 3: 4: return y 5: end procedure |
6. Research Results
7. Overfitting Issues
8. Conclusions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
| ChNN | Chebyshev Neural Network |
| FLANN | Functional Link Artificial Neural Network |
| LeNN | Legendre Neural Network |
| LaNN | Laguerre Neural Network |
| MLP | Multilayer Perceptron |
| PINN | Physics-Informed Neural Networks |
References
- Abdolrasol, M.G.M.; Hussain, S.M.S.; Ustun, T.S.; Sarker, M.R.; Hannan, M.A.; Mohamed, R.; Ali, J.A.; Mekhilef, S.; Milad, A. Artificial Neural Networks Based Optimization Techniques: A Review. J. Abbr. 2021, 10, 2689. [Google Scholar] [CrossRef]
- Tan, L.S.; Zainuddin, Z.; Ong, P. Solving ordinary differential equations using neural networks. AIP Conf. Proc. 2018, 1974, 020070. [Google Scholar] [CrossRef]
- Riedmiller, M.; Lernen, A. Multi layer perceptron. Mach. Learn. Lab Spec. Lect. Univ. Freibg. 2014, 24, 11–60. [Google Scholar]
- Wang, S.; Teng, Y.; Perdikaris, P. Understanding and mitigating gradient flow pathologies in physics-informed neural networks. SIAM J. Sci. Comput. 2021, 43, A3055–A3081. [Google Scholar] [CrossRef]
- Fan, Q.; Zhang, X.; Wen, Z.; Xu, L.; Zhang, Q. Nonlinear Compensation of the Linear Variable Differential Transducer Using an Advanced Snake Optimization Integrated with Tangential Functional Link Artificial Neural Network. Sensors 2025, 25, 1074. [Google Scholar] [CrossRef] [PubMed]
- Pao, Y.H.; Phillips, S.M. The functional link net and learning optimal control. Neurocomputing 1995, 9, 149–164. [Google Scholar] [CrossRef]
- Chaharborj, S.S.; Chaharborj, S.S.; See, P.P. Application of Chebyshev neural network to solve Van der Pol equations. Int. J. Basic Appl. Sci. 2021, 10, 7–19. [Google Scholar] [CrossRef]
- Mall, S.; Chakraverty, S. Application of Legendre neural network for solving ordinary differential equations. Appl. Soft Comput. 2016, 43, 347–356. [Google Scholar] [CrossRef]
- Yang, Y.; Hou, M.; Luo, J. A novel improved extreme learning machine algorithm in solving ordinary differential equations by Legendre neural network methods. Adv. Differ. Equ. 2018, 2018, 469. [Google Scholar] [CrossRef]
- Yildirim, A.; Ozis, T. Solutions of singular IVPs of Lane–Emden type by the variational iteration method. Nonlinear Anal. 2009, 70, 2480–2484. [Google Scholar] [CrossRef]
- Chihara, T.S. An Introduction to Orthogonal Polynomials; Courier Corporation: Mineola, NY, USA, 2011. [Google Scholar]
- Chaharborj, S.S.; Chaharborj, S.S.; Mahmoudi, Y. Study of fractional order integro-differential equations by using Chebyshev neural network. J. Math. Stat. 2017, 13, 1–13. [Google Scholar] [CrossRef]
- Shaw, Z.A. Learn Python the Hard Way; Addison-Wesley Professional: Boston, MA, USA, 2024. [Google Scholar]
- Van Horn, B.M., II; Nguyen, Q. Hands-on Application Development with PyCharm: Build Applications Like a Pro with the Ultimate Python Development Tool; Packt Publishing Ltd.: Bermingham, UK, 2023. [Google Scholar]
- Nabian, M.A.; Gladstone, R.J.; Meidani, H. Efficient training of physics-informed neural networks via importance sampling. Comput. Civ. Infrastruct. Eng. 2021, 36, 962–977. [Google Scholar] [CrossRef]
- Mall, S.; Chakraverty, S. Single layer Chebyshev neural network model for solving elliptic partial differential equations. Neural Process. Lett. 2017, 45, 825–840. [Google Scholar] [CrossRef]
- Tverdyi, D.; Parovik, R. Application of the Fractional Riccati Equation for Mathematical Modeling of Dynamic Processes with Saturation and Memory Effect. Fractal Fract. 2022, 6, 163. [Google Scholar] [CrossRef]
- Allahviranloo, T.; Jafarian, A.; Saneifard, R.; Ghalami, N.; Measoomy Nia, S.; Kiani, F.; Fernandez-Gamiz, U.; Noeiaghdam, S. An application of artificial neural networks for solving fractional higher-order linear integro-differential equations. Bound. Value Probl. 2023, 2023, 74. [Google Scholar] [CrossRef]
- Tverdiy, D.A.; Makarov, E.O.; Parovik, R.I. Hereditary Mathematical Model of the Dynamics of Radon Accumulation in the Accumulation Chamber. Mathematics 2023, 11, 850. [Google Scholar] [CrossRef]
- Nguyen, T.D. Neural network method for solving the boundary value problem for fractional differential equations. Comput. Methods Program. 2025, 26, 245–253. [Google Scholar]
- Ali, I. Advanced machine learning technique for solving elliptic partial differential equations using Legendre spectral neural networks. Electron. Res. Arch. 2025, 33, 826–848. [Google Scholar] [CrossRef]
- Giannelos, S.; Konstantelos, I.; Pudjianto, D.; Strbac, G. The impact of electrolyser allocation on Great Britain’s electricity transmission system in 2050. Int. J. Hydrogen Energy 2026, 202, 153097. [Google Scholar] [CrossRef]




| x | Exact | LeNN | Err | ChNN | Err | LaNN | Err |
|---|---|---|---|---|---|---|---|
| 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| 0.1 | −0.019901 | −0.020136 | 0.000235 | −0.020098 | 0.000197 | −0.020428 | 0.000528 |
| 0.2 | −0.078441 | −0.078844 | 0.000402 | −0.078784 | 0.000342 | −0.079432 | 0.000991 |
| 0.3 | −0.172355 | −0.172545 | 0.000190 | −0.172517 | 0.000162 | −0.172980 | 0.000624 |
| 0.4 | −0.296840 | −0.296616 | 0.000224 | −0.296645 | 0.000195 | −0.296431 | 0.000409 |
| 0.5 | −0.446287 | −0.445794 | 0.000493 | −0.445859 | 0.000428 | −0.444785 | 0.001502 |
| 0.6 | −0.614969 | −0.614560 | 0.000409 | −0.614617 | 0.000353 | −0.612906 | 0.002064 |
| 0.7 | −0.797552 | −0.797509 | 0.000044 | −0.797525 | 0.000028 | −0.795741 | 0.001811 |
| 0.8 | −0.989392 | −0.989695 | 0.000303 | −0.989683 | 0.000290 | −0.988527 | 0.000866 |
| 0.9 | −1.186654 | −1.186971 | 0.000317 | −1.186994 | 0.000341 | −1.186968 | 0.000315 |
| 1.0 | −1.386294 | −1.386297 | 0.000003 | −1.386435 | 0.000140 | −1.387423 | 0.001128 |
| x | Exact | LeNN | Err | ChNN | Err | LaNN | Err |
|---|---|---|---|---|---|---|---|
| 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| 0.1 | −0.019901 | −0.018406 | 0.001495 | −0.019366 | 0.000535 | −0.014775 | 0.005125 |
| 0.2 | −0.078441 | −0.076801 | 0.001640 | −0.077866 | 0.000575 | −0.072799 | 0.005643 |
| 0.3 | −0.172355 | −0.170777 | 0.001579 | −0.171657 | 0.000698 | −0.167410 | 0.004945 |
| 0.4 | −0.296840 | −0.295251 | 0.001589 | −0.295958 | 0.000882 | −0.292378 | 0.004462 |
| 0.5 | −0.446287 | −0.444761 | 0.001526 | −0.445407 | 0.000880 | −0.441909 | 0.004378 |
| 0.6 | −0.614969 | −0.613748 | 0.001221 | −0.614417 | 0.000553 | −0.610649 | 0.004320 |
| 0.7 | −0.797552 | −0.796854 | 0.000699 | −0.797530 | 0.000022 | −0.793689 | 0.003863 |
| 0.8 | −0.989392 | −0.989202 | 0.000191 | −0.989772 | 0.000380 | −0.986570 | 0.002823 |
| 0.9 | −1.186654 | −1.186694 | 0.000040 | −1.187007 | 0.000354 | −1.185287 | 0.001367 |
| 1.0 | −1.386294 | −1.386294 | 0.000000 | −1.386294 | 0.000000 | −1.386294 | 0.000000 |
| x | Exact | MLP(20,2) | Err | MLP(40,2) | Err |
|---|---|---|---|---|---|
| 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| 0.1 | −0.019901 | −0.019918 | 0.000017 | −0.019996 | 0.000096 |
| 0.2 | −0.078441 | −0.078284 | 0.000158 | −0.078554 | 0.000112 |
| 0.3 | −0.172355 | −0.171822 | 0.000534 | −0.172433 | 0.000078 |
| 0.4 | −0.296840 | −0.295774 | 0.001066 | −0.296928 | 0.000088 |
| 0.5 | −0.446287 | −0.444465 | 0.001823 | −0.446377 | 0.000090 |
| 0.6 | −0.614969 | −0.612116 | 0.002853 | −0.615030 | 0.000061 |
| 0.7 | −0.797552 | −0.793419 | 0.004134 | −0.797606 | 0.000053 |
| 0.8 | −0.989392 | −0.983745 | 0.005647 | −0.989446 | 0.000053 |
| 0.9 | −1.186654 | −1.179241 | 0.007413 | −1.186684 | 0.000031 |
| 1.0 | −1.386294 | −1.376869 | 0.009425 | −1.386322 | 0.000028 |
| x | Exact | MLP(20,2) | Err | MLP(40,2) | Err |
|---|---|---|---|---|---|
| 0.0000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| 0.1000 | −0.019901 | −0.019104 | 0.000796 | −0.015659 | 0.004242 |
| 0.2000 | −0.078441 | −0.077559 | 0.000882 | −0.072762 | 0.005679 |
| 0.3000 | −0.172355 | −0.171502 | 0.000854 | −0.166195 | 0.006160 |
| 0.4000 | −0.296840 | −0.296061 | 0.000779 | −0.291002 | 0.005838 |
| 0.5000 | −0.446287 | −0.445638 | 0.000649 | −0.441194 | 0.005093 |
| 0.6000 | −0.614969 | −0.614448 | 0.000521 | −0.610297 | 0.004672 |
| 0.7000 | −0.797552 | −0.797148 | 0.000405 | −0.793336 | 0.004217 |
| 0.8000 | −0.989392 | −0.989135 | 0.000258 | −0.986310 | 0.003083 |
| 0.9000 | −1.186654 | −1.186553 | 0.000100 | −1.185103 | 0.001551 |
| 1.0000 | −1.386294 | −1.386294 | 0.000000 | −1.386294 | 0.000000 |
| Network Architecture | Execution Time, s |
|---|---|
| LeNN | 6.48 |
| ChNN | 4.81 |
| LaNN | 5.77 |
| MLP(20,2) | 4.77 |
| MLP(40,2) | 5.69 |
| Network Architecture | Execution Time, s |
|---|---|
| LeNN | 4.03 |
| ChNN | 3.59 |
| LaNN | 3.85 |
| MLP(20,2) | 3.71 |
| MLP(20,3) | 4.13 |
| x | Exact | LeNN (m = 5) | Err | LeNN (m = 7) | Err |
|---|---|---|---|---|---|
| 0.0000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| 0.1000 | −0.019901 | −0.019803 | 0.000097 | −0.015253 | 0.004647 |
| 0.2000 | −0.078441 | −0.078067 | 0.000374 | −0.070342 | 0.008100 |
| 0.3000 | −0.172355 | −0.171714 | 0.000642 | −0.170697 | 0.001658 |
| 0.4000 | −0.296840 | −0.296249 | 0.000591 | −0.310144 | 0.013304 |
| 0.5000 | −0.446287 | −0.446258 | 0.000029 | −0.474329 | 0.028041 |
| 0.6000 | −0.614969 | −0.615900 | 0.000931 | −0.647436 | 0.032467 |
| 0.7000 | −0.797552 | −0.799405 | 0.001853 | −0.819858 | 0.022305 |
| 0.8000 | −0.989392 | −0.991566 | 0.002174 | −0.993316 | 0.003924 |
| 0.9000 | −1.186654 | −1.188236 | 0.001583 | −1.178808 | 0.007846 |
| 1.0000 | −1.386294 | −1.386824 | 0.000529 | −1.381549 | 0.004746 |
| x | Exact | LeNN (m = 5) | Err | LeNN (m = 7) | Err |
|---|---|---|---|---|---|
| 0.0000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| 0.1000 | −0.019901 | −0.020146 | 0.000246 | −0.017843 | 0.002058 |
| 0.2000 | −0.078441 | −0.078711 | 0.000270 | −0.076163 | 0.002278 |
| 0.3000 | −0.172355 | −0.172609 | 0.000254 | −0.170318 | 0.002038 |
| 0.4000 | −0.296840 | −0.297066 | 0.000226 | −0.294993 | 0.001847 |
| 0.5000 | −0.446287 | −0.446488 | 0.000201 | −0.444588 | 0.001699 |
| 0.6000 | −0.614969 | −0.615148 | 0.000179 | −0.613516 | 0.001454 |
| 0.7000 | −0.797552 | −0.797695 | 0.000142 | −0.796478 | 0.001075 |
| 0.8000 | −0.989392 | −0.989474 | 0.000082 | −0.988740 | 0.000652 |
| 0.9000 | −1.186654 | −1.186676 | 0.000022 | −1.186362 | 0.000292 |
| 1.0000 | −1.386294 | −1.386294 | 0.000000 | −1.386294 | 0.000000 |
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. |
© 2026 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Parovik, R. Algorithms for Solving Ordinary Differential Equations Based on Orthogonal Polynomial Neural Networks. Algorithms 2026, 19, 82. https://doi.org/10.3390/a19010082
Parovik R. Algorithms for Solving Ordinary Differential Equations Based on Orthogonal Polynomial Neural Networks. Algorithms. 2026; 19(1):82. https://doi.org/10.3390/a19010082
Chicago/Turabian StyleParovik, Roman. 2026. "Algorithms for Solving Ordinary Differential Equations Based on Orthogonal Polynomial Neural Networks" Algorithms 19, no. 1: 82. https://doi.org/10.3390/a19010082
APA StyleParovik, R. (2026). Algorithms for Solving Ordinary Differential Equations Based on Orthogonal Polynomial Neural Networks. Algorithms, 19(1), 82. https://doi.org/10.3390/a19010082

