C++ Programming GalleryMath and others

Numerical Methods for Solving Ordinary Equations – ODEs in C++

An ordinary differential equation – ODE, is solved using the following numerical method algorithms, coded in C++ language:

Euler

  • Modified Euler
  • Predictor-Corrector
  • Runge Kutta (Order2)
  • Runge Kutta (Order4)

Developed by:

JOSE LUIS DE LA CRUZ LAZARO

YACSHA – Software & Desing, since 1999, Lima – Perú
The World of Chaos – EL MUNDO DEL CAOS – Unlimited Programming

You can DOWNLOAD the SOURCE CODE and executable software for FREE from here:

Numerical Methods for Solving Ordinary Equations – ODEs (992 downloads )

Join The World of Chaos Developer Community😃

Contribute to the project on Github!

HISTORY

Version 2 – 04-IV-2024

  • Code is updated and improved
  • Merges all numerical methods that solve differential equations in a single file
  • Porting to VC++ 2017
  • Translate functions name
  • Change float variables to double
  • The function y’ = f(x,y) is unified into a single function that is reused in all methods
  • Unused variables are eliminated
  • The ModifiedEuler and Predictor_Corrector method is corrected
  • Order 4 Runge Kutta method added
  • A menu is added in text mode to select the numerical method to use in the solution
  • Unnecessary files are removed
  • The code is modernized, converting it into the CNumericalMethodsSolvingODE class
  • Traces of old C function fabs, etc… are removed and replaced with their modern equivalents
  • The maximum width at which a menu box can be created is increased
  • Change project name to SolvingODE
  • Comments are translated from Spanish to English
  • Credits are added
  • The visualization of the x and y calculation tables is improved, in each method, always showing the values in the range [a, b]
  • A chronometer is added to measure the time that each method takes, and the seconds that each method has taken to process the solution are shown, in order to obtain a point of comparison between the efficiency of the algorithms.
  • The ShowSolutions method is added to display the solutions after the numerical method algorithm code has finished. In such a way that the time of each algorithm can be measured correctly and
    then display the results on the screen.
  • The FormulaParser library is added to define an ODE y’=f(x,y) from a text string entered by the user, and in this way the user will be able to customize the ODE equation that will be solved by the numerical methods implemented.
  • Added ExampleOfUse to the “Enter ODE: y’ = f(x,y)” option, to inform the user how to enter the formulation of the mathematical function

Version 1 – 30-XI-1999

  • First version for Borland C++ 3.1 and Turbo C 3.0

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button