Greybox Modelling Resources and Understanding Examples

4 views (last 30 days)
I am trying to learn how to use the Greybox Modelling techniques in greater understanding than simply running the Matlab apps...perhaps looking for a reference from Mathworks as to whats going on with this function?
Its probably best to frame this in the context of one of the Matlab examples:
This example estimates the gain and time constant to a DC electric motor (lumping the electrical time constant and torque constant into a gain G). It executes a .m file, which is the state space model of the electrical system shown in that example. What is the script doing to get the parameters so close to the actual values??
Now, I've deduced that the .m file is executed many times over the course of running the example script. But I can't figure out what the script is really doing to generate a close estimate to the true value parameter. I suspect some kind of optimization routine is running in the background which is why the .m file keeps getting executed over and over again. In fact, the following option for greyest() will give the window shown below, and theres a cost function being minimized (I think)
opt = greyestOptions('Display','on');
sys = greyest(data,init_sys, opt);
I could use some help if anyone is familiar with this toolbox/matlab feature. A reference as to whats happening or explaination would go a long way to helping me. Do i take derivatives of the matrix in the .m file to do some optimizations?

Answers (1)

Mario Malic
Mario Malic on 12 Oct 2023
Hey!
There aren't many people dealing with this toolbox here. I will try to shed some light to it as I dealt with this for a little while, not enough to understand it properly, so take this with a grain of salt.
You model your system in terms of the state variables, matrices A, B, C, D, (E), which is what you are actually looking for. You would like to know the values of these parameters in the matrices because they relate to the physical properties of whatever you are trying to model, but you can't estimate them exactly or can't calculate them by hand.
You have the experimental data you measured and you would like to find out what parameters in these matrices would make your model to have similar output as the experiment. This leads you to an optimization problem.
You can think of the matrix values as optimization variables and objective function you are trying optimize is to minimize the error between model and experiment.
Optimization methods consist of providing an initial guess for the optimization function which are the values you set up already (you can also supply different initial guess), then the objective function is evaluated many many times (depending how far your initial guess is and by the shape of the optimization function) as the algorithm is trying to look for and minimize the error. You can affect the search in two ways: by limiting your parameters in the matrices to some range of values, or by playing with optimization algorithm options (not recommended, except trying out different algorithms).
If you are working on a problem at hand, I would suggest is to try era function, because there are so many different types of system identification and choosing the appropriate one is hard if you have no background in this area. It is super fast to set up and works really great in estimating anything, and can give you some more information, such as model order which is maybe related to the appropriate number of DOFs your system should have.
Hope this helps.

Categories

Find more on Linear Model Identification in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!