Back to Browse

A Reduced-Order Model with Machine Learning using TwinSimulate and Scikit Learn

117 views
Apr 3, 2025
6:14

Objective The goal of this experiment was to replace a Functional Mock-up Unit (FMU) of a DC motor with a Machine Learning (ML)-based Reduced Order Model (ROM) to improve simulation speed while maintaining accuracy. This approach leverages data-driven modeling to approximate system dynamics efficiently. Methodology Data Collection & Preprocessing A ramp voltage input was provided to the original DC motor FMU. The speed sensor output was recorded as the response. Input-output data pairs were accumulated over multiple iterations. The data was normalized using the StandardScaler to improve numerical stability. Training the Reduced Order Model (ROM) A Ridge Regression model was trained to approximate the FMU behavior. The model parameters (coefficients, intercept, mean, and scale values) were saved to a file. Model Deployment & Evaluation A separate Python block was implemented to load the trained model and apply it to new input data. The loaded model transformed the input, applied the trained equation, and produced the predicted output. The accuracy was measured using R² (coefficient of determination), achieving a high score of 0.99, indicating an excellent fit. Results & Advantages Significant Speed Improvement: The ML-based ROM eliminates the computational overhead of simulating a full-fledged FMU. High Accuracy: The trained model closely mimics the FMU’s response with minimal error. Lightweight & Portable: The model requires only a few stored parameters, making it easy to deploy in embedded systems or real-time simulations. No Need for FMU Execution: Unlike FMUs, which rely on complex solvers, the ROM provides direct function evaluation, reducing processing time. Next Steps Convert the trained model into C code for integration into embedded systems. Explore nonlinear models (e.g., neural networks or higher-degree polynomials) for more complex systems. Extend this approach to other dynamic systems beyond DC motors. This experiment successfully demonstrated how machine learning can replace FMUs for faster, more efficient simulations while maintaining accuracy. 🚀 Website : https://twinsimulate.com Audio : Candlepower by Chris Zabriskie is licensed under a Creative Commons Attribution 4.0 license. https://creativecommons.org/licenses/by/4.0/

Download

0 formats

No download links available.

A Reduced-Order Model with Machine Learning using TwinSimulate and Scikit Learn | NatokHD