0

I am working with ODE45 and I want to force matlab to only operate with as much as 2 decimals.

I have seen that is possible to do that with vpa, but it is not really working in the ODE. Any ideas?

Thank you!

kumbu
  • 145
  • 2
  • 16
  • *only operate with as much as 2 decimals* – Why would you want to do this? It won’t be any faster: floating-point arithmetics is hard-coded on your processor and thus it is as fast to perform operations with 64-bit accuracy as, e.g., with 4-bit accuracy (on a 64-bit architecture). — Did you by any chance want to ask how to reduce the accuracy of the integrator to two digits (i.e., the adaptive integration keeps the relative error at roughly 10⁻²)? – Wrzlprmft Nov 06 '16 at 10:35
  • I guess that yes. I want to reduce the accuracy of the operation. I dont know how to express it any better. I want the ODE not to care what happens beyond the second decimal so it goes faster – kumbu Nov 06 '16 at 11:17
  • I do not speak Matlab, but take a look at the `atol` and `rtol` parameters. Also, if speed really matters to you, consider other solutions (e.g., such where everything is compiled, which does not apply to Matlab, AFAIK). – Wrzlprmft Nov 06 '16 at 12:08

0 Answers0