You can use the
fxpopt function to optimize the data types of a model or subsystem.
Sometimes, the optimization is not successful. The following sections describe how
to troubleshoot these cases.
To determine if the behavior of a new fixed-point implementation is
acceptable, the optimization requires well-defined behavioral constraints. Use
addTolerance method of the
fxpOptimizationOptions class to specify numerical constraints for
the optimized design.
The model containing the system you want to optimize must have the following characteristics:
All blocks in the model must support fixed-point data types.
The model cannot rely on data type override to establish baseline behavior.
The design ranges specified on blocks in the model must be consistent with the simulation ranges.
The data logging format of the model must be set to
To configure this setting, in the Configuration Parameters, in the
Data Import/Export pane, set
The model must have finite simulation stop time.
When the optimization is not able to find a new valid result, the
fxpopt function does not produce an
OptimizationResult output. Invalid results are most often the
result of using a model that is not supported for optimization. For more
information, see Unable to Model Problem — No Constraints Specified Unable to Model Problem — Model is not Supported.
When the optimization is successful, you can explore several different implementations of your design that were found during the optimization process. Do not save the model until you are satisfied with the new design. Saving the model disables you from continuing to explore the other implementations.