MFeval (Magic Formula evaluation) has been created to provide a robust way to evaluate Magic Formul tyre models.
The toolbox contains the function with the same name (mfeval.m) used to evaluate tyre property files with the Magic Formula 5.2, 6.1 or 6.2 equations. A tyre property file (.tir) contains the magic formula parameters that define the tyre's force and moment characteristics.
Marco Furlan (2020). MFeval (https://www.mathworks.com/matlabcentral/fileexchange/63618-mfeval), MATLAB Central File Exchange. Retrieved .
Very nice package!
Thanks a lot for your sharing.
Firstly, thank you for providing this library; it is extremely useful. However, when I use the library in a iterator subsystem I get multiple errors due to the continuous formulation of the library (e.g. iterators need to be changed for sample time reasons, computation errors that need to be fixed with delays etc). Even though I did manage to do changes in order to make it work, the results are not the best. I would like to ask if there is a guideline for us to use in order to make it compatible with iterative subsystems?
MFeval offers the same functionality as other paid-for models but is open source with good documentation and support from the author. Take the time to learn how to implement MFeval into your project and have fun!!!
Great tool! Gracias Marco
Thanks for your comment, and for contributing to the development of MFeval.
You are right. In the line 1580:
% Evaluate Gyk with gamma = 0 and phit = 0
[~,Gyk_sub0] = obj.calculateFy(..., Fyo, muy)
I pass the vectors "Fyo" and "muy" that include camber effects, so technically is not correct. However, "Fyo" and "muy" are not used to calculate "Gyk_sub0" so the result is not affected by this typo.
Even though the result will be the same, I will change the order to evaluate "Fyo_sub0" before "Gyk_sub0" to pass the right inputs (Fyo_sub0 and muy_sub0) and to make it easier to understand.
Hi Marco. You done very useful job. Thank you so much. I have a question:
In Solver61.m. when calculating Mz:
% Evaluate Gyk with gamma = 0 and phit = 0
[~,Gyk_sub0] = obj.calculateFy(tirParams, postProInputs_sub0, internalParams_sub0, modes, starVar, incrVar, Fyo, muy);
gamma is included in Fyo and muy, but when you calculate Fyo and muy you don't set gamma in zero. It is right?
Release notes - Version 2.2.0:
◾ Road position implemented in STI
◾ Road velocity implemented in STI
◾ Some MATLAB Function blocks have been replaced with inbuilt Simulink blocks
◾ The switch case to select the dynamics mode in CPI is done upstream to avoid unnecessary calculations
◾ The passband frequency of the low pass filters has been increased to 100 Hz
◾ Simulink library names updated. This will brake the links from old models and needs to be updated
Since version 2.0 mfeval is written in Object Oriented. The function readTIR is now a method of mfeval and should be called as:
params = mfeval.readTIR('ExampleFile.tir');
I am getting an 'unexpected MATLAB expression' when trying to run the readTIR script. Do you know why this might be the case? The first line of readTIR.m is below, showing what I tried.
function tirParams = readTIR('front.tir')
I use this tool for its import feature to my own scripts, which works well and is really easy to use!
very help thanks
Nice job Marco, very helpful!
Sorry for the delay, but I don't receive a notification when a new comment is posted here.
Modelling is a hard and complex task. First of all you will need good quality tyre data. This data is difficult and expensive to obtain. The data can be measured with a roller drum bench, with a flat belt machine (like Calspan TIRF), with a test trailer (like TNO) or with a wheel force transducer mounted in a real car.
It's very probable that you will have to post-process and crop somehow the data. E.g. separate FreeRolling tests to fit pure lateral Fy, Mz and Mx; use BrakeDrive data to fit Fx and combined forces and moments; use the Spring Rate tests to fit the loaded radius model, etc. You should basically use the right data for the right equation.
Once you are happy with the data you can use a MATLAB fitting function like lsqnonlin to find the correct MF6.1 parameters for your model (or TIR file).
x = lsqnonlin(fun,x0)
Where "x" are your optimized parameters packed in a structure and "fun" is your cost function. Your cost function should calculate the error of the model vs the data. For example error = FYmodel – Fydata (use mfeval in your cost function to calculate FYmodel)
You should later plot your model against the data to see if you have a good fitting. Check if the model is stable in all the operating conditions. It can happen that the operating conditions in your simulation are outside of the tested range, so be sure that the model is able to extrapolate in a stable way.
Finally remember that it’s important to follow a certain order when you are fitting a full Magic Formula model. For example, you can’t fit the Fy combined parameters before the Fy pure parameters.
This is a vague overview of the process, hope it helps.
Firstly I would like to congratulate you for the amazing job done
Do you have some tips to find all the Magic Formula coefficients so that I can create the TIR file?
thank you. I already worked with that paper, but couldn't make any progress on Mz with it. I'll inform you if we do!
I'm still working on the turn slip model, in particular on parking efforts at very low speeds.
I haven't been able to reproduce TNO results yet, but I suggest you to read the following paper:
Lugaro, C., Schmeitz, A., Ogawa, T., Murakami, T. et al., "Development of a Parameter Identification Method for MF-Tyre/ MF-Swift Applied to Parking and Low Speed Manoeuvres," SAE Int. J. Passeng. Cars - Mech. Syst. 9(2):2016, doi:10.4271/2016-01-1645.
Hope it helps, as soon as I can validate parking efforts I will publish MFeval 1.5.
If you find something interesting I would be very interested to know.
Hi Marco, great tool! Thank you for publishing. I am working in a MF6.2 tool to parameterize tires with measurements, done on our inner drum test bench at the KIT. I also got issues with the Turnslip of Mz. Did you make any progress on that topic?
Remember to type "help mfeval" in the command window to see the documentation and learn how to use it.
Thanks for sharing this amazing work!
With your approval, I will use it in my Bachelor Tesis developed with Adams Car (Formula Student model)
MF-Tyre 5.2 equations have been implemented for backward compatibility
MF-Tyre 6.2 equations have been implemented. In 6.2 the loaded radius model is improved with camber dependencies. See the documentation for more information
Slip stiffness (Kxk) is now output number 30
Road friction can be passed as input to STI and CPI interfaces
Road position implemented in STI
◾ Simulink Library updated to work with variable solvers.
Simulink Library updated to be more robust and consistent (STI interface depends on CPI interface)