Code covered by the BSD License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

### Highlights from Greyboxbuild: complete a greybox model

Be the first to rate this file! 13 Downloads (last 30 days) File Size: 22.4 KB File ID: #40584 Version: 1.0

# Greyboxbuild: complete a greybox model

### Bill Whiten (view profile)

Completes a model by relating model parameters to operating conditions using experimental data

File Information
Description

A greybox model is one that has some theoretical structure but needs extra information to be used in a simulation. Greyboxbuild attempts to complete the model by relating model parameters to experimental data obtained at different operating conditions. Greyboxbuild is closely related to greyboxeval which uses similar techniques to determine if a model can be improved but does not attempt to produce a realistic simulation model.

If the model is of the form:
output=model(input,parameters) with input and output values recorded at different operating conditions, greyboxbuild finds the matrix A that relates the parameters to the operating conditions:   parameters = A*conditions by minimising the difference between the data and the model predictions. thus completing the model. Non linear relations can be included by using transforms of the original operating conditions. The model is inverted (see references) so that linear regression term selection techniques can be used to select relevant terms in the A matrix. By default the program linfitregsel is used to select the relevant terms in A, and evaluate the non zero coefficients in A.

The information from the model is given by the function:
[res,der]=resfn(data,i,par) which for the ith data set uses the given parameter values (par) to determine the residues (scaled difference between measured data and model predictions), and optionally derivatives of of the residues with respect to the parameters. The data for all the data sets is provided in any convenient form, such as a matrix, cell array, or struct.
A second function:
[Cond,ps]=condfn(data,i) gives the condition values for the ith data set. An optional second output (ps) gives initial/scale values for the parameters. Note that this second output must be supplied if no initial value for the A matrix is given to greyboxbuild.

The function:
[A,info]=greyboxbuild(condfn,resfn,data,vndata,optn) uses the information from the two functions (condfn, resfn) to calculate an A matrix that relates the experimental conditions to the model parameters. In addition to the two functions for accessing the data, this function required the data in the form used by condfn and resfn, and an array (vndata) giving the vector of data set number to be used. The optional argument allows initial values of A (optn.Amat) the be provided and optn.Acode to control which values of A are calculated and selected from. The function greyboxeval can be used to obtain an initial value for A, and to evaluate the model quality.

The quality of the model found depends on the model form, and choice of model parameters and operating conditions, as well as the extent of the data used. The operating conditions should cover the range of interest for the model and not have eigenvalues (diagonal of d, from [u,d,v]=svd(C,0) ) that differ by a large factor in magnitude. The use of part of the data for testing the resulting model is recomended, and evaluation using simulated data is strongly recommended before data collection.

Whiten, W.J., Determination of parameter relations within non-linear models, SIGNUM Newsletter, 29(3-4,) 2-5, 1994.

Xiao, J., Extensions of model building techniques and their applications in mineral processing, PhD thesis, The University of Queensland, 1998.

Acknowledgements
Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Other requirements Should also be ok for earlier Matlab version
Tags for This File   Please login to tag files.
Comments and Ratings (1)
13 Jun 2013 Bill Whiten