RbfDeSolver: A Software Tool to Approximate Differential Equations Using Radial Basis Functions
Abstract
:1. Introduction
2. Detailed Description
2.1. Main Algorithm
- Initialization step
- (a)
- Setiter = 0, as the current number of generations.
- (b)
- Set, as the total number of chromosomes.
- (c)
- Setn, the number of weights in the RBF network.
- (d)
- Initialize randomly the chromosomes .
- (e)
- Set ITERMAX as the maximum number of generations.
- (f)
- Set as the selection rate and the mutation rate.
- (g)
- Set, the best fitness in the population.
- (h)
- Set , the number of generations to run before applying the local optimization method
- (i)
- Set the number of chromosomes that will involved in the local search procedure.
- Termination check. If ITERMAX OR terminate.
- Calculate the fitness for every chromosome . The calculation procedure is described in Section 2.2.
- Genetic Operators
- (a)
- Selection procedure: During selection, the chromosomes are classified according to their suitability. The best chromosomes are transferred without changes to the next generation of the population. The rest will be replaced by chromosomes that will be produced at the crossover.
- (b)
- Crossover procedure: During this process, chromosomes will be created. Firstly, for every pair of produced offspring, two distinct chromosomes (parents) are selected from the current population using tournament selection: First, a subset of randomly selected chromosomes is created and the chromosome with the best fitness value is selected as parent. For every pair of parents, two new offsprings and are created through the following:
- (c)
- Mutation procedure: For every element of each chromosome, select a random number and alter the corresponding chromosome if .
- Setiter = iter+1
- Local Search Step
- (a)
- IfThen
- Select a subset of randomly chosen chromosomes from the genetic population. Denote this subset with .
- For every chromosome in
- Start a local search procedure
- Set
- (b)
- Endif
- Denote with the best fitness value for the corresponding chromosome
- Goto step 2.
2.2. Fitness Evaluation
2.3. Ode Case
- Create a set of equidistant points.
- Create the RBF network for the the chromosome g.
- Calculate the value
- Calculate the penalty value for the initial conditions:
- Return
2.4. Systems of ODEs Case
- Create a set of equidistant points.
- Split the chromosome g into k parts and create the corresponding RBF networks
- Calculate the errors:
- Calculate the penalty values:
- Calculate the total fitness value:
2.5. Pde Case
- Construct the set uniformly sampled points in .
- Construct the set equidistant points in .
- Construct the set equidistant points in .
- Set the RBF network for the chromosome g.
- Calculate the quantity as
- Calculate the following penalty values:
- Calculate the total fitness as
3. Software Details
3.1. Installation
- unzip RbfDeSolver-master.zip.
- cd RbfDeSolver.
- qmake.
- make clean.
- make.
- TEMPLATE=lib
- SOURCES=ode1.cc
- qmake ode1.pro.
- make.
3.2. Command Line Options
- help. Prints a help screen and terminates.
- kind = DE_KIND. The string value DE_KIND determines the kind of differential equation to be used and the accepted values are: ode, sysode, pde.
- problem = FILE, the string parameter file determines the path to the differential equation to be solved.
- count = K, set as K, the number of chromosomes in the genetic population. The default value is 500.
- random = R, set as R, the seed for the random number generation.
- generations = G, set as G, the maximum number of generations allowed. The default value is 2000.
- epsilon = E, set as E, a small positive value used in the comparisons as well as the termination criterion of the genetic algorithm. The default value is
- weights = W, set as W, the number of weights for the RBF network. The default value is 1.
- srate = S, set as S, the selection rate (parameter of the genetic algorithm. The default value is 0.1
- mrate = M, set as M, the mutation rate (parameter ) of the genetic algorithm. The default value is 0.05
- lg = G, set as G, the number of generations that should be passed in the genetic algorithm before the local search method is applied. The default value is 100.
- li = I, set as I, the number of chromosomes that will participate in the local search procedure. The default value is 20.
- threads = T, set as T, the number of OpenMp threads. The default value is 1.
3.3. Format for ODEs
- getx0(): Returns the lower boundary point, .
- getx1(): Returns the upper boundary point, .
- getkind(): Returns 1, 2 or 3:
- (a)
- If the value is 1 then the ODE is of first order and the boundary condition is of the form: .
- (b)
- If the value is 2 then the ODE is of second order with boundary conditions of the form: .
- (c)
- Code 3 indicates that the ODE is of second order with boundary conditions of the form: .
- getnpoints(): Returns the number of equidistant training points (value N in Section 2.3)
- getf0(): Returns the boundary condition on the left, .
- getf1(): Returns the boundary condition on the right, .
- getff0(): Returns the left boundary condition for second order ODEs .
- ode1ff(x,y,yy): If the ODE is of first order, then the purpose of the tool is to minimize the function ode1ff, for different values of x in the range . The parameter y represents and the parameter yy represents .
- ode2ff(x,y,yy,yyy): If the ODE is of second order, then the tool tries to minimize the function ode2ff, for different values of x in the range The parameter y represents , the parameter yy represents and the parameter yyy represents .
3.4. Format for System of ODEs
- getx0(): returns the left boundary, .
- getx1(): returns the right boundary, .
- getnode(): returns the number of ODEs in the system (parameter k in Section 2.4).
- getnpoints(): R returns the number of equidistant training points (value N in Section 2.4)
- systemfun(k,x,y,yy): For the SYSODE case, the aim of the RbfDeSolver is to minimize the function systemfun for values of x in the range , where k is the total number of equations in the system, Y is the vector of Rbf networks and is a vector with elements the first derivative of these k equations evaluated at x. The double precision array y stands for the vector Y and similar the double precision array yy represents the vector .
- systemf0(node,f0): the argument node stands for the number of differential equations in the system and the double precision array f0 with node elements represents the vector holding the boundary conditions for each equation in the system (vector of Equation (8)).
3.5. PDE Format
- getx0(): returns the left boundary .
- getx1(): returns the right boundary .
- gety0(): returns the left boundary .
- gety1(): returns the right boundary .
- getnpoints(): returns the amount of interior training points for the PDE.
- getbpoints(): returns the amount of training points across each boundary of the PDE.
- f0(y): returns the boundary condition across .
- f1(y): returns the boundary condition across
- g0(x): returns the boundary condition across .
- g1(x): the function returns the boundary condition across .
- pde(x,y,v,x1,y1,x2,y2): For the PDE case RbfDeSolver minimizes the function , where and The argument v corresponds to The argument x1 corresponds to the first derivative of with respect to x, y1 corresponds to the first derivative of with respect to y, x2 corresponds to the second derivative of with respect to x and the y2 corresponds to the second derivative of with respect to y.
4. Experiments
4.1. Linear ODEs
- ODE1
- ODE2
- ODE3
- ODE4
- ODE5
4.2. Non-Linear ODEs
- LODE1
- NLODE2
- NLODE3
- NLODE4
4.3. Systems of ODEs
- SYSODE1
- SYSODE2
- SYSODE3
- SYSODE4
4.4. PDEs
- PDE1
- PDE2
- PDE3
- PDE4
4.5. Experimental Results
4.6. Some Practical Problems
4.6.1. Hires Problem
4.6.2. Rober Problem
4.6.3. Orego Problem
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Sample Availability
References
- Raissi, M.; Karniadakis, G.E. Hidden physics models: Machine learning of nonlinear partial differential equations. J. Comput. Phys. 2018, 357, 125–141. [Google Scholar] [CrossRef] [Green Version]
- Lelièvre, T.; Stoltz, G. Partial differential equations and stochastic methods in molecular dynamics. Acta Numer. 2016, 25, 681–880. [Google Scholar] [CrossRef]
- Scholz, G.; Scholz, F. First-order differential equations in chemistr. ChemTexts 2015, 1, 1. [Google Scholar] [CrossRef] [Green Version]
- Padgett, J.L.; Geldiyev, Y.; Gautam, S.; Peng, W.; Mechref, Y.; Ibraguimov, A. Object classification in analytical chemistry via data-driven discovery of partial differential equations. Comp. Math. Methods 2021, 3, e1164. [Google Scholar] [CrossRef]
- Owoyele, O.; Pal, P. ChemNODE: A neural ordinary differential equations framework for efficient chemical kinetic solvers. Energy 2022, 7, 100118. [Google Scholar] [CrossRef]
- Wang, Z.; Huang, X.; Shen, H. Control of an uncertain fractional order economic system via adaptive sliding mode. Neurocomputing 2012, 83, 83–88. [Google Scholar] [CrossRef]
- Achdou, Y.; Buera, F.J.; Lasry, J.M.; Lions, P.L.; Moll, B. Partial differential equation models in macroeconomics. Phil. Philos. Trans. R. Soc. A Math. Phys. Eng. Sci. 2012, 372, 20130397. [Google Scholar] [CrossRef] [Green Version]
- Hattaf, K.; Yousfi, N. Global stability for reaction—Diffusion equations in biology. Comput. Math. Appl. 2013, 66, 1488–1497. [Google Scholar]
- Getto, P.; Waurick, M. A differential equation with state-dependent delay from cell population biology. J. Differ. 2016, 260, 6176–6200. [Google Scholar] [CrossRef]
- Tang, W.; Sun, Y. Construction of Runge—Kutta type methods for solving ordinary differential equations. Appl. Math. Comput. 2014, 234, 179–191. [Google Scholar] [CrossRef]
- Kennedy, C.A.; Carpenter, M.H. Higher-order additive Runge–Kutta schemes for ordinary differential equations. Appl. Numer. Math. 2019, 136, 183–205. [Google Scholar] [CrossRef]
- Yang, X.; Shen, Y. Runge-Kutta Method for Solving Uncertain Differential Equations. J. Uncertain. Anal. Appl. 2015, 3, 17. [Google Scholar] [CrossRef] [Green Version]
- Kim, H.; Sakthivel, R. Numerical solution of hybrid fuzzy differential equations using improved predictor—Corrector method. Commun. Nonlinear Sci. Numer. Simul. 2012, 17, 3788–3794. [Google Scholar] [CrossRef]
- Daftardar-Gejji, V.; Sukale, Y.; Bhalekar, S. A new predictor–corrector method for fractional differential equations. Appl. Math. Comput. 2014, 244, 158–182. [Google Scholar] [CrossRef]
- Lagaris, I.E.; Likas, A.; Fotiadis, D.I. Artificial neural networks for solving ordinary and partial differential equations. IEEE Trans. Neural Netw. 1998, 9, 987–1000. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Mall, S.; Chakraverty, S. Application of Legendre Neural Network for solving ordinary differential equations. Appl. Soft Comput. 2016, 43, 347–356. [Google Scholar] [CrossRef]
- Pakdaman, M.; Ahmadian, A.; Effati, S.; Salahshour, S.; Baleanue, D. Solving differential equations of fractional order using an optimization technique based on training artificial neural network. Appl. Math. Comput. 2017, 293, 81–95. [Google Scholar] [CrossRef]
- Chang, W.D. Parameter identification of Chen and Lü systems: A differential evolution approach. Chaos Solitons Fractals 2007, 32, 1469–1476. [Google Scholar] [CrossRef]
- Biswas, A.; Das, S.; Abraham, A.; Dasgupta, S. Design of fractional-order PIλDμ controllers with an improved differential evolution. Eng. Appl. Artif. Intell. 2009, 22, 343–350. [Google Scholar] [CrossRef]
- Arqub, O.A.; Hammour, Z.A. Numerical solution of systems of second-order boundary value problems using continuous genetic algorithm. Inf. Sci. 2014, 279, 396–415. [Google Scholar] [CrossRef]
- Gutierrez-Navarro, D.; Lopez-Aguayo, S. Solving ordinary differential equations using genetic algorithms and the Taylor series matrix method. J. Phys. Commun. 2018, 2, 115010. [Google Scholar] [CrossRef] [Green Version]
- Januszewski, M.; Kostur, M. Accelerating numerical solution of stochastic differential equations with CUDA. Comput. Commun. 2010, 181, 183–188. [Google Scholar] [CrossRef] [Green Version]
- Murray, L. GPU Acceleration of Runge-Kutta Integrators. IEEE Trans. Parallel Distrib. Syst. 2012, 23, 94–101. [Google Scholar] [CrossRef]
- Riesinger, C.; Neckel, T.; Rupp, F. Solving Random Ordinary Differential Equations on GPU Clusters using Multiple Levels of Parallelism. Siam J. Sci. Comput. 2016, 38, C372–C402. [Google Scholar] [CrossRef]
- O’Neill, M.; Ryan, C. Grammatical evolution. IEEE Trans. Evol. Comput. 2001, 5, 349–358. [Google Scholar] [CrossRef] [Green Version]
- Tsoulos, I.G.; Lagaris, I.E. Solving differential equations with genetic programming. Genet. Program Evolvable Mach 2006, 7, 33–54. [Google Scholar] [CrossRef]
- Le, T.T.V.; Le-Cao, K.; Duc-Tran, H. A Radial Basis Neural Network Approximation with Extended Precision for Solving Partial Differential Equations. In Soft Computing: Biomedical and Related Applications. Studies in Computational Intelligence; Phuong, N.H., Kreinovich, V., Eds.; Springer: Berlin/Heidelberg, Germany, 2021; Volume 981. [Google Scholar]
- Wei, P.; Li, Z.; Li, X. An 88-line MATLAB code for the parameterized level set method based topology optimization using radial basis functions. Struct. Multidisc. Optim. 2018, 58, 831–849. [Google Scholar] [CrossRef]
- Iqbal, A.; Hamid, N.N.A.; Ismail, A.I.M.; Abbas, M. Galerkin approximation with quintic B-spline as basis and weight functions for solving second order coupled nonlinear Schrödinger equations. Math. Comput. Simul. 2021, 187, 1–16. [Google Scholar] [CrossRef]
- Goldberg, D. Genetic Algorithms in Search, Optimization and Machine Learning; Addison-Wesley Publishing Company: Boston, MA, USA, 1989. [Google Scholar]
- Michaelewicz, Z. Genetic Algorithms + Data Structures = Evolution Programs; Springer: Berlin/Heidelberg, Germany, 1996. [Google Scholar]
- Grady, S.A.; Hussaini, M.Y.; Abdullah, M.M. Placement of wind turbines using genetic algorithms. Renew. Energy 2005, 30, 259–270. [Google Scholar] [CrossRef]
- Park, J.; Sandberg, I.W. Universal Approximation Using Radial-Basis-Function Networks. Neural Comput. 1991, 3, 246–257. [Google Scholar] [CrossRef]
- MacQueen, J. Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Los Angeles, CA, USA, 1 January 1967; Volume 1, pp. 281–297. [Google Scholar]
- Teng, P. Machine-learning quantum mechanics: Solving quantum mechanics problems using radial basis function networks. Phys. Rev. E 2018, 98, 033305. [Google Scholar] [CrossRef] [Green Version]
- Jovanović, R.; Sretenovic, A. Ensemble of radial basis neural networks with K-means clustering for heating energy consumption prediction. Fme Trans. 2017, 45, 51–57. [Google Scholar] [CrossRef] [Green Version]
- Alexandridis, A.; Chondrodima, E.; Efthimiou, E.; Papadakis, G.; Vallianatos, F.; Triantis, D. Large Earthquake Occurrence Estimation Based on Radial Basis Function Neural Networks. IEEE Trans. Geosci. Remote. Sens. 2014, 52, 5443–5453. [Google Scholar] [CrossRef]
- Gorbachenko, V.I.; Zhukov, M.V. Solving boundary value problems of mathematical physics using radial basis function networks. Comput. Math. Math. Phys. 2017, 57, 145–155. [Google Scholar] [CrossRef]
- Wan, C.; Harrington, P. Self-Configuring Radial Basis Function Neural Networks for Chemical Pattern Recognition. J. Chem. Inf. Comput. Sci. 1999, 39, 1049–1056. [Google Scholar] [CrossRef]
- Yao, X.; Zhang, X.; Zhang, R.; Liu, M.; Hu, Z.; Fan, B. Prediction of enthalpy of alkanes by the use of radial basis function neural networks. Comput. Chem. 2001, 25, 475–482. [Google Scholar] [CrossRef]
- Shahsavand, A.; Ahmadpour, A. Application of optimal RBF neural networks for optimization and characterization of porous materials. Comput. Chem. Eng. 2005, 29, 2134–2143. [Google Scholar] [CrossRef]
- Wang, Y.P.; Dang, J.W.; Li, Q.; Li, S. Multimodal medical image fusion using fuzzy radial basis function neural networks. In Proceedings of the 2007 International Conference on Wavelet Analysis and Pattern Recognition, Beijing, China, 2–4 November 2007; pp. 778–782. [Google Scholar]
- Mehrabi, S.; Maghsoudloo, M.; Arabalibeik, H.; Noormand, R.; Nozari, Y. Congestive heart failure, Chronic obstructive pulmonary disease, Clinical decision support system, Multilayer perceptron neural network and radial basis function neural network. Expert Syst. Appl. 2009, 36, 6956–6959. [Google Scholar] [CrossRef]
- Veezhinathan, M.; Ramakrishnan, S. Detection of Obstructive Respiratory Abnormality Using Flow—Volume Spirometry and Radial Basis Function Neural Networks. J. Med. Syst. 2007, 31, 461. [Google Scholar] [CrossRef]
- Momoh, J.A.; Reddy, S.S. Combined Economic and Emission Dispatch using Radial Basis Function. In Proceedings of the 2014 IEEE PES General Meeting|Conference & Exposition, National Harbor, MD, USA, 27–31 July 2014; pp. 1–5. [Google Scholar] [CrossRef]
- Guo, J.-J.; Luh, P.B. Selecting input factors for clusters of Gaussian radial basis function networks to improve market clearing price prediction. IEEE Trans. Power Syst. 2003, 18, 665–672. [Google Scholar]
- Falat, L.; Stanikova, Z.; Durisova, M.; Holkova, B.; Potkanova, T. Application of Neural Network Models in Modelling Economic Time Series with Non-constant Volatility. Procedia Econ. Financ. 2015, 34, 600–607. [Google Scholar] [CrossRef] [Green Version]
- Dagum, L.; Menon, R. OpenMP: An industry standard API for shared-memory programming. IEEE Comput. Sci. Eng. 1998, 5, 46–55. [Google Scholar] [CrossRef] [Green Version]
- Powell, M.J.D. A Tolerant Algorithm for Linearly Constrained Optimization Calculations. Math. Program. 1989, 45, 547. [Google Scholar] [CrossRef]
- Kaelo, P.; Ali, M.M. Integrated crossover rules in real coded genetic algorithms. Eur. J. Oper. 2007, 176, 60–76. [Google Scholar] [CrossRef]
- Schäfer, E. A new approach to explain the “high irradiance responses” of photomorphogenesis on the basis of phytochrome. J. Math. Biol. 1975, 2, 41–56. [Google Scholar] [CrossRef]
- Robertson, H.H. The Solution of a Set of Reaction Rate Equations. In Numerical Analysis: An introduction; Walsh, J., Ed.; Academic Press: Cambridge, MA, USA, 1967; pp. 178–182. [Google Scholar]
- Hairer, E.; Wanner, G. Solving Ordinary Di Erential Equations II: Sti and Di Erential-Algebraic PROBLEMS, 2nd revised ed.; Springer: Berlin/Heidelberg, Germany, 1996. [Google Scholar]
- Cash, R.; Considine, S. An MEBDF code for stiff initial value problems. Acm Trans. Math. Softw. 1992, 18, 142–158. [Google Scholar] [CrossRef]
Parameter | Value |
---|---|
1000 | |
ITERMAX | 5000 |
0.1 | |
0.05 | |
100 | |
20 | |
100 |
Equation | w = 5 | w = 10 | w = 15 |
---|---|---|---|
ODE1 | |||
ODE2 | |||
ODE3 | |||
ODE4 | |||
ODE5 | |||
NLODE1 | |||
NLODE2 | |||
NLODE3 | |||
NLODE4 | |||
SYSODE1 | |||
SYSODE2 | |||
SYSODE3 | |||
SYSODE4 | |||
PDE1 | |||
PDE2 | |||
PDE3 | |||
PDE4 |
Problem | w = 10 | MEM |
---|---|---|
Hires | ||
Rober | ||
Orego |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Tsoulos, I.G.; Tzallas, A.; Karvounis, E. RbfDeSolver: A Software Tool to Approximate Differential Equations Using Radial Basis Functions. Axioms 2022, 11, 294. https://doi.org/10.3390/axioms11060294
Tsoulos IG, Tzallas A, Karvounis E. RbfDeSolver: A Software Tool to Approximate Differential Equations Using Radial Basis Functions. Axioms. 2022; 11(6):294. https://doi.org/10.3390/axioms11060294
Chicago/Turabian StyleTsoulos, Ioannis G., Alexandros Tzallas, and Evangelos Karvounis. 2022. "RbfDeSolver: A Software Tool to Approximate Differential Equations Using Radial Basis Functions" Axioms 11, no. 6: 294. https://doi.org/10.3390/axioms11060294
APA StyleTsoulos, I. G., Tzallas, A., & Karvounis, E. (2022). RbfDeSolver: A Software Tool to Approximate Differential Equations Using Radial Basis Functions. Axioms, 11(6), 294. https://doi.org/10.3390/axioms11060294