Code covered by the BSD License  

Highlights from
Greyboxbuild: complete a greybox model

Be the first to rate this file! 15 Downloads (last 30 days) File Size: 22.4 KB File ID: #40584
image thumbnail

Greyboxbuild: complete a greybox model

by

 

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

| Watch this File

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.

greyboxeval http://www.mathworks.com/matlabcentral/fileexchange/40250

linfitregsel http://www.mathworks.com/matlabcentral/fileexchange/40566

optndfts http://www.mathworks.com/matlabcentral/fileexchange/38881

startup_finish http://www.mathworks.com/matlabcentral/fileexchange/39425

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

Optional Function Arguments, Restore Project Status For Selected Project, Greyboxeval Model Quality Evaluation, and Linfitregsel Term Selection In Linear Regression inspired this file.

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.
Please login to add a comment or rating.
Comments and Ratings (1)
13 Jun 2013 Bill Whiten

Additional publication:
Model completion and validation using inversion of grey box models by Bill Whiten.
ANZIAM J. 54 (CTAC2012) pp.C187-C199, 2013
http://journal.austms.org.au/ojs/index.php/ANZIAMJ/article/view/6125/1682

Contact us