How to integrate ordinary differential equations with pulse-like time-varying parameters?

5 ビュー (過去 30 日間)
Pierre S.
Pierre S. 2014 年 4 月 23 日
コメント済み: RahulTandon 2015 年 7 月 8 日
Problem.
I am simulating an ordinary differential equation with time-varying parameters as follows
p = @(t) p0*( (T0 < t) & (t < T1) )
sol = ode15s(@(t,x) myode(t,x,p(t)),[t0 tf],x0)
where p(t) is a pulse of amplitude p0 and duration (T1-T0) (if T0 < T1).
Because of its adaptive time-step, the integrator "misses the pulse" if the time-step becomes larger that the pulse duration.
Naive solution.
A naive solution would be to constrain the MaxStep to (T1-T0)/2 to be sure that the pulse is detected by the integrator. However, this constrains the MaxStep at time where it is not really needed.
More efficient solution?
I am wondering if there is a more efficient way to do ensure that the pulse is detected.
  4 件のコメント
Star Strider
Star Strider 2014 年 5 月 1 日
Posting (or attaching — use the ‘paperclip’ icon) the code for myode would do for a start, as well as information on p0, T0, and T1. We really cannot suggest a solution to a problem we cannot experiment with ourselves.
RahulTandon
RahulTandon 2015 年 7 月 8 日
pleas send the formulae for the two equations 1) The mymode function 2) The pulse train Awaiting an early reply!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by