Error in Simulink - Derivative of state '1' in block at time 301.02267725 is not finite. The simulation will be stopped. There may be a singularity in the solution.
744 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I get the following error -
An error occurred while running the simulation and the simulation was terminated
Caused by:
- Derivative of state '1' in block 'gam_control1/PID Controller2/Integrator/Continuous/Integrator' at time 301.02267725611046 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
I am using a manually created signal (using signal editor) as an input into a PID controller. I have tried to select ODE15 from the model configurations and also tried tightening the absolute error. Nothing works. The simulation stops at 300 s. I need it to run till 550 s. Please help.
7 Kommentare
Sam Chak
am 18 Dez. 2024 um 2:58
The error message isn't very user-friendly for those who just want to construct the control block diagram and run it. A lot of the terminology probably isn't covered in your Electrical Engineering course on the DC Boost converter.
A control system, especially the DC Boost converter in your case, consists of a set of differential equations that need to be integrated over a certain time duration to obtain the behavior of the system states as they change over time.
In layman's terms, the message indicates that the instantaneous value of the derivative of state No. 1 (from the first differential equation) at time 10^{-6} is not a valid value, possibly because the state value grows extremely large over time. This situation often occurs when there is a division in the differential equation, causing the state value to become smaller than what can be integrated by the Simulink Integrator block.
As a result, the simulation will stop, and it suggests reducing the integration step size so that the integrator can better capture the dynamic changes of the state. The first step is to check whether the differential equations are correctly implemented in the blocks. If they are 100% correct, then it may be that your PID controller is designed incorrectly, leading to system instability.
Antworten (2)
Salman Ahmed
am 14 Okt. 2021
Hi Riya,
This problem occurs oftenly. This is usually caused because of Inf or NaN output produced at a block. Set the diagnostic "Inf or NaN block output" to error in the configuration settings. If this is the issue, you will get the error as follows:
An error occurred while running the simulation and the simulation was terminated
Caused by:
- Block 'BlockName' outputs 'NaN' for element x of output port x at major time step 0
where BlockName is the block in which error is thrown.
You can debug your model from there to bypass NaN or Inf values from reaching the integrator.
3 Kommentare
Andre Morais
am 26 Jul. 2024
Thank you for sharing this piece of information. It was incredibly helpful!
Best regards
Sam Chak
am 3 Okt. 2024
% Derivative of state '1' in block 'gam_control1/PID Controller2/Integrator/Continuous/Integrator'
% at time 301.02267725611046 is not finite. The simulation will be stopped. There may be a singularity
% in the solution. If not, try reducing the step size...
Previously, I have asked many students who use Simulink's "Transfer Function" blocks, primarily in courses such as Dynamical Systems and Control Systems, but NONE of them truly understand the meaning of the error message or the suggestion to reduce the step size. They do not learn about "non-finite derivatives" and "singularity" in these courses because the focus is primarily on modeling stable dynamical systems using Laplace transforms and tuning controller gains to achieve stability by evaluating closed-loop poles. These terms are rarely mentioned in the curriculum.
Most of the time, the error indicates that the dynamical system is unstable. In this context, "unstable" means that the output of the transfer function or some of the internal states (in your case, state '#1' is the output) increase or decrease over time without bounds. The output of the system will diverge rapidly, leading to unbounded behavior. Practically speaking, this means that the system's response will grow infinitely (getting non-finite signal), which can cause the system to fail or become uncontrollable. Since Simulink cannot continuously run the simulation without limits, the simulation will be stopped. The term "singularity," in the context of dynamic systems, refers to a condition where the system's equations become undefined or lead to infinite values.
Reducing the step size is a technical adjustment in Simulink that allows the user to specify a much smaller simulation step size (time) to capture the rapidly growing behavior of the system's response. However, in 100% of cases where linear systems are unstable; specifically, where any pole of the transfer function has a positive real part; reducing the step size will not help, as it does not "magically stabilize" the system.
Suggestion:
If the instability is caused by modeling errors due to human mistakes in specifying the system's equations incorrectly (such as plus/minus sign errors, decimal point errors, etc.), these issues must be corrected manually. In almost all cases, users should perform stability analysis of the closed-loop system before running the simulation in Simulink. For linear systems, there are plenty of tools available, such as isstable(), pole(), rlocus(), and eig().
If the instability issue persists, please post your problem along with a screenshot of the Simulink model in a New Question.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Classical Control Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!