Closed armstrongc93 closed 5 years ago
To get a more accurate solution, you should be decreasing the tolerance (both absolute and relative, try 1E-8 for example). For the Dopri5, the timestep is only relevant for the first step, 0.1 looks like a reasonable choice.
I have adjusted the tolerance consistently and it has had no impact other than to make the solution worse. I switched in the Burlisch-Stoer stepper in for dopri5 and it works perfectly now. Could the micro-oscillation over the course of the response be affecting dopri5's error calculations?
This is strange, Dopri5 should work perfectly fine if the tolerances are reasonably small... Can you provide a reduced example (with all parameters pre-defined), so I can easily verify your observation?
Sure, I'll define the parameters and required functions then upload the file here
I'll assume this is resolved...
For a vehicle vibration analysis, I am implementing runge_kutta_dopri5 to evaluate the motions of a vehicle using C++ (code can be seen here). However, I am unable to get correct results.
Changing the time step or error values dramatically changes the solution; at 0.1 timestep the solution is incorrect but the general shape is close to the correct answer. If that value is reduced at all (or increased) the solution is entirely incorrect. The equations are correct, so I can only assume there is some kind of bug within odeint's stepper.