主要内容

导入数据进行参数估计

Create Experiment

Before you begin data import, create an experiment.万博1manbetx®Design Optimization™software provides an app for setting up the estimation session.

To create an estimation session:

  1. 在Matlab®prompt, open the nonlinear idle speed model of an automotive engine by typing :

    engine_idle_speed

    The model contains the Inport blockBPAV和外港块Engine Speedfor importing input and output data, respectively. To learn more, see导入数据的模型要求

  2. In the Simulink model window, open theParameter Estimator通过选择Analysis>参数估计

    Parameter Estimator

    You can organize the estimation and validation tasks inside经验erimentsunder数据浏览器panel on the left. You can assign each experiment to an estimation task or validation task.

    要创建实验,请单击新实验button.

    This creates an experiment called经验under经验eriments。To change the name of the experiment, right-click and selectRename。Call itNewData

    Note

    The Simulink model must remain open to perform parameter estimation tasks.

Time-Domain Data

经验eriments are collections of signal data, specifically input and output signal data. After you create an experiment, as described inCreate Experiment, you can import data into your experiment from various sources including MATLAB® variables, MAT-files, Excel® files, or comma-separated-value files.

将数据导入您的实验右键单击并选择Edit...。This will launch the experiment editor. In the experiment editor, you can define the signals contained in the experiment.

例如,在Inputspanel of the editor correspond to Inport blockBPAV在里面engine_idle_speedmodel.

The rows in theOutputspanel correspond to Outport blockEngine Speed。You can import signal data from files or MATLAB workspace.

Note

Simu万博1manbetxlink型号必须包含Inport或Outport Block或已记录信号以启用导入数据。有关更多信息,请参阅导入数据的模型要求。要选择更多输出信号以指定数据的数据,请单击选择测量的输出信号在里面Outputs控制板。

The idle-speed model of an automotive engine contains the measured data stored in theiodata在工作区中的数组。该数组包含两个列:第一个用于输入数据,而第二个用于输出数据。时间数据在time在工作区中的数组。You can import the input data by typing[time,iodata(:,1)]在里面Inputs控制板。

You can import the output data by typing[time,iodata(:,2)]在里面Outputs控制板。您可以通过单击查看数据。The input data should look like this:

Output data should look like this:

After importing the data forNewData实验,实验编辑看起来像这样:

To import data from a file, click thebutton.

了解更多有关编辑实验:对话框,请参阅编辑实验数据

Time-Series Data

时间序列data is stored in time-series objects. For more information, seeTime Series Objects and Collections

When you import input data from a time-series object,t, for parameter estimation, you must specify the time vector and data as[t.time,t.inputdata]在里面Inport signal dialog box. Similarly, to import output data, you must specify the time vector and data as[t.time,t.outputdata]在“出口信号”对话框中。有关如何将数据导入实验的更多信息,请参见Time-Domain Data

Complex Data

复杂值data is data whose value is a complex number. For example, a signal with the value1+2j很复杂。您可以使用复杂的数据来估计电气系统的参数,例如大小和相位。

Note

You must sample the real and imaginary parts of the data as a function of the same time vector.

To use complex data for parameter estimation:

  1. Split the data into two data sets that contain the real and imaginary parts. To split the data, use the MATLAB functions真实的, 和imag

  2. Create two signals, one for the real part and one for the imaginary part for the Inport or Outport block.

  3. Select both signals in the experiment editor.

  4. Import the data to the corresponding signal as described inTime-Domain Data

Related Examples

More About