Digital twin · machine learning · energy systems
A digital twin of a biogas dual-fuel engine
An 18 kW, four-cylinder generator (Cat C2.2-based DE18E3) converted to run on biogas with a diesel pilot. Machine-learning models trained on 1,750 measured operating points predict its efficiency and exhaust temperature, and an energy balance works out the fuel it needs. Set a power output and diesel share below to run the twin.
Run the twin
Choose a load and a diesel energy share (DES). The twin predicts efficiency with the KNN model and exhaust temperature with the regression model, then solves the energy balance for the diesel and methane flows.
Operating maps
Grey points are the 1,750 measured operating points. The line is the trained model and the orange marker is your current setting, as in the original Python dashboard.
Electrical efficiency
% vs. power output (KNN model)
Fuel mass flows
kg/h vs. power output
Exhaust gas temperature
°C vs. power output (linear regression)
Model validation
Predicted vs. measured values using 5-fold cross-validation, so each point is predicted by a model that never saw it. Points on the diagonal are perfect predictions.
Efficiency: KNN regression
Exhaust temperature: linear regression
How the twin works
How it's calculated
This script trains the same models as the project's Tkinter dashboard, cross-validates them, and exports the model parameters and data this page runs on. The twin above re-implements the KNN prediction and the energy balance in JavaScript.
analysis/build_demo_data.pyOpen on GitHub →Loading…