ODE15s/ODE23s in C++

Dear All,
I have received a Programm written in MATLAB that I have manually translated into C++. However, the MATLAB code includes the usage of ODE15s for solving a stiff system which i am currently struggeling to find an equivalent C++ Library for it. I have included the library CVODE as a replacement in my C++ code, because the CVODE BDF solver is capable of calculating the Jacobian matrix internaly as ODE15s. But the results i receive are different than with the ODE15s.
I have to admit, that I don't have much experiene with ODE's. From what i can tell, the tolerances in the MATLAB code for the ODE are the defaults one (1e-3 RelTol and 1-6 AbTol). When I use the same tolerances for the CVODE BDF solver, I receive a different output. Moreover, even if I "increase" the tolerances to (1e-12, 1e-12) I still receive different results. It is noteworthy to tell, that the outputs are in the range of 1e-8 to 1e-20. Are there other settings that need to be set in CVODE? Adiitionall, I replaced the ODE15s solver in the MATLAB code with ODE23s and it provides the same output. So it is not necesarily required to be ODE15s solver equivalent.
Does anyone have experience in CVODE and MATLAB who could help or know a more suitable C++ library? I have also the MATLAB Compiler SDK toolbox, in case any one has experience to compile the ODE solver as a C++-Library.

Réponses (0)

Produits

Version

R2017b

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by