Sudden Increases in Computational Noise During Simulation
조회 수: 2 (최근 30일)
이전 댓글 표시
In my Simulink model, a signal of interest should occur to be zero. Due to computational errors, it has some noise, I understand that. The thing I do not understand is that this computational noise level is suddenly increased multiple times during the simulation. As the picture below shows, at least 4 update in the noise amplitude can be counted. If the increase in the noise amplitude was continuous, it could have been explained as accumulation of errors, but here I see sudden changes as if Simulink decides to increase computational error tolerance.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/861350/image.png)
The model generating this result seems like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/861355/image.png)
I am using variable-step solver (ode45). Duration of the simulation is 100000 seconds. I tried disabling absolute tolerance auto scaling but it did not change anything. Also, I suspected accumulation of error at the sinusoidal wave, but the reason is not that either.
I wonder why this happens and how to avoid it. I have attached the simulink model for reproducability.
댓글 수: 2
Mathieu NOE
2022년 1월 20일
hello
I would prefer to run a fixed step solver - can you try this ?
IMHO, I would go for discrete models + fixed step solver
답변 (1개)
Rangesh
2023년 9월 29일
편집: Rangesh
2023년 9월 30일
Hi tkarg,
I understand that you want to reduce the noise in the Simulink computations. To reduce noise in simulations, consider using a fixed step solver instead of a variable step solver. Variable step solvers can introduce more noise when there are numerical instabilities or rapid transitions in the system. By using a fixed step solver, you can mitigate these issues and achieve more stable and accurate results.
Attached below is the result generated by your model obtained using fixed step solver:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1496604/image.png)
You can refer to the following documentation on the usage of different solvers:
I hope this resolves your query.
Thanks,
Rangesh
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!