You usually use a linear, time-invariant (LTI) model, for example, an ARX, a transfer function, or a state-space model, to represent a system. However, many real-world applications have certain degree of nonlinearity such that a predefined linear model representation is unable to capture their principal characteristics. Non-linear models are developed to handle these cases.
The LabVIEW System Identification Toolkit provides parametric and non-parametric model estimation methods to identify LTI models. With the System Identification Toolkit, you also can estimate a user-defined model, which can be either linear or non-linear. This application note guides you through using the System Identification Toolkit to identify and validate a non-linear model.
2. Non-Linear Model
Non-linear models can be used to represent the relationship between dependent parameters and independent parameters. Different from linear models which obey the principles of superposition and homogeneity, nonlinear models include a variety of non-linear effects, such as saturation and dead-zone. Due to the nature of its complexity and less attention paid historically, non-linear system identification is far from a mature state.
The System Identification Toolkit allows users to decide which non-linear model they want to identify. Users can define the relationship between dependent parameters and independent parameters by themselves. This method is known as user-defined model estimation.
This application note uses the Estimate Hammerstein Model VI as an example to demonstrate the procedure from defining to estimating and validating a user-defined model. You can find this example VI in the LabVIEW\examples\System Identification\Getting Started\User Defined Model.llb directory. This Hammerstein model consists of a static non-linear function followed by a linear dynamic function. This model is widely used to approximate many real-world processes. The following diagram represents this Hammerstein model:
In the diagram, u(t) is the input signal, y(t) is the output signal, and v(t) is the disturbance. f(u) is the static nonlinear function, and G(q) is the linear dynamic function. The following equations define f(u) and G(q).
The complete Hammerstein model is represented by the following equation:
3. Non-Linear Model Estimation
You can use the SI Estimate User-Defined Model VI to estimate a user-defined model, either linear or non-linear. Similar to other model estimation VIs for LTI models, with the SI Estimate User-Defined Model VI, you need to provide the stimulus and response signals of the system. In addition, you must provide another VI that defines a user-defined model.
4. Define a Non-Linear Model
You can use the template VIs to define a user-defined model. The template VIs are located at the LabVIEW\vi.lib\addons\System Identification\User-Defined Model Templates.llb directory. This application note revises the SI User-Defined Model Template (SISO Array) VI to define the Hammerstein model.
The following figure shows the connector pane, which shows up on the upper-right corner of the front panel, of the SI User-Defined Model Template (SISO Array) VI.
Note: For the template to work, you cannot make any changes to the connector pane under any circumstances. In other words, you cannot change the pattern of the connector pane, delete any existing terminals from it, change the location of any existing terminals, or add new terminals to it. However, not all existing terminals need to be connected when defining the relationship between the input and output signals.
The following figure depicts the front panel of the SI User-Defined Model Template (SISO Array) VI.
The following figure depicts the block diagram of the SI User-Defined Model Template (SISO Array) VI.
From the above figures you can find that the template VI does not include any functional codes. The template VI only defines the required inputs and outputs terminals, and you need to write you own code to describe the relationship between these inputs and outputs terminals.
After adding functional codes to the SI User-Defined Model Template (SISO Array) VI, you create the Hammerstein Model Simulation VI to define the Hammerstein model. Because the front panel of the Hammerstein Model Simulation VI is the same as the template VI, the following contents discuss the block diagram in detail.
The above figure shows the block diagram of the Hammerstein Model Simulation VI. From this block diagram, you can see that the static nonlinear function f[u(t)] is described by a FOR Loop which accumulates each term. The summation is then cascaded to an IIR filter which has the coefficients of B(q)/A(q) to represent the linear dynamic function G(q). You can see this templates intuitively defines the relationship between u(t) and y(t).
5. Estimate and Validate a Non-Linear Model
You can use the SI Estimate User-Defined Model VI to estimate a Hammerstein model. The following figure shows the inputs and outputs of this VI.
After you define the relationship between the input and output signals with the Hammerstein Model Simulation VI, connect this VI to the SI Estimate User-Defined Model VI, provide the stimulus and response signals, and make initial guesses for each variable. Then you are ready to estimate the Hammerstein model.
The following figure shows the block diagram of the Estimate Hammerstein Model VI. The Industrial Process Simulated by Hammerstein Model VI supplies simulated stimulus and response signals to SI Estimate User-Defined Model VI. The saved Hammerstein Model Simulation VI is called through its path and passed through user defined model terminal. Initial guesses of Beta Order, A Order, and B Order are also passed through variables terminal.
For model validation purpose, the SI Estimate User-Defined Model VI automatically provides a simulated response signal with the response obtained by estimate model terminal. You can compare this simulated response with your original response signal to validate the quality of the estimated model. The estimated model matches the real-world model as shown in Figure 8, because the Response Signal Obtained by the Estimated Model plot matches the Ideal Response Signal plot.
Many real-world applications have certain degree of nonlinearity and nonlinearity appears in many different forms. Therefore, you might find that none of the existing model representations meet the requirements you need and that you need another model representation. With the System Identification toolkit, you can create a user-defined model by defining the input-output relationship. You then can use the SI Estimate User-Defined Model VI and template VIs provided by this toolkit to estimate and validate the user-defined model. Please refer to LabVIEW\examples\System Identification\Getting Started\User Defined Model.llb for other examples of using the SI Estimate User-Defined Model VI.