Taming ODE solver behavior by dummy state variables with self-defined dynamics?

Hi all,
Is it possible to force the ODE solver integrate specific region in time space by defining dummy state variable with a certain dynamics? So my problem is that I have an impulse input of 1ms duration every 500ms in my system. I can integrate by integral, of course, but it would take too long for my purpose (6min run time for simulation over 1e6ms). If I use ODE15s, it finishes in 0.2s, however it skipped all my input since the solver thought my system is "boring" and it integrates over large time steps, apparently ignoring the 1ms input every 500ms. If I use ODE113, it integrate over all the inputs, but it takes even longer, more than 1 hour. ODE45 and ODE23 basically just "accidentally" integrate over time region that has the input.
So what I want is a solver that take small steps over where I have the input and larger steps over the rest. However it is hard to tell the solver where there is an input. Right now I can only think of implement an Eular-type solver with adaptive time steps myself. However, I am thinking is there a way to define a dummy state variable with certain dynamics that tames the ODE15s to integrate over smaller time steps at the region nearby the inputs? I tried sin(t), and it definitely helps but I am still missing certain inputs. Has anyone done this before?
Thanks!

回答 (1 件)

Torsten
Torsten 2016 年 10 月 6 日
Call the solver several times:
First call: tstart=0, tend=1ms
Second call: tstart=1ms, tend=500ms
Third call: tstart=500ms, tend=501ms
Fourth call: tstart=501ms, tend=1000ms
...
In each step, start with the solution of the previous step.
Best wishes
Torsten.

2 件のコメント

Chao Feng
Chao Feng 2016 年 10 月 6 日
Hi Torsten,
Thanks for your reply. But that is what I mean by "integrate by interval". This is simply taking too long for my purpose.
Torsten
Torsten 2016 年 10 月 6 日
For high reliability of the results, there is no alternative to the "integrate by interval" method.
Best wishes
Torsten.

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

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

タグ

質問済み:

2016 年 10 月 5 日

コメント済み:

2016 年 10 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by