# Estimate Nonlinear Models of Dynamic Systems

Learn how to include physics insights and knowledge of your system for estimating nonlinear models using Hammerstein-Wiener and nonlinear ARX models. This demonstration shows how to include insights and prior knowledge with the help of physics-inspired nonlinearities, custom regressors, and predefined linear models while estimating nonlinear models.

**Published:
17 Jul 2023**

In this video we’ll see how to estimate nonlinear system dynamics from measured data using Hammerstein-Wiener and Nonlinear ARX models.

Nonlinear models are useful when linear models cannot adequately capture the dynamics of the process or system you are trying to identify.

There are different nonlinear modeling techniques available from System Identification Toolbox, they include Nonlinear ARX and Hammerstein Wiener models where you can include your insights or knowledge of physics of your system, neural-state space models where you can create deep learning based nonlinear state space models, and finally nonlinear grey box models where you represent your nonlinear system using ordinary differential or difference equations and then estimate physically meaningful parameters from measured data.

In this video we’ll focus on how you can include your insights and knowledge of physics while modeling nonlinear systems.

Let's look at a demo.

Here we are trying to identify a model of a DC motor from measured data where voltage is the input to the motor and angle of the motor shaft is the output.

To estimate a model for this motor, let’s start by opening the system Identification app and load the measured data in.

On looking at the time plot we can see that at low values of voltage applied to the motor, the shaft is barely moving, this tell us that there is nonlinearity in this system, and to be precise this is happening because there is dry friction in this motor – so it takes relatively more voltage to overcome the dry friction.

Let’s try to fit this data with a linear model and see if that captures this behavior of the motor, lets estimate a transfer function, here you have the option to configure parameters such as poles, zeros, and delays, but for this exercise lets go with the default option and click on estimate. The tool goes through few iterations, estimates the transfer function model and when it is done it adds it to the graphical user interface.

Now on comparing the response of the transfer function model with the actual data, we can see that fit in the region where the voltage level is high is pretty good, but the fit in the region where the voltage is low is not great.

To improve this fit and capture the nonlinear behavior at low voltage we can try one of the nonlinear models, here let’s start with the Hammerstein Wiener model, this is a model structure where there are input and output static nonlinearities connected in series with a linear system.

Since we have a motor exhibiting dry friction in this case, we can try to model that with a physics inspired nonlinear estimator like dead zone at the input, as you can see there are other available nonlinear estimators as well but for this case well use the dead zone since we have that insight and leave the remaining options as default.

Now on estimating this model, the tool goes through few iterations and adds a new model to the app browser. On looking at the results we can see that the fit percentage is pretty good, and more importantly our model is now able to capture the dynamics at lower voltage i.e. it is able to represent dry friction in the motor which was not possible before with a linear model.

Alternatively, you can also use the nonlinear ARX model, the structure in this case is slightly different where you have regressors or features at the input and then a linear model that is connected in parallel with dynamic nonlinear mapping objects.

To capture the dynamics of the motor with this model structure you can create a custom regressor with a user defined formula to represent the dry friction, and then select the nonlinear estimator from the array of options to map the regressors to the output. These include general purpose nonlinear estimators such as wavelet network and sigmoid networks as well as machine learning algorithms like support vector machine, regression tree ensemble, and gaussian process to capture the nonlinearities. You can then estimate the model and compare the results.

Additionally, you can also estimate Nonlinear ARX and Hammerstein Wiener models incrementally, i.e. by starting with a linear model that you understand well and then configuring nonlinear estimators to capture nonlinearities that are not part of the linear model.

Once you have the nonlinear model identified you can bring the model to MATLAB workspace, and then use it in MATLAB or bring it into Simulink using built-in blocks for applications such as Control design, Desktop simulation and HIL, Reduced Order Modeling, and Virtual Sensor Modeling.

To learn about how to model nonlinear systems by leveraging machine learning and deep learning algorithms with system identification techniques please check out the linked videos.

Featured Product

#### System Identification Toolbox

### Up Next:

### Related Videos:

您也可以从以下列表中选择网站：

如何获得最佳网站性能

选择中国网站（中文或英文）以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。

美洲

- América Latina (Español)
- Canada (English)
- United States (English)

欧洲

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

亚太

- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)