主要内容

FunctionApproximation。问题类

包:FunctionApproximation

对象,定义要近似的函数或要优化的查找表

描述

FunctionApproximation。问题对象定义要用查找表近似的函数,或要优化的查找表块。定义问题之后,使用解决方法来生成FunctionApproximation。LUTSolution对象,该对象包含近似。

建设

approximationProblem= FunctionApproximation.Problem ()创建一个FunctionApproximation。问题具有默认属性值的对象。当没有函数提供了输入FunctionToApproximate属性设置为“罪”

approximationProblem= FunctionApproximation。问题(函数创建一个FunctionApproximation。问题来近似函数,数学函数块或指定的查找表函数

输入参数

全部展开

要近似的函数或块,或要优化的查找表块,指定为函数句柄,数学函数,一个cfit(曲线拟合工具箱)对象,仿真软件®块或子系统,或者查找表块之一(例如,一维查找表一天的查找表).

如果指定一个查找表块,则解决方法生成优化的查找表。

如果你指定一个数学函数,一个函数句柄,cfit对象,或块解决方法生成输入函数的查找表近似值。

如果指定cfit对象,使用fittype(曲线拟合工具箱)函数指定要近似的库模型。有关库模型的列表,请参见曲线和曲面拟合库模型列表(曲线拟合工具箱)

函数句柄必须在MATLAB上®搜索路径,否则近似失败。

支持近似的MATLAB数学函数为:

  • 1. / x

  • 10 . x ^

  • 2 . x ^

  • 这些“可信赖医疗组织”

  • 作用是

  • 印度历的7月

  • 的作用

  • :

  • 量化

  • atanh

  • 因为

  • cosh

  • 经验值

  • 日志

  • log10

  • log2

  • sinh

  • √6

  • 棕褐色

  • 双曲正切

  • x ^ 2。

提示

函数句柄生成查找表近似的过程比子系统快。如果子系统可以用函数句柄表示,则近似函数句柄会更快。

数据类型:字符|function_handle

属性

全部展开

要近似的函数或块,或要优化的查找表块,指定为函数句柄、数学函数、Simulink块或子系统,或查找表块之一(例如,一维查找表一天的查找表).

如果指定一个查找表块,则解决方法生成优化的查找表。

如果指定cfit对象,使用fittype(曲线拟合工具箱)函数指定要近似的库模型。有关库模型的列表,请参见曲线和曲面拟合库模型列表(曲线拟合工具箱)

如果你指定一个数学函数,一个函数句柄,cfit对象,或块解决方法生成输入函数的查找表近似值。

函数句柄必须在MATLAB搜索路径上,否则近似失败。

支持近似的MATLAB数学函数为:

  • 1. / x

  • 10 . x ^

  • 2 . x ^

  • 这些“可信赖医疗组织”

  • 作用是

  • 印度历的7月

  • 的作用

  • :

  • 量化

  • atanh

  • 因为

  • cosh

  • 经验值

  • 日志

  • log10

  • log2

  • sinh

  • √6

  • 棕褐色

  • 双曲正切

  • x ^ 2。

提示

函数句柄生成查找表近似的过程比子系统快。如果子系统可以用函数句柄表示,则近似函数句柄会更快。

数据类型:字符|function_handle

近似函数的输入数。这个属性是从FunctionToApproximate属性,因此它不是一个可写的属性。

如果你生成一个直接查找表,要近似的函数只能有两个输入。

数据类型:

近似函数的输入的期望数据类型,指定为numerictype仿真软件。Numerictype的向量numerictype仿真软件。Numerictype对象。的数量InputTypes指定的必须与NumberOfInputs

例子:问题。InputTypes = ["numerictype(1,16,13)", "numerictype(1,16,10)"];

函数要近似的输入范围的下限,指定为标量或向量。如果您指定,InputLowerBounds在近似过程中使用的是由InputTypes财产。的尺寸InputLowerBounds必须匹配NumberOfInputs

数据类型:||int8|int16|int32|int64|uint8|uint16|uint32|uint64|fi

函数要近似的输入范围的上限,用标量或向量表示。如果您指定,InputUpperBounds在近似过程中使用的是由InputTypes财产。的尺寸InputUpperBounds必须匹配NumberOfInputs

数据类型:||int8|int16|int32|int64|uint8|uint16|uint32|uint64|fi

函数近似输出的期望数据类型,指定为numerictype仿真软件。Numerictype.例如,要指定输出为具有16位字长和最佳精度分数长度的带符号定点数据类型,请设置OutputType财产“numerictype(16)”

例子:问题。OutputType = " numerictype(16)”;

在近似中使用的其他选项和约束,指定为FunctionApproximation。选项对象。

方法

解决 求函数逼近问题的最优解

复制语义

句柄。要了解句柄类如何影响复制操作,请参见复制对象

例子

全部折叠

创建一个FunctionApproximation。问题对象,指定要近似的函数句柄。

问题(@(x,y) sin(x)+cos(y))
问题= FunctionApproximation。问题with properties FunctionToApproximate: @(x,y)sin(x)+cos(y) NumberOfInputs: 2 InputTypes: ["numerictype('double')" "numerictype('double')"] InputLowerBounds: [-Inf -Inf] InputUpperBounds: [Inf Inf] OutputType: "numerictype('double')" Options: [1×1 FunctionApproximation.Options]

FunctionApproximation。问题对象,问题,使用默认属性值。

将函数输入的范围设置为0到2 *π

问题。InputLowerBounds = (0,0);问题。InputUpperBounds = [2*pi, 2*pi]
问题= FunctionApproximation。问题with properties FunctionToApproximate: @(x,y)sin(x)+cos(y) NumberOfInputs: 2 InputTypes: ["numerictype('double')" "numerictype('double')"] InputLowerBounds: [0 0] InputUpperBounds: [6.2832 6.2832] OutputType: "numerictype('double')" Options: [1×1 FunctionApproximation.Options]

创建一个FunctionApproximation。问题对象,指定要近似的数学函数。

问题= FunctionApproximation。问题(“日志”
问题= FunctionApproximation。问题with properties FunctionToApproximate: @(x)log(x) NumberOfInputs: 1 InputTypes: "numerictype(1,16,10)" InputLowerBounds: 0.6250 InputUpperBounds: 15.6250 OutputType: "numerictype(1,16,13)" Options: [1×1 FunctionApproximation.Options]

数学函数具有适当的输入范围、输入数据类型和输出数据类型属性默认值。

创建一个FunctionApproximation。问题对象,指定一个cfit对象来近似。

ffun = fittype (“exp1”);cfun = cfit (ffun, 0.1, 0.2);问题= FunctionApproximation.Problem (cfun);
问题= 1×1函数逼近。问题with properties: FunctionToApproximate: [1x1 cfit] NumberOfInputs: 1 InputTypes: "numerictype('double')" InputLowerBounds: -Inf InputUpperBounds: Inf OutputType: "numerictype('double')" Options: [1×1 FunctionApproximation.Options]

创建一个FunctionApproximation。问题对象来优化现有的查找表。

openExample (“simulink_automotive / ModelingAFaultTolerantFuelControlSystemExample”“supportingfile”“sldemo_fuelsys”);问题= FunctionApproximation。问题(“sldemo_fuelsys / fuel_rate_control airflow_calc /注入恒定的
问题= FunctionApproximation。问题with properties FunctionToApproximate: 'sldemo_fuelsys/fuel_rate_control/airflow_calc/Pumping Constant' NumberOfInputs: 2 InputTypes: ["numerictype('single')" "numerictype('single')"] InputLowerBounds: [50 0.0500] InputUpperBounds: [1000 0.9500] OutputType: "numerictype('single')" Options: [1×1 FunctionApproximation.Options]

该软件推断的属性问题对象。

限制

  • 在模型掩码工作区中不支持查找表对象和断点对象。

算法

全部展开

版本历史

介绍了R2018a

全部展开

Baidu
map