Error using simulink solvers

조회 수: 6 (최근 30일)
eduardo marmol
eduardo marmol 2022년 2월 24일
답변: Yash 2024년 3월 14일
I am running the simulation of a very nonlinear system using simulink, but the solutions of the system are not very accurate. Some people said that the solver can be accumulating errors but I do not know how to fix this error accumulation. The system that I am simulating is a boost converter with pulse current.
The code that I am suing is:
clear all
clear
close all
RL=0.1
L=10E-3
c=100E-6
Rc=50
l=0.5 % Lambda
P=5000 % Power
dc=0.4 % Duty cycle of the PWM signal
T=0.14 % Period of the PWM signal
Stime=T % Simulation time
ST=1E-5 % Smapling time
sim('test3');
% Plot of the capacitor's voltaga
plot(ans.tout,ans.Vc.signals.values,"LineWidth",1.0)
grid on
xlim([x1,x2])
title("")
ylabel("Vc",'FontWeight',"bold")
xlabel("Time (sec)","FontWeight","bold")
Mi problem is that my answer Vc has rare switches/noise/error when I increase the duty cycle of the PWM signal, and this affect the rest of the system behavior. You can observe the noise/error in the folowing image.
I will appreciate any help that you can provide.
  댓글 수: 2
Benjamin Thompson
Benjamin Thompson 2022년 2월 24일
All numerical solvers have some error. You just have to balance the amount of error against computational complexity and run time. Switching systems are often very problematic. Have you tried changing your selected solver parameters for the model, maybe trying several, trying a smaller fixed time step, or different choices for the zero crossings control?
If solver error has less effect than uncertainties in other parameters of your model you are generally ok.
eduardo marmol
eduardo marmol 2022년 2월 24일
편집: eduardo marmol 2022년 2월 24일
Yes, I have tried different solvers and smaller fixed time step and different chocies for the zero crossing control.

댓글을 달려면 로그인하십시오.

답변 (1개)

Yash
Yash 2024년 3월 14일
Hi Eduardo,
The assumption that the error only occurs when the duty cycle is small is not correct. The error persistes even when the duty cycle is reduced to 0.1. This might not be visible at a larger time step, bit if the time time step is reduced to 1e-6, it becomes noticable. There can be a variety of reasons for this error. One of them could be the values chosen for various parameters in the system.
It's been observed that the solver exhibits consistent behavior across all duty cycles when the step size is minimized. As Benjamin pointed out, it's inherent for all numerical solvers to exhibit some degree of error. The key is to find an optimal balance between the acceptable error margin and the computational complexity and execution time.
To troubleshoot and address the parameter-related issues, consider the following steps:
  • Sensitivity Analysis: Conduct a sensitivity analysis by incrementally adjusting the duty cycle and monitoring the system's reaction. This approach can help pinpoint the specific scenarios under which the errors are amplified.
  • Subsystem Testing: Evaluate the subsystems of your model independently to verify their individual performance. This ensures that each component functions correctly before their integration into the full system.
Hope this helps!

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by