• No results found

Simulink allows the user to perform parameter estimations using the Control and Estimation Graphical User Interface (GUI) or by making use of the MATLAB command line commands. A decision was made to use the command line commands rather than the GUI since this provides a greater understanding of the process and structure of parameter estimation in MATLAB. The MATLAB parameter estimation process makes use of Object-Oriented Programming (OOP) with eight classes that are of importance, namely Transient Data, State Data, Transient Experiment, Parameter, State, Estimation, Simulation Options and Optimisation Options. Figure 5-1 shows a diagram of the most important configuration settings for performing parameter estimation. The remainder of this section uses this topology to provide an overview of the configuration required to perform parameter estimation on a Simulink model. The code used for performing parameter estimation on the model shown in Figure 4-14 is provided in APPENDIX H.

The Model block refers to the Simulink model that needs to be configured for the parameter estimation process. This entails replacing all input and output signals with input and output ports. In the case of the gearbox model for example, the configured Simulink model would resemble the one shown in Figure 5-2. Appropriate names also need to be given to the variables assigned to the parameter field of the model for easy identification. This model is saved as a MATLAB model file, in this case Gearbox_Estimation.mdl, and the filename is then assigned to the model property of the Estimation object.

94

95

Figure 5-2: Configuration of gearbox model for parameter estimation.

With the model configured, the data structure used for the estimation needs to be configured. A Transient Data object is created for each input and output port. This object has properties for the port type, port number, data and time values of the signal as well as a weight factor specifying the relative importance of the signal. Four Transient Data objects are created for the gearbox example, namely two for the input signals and two for the output signals. Furthermore, a State Data object is created for each Simulink block with states. The State Data objects are configured with the initial values of the states for the experiment. The Transient Data objects together with the State Data objects are assigned to the input-output data and initial states properties of the Transient Experiment object respectively. The Transient Experiment object is then assigned to the experiment data property of the Estimation object.

Further creation and configuration of the Parameter objects are required. A Parameter object is needed for each parameter of the model. The important properties of this object are dimension, value, estimation flag, initial guess, boundaries and typical values. The dimension and initial guess properties are self-explanatory. Considering a one dimensional parameter, the estimation flag property is a boolean variable configured with a true value for a parameter to be estimated and a false value for a parameter not to be estimated. The value property initially contains the initial guess value of the parameter but changes as the value is estimated. If the parameter value is known to be in a specific range, the boundary property is configured with a minimum and maximum value. The final property of the Parameter object to discuss is the typical value property. This value is used for scaling purposes in the estimation process. The typical value of the parameter can be assigned if it is known; otherwise, the initial value of the parameter is automatically assigned to this property. In the case where a parameter is a vector/matrix parameter (e.g., the power coefficient matrix of the turbine blade model) the value, estimation flag, initial guess, boundaries and typical values properties are vectors/matrices. These vectors/matrices have the same dimensions as the parameter with each element of the property corresponding to an element of the parameter

96

vector/matrix. All the Parameter objects of a model are grouped together and assigned to the parameter property of the Estimation object.

The State object has the same properties as the Parameter object and is configured in the same manner as the Parameter object. All the State objects of a model are grouped together and assigned to the states property of the Estimation object.

The numerical solver used by Simulink and the optimisation algorithm used for the estimation routine also require configuration. The configuration of the numerical solver is done by creating and configuring a Simulation Options object. The most important property of the Simulation Options object is the solver property. As discussed in Chapter 4, the ode23s solver was found to produce sufficient results and is, therefore, assigned to the solver property for all estimations. The Simulation object also has properties for minimum and maximum step sizes as well as for stop and start times. If no values are assigned to these properties, it defaults. In such a case, the solver has full control over the step sizes and the stop and start times are retrieved from the Transient Experiment object. This Simulation Options object is assigned to the simulation options property of the Estimation object.

An Optimisation Options object needs to be created and configured to be assigned to the optimisation options property of the Estimation object. The Optimisation Options object has the following important properties:

Method: This refers to the method used for the optimisation process. Table F-2 provided in APPENDIX E helps the user to decide which method to use. For this study, the sum of least-square objective function was chosen for reasons discussed in Chapter 2. It is also known that the objective function is non-linear in its parameters and that the parameters have either no constraints or only boundary constraints. Therefore, the non-linear least-square method (lsqnonlin) is assigned to the method property.

Algorithm: This property pertains to the algorithm used for the optimisation process. The options available depend on the configuration of the Method property. With the method property set to lsqnonlin, the options available are the Trust-region-reflective or Levenberg-Marquardt algorithm. The user's guide [63] recommends using the Trust-region-reflective algorithm for problems that are not underdetermined, that is, problems with fewer equations than dimensions. Since the problems in this study are not underdetermined, the algorithm property is set to trust-region-reflective.

97

DiffMin and DiffMax: DiffMin and DiffMax are the minimum and maximum differences properties respectively. These properties define the minimum and maximum step size for finite differences in gradient estimation.

TolX: The Parameter tolerance property, or TolX, is a lower bound for the norm of the step size. The optimisation is terminated if the algorithm tries to take a step smaller than this bound.

TolFun: TolFun refers to the function tolerance property. This property defines the lower bound on the change in the value of the objective function from one step to the next. The optimisation is terminated if the change is smaller than this bound.

MaxIter: MaxIter is the maximum iterations property. This property defines an upper bound on the number of optimisation iterations. The optimisation is terminated if this boundary is reached.

MaxFunEvals: MaxFunEvals is the maximum number of function evaluations property. This property defines an upper bound on the number of times the function can be evaluated. The optimisation is terminated if the boundary is reached.

Display: The display property can be set to display different information about the estimation process.

To conclude the discussion on the Estimation object, one more property and method of the object should be mentioned. The parameter estimation process is initiated by invoking the estimate method, e.g., ParamEstimObject.estimate would initiate the parameter estimation process on the ParamEstimObject Estimation object. After completion of the estimation process, the EstimInfo property of the Estimation object holds all the information about the estimation, i.e., the number of iterations, number of function evaluations, values of parameters at each iteration step, the value of the cost function at each iteration and step size of each iteration.

5.3 Parameter estimation cases for individual models