fxpopt

优化系统的数据类型

描述

例子

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

例子

全部折叠

此示例展示如何基于指定的容差优化系统使用的数据类型。

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

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

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

选择= fxpOptimizationOptions (“AllowableWordLengths”24,“UseParallel”,真正的)
opt = fxpOptimizationOptions with properties: MaxIterations: 50 MaxTime: 600 Patience: 10 verbose: High allowablewordcolumns: [10 11 12 13 14 15 16 17 18 19 20 21 22 23 24] UseParallel: 1高级选项高级选项:[1×1 struct]

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

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

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

结果= fxpopt(model, sud, opt);
使用“本地”配置文件...连接到并行池(工人数:4)开始并行池(Parpool)。+预处理+建模优化问题 - 构建决策变量+运行优化求解器分析和将文件传输给工人......完成。- 评估新解决方案:成本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