Why does Jpattern option not improve execution time of ODE solver?

2 ビュー (過去 30 日間)
Francisco de Castro
Francisco de Castro 2018 年 10 月 26 日
編集済み: Torsten 2018 年 10 月 26 日
I have a system of ~100 ODEs. They represent interactions between species in an ecosystem. Each species interacts only with a small set of other species, so the matrix of interactions is relatively empty (~65% zeros). I'm trying to improve the speed of integration by using the option 'JPattern' in odeset, as:
options= odeset('JPattern',sparse(A))
where A is a 0 and 1 square matrix in which Aij= 1 means variables i and j interact. However, including 'JPattern' in the options actually increases execution time by a factor of 2: from 4.8 sec. to 9.7 sec. in average. It happens with at least several ODE solvers. Shouldn't the execution time reduce at least somewhat? Does the matrix A need to have some level of 'sparsiness' to improve the speed? Any ideas what am I doing wrong here?
Thanks
  3 件のコメント
Francisco de Castro
Francisco de Castro 2018 年 10 月 26 日
Yes, of course, I realize 65% is not sparse. However, why should including it as JPattern increase integration time? Shouldn't at least left it unafected? In the near future, I plan to use larger systems, which are more sparse (to > 90% zeros). Will be the JPattern option useless/detrimental in that case too?
Torsten
Torsten 2018 年 10 月 26 日
編集済み: Torsten 2018 年 10 月 26 日
This has to be tested for each case separately. No general rule can be given.
Try a really sparse example, e.g. the discretized heat equation in one dimension.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by