Derivative of state '1' in block 'model4/PMSM /Integrator' at time 1.09996 is not finite
18 views (last 30 days)
Show older comments
Could you please help me to solve the following error.
I am triing to find integrl squer error for pi controller and get this error
Error using fun (line 16) Derivative of state '1' in block 'model4/PMSM /Integrator' at time 1.09996 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)
0 Comments
Answers (4)
hardik
on 17 Jul 2021
Use saturation block, because somewhere, the answer is getting zero.
3 Comments
Peter O
on 18 Jul 2021
This error can occur when the feedback loop creates positive feedback. As you step through time your derivative input into the integrator looks something like:
- dx/dt = 0.12
- dx/dt = 123
- dx/dt = 1230
- dx/dt = 1.23e6
- dx/dt = 1.23e9
- dx/dt = 1.23e16
- dx/dt = 1.23e50
- dx/dt = 1.23e150
- dx/dt = 1.23e300
- dx/dt = Inf or NaN (Overflows the floating point)
To determine if this is the case, attach a scope to the input to the integrator. If you're blowing up, then you'll see a dramatic exponential curve ending at that incredibly high value. Less commonly, you might encounter a divide by zero condition which also sends a NaN into the integrator. Check your connections in the PI loop and make sure you're sending the controller negative feedback with appropriate gains.
2 Comments
Peter O
on 21 Jul 2021
Based on the photograph, you seem to be integrating the square of the summed error over time. It's a little tricky to troubleshoot your problem without a larger context. A couple ideas:
- Does this "SE" term feed back into the model before the time horizon ends or is it strictly informational for the optimizer, at the end of a defined period? If you're using it to tune a gain in real-time, know that all errors (under and overshoot) it passes back are going to show up as positive, so it doesn't matter what action it takes: the error will always seem to be increasing, which might cause the controller to drive something really, really hard and lose stability.
- If it's strictly informational (for instance, you're using a Monte-Carlo method to check out a bunch of gain constants), you might still get a couple "bad" gain sets which could cause this. Either adjust your bounds to operate within a more stable region or look into doing something like checking the model error for a maximum gain error and using the Stop Simulation block to kill it early.
Answering your question, you can encounter divide by zero if some term on the loop denominator goes to zero. If you have something like for a block and something earlier in the loop sets u to zero, then
y = 1/0
isfinite(y)
So either NaN or Inf is going to give you trouble. From what you've shown, I don't think a divide by zero problem is occuring here.
sy
on 4 Aug 2024
- Derivative of state '1' in block 'fuzzy/Subsystem/Integrator' at time 0.54 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) .Thank
1 Comment
Sam Chak
on 4 Aug 2024
Hi @sy
Your response does not appear to provide a proposed solution to the question by @Hussein shutari at hand. If you are encountering a technical issue while designing a Fuzzy Controller for a dynamic system, I kindly request that you post a new question by clicking the provided link. When doing so, please include the mathematical descriptions of both the system and the controller, as well as the Simulink model, so that the issue can be addressed by subject matter experts.
Communities
More Answers in the Power Electronics Control
See Also
Categories
Find more on Classical Control Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!