ROM using Machine Learning
From the series: Reduced Order Modeling
Learn how to create reduced-order models of high-fidelity systems using machine learning techniques in System Identification Toolbox™. Watch a demonstration on how to identify support vector machine–based nonlinear ARX models using measurements from a high-fidelity model of an internal combustion engine, and use a trained model to replace the original model for faster simulations.
Published: 8 Jul 2022
Sensor data from your system or high-fidelity model can be used to drive a simpler proxy that is faster to simulate or is more amenable for specific applications, such as control design. This video shows how you can leverage machine learning techniques in System Identification Toolbox to achieve these goals in a simple manner. Over the last few releases, we've added capabilities for training non-linear ARX models using techniques such as support vector machines, neural ODEs, Gaussian processes, feed-forward multilayer neural networks, and ensemble learners.
In this video, we will use a high-fidelity first principles model of a vehicle with an internal combustion engine. To ensure faster simulation with this model, we will create a reduced-order model to represent the nonlinear dynamics of the internal combustion engine. More specifically, we will show you how to train a non-linear ARX model using support vector machines, import the trained model to Simulink for validation, and finally use it in full vehicle model for system-level simulation.
In this model the engine torque is expressed as a function of these four inputs. The input-output data is collected through design of experiments. To prepare the data for training, this section extracts the data, removes transients, and split the data into two, one set for training and another one for validation. For nonlinear model identification, System Identification Toolbox lets you estimate nonlinear ARX models, Hammerstein-Wiener models, and neural state space models. In this example, we will estimate a nonlinear ARX model using support vector machine, or SVM.
For training, we first specify the model structure, which consists of the regressors and the output function. Regressors are the features computed from data to be used in the machine learning algorithm. In this example, we use linear regressors. Other available types include polynomial, periodic, and custom formulas.
Next, we specify the output function, which maps the regressors to the model output and helps capture the nonlinearity in the system dynamics. To use SVM as the nonlinear mapping function, we define its hyperparameters, such as the kernel, box constraint, and epsilon margin. Hyperparameter selection is critical for creating accurate and robust models when using machine learning algorithms. For this example, we use the Experiment Manager app from Deep Learning Toolbox to run the training algorithm with different model configurations, which helps us identify the optimal SVM parameters, as shown in the highlighted row.
Another important hyperparameter for model training is the model sample time. Too high sampling can increase noise and training time and interfere with the model's ability to capture the essential dynamics. After experimenting with a series of non-sampling factors in the range of 10 to 1, we used the factor of 10, which resulted in the most accurate model. Lastly, we specify the training options and use the nlarx function to train a nonlinear ARX model from the training data.
Once the training is done, we can import the reduced-order model to Simulink using the nonlinear ARX model block and validate the model by simulating it using the validation data. Simulation results show good agreement between the reduced-order model and the high-fidelity model, indicating that the reduced-order model captures the essential dynamics of the system. We can now use the nonlinear ARX model in the full vehicle model, where we edit it as one of the variants for modeling the engine dynamics. As seen in this table, the nonlinear ARX model provides a speed-up for the engine model by a factor of 10 when compared to the high-fidelity model. This concludes the video.