Error using simulink solvers

4 views (last 30 days)
eduardo marmol
eduardo marmol on 24 Feb 2022
Answered: Yash on 14 Mar 2024
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 Comments
Benjamin Thompson
Benjamin Thompson on 24 Feb 2022
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 on 24 Feb 2022
Edited: eduardo marmol on 24 Feb 2022
Yes, I have tried different solvers and smaller fixed time step and different chocies for the zero crossing control.

Sign in to comment.

Answers (1)

Yash
Yash on 14 Mar 2024
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!

Categories

Find more on General Applications in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!