File Exchange

image thumbnail


version 4.3.1 (4.37 MB) by Marco Furlan
Contains the necessary functions to evaluate Magic Formula 5.2, 6.1 and 6.2 models from .tir files


Updated 12 Mar 2021

View Version History

View License

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.

Cite As

Marco Furlan (2021). MFeval (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (58)

Christos Patrinos

Bob Bao

Hi, Marco

Thanks for your great works. when I typing 'help mfeval' in my command window, i could not find the related information about this tool. by the way, my matlab version is R2016b, di i need to use R2017b? thanks again.

lukas Henkenjohann

Hey Marco,
You have done a great job with this MFeval toolbox. I like it very much. But i have a little problem using it in combination with IPG Carmaker. Using this MFeval models results in very high simulation times in Simulink.
Do you have any ideas where this might come from?

Best regards

Marco Furlan

Hi Marc, please email me your .tir file to see if I can spot the error. You can find my email typing "help mfeval" in the command window

Marc Schindler

Thank you very much for your work.
So far I have used tir files from MF 6.x. However, I am now using an older version MF 5.2. Unfortunately, Simulink now gives me an error message:
Error in 'Modell/Tiremodell MFeval/CPI tyre':
Failed to evaluate mask initialization commands.

Can you please help me?
Thank you very much!

Dennis Spiliopoulos

Amazing work. Thanks Marco!

krishna teja

hi marco
firstly, i appreciate well written and documented codes
i am trying to use STI tire same way as TNO tire for simscape multiibody. unfortunately, it doesn't work. Can you provide some suggestions on it

Marco Furlan

Updates in version 4.2.0:
◾ mfeval.coefficientCheck uses the correct nominal pressure parameter (P0 = MFStruct.NOMPRES)
◾ The Mx formulation does not allow the parameter sets QSX1 to QSX11 and QSX12 to QSX14 to be both non-zero
◾ The Mz combined formulation under high inclination angles has been improved to match TNO (parameter Gyk_sub0)

Filippo Guzzabocca

Tom Teasdale

Marco Furlan

Thank you for posting and asking questions. But please note that I don't receive any notification when a comment is posted here.
If your question is urgent or needs a lengthy explanation please send your queries to the email address that can be found in the documentation or by typing "help mfeval" in the command window.

Marco Furlan

Release notes for version 4.1.0:
◾ Typo in .tir file names fixed
◾ Mz combined with camber improved after using starVar_sub0 to calculate Fy
◾ Contact patch global positions x, y, z are now calculated in STI
◾ Saturation block for FZ has been changed to only apply a lower bound.
◾ In STI a more robust transformation from ISOW to ISOC has been implemented.
◾ In STI the tratmat input order has been changed to match TNO
◾ The saturation of the pressure input in CPI has been removed to improve the effective radius and slip ratio correlation with TNO

Jianyang Lin

Hi,Macro,thanks for sharing this.
In the fitting example, I have fitted the lateral force Fy. Could you give me some instruction on how to fit the self aligning moment Mz. How to modified in the fitting example, so that the Mz reslut can be obtained?

Taichi Shiiba

Great work!

Taichi Shiiba

Manuel Ferreira

Krzysztof Kowalski

Very nice package!


Thanks a lot for your sharing.

Christos Patrinos

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?

Justin Taylor

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!!!

Joseph McCarrison

Akira Kuramori

Biome Zhao

Matthew Schroeder

Javier Lomas

Great tool! Gracias Marco


Alexander Mullaart

Samir Charif

Yize Yu

wenquan hao


Marco Furlan

Hi Mikhail,

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?

Marco Furlan

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

Pablo Gonzalez

Vicent Garcia Garcia

Raúl Peña

Marco Furlan

Hi Thomas,
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');


Thomas Dunn

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')


Matjaz Skafar

I use this tool for its import feature to my own scripts, which works well and is really easy to use!

zhao px

luis Armando Solis

Ronit Saha

Marek Laszlo

Miguel Zambrana


very help thanks

Jorge Gutierrez

Carlos Rayo

Nice job Marco, very helpful!

Marco Furlan

Hello Gustavo,
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.

Gustavo Fialho

Hi Marco,
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?

Jochen Bodmer

Hi Marco,
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!

ismail bensekrane

Marco Furlan

Hi Jochen,
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.

Best regards,

Jochen Bodmer

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?

Marco Furlan

Remember to type "help mfeval" in the command window to see the documentation and learn how to use it.

Madhu Shurpali

Very Helpful.Thanks.

Javier Catalan

Thanks for sharing this amazing work!
With your approval, I will use it in my Bachelor Tesis developed with Adams Car (Formula Student model)

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!