From Hackathon to Real-World Motorcycle Modeling with MATLAB
The motivation for joining the challenge
We are chemical engineering students from the University of Pannonia; Éva Kenyeres is a PhD student specializing in modelling, stochastic algorithms, programming and optimisation. Csenge Juhász has a BSc in Chemistry but her research is centred around data science. Levente Sólyom and Ferenc Gulyás are both chemical engineers with interest in process modelling. We are always looking out for competitions where we can test our problem solving skills on a real life task. All of us knew MATLAB beforehand so this competition seemed like a good opportunity to test our skills. Also this way we can get exposure to the industry in a fun and rewarding way. That’s why when we found the 2026 DATA-ENG Hackathon which was organized by SciEngineer, AUMOVIO, and the University of Pannonia we quickly had a team meeting and joined the challenge.

Breaking down the problem
Our task was to estimate the difference in circumferential speed between the front and rear wheels of a motorcycle. These calculations later could be used to implement better cruise control and Anti-lock Braking System (ABS). We were provided with two sets of experimental data made with two different motorcycles. These files contained the velocity of the vehicle and the leaning angle from which we had to predict the speed difference. As this problem requires complex calculations, data science and possibly deep learning possibilities we choose MATLAB as our go to software.
he first task was doing the recommended MathWorks courses. These were MATLAB Onramp, Simulink Onramp, Simscape Onramp, Deep Learning Onramp and the course about Regression with Deep Learning. We were familiar with MATLAB beforehand however they still proved valuable. Thanks to them we learned about the useful toolboxes we should use during the competition. The next challenge was solving the real problem. The competition consisted of two phases. In the first phase we were only allowed to use a priori models. During the second phase we were permitted to use neural networks or upgrade our previous work. We also had to figure out ways to filter the dataset which contained quite bit of noise.

Our idea and it’s implementation
Since the raw measurement data contained significant sensor noise, effective signal processing was an essential first step before any modelling activities could begin. To reduce measurement noise, we processed the motorcycle speed and lean angle using an Infinite Impulse Response (IIR) filter, which provides efficient smoothing while maintaining computational simplicity. We selected the filter parameters based on the sampling frequency and an experimentally determined cut-off frequency to preserve the relevant dynamic behaviour while eliminating high-frequency disturbances. We processed the wheel speed signals separately using a second-order Butterworth low-pass filter, which effectively suppresses rapid fluctuations without significantly affecting slower, physically meaningful variations in the measurements. These methods were accessible thanks to the Signal Processing Toolbox of MATLAB.

1. Figure The filtering workflow we followed
After filtering, we identified quasi-stationary operating points to improve parameter estimation. We determined these operating points by calculating the time derivatives of the filtered vehicle speed and lean angle. Measurement points exceeding predefined threshold values were classified as dynamic and excluded from the model fitting process. Restricting the optimisation to stable operating conditions reduced the influence of transient effects and measurement uncertainty, resulting in a more reliable representation of the physical system.
We developed a mathematical model to estimate the circumferential speed difference between the front and rear wheels as a function of vehicle speed and lean angle while incorporating the dominant forces acting on the motorcycle. The model accounts for rolling resistance, aerodynamic drag, tyre longitudinal stiffness, and the geometric effects of motorcycle lean. According to the corresponding literature this is an appropriate model for this task.
Δv = v · [(cr·m·g + ½·ρ·CD·A·v²) / Cκ] · 1/√(1 − tan²φ) (1)
Where m denotes the combined mass of the motorcycle and rider; g is the gravitational acceleration; ρ is the air density; and A is the effective frontal area.
Several model parameters, including the rolling resistance coefficient, drag coefficient, effective frontal area, and longitudinal stiffness coefficient, were estimated using MATLAB’s constrained nonlinear optimisation algorithm. This can be accessed through MATLAB’s Optimization Toolbox. The optimisation minimised the mean absolute prediction error over the filtered quasi-stationary dataset. Physically realistic parameter bounds and variable scaling improved numerical stability, and the optimisation converged successfully without any parameter reaching its prescribed limits, indicating a genuine optimum within the feasible search space.
During the second phase we opted to refine our model further to enhance predictive performance. We generated additional predictor variables, including polynomial, exponential, and interaction terms based on vehicle speed and lean angle. After that we applied stepwise regression to identify the most informative predictors while removing redundant variables. Model selection was based on the Akaike Information Criterion (AIC), balancing predictive accuracy and model complexity. The resulting regression model was validated using multiple motorcycle datasets. Evaluation with root mean standard error, mean absolute error, and the coefficient of determination (R²) showed consistently high accuracy on both the training and test sets, demonstrating improved generalisation while retaining the physical interpretation of the original white-box model.

2. Figure The MATLAB workflow we employed
Results
The resulting model was evaluated using datasets from both motorcycles. For the first (Moto Guzzi) dataset, the model achieved the desired prediction accuracy, with the majority of estimated wheel speed differences remaining within the target error threshold. Time-series comparisons further confirmed that the predicted values closely followed the measured data throughout the test sequences.
The Triumph dataset proved to be more challenging. During the initial phase we observed greater error. This indicates the presence of physical effects that were not fully described by the simplified mathematical formulation. However, by applying data-driven techniques in the second phase of the competition, we achieved much better agreement with the experimental results.

3. Figure Results for both of the motorcycles (Guzzi – left, Triumph – right)
Finally, we translated the MATLAB code into C and evaluated if it complied with the hardware requirements specified by the competition. Testing confirmed that the algorithm satisfied all memory and runtime constraints while requiring no Electrically Erasable Programmable Read-Only Memory usage. The implementation consumed less RAM and ROM than the specified limits and completed its computations well within the maximum execution time. This way we could state that the solution could be used in embedded automotive hardware thanks to its computational efficiency and accuracy. The code however is not available for the public as it is only a demonstration of what can be achieved with the help of MATLAB in this field of engineering.
Key Takeaways
During the competition we learnt a lot about data analysis, modelling but also we gained experience in the not so technical side of engineering. We had to present our ideas in front of a jury and work as a team during the competition. We believe these skills will prove useful later in our life.

- 类别:
- Hackathons


评论
要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。