How to use derived ranges for gain and constant blocks using derive range analysis?

1 vue (au cours des 30 derniers jours)
I am trying to use derived range analysis and I am specifying design min, max for the gain block parameter as shown in the model below. But derived range analysis treats the parameter as a constant and disregards the design min, max. I would expect the derived ranges for the output of the gain block to be [0 (0x1), 960 (15x64)] while I see a range of [0,30].

Réponse acceptée

MathWorks Fixed Point Team
In this scenario, your parameter is not considered as tunable and therefore treated as an invariant constant. So the design ranges do not apply and we take the actual value into consideration. You need to specify and use a tunable parameter in order to leverage the design ranges during range analysis.
You can do this using Simulink.Parameter object, specify the design min, max for the parameter value. In order to make the parameter tunable, you need to set the storage class to a value other than the default “Auto” setting.
Here is one way to specify the parameter with ‘Model Default’ as the storage class:
myGain = Simulink.Parameter(2);
myGain.Min = 1;
myGain.Max = 64;
myGain.StorageClass = 'Model Default';
Please use the attached example to follow the suggestions above.
Please refer to the doc link for more information on derive range analysis with Simulink parameter objects.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by