Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Optimization   

Estimating Parameters at the Command Line

Workflow for Estimating Parameters at the Command Line

In addition to the Control and Estimation Tools Manager GUI, you can also use Simulink Design Optimization functions to perform parameter and state estimation. These functions perform the same tasks as the tools manager, but have the advantages of command-line execution. When you perform a state or parameter estimation using the GUI, you create MATLAB objects for all the states and parameters of your model. If you have a large number of states or parameters, this can use up large amounts of memory and cause computational delays. With the command-line approach, only those states and parameters that you select are assigned MATLAB objects, which is more efficient.

In addition, the command-line approach is useful for batch jobs where you can estimate parameters for a large numbers of models.

Simulink Design Optimization software uses MATLAB objects to perform estimation tasks. To learn more about object-oriented programming, see the Object-Oriented Programming documentation for a description of object-oriented programming in MATLAB.

Simulink Design Optimization command-line interface requires a Simulink model as a starting point for analysis and estimation.

After you configure your model for parameter estimation, as described in Configuring a Model for Importing Data, the estimation process at the command line consists of the following steps:

  1. Defining experiments consisting of empirical data sets, and the operating conditions and/or initial conditions of your model.

  2. Selecting the variables and states to be estimated.

  3. Performing the estimation.

  4. Reviewing the results and iterating as necessary.

  5. Validating estimation results.

The following sections discuss these topics:

Objects for Parameter Estimation

The following sections describe in more detail how to create and modify transient data and estimation objects:

First, a quick look at terminology:

Creating Transient Data Objects

What is a Transient Data Object.   The @TransientData object encapsulates the data measured at a single input or output of a physical system during an experiment. Transient data objects are associated with three types of Simulink blocks:

Each @TransientData object describes the time history of a signal at a Simulink port. A data set is identified by the Block property of this object corresponding to a block name in the Simulink model. A PortNumber value is also necessary for internal blocks to uniquely identify signals within the block diagram.

Constructor.   Estimating parameters requires a transient data object, which you create using a constructor. The syntax to create a transient data object is

% I/O port block
h = ParameterEstimator.TransientData('block');
% Internal block
h = ParameterEstimator.TransientData('block',portnumber); 

h = ParameterEstimator.TransientData('block',data,time);
h = ParameterEstimator.TransientData('block',data,Ts);
h = ParameterEstimator.TransientData('block',portnumber,data,time);
h = ParameterEstimator.TransientData('block',portnumber,data,Ts);

Properties of Transient Data Objects.   Descriptions of properties of the transient data object and the associated input parameters are as follows.

Transient Data Object Properties

Property

Description

Block

Name of the Simulink block with which the data is associated. Must be a string.

PortType

The type of signal that this object represents is determined in the constructor from the Block property, which may be Inport, Outport, or Signal.

PortNumber

For data associated with the outputs of regular blocks or subsystems, this property specifies the output port number of interest. The default value is 1.

Dimensions

Dimensions of the data required for this data set. It is computed from the CompiledPortDimensions property of the appropriate port of the block, and it defines the size of other properties. Currently, Simulink supports scalar, vector, or matrix signals, so Dimensions is either a scalar or a 1-by-2 array.

Data

Actual experimental data. Its size must be consistent with the Dimensions property. To conform with Simulink conventions, the data is stored in the following formats:

  • Scalar or vector-valued data. The data is of the form Ns m, where Ns is the number of data samples, and m is the number of channels in the signal.

  • Multidimensional data (matrix and higher dimensions). The data is of the form m1 . . . mn Ns, where Ns is the number of data samples, and mi is the number of channels in the ith dimension of the signal.

  • For missing or unspecified data, NaNs are used.

Ts,
Tstart,
Tstop

For uniformly sampled data, Ts is the sample time and Tstart is the start time of the signal. The stop time Tstop and the time vector Time are given by

Tstop = Tstart + Ts * (Ns -1)

Time = Tstart : Ts : Tstop

For nonuniform time data, Ts is set to NaN, and the start and stop times are calculated from the time vector.

Time

The time data in column vector format. The length of Time must be consistent with the number of samples in Data.

For a nonuniformly spaced Time vector, its length should match the length of Data.

Otherwise, Time is automatically adjusted based on the length of Data.

Modifying Ts resets Time internally. In this case, Time is a virtual property whose value is computed from Ts and Tstart when you request it. The rules for setting time related properties are

  • Modifying Time sets

    Ts = NaN 
    Tstart = Time(1)
    
  • If the time vector is uniformly spaced, a sample time Ts is calculated.

  • Modifying Tstart translates time forward or backward.

  • Modifying Ts sets Time = [] internally and generates it when required by the simulation.

Weight

The weight associated with each channel of this data set. It is used to specify the relative importance of signals. The default value is 1.

InterSample

Interpolation method between samples can be zero-order hold (zoh) or first-order hold (foh). This property is used for data preprocessing.

Modifying Properties of Transient Data Objects.   After a transient data object is created, you can modify its properties using this syntax:

in1.Data = rand(2,1,10); % 10 data values each of size [2 1]
in1.Time = 1:10; % Automatically converted to column vector

Some properties (e.g., Weight) support scalar expansion with respect to the value of the Dimensions property.

Example: Assigning Input Port Data.  

To assign data to an input port with 2-by-3 port dimensions, use

in1 = ParameterEstimator.TransientData(gcb, rand(2,3,100), 0.05)

This command returns the following result:

(1) Transient data for Inport block 'portdata_test_noSim/By//Pass 
Air Valve Voltage':
Sampling interval: 0.05 sec.
Data set has 100 samples and 6 channels.

Using Class Methods.   Descriptions of two important methods are given next:

Creating State Data Objects

What is a State Data Object.   The ParameterEstimator.StateData object defines the known states of a dynamic Simulink block. It is used in a transient estimation context to define known initial conditions of a block diagram model, and in a steady-state estimation context to define the known states of the model.

For example, the Simulink model of a simple mass-spring-damper system has two integrator blocks to generate velocity and position signals from acceleration and velocity values, respectively, during simulation. If the corresponding physical system is known to be at rest at the beginning of an experiment, the initial states (velocity and position) of these integrators are zero. So, two @StateData objects can be created to describe these known initial conditions.

Constructor.   The syntax for creating this object is

h = ParameterEstimator.StateData('block');
h = ParameterEstimator.StateData('block', data);

In the first constructor, the state vector is initialized from the model containing the block.

Properties of the State Data Object.   Descriptions of some important properties are given in the following table .

State Data Object Properties

Property

Description

Block

Name of the Simulink block whose states are defined by this object.

Dimensions

Scalar value to store the number of states of the relevant block.

Data

Column vector to store the initial value of the state for the block specified by this object. The length of this vector should be consistent with the Dimensions property. Since the underlying Simulink model also stores an initial state vector for all dynamic blocks, the following conventions are used to resolve the initial state values during estimations:

  • If Data is not empty, use it when forming the state vector.

  • If Data is empty, get the state vector for this block from the model. This behavior is useful when using helper methods to create an experiment object that instantiates empty state data objects for all dynamic blocks in the Simulink model.

  • If there is no state data object for a dynamic block in the model, get the state vector of that block from the model. This behavior is useful for command-line users, when there are too many states in the model and only a few of them have to be set to different initial values.

Ts

Sampling time of discrete blocks. Set to 0 for continuous blocks. This property is read only and is currently used for information only.

Domain

String to hold the physical domain of the block. Used for SimMechanics or SimPowerSystems blocks with states.

Example: Initial Condition Data.   To create an empty initial condition object for the engine_idle_speed/ TransferFcn2, use

st1 = ParameterEstimator.StateData ... 
('engine_idle_speed/Transfer Fcn2', [1 2])

(1) State data for 'f14/Dryden Wind Gust Models/W-gust model' 
block:
The block has 2 continuous state(s).
State value : [1;2]

Modifying Properties.   After a state data object is created, you can modify its properties using this syntax:

st1.Data = [2 3]; % State vector of size 2

Some properties (e.g., Data) support scalar expansion with respect to the value of the Dimensions property.

Using Class Methods.   Description of two important methods are given next:

Creating Transient Experiment Objects

What is a Transient Experiment Object.   The @TransientExperiment object encapsulates the data measured at the input and output ports of a system during a single experiment, as well as the system's known initial states.

Constructor.   The syntax to create a transient experiment object is

h = ParameterEstimator.TransientExperiment('model');

where model specifies the name of the Simulink model.

Properties of Transient Experiment Objects.   Descriptions of some important properties are given in the following table.

Transient Experiment Object Properties

Property

Description

Model

Simulink model with which this experiment is associated.

InputData, OutputData

Transient data objects associated with appropriate I/O blocks in the model. Blocks with unassigned objects or objects with no data are not used in estimations, meaning:

  • For input ports, assign zeros to these ports/channels during simulation.

  • For output ports, don't use these ports/channels in the cost function.

InitialStates

State data objects associated with appropriate dynamic blocks in the model.

InitFcn

Function to be executed to configure the model for this particular experiment.

Example: Creating an F14 Experiment.   To create an empty transient experiment for the f14 model, use

exp1 = ParameterEstimator.TransientExperiment('f14')
Experimental (Transient) data set for the model 'f14':
Outputs
(1) f14/alpha (rad)
(2) f14/Nz Pilot (g)
Inputs
(1) f14/u
Initial States
(1) f14/Actuator Model
(2) f14/Aircraft Dynamics Model/Transfer Fcn.1
(3) f14/Aircraft Dynamics Model/Transfer Fcn.2
(4) f14/Controller/Alpha-sensor Low-pass Filter
(5) f14/Controller/Pitch Rate Lead Filter
(6) f14/Controller/Proportional plus integral compensator
(7) f14/Controller/Stick Prefilter
(8) f14/Dryden Wind Gust Models/Q-gust model
(9) f14/Dryden Wind Gust Models/W-gust model

Example: Creating a Van der Pol Experiment from User Objects.   To create a transient experiment from user objects for I/Os and states, use

out1 = ParameterEstimator.TransientData('vdp/Out1');
ic1 = ParameterEstimator.StateData('vdp/x1');
exp1 = ParameterEstimator.TransientExperiment... 
(gcs, [], out1, ic1);
Experimental (Transient) data set for the model 'vdp':
Outputs
(1) vdp/Out1
Inputs
(none)
Initial States
(1) vdp/x1

Modifying Properties.   The objects referred in InputData, OutputData, and InitialStates properties can be modified or removed as necessary.

Using Class Methods.   The description of one important method is given next:

update — Updates the object after the Simulink model has been modified. The object listed in the InputData, OutputData, and InitialStates properties are updated in turn.

Creating Parameter Objects

What is a Parameter Object.   The @Parameter object refers to the parameters of the Simulink model marked for estimation. Some of the Simulink model parameters are to be estimated and storage is required for the initial values, current values, ranges, etc. One @Parameter object corresponds to each parameter in the Simulink model to be potentially estimated. These objects represent estimation parameters of any type such as scalars, vectors, and multidimensional arrays.

Constructor.   The syntax to create a parameter object is

h = ParameterEstimator.Parameter('Name');
h = ParameterEstimator.Parameter('Name', Value);
h = ParameterEstimator.Parameter('Name', Value, Minimum, 
    Maximum);

In the first case, Name is a workspace variable. In the other cases, Name does not need to exist in the workspace at the time of object creation. However, it is required at estimation time.

Properties of Parameter Objects.   Descriptions of some important properties are given in the following table.

Parameter Object Properties

Property

Description

Name

Parameter name. The parameter can be a multidimensional array of any size.

Dimensions

Dimensions of the value of the parameter. This is the defining property for the size of other properties.

Value

The current or estimated value of the parameter. This is the defining property for size checking and scalar expansions.

Estimated

A Boolean array of the same size as that of Value. Depending on the value of the elements of the Estimated property, the behavior of the corresponding elements of Value is as follows:

  • The elements of Value is estimated if the corresponding elements in Estimate are set to true. The result is stored in the Value property.

  • The elements of Value are not estimated if the corresponding elements in Estimated are set to false. However, these elements are used to reset the corresponding workspace parameter during estimations.

    This property is set to false by default, meaning that the parameter value is not estimated.

InitialGuess

Separate properties are required to hold the initial and current values of the parameters. So, when the InitialGuess property is initialized with a value, both it and the Value property are assigned the same value.

Depending on the value of the elements of the Estimated property, the behavior of the corresponding elements of InitialGuess is as follows:

  • If any element in Estimated is set to true, then the corresponding element of InitialGuess is used to initialize the workspace parameter during estimations.

  • If any element in Estimated is set to false, then the corresponding element of InitialGuess is not used in any way.

Minimum, Maximum

Parameter range.

TypicalValue

The typical values of the parameters. This property is used in estimations for scaling purposes. The default value is 1.

Example: F14 Model.   To create a parameter object for the parameter Ta in the f14 model, use

par1 = ParameterEstimator.Parameter('Ta')
(1) Parameter data for 'Ta':
Parameter value : 0.05
Initial value : 0.05
Estimated : false
Referenced by the blocks:
f14/Actuator Model

Example: Gain Matrix.   To create a parameter object for a matrix parameter K of size 4-by-1, use

par1 = ParameterEstimator.Parameter('K', [1 2 3 4]')
(1) Parameter data for 'K':
Parameter value : [1;2;3;4]
Initial value : [1;2;3;4]
Estimated elements : [false;false;false;false]
Referenced by the blocks:

Modifying Properties.   After a parameter object is created, you can modify its properties using this syntax:

par1.Estimated = true; % Estimate this parameter

Most of the properties, for example, Estimated and TypicalValue support scalar expansion with respect to the size of Value.

Using Class Methods.   Descriptions of two important methods are given next:

Creating State Objects

What is a State Object.   The @State object is similar to the @Parameter object, and refers to the states of the Simulink model marked for estimation. One @State object corresponds to each Simulink block with states in the model.

Constructor.   The syntax to create a state object is

h = ParameterEstimator.State('block');
h = ParameterEstimator.State('block', Value);
h = ParameterEstimator.State('block', Value, Minimum, 
    Maximum);

In the first case, the state vector is initialized from the model containing the block. In the other cases, block does not need to exist in the workspace at the time of object creation. However, it is required at estimation time.

Properties of State Objects.   Descriptions of some important properties of state objects are given in the following table.

State Object Properties

Property

Description

Block

Name of the Simulink block whose states are defined by this object.

Dimensions

Scalar value to store the number of states of the relevant block.

Value

Column vector to store the value of the state for the block specified by this object. The length of this vector should be consistent with the Dimensions property.

Estimated

A Boolean array of the same size as that of Value. Depending on the value of the elements of the Estimated property, the behavior of the corresponding elements of Value is as follows:

  • The elements of Value are estimated if the corresponding elements in Estimate are set to true. The result is stored in the Value property.

  • The elements of Value are not estimated if the corresponding elements in Estimated are set to false. However, these elements are used to reset the corresponding states during estimations.

    This property is set to false by default, meaning that the state value is not estimated.

InitialGuess

Separate properties are required to hold the initial and current values of the states. So, when the InitialGuess property is initialized with a value, both it and the Value property are assigned the same value.

Depending on the value of the elements of the Estimated property, the behavior of the corresponding elements of InitialGuess is as follows:

  • If any element in Estimated is set to true, then the corresponding element of InitialGuess is used to initialize the state during estimations.

  • If any element in Estimated is set to false, then the corresponding element of InitialGuess is not used in any way.

Minimum, Maximum

State vector range.

TypicalValue

The typical values of the states. This property is used in estimations for scaling purposes. The default value is 1.

Ts

Sampling time of discrete blocks. Set to zero for continuous blocks. This property is read-only and is currently used for information only.

Domain

String to hold the physical domain of the block. Used for SimMechanics™ or SimPowerSystems™ blocks with states.

Example: F14 Model.   To create a state object for the f14/Actuator Model block in the f14 model, use

st1 = ParameterEstimator.State(gcb)

This command returns the following result:

(1) State data for f14/Actuator Model block:

    The block has 1 continuous state(s).

           State value : 0
         Initial guess : 0
             Estimated : false

Modifying Properties.   After a state object is created, you can modify its properties using this syntax:

ic1.Estimated = true; % Estimate this state

Most of the properties, for example, Estimated and TypicalValue, support scalar expansion with respect to the size of Value.

Using Class Methods.   Description of two important methods are given next:

Creating Estimation Objects

What is an Estimation Object.   The @Estimation object defines the estimation problem, and is the coordinator between the model, experiments, parameter objects, and state objects.

Constructor.   The @Estimation object is the coordinator of the model, experiment, and parameter objects. The syntax to create an estimation object is

h = ParameterEstimator.Estimation('model');
h = ParameterEstimator.Estimation('model', hParam);
h = ParameterEstimator.Estimation('model', hParam, hExps);

Properties of Estimation Objects.   Descriptions of some important properties of estimation objects are given in the following table.

Estimation Object Properties

Property

Description

Model

Name of the Simulink model with which this estimation is associated.

Experiments

Experiments to be used in estimations. For multiple experiments, the cost function uses a concatenation of the output error vectors obtained using each experimental data set.

Parameters

Parameter objects to be used in estimations.

States

State objects to be used in estimations. This is a handle matrix with as many columns as there are experiments, and as many rows as there are states in Model.
The handle matrix is created automatically in the constructor. You can reorganize its rows to specify shared states between experiments, and set the Estimated flag of desired states.
If state data is provided in an experiment, the state objects stored in the columns of this matrix are initialized from the experiments.

SimOptions

Same as simset structure. This property is initialized to simget(this.Model).

OptimOptions

Same as optimset structure.

EstimInfo

This property is used to store estimation-related information at each iteration of the optimizer, and is initialized as


this.EstimInfo = struct( 'Cost', [],...
                         'Covariance', [],...
                         'FCount', [],...
                         'FirstOrd', [],...
                         'Gradient', [],...
                         'Iteration', [],...
                         'Procedure', [],...
                         'StepSize', [],...
                         'Values', [] );

Example: F14 Model.   To create an estimation object for the f14 model to estimate the parameters Ta and Kf and two states, use

exp1 = ParameterEstimator.TransientExperiment(gcs);
par1 = ParameterEstimator.Parameter('Ta', 'Estimated', true);
par2 = ParameterEstimator.Parameter('Kf', 'Estimated', true);
est1 = ParameterEstimator.Estimation(gcs, [par1, par2], exp1);
est1.States(1,1).Estimated = true;
est1.States(6,1).Estimated = true;
est1

This command returns the following result:

Estimated variables for the model 'f14':

Estimated Parameters

Using Experiments
   (1) f14 experiment

Estimated States for Experiment 'f14 experiment' 
   (1) f14/Actuator Model
   (6) f14/Controller/Proportional plus integral compensator

Modifying Properties.   After an estimation object is created, you can modify its properties using this syntax:

est.OptimOptions.Method = 'fmincon'; % Estimation method
est.OptimOptions.Display = 'iter'; % Show estimation information 
...in workspace
est.Parameters(1).Estimated = false; % Do not estimate first 
...parameter
est.States(2,3).Estimated = false; % Do not estimate second state 
...of third expression

Using Class Methods.   Descriptions of some of the important methods are given next:

Example — Estimating Parameters and Initial States at the Command Line

Loading the F14 Jet Model

To define an experiment, you must start with a Simulink model. For this example, type

f14

to load the F14 fighter jet model into the MATLAB workspace. The following figure shows the f14 model.

F14 Fighter Jet Model

This example outlines the basics of constructing an estimation project using object-oriented code. Only what you need to run the example is presented in this section. See Objects for Parameter Estimation for details on all the properties and methods associated with parameter estimation.

Baseline Simulation

Before running an estimation, you need a baseline for data comparison. First, you must choose parameters and states' initial conditions for estimation. This example uses Ta, the actuator time constant, and Zd and Md, the vertical velocity and pitch rate gains, respectively. Then use the following code to run the Simulink f14 model. Note that this is standard Simulink code and does not involve Simulink Design Optimization command-line interface in any way. See sim in the Simulink Reference documentation for information about running Simulink models from the MATLAB command line.

%% Open the model and load experimental data.
open_system('f14')
load f14_estim % Load empirical I/O data.

%% Set initialize unknown parameters 
% Actuator time constant (ideal: Ta = 0.05)
Ta = 0.5;

% Aircraft dynamic model parameters (ideal: Md = -6.8847,
% Zd = -63.998)
Md = -1; Zd = -80;

%% Plot measured data and simulation results
[T,X,Y] = sim('f14', time, [], [time iodata(:,1)]);
plot(time, iodata(:,2:3), T, Y, '-');
legend( 'Measured angle of attack',  'Measured pilot g force', ...
        'Simulated angle of attack', 'Simulated pilot g force');

The following figure appears.

As you can see, the measured and simulated data are a poor match. The rest of this section describes how to estimate values for Ta, Zd, and Md that result in a better match of data sets.

Creating a Transient Experiment Object

After you have a model and identify the parameters you want to estimate, the next step is to create the objects required for an estimation. ParameterEstimator is both the name of the class and the object instantiated by that class. Classes are created by a constructor; objects are created by invoking the class name with parameters.

First, create an estimation project object. This is the constructor syntax:

hExp = ParameterEstimator.TransientExperiment('f14')

This command returns the following information about the f14 model.

Experimental transient data set for the model 'f14':

Output Data
   (1) f14/alpha (rad)
   (2) f14/Nz Pilot (g)

Input Data
   (1) f14/u

Initial States
   (1) f14/Actuator Model
   (2) f14/Aircraft Dynamics Model/Transfer Fcn.1
   (3) f14/Aircraft Dynamics Model/Transfer Fcn.2
   (4) f14/Controller/Alpha-sensor Low-pass Filter
   (5) f14/Controller/Pitch Rate Lead Filter
   (6) f14/Controller/Proportional plus integral compensator
   (7) f14/Controller/Stick Prefilter
   (8) f14/Dryden Wind Gust Models/Q-gust model
   (9) f14/Dryden Wind Gust Models/W-gust model

Assigning Experimental Data to Inputs and Outputs of the Model

After you create a ParameterEstimator object, assign input and output experimental (i.e., empirical) data.

%% Create objects to represent the experimental data sets.
set(hExp.InputData(1), 'Data', iodata(:,1), 'Time', time);

set(hExp.OutputData(1), 'Data', iodata(:,2), 'Time', ...
    time, 'Weight', 5);
set(hExp.OutputData(2), 'Data', iodata(:,3), 'Time', time);

Creating Parameter Objects for Estimation

To activate parameters for estimation, you must create parameter objects for the parameters you want to estimate. For this example, use Ta, the actuator time constant, and Zd and Md, the vertical velocity and pitch rate gains, respectively. The Zd and Md gains are located in the F14 aircraft dynamics subsystem.

First, create ParameterEstimator objects for the parameters you want to estimate.

%% Create objects to represent parameters.
hPar(1) = ParameterEstimator.Parameter('Ta');
set(hPar(1), 'Minimum', 0.01, 'Maximum', 1, 'Estimated', true)

hPar(2) = ParameterEstimator.Parameter('Md');
set(hPar(2), 'Minimum', -10, 'Maximum', 0, 'Estimated', true)

hPar(3) = ParameterEstimator.Parameter('Zd');
set(hPar(3), 'Minimum', -100, 'Maximum', 0, 'Estimated', true)

%% Create objects to represent initial states.
hIc(1) = ParameterEstimator.State('f14/Actuator Model');
set(hIc(1), 'Minimum', 0, 'Estimated', false);

You can also use dot notation here. For example, instead of

set(hPar(2), 'Minimum', -10, 'Maximum', 0, 'Estimated', true)

you can write

hPar(2).Estimated=true;
hPar(2).Minimum=-10;
hPar(2).Maximum=0;

Creating an Estimation Object and Running the Estimation

Finally, create an estimation object and run the estimation, using gcs to get the full pathname to the Simulink model.

hEst = ParameterEstimator.Estimation(gcs, hPar, hExp);
hEst.States = hIc;

%% Setup estimation options
hEst.OptimOptions.Method    = 'lsqnonlin';
hEst.OptimOptions.GradientType = 'refined';
hEst.OptimOptions.Display      = 'iter';

%% Run the estimation
estimate(hEst);

%% Plot measured data and final simulation results
[T,X,Y] = sim('f14', time, [], [time iodata(:,1)]);
figure
plot(time, iodata(:,2:3), T, Y, '-');
legend( 'Measured angle of attack',  'Measured pilot g force', ...
        'Simulated angle of attack', 'Simulated pilot g force');

This figure shows the results of the estimation.

The measured and simulated outputs now appear to be a close match. Next, look at the estimated values to see how they compare with the default values of the f14 model.

%% Look at the estimated values
find(hEst.Parameters, 'Estimated', true)

This command returns the following result:

(1) Parameter data for 'Ta':

       Parameter value : 0.05
         Initial guess : 0.5

             Estimated : true

          Referenced by:

(2) Parameter data for 'Md':

       Parameter value : -6.884
         Initial guess : -1

             Estimated : true

          Referenced by:

(3) Parameter data for 'Zd':

       Parameter value : -63.99
         Initial guess : -80

             Estimated : true

          Referenced by:

You can verify that these values match the default values of the f14 model by clearing your workspace, loading the model, and checking the values.

clear all
f14
whos

How to Use Parallel Computing at the Command Line

After you configure your system for parallel computing, as described in Configuring Your System for Parallel Computing, you can estimate the model parameters using the command-line functions. To learn more about parameter estimation using parallel computing, see When to Use Parallel Computing for Estimating Model Parameters, and How Parallel Computing Speeds Up Parameter Estimation.

To use parallel computing for parameter estimation at the command line:

  1. Open the Simulink model by typing the model name at the MATLAB prompt.

  2. Configure an estimation project, as described in Workflow for Estimating Parameters at the Command Line.

  3. Enable the parallel computing option in the estimation project by typing the following command:

    hEst.OptimOptions.UseParallel='always';

    To view that the UseParallel property has been set, type the following command:

    hEst.OptimOptions
  4. Find the model path dependencies by typing the following command:

    dirs=hEst.finddepend;
    

    This command returns the model path dependencies in your Simulink model in the dirs cell array.

      Note   As described in Model Dependencies, the finddepend command may not detect all the path dependencies in your model.

  5. (Optional) Modify dirs to include the model path dependencies that finddepend does not detect by typing the following command.

    dirs=vertcat(dirs;'\\hostname\C$\matlab\work')
    
  6. Assign the path dependencies to the estimation project by typing the following command:

    hEst.OptimOptions.ParallelPathDependencies=dirs;
  7. Run the estimation by typing the following command:

    estimate(hEst);

    For more information on how to troubleshoot estimation results you obtained using parallel computing, see Troubleshooting.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS