对象是模型类的实例。每个班级is a blueprint that defines the following information about your model:
对象如何存储数据
您可以在对象上执行哪些操作
This toolbox includes nine classes for representing models. For example,IDSS
represents linear state-space models andidnlarx
represents nonlinear ARX models. For a complete list of available model objects, seeAvailable Linear ModelsandAvailable Nonlinear Models。
Modelpropertiesdefine how a model object stores information. Model objects store information about a model, such as the mathematical form of a model, names of input and output channels, units, names and values of estimated parameters, parameter uncertainties, and estimation report. For example, anIDSS
模型有一个输入名
用于存储一个或多个输入频道名称的属性。
对象上允许的操作称为methods。在系统标识Toolbox™软件中,某些方法具有相同的名称,但适用于多个模型对象。例如,步
创建一个阶跃响应nse plot for all dynamic system objects. However, other methods are unique to a specific model object. For example,佳能
is unique to state-spaceIDSS
models and线性化
到非线性黑框模型。
每个班级都有一种特殊的方法,称为构造函数,用于创建该类的对象。使用构造函数创建相应类或instantiates the object。构造函数名称与类名称相同。例如,IDSS
andidnlarx
既是类的名称,也是实例化线性状态空间模型和非线性ARX模型的构造函数的名称。
您可以通过明确指定所有必需的模型属性来使用模型构造函数在命令行中创建模型对象。
You must construct the model object independently of estimation when you want to:
Simulate or analyze the effect of model parameters on its response, independent of estimation.
在估计之前指定特定模型参数值的初始猜测。您可以在参数值上指定界限,或者预先设置辅助模型信息,或两者兼而有之。辅助模型信息包括指定输入/输出名称,单位,注释,用户数据等。
In most cases, you can use the estimation commands to both construct and estimate the model—without having to construct the model object independently. For example, the estimation commandtfest
creates a transfer function model using data and the number of poles and zeros of the model. Similarly,nlarx
使用数据和模型订单以及定义回归器配置的延迟创建非线性ARX模型。有关如何使用单个命令构建和估算模型的信息,请参见Model Estimation Commands。
对于灰色框模型,您必须始终首先构建模型对象,然后估算普通微分方程或差异方程的参数。
下表总结了系统标识工具箱产品中可用的模型构造仪,用于表示各种非线性模型。
经过模型估计,您可以识别MATLAB中的相应模型对象®Workspace浏览器通过其类名称。构造函数的名称匹配其创建对象的名称。
有关如何使用单个命令构建和估算模型的信息,请参见Model Estimation Commands。
模型构造函数的摘要
模型构造函数 | Resulting Model Class |
---|---|
idnlgrey |
非线性普通微分方程或差异方程(灰色框模型)。您编写一个函数或mex文件来表示管理方程。 |
idnlarx |
Nonlinear ARX models, which define the predicted output as a nonlinear function of past inputs and outputs. |
idnlhw |
Nonlinear Hammerstein-Wiener models, which include a linear dynamic system with nonlinear static transformations of inputs and outputs. |
有关何时使用这些命令的更多信息,请参阅When to Construct a Model Structure Independently of Estimation。
A model object stores information in thepropertiesof the corresponding model class.
非线性模型idnlarx
,,,,idnlhw
,,,,andidnlgrey
are based on theidnlmodel
superclass and inherit allidnlmodel
properties.
通常,所有模型对象都具有属于以下类别的属性:
输入和输出渠道的名称,例如输入名
andOutputName
Sample time of the model, such asTS
Time units
Model order and mathematical structure (for example, ODE or nonlinearities)
Properties that store estimation results (报告
)
User comments, such as笔记
andUserdata
有关在对象属性上获得帮助的信息,请参见模型参考页面。
下表总结了查看和更改模型属性值的命令。属性名称不敏感。如果前几个字母独特地标识属性,则无需键入整个属性名称。
Task | 命令 | 例子 |
---|---|---|
View all model properties and their values | Useget 。 |
加载样品数据,计算非线性ARX模型,并列出模型属性。 加载iddata1sys = nlarx(z1,[4 4 1]); get(sys)
|
Access a specific model property | Use dot notation. | View the output function in the previous model. sys.outputfcn |
对于属性,例如报告 ,,,,that are configured like structures, use dot notation of the formmodel.propertyname.fieldname 。fieldname is the name of any field of the property. |
查看非线性ARX模型估计中使用的选项。 sys.report.options |
|
Change model property values | Use dot notation. | 更改输出函数使用的非线性映射函数。 sys.outputfcn= 'idSigmoidNetwork'; |
Access model parameter values and uncertainty information | Usegetpvec andgetcov (foridnlgrey models only). |
Model parameters and associated uncertainty data. GETPVEC(SYS) |
设置模型参数值和不确定性信息 | Usesetpar andsetcov (foridnlgrey models only). |
设置参数向量。 sys = setpar(sys,'价值',,,,parlist)
|
Get number of parameters | Usenparams 。 |
获取参数数。 nparams(sys) |