JuliaLang/ODE.jl — pull request #16 by acroy (2014-03-02 20:17:09+00:00)
Title: WIP: Generalize oderkf to eventually replace ode23

The function `oderkf` is extended to support embedded RK methods with `order!=5`. Using the Butcher tableau for the Bogacki–Shampine method we can eventually replace the current `ode23`. This is WIP since I would like to discuss some optimizations and also wait for #13 to be merged.

To monitor potential performance regressions/improvements I have added a very basic "performance test" in `test/perf_test.jl`, which currently gives
```
testing method ode23
elapsed time: 0.173369477 seconds (28322912 bytes allocated)
* number of steps: 307
* minimal step: 0.017235477520255074
* maximal step: 0.13251841618852822
* maximal deviation from known solution: 0.00024150339669093412

testing method ode23_bs
elapsed time: 0.143952278 seconds (25093360 bytes allocated)
* number of steps: 284
* minimal step: 0.04058097707789443
* maximal step: 0.16972148358466033
* maximal deviation from known solution: 0.00029454047976829045

testing method ode45_dp
elapsed time: 0.02042501 seconds (5396480 bytes allocated)
* number of steps: 50
* minimal step: 0.2
* maximal step: 0.6237898397680723
* maximal deviation from known solution: 1.521321931230446e-5

testing method ode45_fb
elapsed time: 0.023933644 seconds (5487280 bytes allocated)
* number of steps: 56
* minimal step: 0.2
* maximal step: 0.518603647973384
* maximal deviation from known solution: 0.00035154683318205926

testing method ode45_ck
elapsed time: 0.01847891 seconds (4496800 bytes allocated)
* number of steps: 48
* minimal step: 0.2
* maximal step: 0.6213739278959354
* maximal deviation from known solution: 0.00013938517428924158
```
Note that `ode23` and `ode23_bs` (based on `oderkf`) currently cannot be compared, because of different tolerances.

Comments and/or suggestions are most welcome.