Has anybody seen this warning before? I can't troubleshoot it. Parameter precision loss occurred for 'X0'.......

Getting the following warning. Think it is possibly the external input of an integrator block. Want to turn off Warning but boss doesn't want to because we want to check for other signal precision loss. When error is asserted it doesn't show any suspects. Note: 'X0' does not appear to be a parameter that we define.
Warning: Parameter precision loss occurred for 'X0'. The parameter's value cannot be represented exactly using the run-time data type. A small quantization error has occurred. To disable this warning or error, in the Configuration Parameters > Diagnostics > Data Validity pane, set the 'Detect precision loss' option in the Parameters group to 'none'.

Answers (1)

This happens when you use a parameter value whose specified value/data type is more accurate than what the Simulink model is actually using.
For example, look at the image below. If you have a parameter whose value is 1.5 but your signal/state is an integer value, you have a precision loss and the first output of that integrator is actually 2.
- Sebastian

3 Comments

Sebastian,
Thanks for the response, it was very helpful! Still have not found my root cause but your example illustrates that I am looking in the right direction. I recreated your example and was able to obtain the same error. FYI - our model uses both continuos and discrete subsystems (all ran at a continous state top level). There are over 50 continuous integrators with external resets (like one in attached figure). I tried changing data types similar to your discrete example but the model flagged error. So maybe i am not looking in the right spot. Either way, thanks for the response it helped me confirm that I was headed in the right direction and gave a solid foundation of the fundamental issue.
No problem!
Does your MATLAB version give you a hyperlink to the block that's causing the problem -- or, at least, the name of the block? That may be a good place to start searching.
Here is that image from previous message.
Using 2012a for this program. "Detect precision loss:" was set to Warning so changed it to Error. However, when it flags the error the source is unknown and it doesn't highlight a block. It is a very complicated model with hundreds of masks, libraries, and associated m-files.

Sign in to comment.

Products

Asked:

on 6 Aug 2015

Commented:

on 7 Aug 2015

Community Treasure Hunt

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

Start Hunting!