simulation stopped because powergui caused 1000 zero crossings events

1 次查看(过去 30 天)
Simulation was stopped because powergui and some other blocks like relays etc. caused 1000 zero crossings events.This error did not go even after I increased the maximum no. of zero crossings in configuration properties.
I also made the zero crossing detection "adaptive" and changed ignored and masked zero crossings to "none", as instructed in the diagnostics pane, but even though the simulation ran uptil completion after that, the ouput graphs were not correct. It was as if, after the time intervals where zero crossings> 1000 was indicated, the graphs just continued as per previous state. It was no longer responsive to the changes in input signals.

回答(1 个)

Riya
Riya 2023-12-20
编辑:Riya 2024-1-5
Hello Rhea,
As per my understanding, you're facing issues with zero crossing events in your MATLAB/Simulink simulation and altering the maximum number of zero crossings and the zero crossing detection settings did not resolve the issue.
Please note that here's a step-by-step guide to troubleshoot the problem.
  • Ensure that the parameters and initial conditions of your model represent a physically realistic system.
  • Choose a solver that is better suited for handling stiff systems or systems with discontinuities and adjust the step size and tolerances.
  • Implement hysteresis in the switching logic of relays and other components that cause zero crossings to prevent chattering.
% Add hysteresis to a relay block programmatically
set_param('my_model/Relay', 'SwitchOnPoint', '5.1', 'SwitchOffPoint', '4.9');
  • Filter Noisy Signals
Apply filtering to noisy signals that could be causing unnecessary zero crossings.
% Applying a low-pass filter to a noisy signal
fs = 1000; % Sampling frequency
fc = 50; % Cutoff frequency
[b, a] = butter(3, fc/(fs/2)); % Create a 3rd-order Butterworth filter
filtered_signal = filter(b, a, noisy_signal);
  • Temporarily disable non-essential dynamics to isolate the problematic part of the model.
  • Use Event-Based Modeling
  • Resolve Algebraic Loops
Identify and resolve any algebraic loops in your model that could be causing numerical difficulties.
% Introduce a delay to break an algebraic loop
set_param('my_model/AlgebraicLoopBlock', 'SampleTime', '1e-3');
  • Review Output Graphs and Data
After running the simulation, thoroughly review the output graphs to ensure they are physically plausible.
If you continue to experience issues, please provide more details about your model, the blocks causing problems, and the exact nature of the incorrect outputs in your graphs. This will help in offering a more precise solution.
For more information you can refer following articles:
I hope it helps!

类别

Help CenterFile Exchange 中查找有关 General Applications 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by