Derivative of state '1' in block 'X/Y/Integrator' at time 0.55 is not finite.

조회 수: 829 (최근 30일)
Revathi Meda
Revathi Meda 2015년 11월 3일
답변: Hugo 2024년 10월 2일
An error occurred while running the simulation and the simulation was terminated Caused by: Derivative of state '1' in block 'X/Y/Integrator' at time 0.55 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). How to fix this error?
  댓글 수: 4
Sam Chak
Sam Chak 2023년 4월 14일
Please post your Simulink model (a snapshot) on a New Question. It allows to use to visually inspect if there is any block that cause the problem.
By the way, most of the time, the true singularity problem cannot be solved by merely reducing the fixed step size or by tightening the error tolerances. Take note!
Sourabh
Sourabh 2023년 5월 22일
편집: Walter Roberson 2023년 5월 22일
mdl = 'rl_exam'
obsInfo = rlNumericSpec([2 1]);
obsInfo.Name = 'observations';
obsInfo.Description = 'integrated error and error';
actInfo = rlNumericSpec([1 1]);
actInfo.Name = 'PID output';
env = rlSimulinkEnv(mdl,[mdl '/RL Agent'],obsInfo,actInfo)
agentOpts = rlDDPGAgentOptions(...
'SampleTime',0.01,...
'TargetSmoothFactor',1e-3,...
'DiscountFactor',0.99,...
'ExperienceBufferLength',100000,...
'MiniBatchSize',64,...
'NumStepsToLookAhead',2);
agent = rlDDPGAgent(obsInfo,actInfo,agentOpts)
This is the code i am using and i am getting
  • Algebraic state in algebraic loop containing 'rl_exam2/calculate reward/Sum1' computed at time 0.30000000000000004 is Inf or NaN. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances) or tweak the initial guess of algebraic loop variable values.
as error . i dont know how to attach the simulink file. i am stuck from last 5 days on this, any help would be great.

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

답변 (10개)

Sorelys Sandoval
Sorelys Sandoval 2016년 8월 21일
Hi, I had the same problem and the next thing worked for me:
Go to model configuration parameters/Solver/Solver Options:
Type: Variable-step
Solver: ode15s (stiff/NDF)
and that's all. Hope it works for you :D
  댓글 수: 20
Sam Chak
Sam Chak 2023년 10월 12일
@VIGNESH BALAJI, Good to hear that you've fixed the issue!
Nicolas CRETIN
Nicolas CRETIN 2024년 4월 26일
편집: Nicolas CRETIN 2024년 5월 21일
I don't have exactly the same error, but the following has helped in my case: I reduced the relative tolerance in the solver parameters:
hope it can help someone!

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


Sebastian Castro
Sebastian Castro 2015년 11월 4일
This usually has to do with really large or infinite signals feeding into an Integrator block. Numerical solvers (expectedly) have trouble integrating such large signals and therefore this leads to errors.
Typical causes can be divide by zero (1/0 = inf) or general unstable dynamics that quickly blow up over time. You should check that in your model. It can help to use Port Value Displays as you step through the model to figure out why this happens.
- Sebastian

Abhiram V. P. Premakumar
Abhiram V. P. Premakumar 2021년 4월 1일
편집: Abhiram V. P. Premakumar 2023년 6월 30일
I solved this issue by eliminating the infinite signal, using a switch block, and setting a clock as it's threshold (or a step block with t=1e-3). Denominator of a DIVIDE block being 0 at the beginning of a simulation, was the issue in my case. Using a clock or a step signal starting at t=1e-3s, along with a switch block, can make the divide block in the output of the switch block use a finite value temporarily, until the actual signal becomes finite.
  댓글 수: 9
OLUWASEUN ADEKOYA
OLUWASEUN ADEKOYA 2023년 6월 30일
@Abhiram V. P. Premakumar It would be great if you could be more elaborate on what specific values you put into what. For example, the clock, the only option I see here is decimation (which ofcourse only permits positive integer values). Is that the threshold value you are referring to?
Also, MATLAB's Simulink signals an error when a port is empty. Should one worry about that?
Finally. did you mean "integrator block" when you refer to "divide block"?
Thanks in anticipation.
Abhiram V. P. Premakumar
Abhiram V. P. Premakumar 2023년 6월 30일
Denominator of a DIVIDE block being 0 at the beginning of a simulation, was the issue in my case. A clock or a step signal starting at t=1e-3s, can make the divide block use a finite value temporarily until the actual signal becomes finite.

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


Guy Rouleau
Guy Rouleau 2024년 7월 25일
I describe the most common reasons for this error in this blog post:
The most common causes are:
  • A modeling error making the equations diverging
  • Too large step size
  • Division by zero
  댓글 수: 2
RAGHUVEER RAJESH
RAGHUVEER RAJESH 2024년 9월 3일
How to find the division by zero in a large model?
Guy Rouleau
Guy Rouleau 2024년 9월 3일
Set this diagnostics to Error, it will point to the block where the division by zero happens:

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


ahmet akgün
ahmet akgün 2021년 5월 2일
Adaptive Sliding-Mode Control for Boost DC–DC Converters simulation simulation fails;''Derivative of state '1' in block 'power_BoostConverter_Adaptive_SMC_math/TSMC Controller/Integrator' at time 0.0 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) ''
How to fix this error?
  댓글 수: 6
Ambe Harrison
Ambe Harrison 2022년 8월 23일
Hello,ahmet akgün. I am presently working on a Back steeping controller. Face thesame problem with the integrator. Please have you solved it.
If possible we may exchange more via email, ambeharrison2000@gmail.com
Zakarya Motea
Zakarya Motea 2023년 12월 10일
If your system has multiple chanels Try to tune them one by one. When tuning one chanel let the input for other chanels as zero.

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


Pavke
Pavke 2023년 3월 7일
Hello guys
I am doing a project in simulink and I have a problem. It is about braking an asynchronous motor with direct current, which I made (it works correctly), and it is necessary to connect that system to the distribution network (I use IEEE Bus 13). I connected the braking system of the asynchronous motor to the distribution network, and the system starts to work, it goes down from 1800 reversions and comes to 1480, and by the end of the simulation it stands at 1480, the engine will not brake and the simulation does not finish to the end and the following error occurs :
An error occurred while running the simulation and the simulation was terminated Caused by: Derivative of state '1' in block 'distributivnamrezamodel/Transfer Fcn' at time 0.991475799999991 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).
How to fix this problems?
Thank you
  댓글 수: 2
GEORGIOS
GEORGIOS 2023년 3월 16일
hey , did you find a solution on this ?
Daniel Joseph
Daniel Joseph 2023년 3월 28일
Try to figure out why is your signal really large/infinite. Is divide by zero correct in this case? maybe you can substitute a very small value like 1e-6 instead of zero, using the switch example shown above by @Abhiram V. P. Premakumar, such that the solver does not get bogged down at very small /large values.

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


Anton
Anton 2023년 4월 23일
편집: Walter Roberson 2023년 5월 22일
Hello, I have the same error. Please help me figure out what's wrong.
K1 = 2000;
K2 = 1;
Kk1 = 0.0012;
T1 = 0.2;
T2 = 0.005;
Tk1 = 0.0001;
T3 = 0.1;
Kt = 0.5;
tp = 0.280;
  댓글 수: 4
Sam Chak
Sam Chak 2023년 4월 23일
편집: Sam Chak 2023년 4월 23일
Hi @Saleh Altbawi, it is definitely not the solver. When a system is unstable, it doesn't matter what solver is chose. Here is a simple example of an unstable transfer function, with a positive pole.
Saleh Altbawi
Saleh Altbawi 2023년 4월 24일
Hi. The system is not stable at specific time does not mean division on zero. If that true it should not work from the beginning. That mean solver at specific time could not convergence the transfer function. So try to use different kinds of solver. If does not work then try to update your system's parameters.

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


Yingxin Zhang
Yingxin Zhang 2023년 5월 22일
hey i have the same problem, can you help me?
  댓글 수: 1
OLUWASEUN ADEKOYA
OLUWASEUN ADEKOYA 2023년 6월 30일
Any luck on this yet?
I'm currently experiencing some similar issues with this as well. Thanks.

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


Camila
Camila 2024년 3월 7일
Im having the same problem

Hugo
Hugo 2024년 10월 2일
When I get this error, I can fix this by using the folling method :
  1. run your model using the step forward function (run step by step)
  2. Starting from the integrator block that makes the model stop, clik on signals to display values
  3. Track the signal until you find where the value diverges
  4. make the necessary corrections.
It works for me. I hope it will help you.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by