What is an alternative method(apart from 'Maxstep') to ensure ode45 does not take large time steps and ignore high frequency components in the forcing function?
1 回表示 (過去 30 日間)
古いコメントを表示
I am working on the response of vibrational energy harvesters to a very abrupt forcing function with many high-frequency components. The forcing signal is attached and it can be seen the peaks in the attached signal are very narrow and have high-frequency components. To accurately reproduce the forcing signal, ode45 needs to take very small time steps. But limiting the time steps via "MaxStep" option makes the simulation very very slow- I am talking snail- pace, nausea-inducing slow.
Are there any alternatives ?
In response to the answer by Star Strider
I already pass an array for the Time vector. If I increase the sampling(increase the number of points), instead of MaxStep,
- The array becomes large
- The solution is very slow
Is there any way to make ode45 take large steps when the forcing is flat and take really small steps when the forcing derivatives are high(basically when the forcing has peaks) ?
0 件のコメント
回答 (2 件)
Star Strider
2016 年 8 月 8 日
I would give it a vector of times (rather than a 2-element range) for ‘tspan’. It will report the integrated results at those times (or very close to them), requiring it to evaluate your function at those times. You can do this with the colon operator (:) or with linspace.
Example with linspace:
Ts = 0.001; % Sampling Interval
N = 1E4; % Number Of Points /Desired
tspan = linspace(0, 1, N)*Ts; % Time Vector
2 件のコメント
Star Strider
2016 年 8 月 9 日
It depends on what you want to do with the integrated function. The image you attached is an EKG. If you want to do heart rate variability studies, the signal has to be regularly-sampled, just as would a recorded EKG trace. This is characteristic of all discrete biomedical signal processing techniques I’m aware of.
In the example I posted, I used a 1000 Hz sampling frequency. For EKG signal processing, any sampling frequency of 250 Hz or higher (sampling interval of at most 0.004 seconds) will work. This is due to the highest usable frequency in the majority of (and all normal) EKG records being about 100 Hz, requiring a Nyquist frequency (highest uniquely identifiable frequency in a sampled signal) of 200 Hz.
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!