Online estimation algorithms estimate the parameters of a model when new data is available during the operation of the physical system. Consider a heating and cooling system that does not have prior information about the environment in which it operates. Suppose that this system must heat or cool a room to achieve a certain temperature in a given amount of time. To fulfil its objective, the system must obtain knowledge of the temperature and insulation characteristics of the room. You can estimate the insulation characteristics of the room while the system is online (operational). For this estimation, use the system effort as the input and the room temperature as the output. You can feed the estimated model to the system to govern its behavior so that it achieves its objective. Online estimation is ideal for estimating small deviations in the parameter values of a system at a known operating point.
Online estimation is typically performed using a recursive algorithm. To estimate the parameter values at a time step, recursive algorithms use the current measurements and previous parameter estimates. Therefore, recursive algorithms are efficient in terms of memory storage. Also, recursive algorithms have smaller computational demands. This efficiency makes them suited to online and embedded applications.
Common applications of online estimation include:
Adaptive control — Estimate a plant model to modify the controller based on changes in the plant model.
Fault detection — Compare the online plant model with the idealized or reference plant model to detect a fault (anomaly) in the plant.
Soft sensing — Generate a "measurement" based on the estimated plant model, and use this measurement for feedback control or fault detection.
Verification of the experiment-data quality before starting offline estimation — Before using the measured data for offline estimation, perform online estimation for a few iterations. The online estimation provides a quick check of whether the experiment used excitation signals that captured the relevant system dynamics. Such a check is useful because offline estimation can be time intensive.
In System Identification Toolbox™ you can perform online parameter estimation in Simulink® or at the command line.
In Simulink, use the Recursive Least Squares Estimator and Recursive Polynomial Model Estimator blocks to perform online parameter estimation. You can also estimate a state-space model online from these models by using the Recursive Polynomial Model Estimator and Model Type Converter blocks together. You can generate C/C++ code and Structured Text for these blocks using Simulink Coder™ and Simulink PLC Coder™.
At the command line, use
to estimate model parameters for your model structure. Unlike estimation
in Simulink, you can change the properties of the recursive estimation
algorithm during online estimation. You can generate code and standalone
applications using MATLAB® Coder and MATLAB Compiler™.
After validating the online estimation, you can use the generated code to deploy online estimation to an embedded target.
When you perform online parameter estimation in Simulink or at the command line, the following requirements apply:
Model must be discrete-time linear or nearly linear with parameters that vary slowly with time.
Structure of the estimated model must be fixed during estimation.
is not supported during online estimation. Specify estimation output
data as a real scalar, and input data as a real scalar or vector.
 Ljung, L. System Identification: Theory for the User. Upper Saddle River, NJ: Prentice-Hall PTR, 1999, pp. 428–440.