FFT resolution and RelaTol and AbsTol

3 ビュー (過去 30 日間)
Sofiane
Sofiane 2024 年 1 月 20 日
so my question is simple, I modeled an induction motor with an inter-turn short circuit i used a code not in Simulink, so i used ODE 45 with a linear vector tspan ('t_init:step:t_final'), so i noticed that when i increase RelTol (to 1e-3) and AbsTol (to 1e-8) i see new frequencies in my FFT that i dont see when i use tight tolerences like ('1e-6' ans 1e-10'), my question is why i see new frequencies (numerical noise ?), and what is the best solution to have more accurate results?

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2024 年 1 月 20 日
There are several critical points to consider here:
Numerical Noise. Higher tolerances of the ODE solvers may take larger steps, and in regions with rapidly changing dynamics; however, tighter tolerances may not capture the whole system behavior accurately. This can result in numerical noise and the appearance of spurious frequencies in the FFT.
To address the accuracy issues of numerical simulations:
(1) Refine a time step: Instead of drastically increasing tolerances, you might consider refining the time stepping in regions of interest. Consider a variable step solver that will take variable step algorithms which can automatically adjust the step size based on the local behavior of the system.
(2) Test Higher-Order Solvers, e.g. ODE113 and also, stiff solvers (e.g., ODE15s) which may be more suitable for stiff systems.
(3) Double-check Initial Conditions: In some unstable or very dynamic systems, small changes in initial conditions can lead to significant behavior changes.
All the best.
  2 件のコメント
Sofiane
Sofiane 2024 年 1 月 20 日
Thank you for your response Sulaymon,
So if i understand you with 'Refine' is to use Refine in odeset? but what i saw in matlab is that Refine does not apply when length(tspan) > 2, or when the ODE solver returns the solution as a structure.
For stiff solver like ODE15s it's a time consuming for my simulation (t>2h)
and about initial conditions i think they are good.
maybe i will try with ode 113 and i'll see the results!
Thank you again
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2024 年 1 月 20 日
Most welcome! Glad to be of some help :) Thumbs UP :)

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by