# Online model

An online model is a mathematical model which tracks and mirrors a plant or process in real-time, and which is implemented with some form of automatic adaptivity to compensate for model degradation over time.

## Relationship to other kinds of models

An online model is also sometimes referred to as an "online simulator" or "online system".
An online model is related to the concept of real-time simulation, as an online model runs in real-time by definition. Conversely, a real-time simulation is not necessarily an online model as it by definition does not require adaptivity in either states or parameters.
While many models are adjusted to better fit historical data, traditionally this is done in campaigns or during initial design, and often this is done either manually or with a combination of mathematical and manual methods. By contrast, online models include some automatic procedure to adapt to new process data.

## Background and context

Online models are an aspect of process simulation that deals with the use of estimation techniques to ensure that the state and parameter of the process model are as close a match as possible to the real plant.
Reasons that models may need to be taken online include that it is not possible to find offline data for the entire range of operating conditions or that the process is time-varying .
Parameter estimation can also be used as a technique to capture the influence of effects that are not explicitly modeled, in which case parameters may need to take on values that differ from text-book or table values.

## Uses

An online model as defined here has the useful property that it closely resembles the real plant, and for this reason the online model can at any time be used to assess planned changes in operations, either for control, for optimization and for different operational tasks to be performed. It can then be used amongst other things for real-time monitoring, de-bottlenecking or plant redesign, or for "what-if" analysis.
Analyzing trends of how estimated parameters and states in the updated model have changed over time may itself be useful for detecting errors or events in that have occurred during operation and influenced the plant.

## Techniques

The concepts of online models have origins in control engineering.
Online models have three commonalities:
* feeding the same control and disturbance signals to the model as is fed to the plant,
* synchronizing simulation clock with the real-world clock, and
* adaptivity: adjustment in states and/or parameters at regular intervals by feedback from measurements.
One important aspect of bringing a model online is parameter estimation. By some means the parameters of the online model should match the real plant for the model to be a useful analog. System identification and estimation theory describe techniques to estimate values of unknown parameters.
Using observers such as the Kalman filter or the moving-horizon estimator, it is possible to do state estimation, updating the state of the model to ensure that measured and modeled outputs remain as close as possible over time.
It is possible to combine state and parameter estimation, for instance by using an augmented Kalman filter.
Mathematical process models can be used for engineering in the design phase prior to building whole or part of a process plant, but models cannot be brought online at this stage as no process data exists to feed to the model. However once the plant is built and in use, it is tempting to reuse the model used in the design phase for operation, control and optimization tasks. Re-using models in this manner is often term "life-cycle simulators".
An alternative way to obtain an online model is to build one from scratch for this purpose, the advantage of this approach is that issues such as complexity and simulation speed can be tailored for the needs of online use.

## Applications

Online models are used in
* weather forecasting, where techniques used are often termed data assimilation,
* reservoir simulation, where techniques used are often termed (automatic) history matching,
* model-based control, for instance nonlinear model predictive control, where adaptivity in model states and parameters are often introduced by use of an augmented Kalman Filter, and in
* process simulation, where such models are sometimes referred to as "lifecycle simulators"
* ↑ "SIMONE Research Group s.r.o. - Solutions for Simulation and Optimisation in the Gas Industry".
* ↑ Davis, Wayne J. (1998). "On-Line Simulation: Need and Evolving Research Requirements". Handbook of Simulation. pp. 465–516. doi:10.1002/9780470172445.ch13. ISBN 9780470172445.
* ↑ "Home - OnePetro".
* ↑ Ferreira, P.M.; Ruano, A.E. (2009). "Online Sliding-Window Methods for Process Model Adaptation". IEEE Transactions on Instrumentation and Measurement. 58 (9): 3012–3020. Bibcode:2009ITIM...58.3012F. doi:10.1109/TIM.2009.2016818. S2CID 10208714.
* 1 2 3 http://www.ivt.ntnu.no/ept/fag/tep4215/innhold/LNG%20Conferences/2007/fscommand/PS7_3_Skjerven_s.pdf
* 1 2 "Home - OnePetro".
* ↑ "Cybernetica AS - Model based control systems for the process industry". Archived from the original on 2012-04-25. Retrieved 2011-10-11.