fxpopt

优化系统的数据类型

描述

例子

结果= fxpopt (模型,sud,选项)指定的模型或子系统中的数据类型的优化sud在模型中,模型属性中指定的附加选项fxpOptimizationOptions对象,选项

例子

全部折叠

这个示例展示了如何根据指定的公差优化系统使用的数据类型。

首先,打开要对其优化数据类型的系统。

模型=“ex_auto_gain_controller”;sud =“ex_auto_gain_controller / sud”;open_system(模型)

创建一个fxpOptimizationOptions对象来定义满足设计目标的约束和公差。设置UseParallel财产的fxpOptimizationOptions对象真正的并行运行优化的迭代。属性还可以指定设计中允许的字长AllowableWordLengths财产。

选择= fxpOptimizationOptions (“AllowableWordLengths”24,“UseParallel”,真正的)
选择= fxpOptimizationOptions属性:MaxIterations: 50 MaxTime: 600耐心:10冗长:高AllowableWordLengths:[10 11 12 13 14 15 16 17 18 19 20 21日22日23日24]UseParallel: 1高级选项AdvancedOptions:[1×1 struct]

使用addTolerance方法为系统的原始行为与使用优化的定点数据类型的行为之间的差异定义公差。

托尔= 10依照;addTolerance(选择模型' / output_signal '), 1“AbsTol”, tol);

使用fxpopt函数运行优化。该软件分析在设计下的系统中的对象范围和指定的约束fxpOptimizationOptions对象将异构数据类型应用到系统中,同时最小化总位宽。

结果= fxpopt(model, sud, opt);
开始使用“本地”轮廓平行池(parpool)......连接到并行池(工号:4)。+预处理+模拟优化问题 - 构建决策变量+运行优化求解分析和传输文件给工人...完成。- 评估新的解决方案:成本180,不符合公差。- 评估新的解决方案:成本198,不符合公差。- 评估新的解决方案:成本216,不符合公差。- 评估新的解决方案:成本234,不符合公差。- 评估新的解决方案:成本252,不符合公差。- 评估新的解决方案:成本270,不符合公差。- 评估新的解决方案:成本288,不符合公差。- 评估新的解决方案:成本306,符合公差。 - Evaluating new solution: cost 324, meets the tolerances. - Evaluating new solution: cost 342, meets the tolerances. - Evaluating new solution: cost 360, meets the tolerances. - Evaluating new solution: cost 378, meets the tolerances. - Evaluating new solution: cost 396, meets the tolerances. - Evaluating new solution: cost 414, meets the tolerances. - Evaluating new solution: cost 432, meets the tolerances. - Updated best found solution, cost: 306 - Evaluating new solution: cost 304, meets the tolerances. - Evaluating new solution: cost 304, meets the tolerances. - Evaluating new solution: cost 301, meets the tolerances. - Evaluating new solution: cost 305, does not meet the tolerances. - Evaluating new solution: cost 305, meets the tolerances. - Evaluating new solution: cost 301, meets the tolerances. - Evaluating new solution: cost 299, meets the tolerances. - Evaluating new solution: cost 299, meets the tolerances. - Evaluating new solution: cost 296, meets the tolerances. - Evaluating new solution: cost 299, meets the tolerances. - Evaluating new solution: cost 291, meets the tolerances. - Evaluating new solution: cost 296, does not meet the tolerances. - Evaluating new solution: cost 299, meets the tolerances. - Evaluating new solution: cost 300, meets the tolerances. - Evaluating new solution: cost 296, does not meet the tolerances. - Evaluating new solution: cost 301, meets the tolerances. - Evaluating new solution: cost 303, meets the tolerances. - Evaluating new solution: cost 299, meets the tolerances. - Evaluating new solution: cost 304, does not meet the tolerances. - Evaluating new solution: cost 300, meets the tolerances. - Updated best found solution, cost: 304 - Updated best found solution, cost: 301 - Updated best found solution, cost: 299 - Updated best found solution, cost: 296 - Updated best found solution, cost: 291 - Evaluating new solution: cost 280, meets the tolerances. - Evaluating new solution: cost 287, meets the tolerances. - Evaluating new solution: cost 288, does not meet the tolerances. - Evaluating new solution: cost 287, does not meet the tolerances. - Evaluating new solution: cost 283, meets the tolerances. - Evaluating new solution: cost 283, does not meet the tolerances. - Evaluating new solution: cost 262, does not meet the tolerances. - Evaluating new solution: cost 283, does not meet the tolerances. - Evaluating new solution: cost 282, does not meet the tolerances. - Evaluating new solution: cost 288, meets the tolerances. - Evaluating new solution: cost 289, meets the tolerances. - Evaluating new solution: cost 288, meets the tolerances. - Evaluating new solution: cost 290, meets the tolerances. - Evaluating new solution: cost 281, does not meet the tolerances. - Evaluating new solution: cost 286, does not meet the tolerances. - Evaluating new solution: cost 287, meets the tolerances. - Evaluating new solution: cost 284, meets the tolerances. - Evaluating new solution: cost 282, meets the tolerances. - Evaluating new solution: cost 285, does not meet the tolerances. - Evaluating new solution: cost 277, meets the tolerances. - Updated best found solution, cost: 280 - Updated best found solution, cost: 277 - Evaluating new solution: cost 272, meets the tolerances. - Evaluating new solution: cost 266, meets the tolerances. - Evaluating new solution: cost 269, meets the tolerances. - Evaluating new solution: cost 271, does not meet the tolerances. - Evaluating new solution: cost 274, meets the tolerances. - Evaluating new solution: cost 275, meets the tolerances. - Evaluating new solution: cost 274, does not meet the tolerances. - Evaluating new solution: cost 275, meets the tolerances. - Evaluating new solution: cost 276, does not meet the tolerances. - Evaluating new solution: cost 271, meets the tolerances. - Evaluating new solution: cost 267, meets the tolerances. - Evaluating new solution: cost 270, meets the tolerances. - Evaluating new solution: cost 272, meets the tolerances. - Evaluating new solution: cost 264, does not meet the tolerances. - Evaluating new solution: cost 265, does not meet the tolerances. - Evaluating new solution: cost 269, meets the tolerances. - Evaluating new solution: cost 270, meets the tolerances. - Evaluating new solution: cost 269, meets the tolerances. - Evaluating new solution: cost 276, meets the tolerances. - Evaluating new solution: cost 274, meets the tolerances. - Updated best found solution, cost: 272 - Updated best found solution, cost: 266 + Optimization has finished. - Neighborhood search complete. - Maximum number of iterations completed. + Fixed-point implementation that met the tolerances found. - Total cost: 266 - Maximum absolute difference: 0.087035 - Use the explore method of the result to explore the implementation.

使用探索的方法OptimizationResult对象,结果、发射模拟数据检查和探索设计包含最小的比特总数,同时保持了数字中规定的公差选择对象。

探索(结果);

属性可以将模型恢复到初始状态回复的方法OptimizationResult对象。

回复(结果);

输入参数

全部折叠

包含要优化的系统的模型的名称。

数据类型:字符

您想要优化其数据类型的模型或子系统,指定为包含系统路径的字符向量。

数据类型:字符

fxpOptimizationOptions对象,指定要在数据类型优化过程中使用的其他选项。

输出参数

全部折叠

优化的结果,返回为OptimizationResult对象。使用探索方法的对象打开仿真数据检查器,查看优化后的系统的行为。还可以研究优化过程中发现的其他解决方案,这些解决方案可金宝搏官方网站能满足,也可能不满足fxpOptimizationOptions对象,选项

介绍了R2018a