FFT resolution and RelaTol and AbsTol

조회 수: 3 (최근 30일)
Sofiane
Sofiane 2024년 1월 20일
댓글: Sulaymon Eshkabilov 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 CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by