Solver is encountering difficulty in simulating model 'new_try_model1' at time 1.7234322815991867.

110 次查看(过去 30 天)
I am runing my simulation with auto solver. So, It is taking ode45 as solver for my simulation. But when I run the simulink model, I am getting the error shown below.
Can anyone tell me what can i do in this error ?

采纳的回答

Vignesh Murugavel
Vignesh Murugavel 2022-11-11
Hi Shiv,
This problem likely occurs when an operation in the model causes an "Inf" or "NaN" output. These Infinite or NaN values get passed to the integrator block which generates this error message.
This can happen if an integrator is present in the model, but it does not necessarily mean the error is caused by or at the integrator.
In order to find out which block was responsible for generating Infinite or NaN value you can set the configuration parameters by performing the below steps:
  1. Go to 'Model Settings' of Top Model from Toolstrip
  2. Search for 'Inf or NaN block output' using the search bar present above in the Configuration Parameters panel.
  3. Set the value of 'Inf or NaN block output' to 'error' (by default it would be 'none')
  4. Click Apply and OK. Run the model again.
Now you can see an error in the 'Diagnostic Viewer' which points out the block that is creating Infinite or NaN value.
This block either divides by 0 or outputs NaN, which creates an Inf that when fed to an Integrator, generates this error.
So, avoid division by zero in the logic and check operations for possible NaN outputs.
You Could alternatively also try the following Approaches to resolve the problem:
  • Rescale the model if the values of your states differ by a large magnitude
  • Change Solver Type to ‘Variable-step’ and Solver to ‘ode15s (stiff/NDF)’ in Configuration Parameters
  • Set specific error tolerances for the Integrator blocks
Hope this helps!

更多回答(0 个)

类别

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

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by