[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slow odepkg
From: |
Richard Crozier |
Subject: |
Re: Slow odepkg |
Date: |
Tue, 16 Aug 2011 20:42:38 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.7) Gecko/20100713 Lightning/1.0b2 Thunderbird/3.1.1 |
On 16/08/2011 20:19, Jordi GutiƩrrez Hermoso wrote:
> On 16 August 2011 07:24, Richard Crozier <address@hidden> wrote:
>> Under the hood, simulink uses the Matlab ode solver functions such as ode45,
>> ode23, ode15s etc. All simulink really does is provide a pretty interface
>> and some handy built-in blocks (such as SimPowerSystems).
>>
>> Octave has equivalents to these ode functions (in an octave-forge package at
>> least) so you can get the same functionality without being locked into
>> simulink if you are willing to invest the time in learning to use these.
>> They are significantly slower implementations in Octave though.
> I like optimising stuff. What's slow? The ode-pkg functions? All of
> them? Do you have some clues on where to speed things up? Some
> benchmarks?
>
> - Jordi G. H.
>
This is based on the benchmarks provided in the odepkg documentation
shown below:
matlab solvers
-----------------------------------------------------------------------------------------
Solver RelTol AbsTol Init Mescd Scd Steps Accept FEval JEval
LUdec Time
-----------------------------------------------------------------------------------------
ode113 1e-007 1e-007 1e-009 7.57 5.37 24317 21442 45760
11.697
ode23 1e-007 1e-007 1e-009 7.23 5.03 13876 13862 41629
2.634
ode45 1e-007 1e-007 1e-009 7.91 5.70 11017 10412 66103
2.994
ode15s 1e-007 1e-007 1e-009 7.15 4.95 290 273 534 8
59 0.070
ode23s 1e-007 1e-007 1e-009 6.24 4.03 702 702 2107 702
702 0.161
ode23t 1e-007 1e-007 1e-009 6.00 3.79 892 886 1103 5
72 0.180
ode23tb 1e-007 1e-007 1e-009 5.85 3.65 735 731 2011 5
66 0.230
-----------------------------------------------------------------------------------------
odepkg solvers
-----------------------------------------------------------------------------------------
Solver RelTol AbsTol Init Mescd Scd Steps Accept FEval JEval
LUdec Time
-----------------------------------------------------------------------------------------
ode23 1e-07 1e-07 1e-09 7.86 5.44 17112 13369 51333
138.071
ode45 1e-07 1e-07 1e-09 8.05 5.63 9397 9393 56376
92.065
ode54 1e-07 1e-07 1e-09 8.25 5.83 9300 7758 65093
84.319
ode78 1e-07 1e-07 1e-09 8.54 6.12 7290 6615 94757
97.746
ode2r 1e-07 1e-07 1e-09 7.69 5.27 50 50 849 50
59 0.624
ode5r 1e-07 1e-07 1e-09 7.55 5.13 71 71 671 71
81 0.447
oders 1e-07 1e-07 1e-09 7.08 4.66 138 138 828 138
138 0.661
odesx 1e-07 1e-07 1e-09 6.56 4.13 30 26 1808 26
205 1.057
odebda 1e-07 1e-07 1e-09 6.53 4.11 401 400 582 42
42 0.378
-----------------------------------------------------------------------------------------
Although these are for a non-stiff problem, and I don't see immediately
any comparisons for a stiff problem. There is a test suite of problems I
think provided with odepkg.
I'm afraid I wouldn't know where to start on improving these, I
understand the rough principle of their operation, but I'm really just a
user in this case, and doubt I could improve on the original author's
code. It's also possible, indeed I think likely, that the bottleneck is
not the solvers themselves but the speed of computation for the function
defining the ode since the odepkg functions actually take fewer steps to
solve the problem in these examples. The new profiler might tell us the
answer to this.
Richard
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
- Slow odepkg, Jordi GutiƩrrez Hermoso, 2011/08/16
- Re: Slow odepkg,
Richard Crozier <=