{"id":7964,"date":"2022-06-07T09:19:10","date_gmt":"2022-06-07T13:19:10","guid":{"rendered":"https:\/\/blogs.mathworks.com\/student-lounge\/?p=7964"},"modified":"2025-02-21T09:54:04","modified_gmt":"2025-02-21T14:54:04","slug":"mf-tyre","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/student-lounge\/2022\/06\/07\/mf-tyre\/","title":{"rendered":"Magic Formula Tire Modeling in Formula Student"},"content":{"rendered":"<div class=\"rtcContent\">\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">For today&#8217;s blog post, <a href=\"https:\/\/www.linkedin.com\/in\/veer-alakshendra-b5324222\/\">Veer Alakshendra<\/a> is happy to host <a href=\"https:\/\/www.linkedin.com\/in\/teasdale-tom\/\">Tom Teasdale<\/a> from the <a href=\"https:\/\/formulastudent.uni-paderborn.de\/\">UPBracing<\/a> Formula Student team. Tom is here to discuss about the tool that he has developed for tire modeling.<\/div>\n<h2 id=\"H_09BA0C9E\" style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Introduction<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This blog post will briefly introduce Magic Formula Tire and a new, <a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-tool\">open-source MATLAB tool<\/a> for creating, fitting, and evaluating Magic Formula Tire models. It is tailored for students trying to implement tire models using data from the FSAE Tire Test Consortium (<a href=\"https:\/\/www.millikenresearch.com\/fsaettc.html\">FSAE TTC<\/a>). You can export your fitted model as a TIR-file or as a struct to use outside of this tool.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-8426 alignnone\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/10_gif.gif\" alt=\"\" width=\"706\" height=\"408\" \/><\/div>\n<h2 id=\"H_D0F9CBAC\" style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Motivation<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Are you a student participating in the Formula Student (FSAE) competition? If your answer is yes, you know how heavily your car is influenced by your tires. Limiting the maximum transmissible force of your engine (or motors) to the road, tire characteristics should be understood and compared to make a qualified tire choice. You might also be developing a Vehicle Dynamics Control algorithm or a high-fidelity vehicle model in MATLAB\/Simulink for which you also need a model representation of your car&#8217;s tire. As an active student in Formula Student myself, those were the typical challenges we had to face at my team <a href=\"https:\/\/formulastudent.uni-paderborn.de\/\">UPBracing<\/a>.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Luckily, Formula Student teams can gain access to high-quality tire data by becoming members of the <a href=\"https:\/\/www.millikenresearch.com\/fsaettc.html\">FSAE Tire Test Consortium<\/a>. For a small membership fee, you can download complete data of most Formula Student tires which we can then use to create highly accurate and computationally efficient, empirical tire models.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Magic Formula Tire is not the only empirical tire modeling approach out there. It is only one of many. However, it is also the most popular one (neglecting the linear tire model), and for good reasons. It can be understood as an advanced version of the famous, classic Magic Formula.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><span style=\"vertical-align: -15px;\">$ y = D \\cdot \\sin \\bigg( C \\cdot \\arctan \\Big( B \\cdot x &#8211; E\\big( B \\cdot x &#8211; \\arctan(B \\cdot x) \\big) \\Big) \\bigg) $<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -5px;\">where <span style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: #212121;\">y<\/span> is the output variable (e.g. lateral tyre force) and <span style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: #212121;\">x<\/span> the input variable (e.g. slip angle). B, C,D and E are the tuning parameters.<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">For an example of how you can fit the classic Magic Formula to data, you can refer to <a href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2018\/08\/01\/analyzing-tire-data\/\">Analyzing Tire Test Data<\/a>, a blog post by MathWorks staff. In their case, the fitting results in a large interpolation grid which alters the parameters depending on the current steady-state conditions. But interpolation grids can be disadvantageous, especially where execution speed matters and they are also hard to modify after the fitting process.<\/div>\n<div><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">A more advanced version of the classical Magic Formula is the semi-empirical Magic Formula model with around 100 parameters. Semi-empirical means that the model incorporates knowledge about tire dynamics in its equations and is not purely empirical as, for example, a polynomial model. Therefore, semi-empirical Magic Formula models can also realistically extrapolate tire characteristics using the so-called <a href=\"https:\/\/www.sciencedirect.com\/book\/9780080970165\/tire-and-vehicle-dynamics?via=ihub=\"><span style=\"font-style: italic;\">similarity method<\/span><\/a>. This is very useful, as we usually don&#8217;t have test-bench data for every possible steady-state. The <a href=\"https:\/\/www.millikenresearch.com\/fsaettc.html\">TTC<\/a> for example only tests slip angles up to about 6 degrees. Although the model seems really complex with over 100 parameters to tune, we usually only need a fraction of those for a great model-data-fit. But, to be fair, it can be a bit cumbersome to build Magic Formula Tire models with just MATLAB scripts, especially if you want to manually tune parameters. I hope that my tool can help students in that regard.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In the following, any reference to Magic Formula or Magic Formula Tire implies its semi-empirical form.<\/div>\n<\/div>\n<div class=\"rtcContent\">\n<h2 id=\"H_5088B734\" style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Methodology<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The Magic Formula Tire Tool showcased here can be understood as an open-source alternative to multiple commercial solution to fitting Magic Formula Tire models to data. It acts as a graphical <span style=\"font-style: italic;\">wrapper <\/span>to the closely related project Magic Formula Tire <a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-library\"> MATLAB Library<\/a>, which is a collection of command-line tools. This means, that almost everything done by the GUI can be done with just the library in the MATLAB console. It also means that the Magic Formula Tire equations used in the GUI for fitting are the same as in the library. So the fitted parameter set yields the same results in the GUI as with the Command-Line tools in the Magic Formula Tire <a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-library\"> MATLAB Library<\/a>.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">By the way, the evaluation functions in the library mentioned above are code-generation compatible and have been used for that purpose at <a href=\"https:\/\/formulastudent.uni-paderborn.de\/\">UPBracing<\/a>. So feel free to fit your model using the GUI and evaluate it using the library in your code-generation projects.<\/div>\n<h3 id=\"H_2CEED5F4\" style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Implementing Magic Formula Tire<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">For those who want to understand the implementation of Magic Formula Tire model, I will provide a short summary. Here the definitive reference is the book <a href=\"https:\/\/doi.org\/10.1016\/C2010-0-68548-8\"><span style=\"font-style: italic;\">Tire and Vehicle Dynamics<\/span> by Hans B. Pacejka (2012)<\/a>. In chapter 4.3.2. you will find the full set of equations. You should also keep the MF-Tyre\/MF-Swift manual nearby as a sort of cheatsheet for the <a href=\"https:\/\/docs.plm.automation.siemens.com\/data_services\/resources\/nx\/1899\/nx_help\/custom\/en_US\/samcef_solver_documentation\/m011\/mftyre-mfswift_help-m011.pdf\">parameters<\/a>. Implementing these is pretty straightforward. Let&#8217;s take a peak at the <a href=\"https:\/\/github.com\/teasit\/magic-formula-tyre-library\/blob\/main\/src\/%2Bmagicformula\/%2Bv61\/Fx0.m\">source-code<\/a> for <span style=\"font-family: monospace;\">Fx0<\/span>, which calculates longitudinal tire force for pure longitudinal slip.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">function <\/span>[Fx0,mux,Cx,Dx,Ex] = Fx0(p,longslip,inclangl,pressure,Fz)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% (4.E1)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">FNOMIN = p.FNOMIN.*p.LFZO;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% (4.E2a) <\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">dfz = (Fz-FNOMIN).\/FNOMIN;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% (4.E2b) <\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">dpi = (pressure-p.NOMPRES).\/p.NOMPRES;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% (4.E11) <\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">Cx = p.PCX1.*p.LCX;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">&#8230;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% (4.E9)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">Fx0 = Dx.*sin(Cx.*atan(Bx.*longslip-Ex.*(Bx.*longslip-atan(Bx.*longslip))))+SVx;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The parameter names have been implemented in accordance with the Magic Formula Tire\/MF-Swift manual and variable names try to follow Pacejka&#8217;s book closely. Other than that, you only have to translate the math from the book into MATLAB code.<\/div>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Creating the Fitter<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In <a href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2018\/08\/01\/analyzing-tire-data\/\">Analyzing Tire Data<\/a> the <span style=\"font-family: monospace;\">lsqcurvefit<\/span> function is used to fit the Magic Formula Tire model to data. As the name suggests, it minimizes the squared sum of errors. The Magic Formula Tire Tool uses the Fitter included in the Magic Formula Tire<a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-library\"> MATLAB Library<\/a>. It also uses a least-squares approach but uses the <span style=\"font-family: monospace;\">fmincon<\/span> function instead. This is because I also wanted to implement nonlinear constraints, as certain variables of Magic Formula Tire should always be within certain bounds. For example, Pacejka&#8217;s book says that<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><span style=\"vertical-align: -29px;\">$ $$ C_x = p_{Cx1} \\cdot \\lambda_{Cx} \\ &gt; 0\\ D_x = \\mu_{x} \\cdot F_z \\cdot \\zeta_1&gt; 0\\ E_x = &#8230; \\leq 1 $$ $<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -6px;\">C_x and <\/span><span style=\"vertical-align: -6px;\">D_x must be greater than zero. This can be implemented as a nonlinear constraint in the fitter (see <a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-library\/blob\/d06f24fa2152e694f1043a897130024e93b5d0af\/src\/%2Bmftyre\/%2Bv62\/Fitter.m\">source code<\/a>).<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">[~,~,Cx,Dx,Ex] = mftyre.v62.equations.Fx0(params,longslip,inclangl,pressure,Fz);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">c = [-Cx+eps;-Dx+eps;Ex-1];<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here <span style=\"font-family: monospace;\">c<\/span> is an output of the function handle passed to <span style=\"font-family: monospace;\">fmincon<\/span> as a nonlinear constraint (see <a href=\"https:\/\/de.mathworks.com\/help\/optim\/ug\/fmincon.html#busog7r-nonlcon\">nonlcon<\/a>). Next, we have to consider the order in which the model is fitted to the data. Assuming that we have separated our time series data into steady-state conditions, meaning that we have isolated data arrays where each input can be considered constant (except for one sweeping variable like slip ratio or slip angle), we can do the following.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode aligncenter\" style=\"vertical-align: baseline; width: 375px; height: 190px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/06\/JUne7_2.png\" alt=\"\" width=\"375\" height=\"190\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This list is incomplete, as Magic Formula Tire can model more outputs, but this is sufficient for demonstration. This table shows that we should always fit the model to pure slip conditions first (<span style=\"font-family: monospace;\">Fx0<\/span>, <span style=\"font-family: monospace;\">Fy0<\/span>) and then move on to the other equations. The order naturally comes from the dependencies of the equations. <span style=\"font-family: monospace;\">Fx<\/span> uses <span style=\"font-family: monospace;\">Fx0<\/span> and only applies a scaling term to it, same for <span style=\"font-family: monospace;\">Fy<\/span>. Note that it does not matter whether you fit <span style=\"font-family: monospace;\">Fx0<\/span> or <span style=\"font-family: monospace;\">Fy0<\/span> first, same for <span style=\"font-family: monospace;\">Fx<\/span> and <span style=\"font-family: monospace;\">Fy<\/span>. The order described here is also implemented in the fitter, meaning that if you select multiple fit-modes in the GUI, the fitter will proceed in stages.<\/div>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Building the GUI<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">My approach to building the GUI was using the <a href=\"https:\/\/mathworks.com\/help\/matlab\/developing-custom-ui-component-classes.html\">custom UI component class<\/a> provided by MATLAB to develop a modularized application without <a href=\"https:\/\/mathworks.com\/products\/matlab\/app-designer.html\">AppDesigner<\/a>. Building the app by using custom components makes it very easy to focus only on a part of the app. You can execute individual UI components in isolation and see if any bugs arise. It is not necessary to always run the full app when developing custom UI component classes.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I still use AppDesigner to create Mockups quickly and see if my planned UI looks good, but I prefer not to use it for the final application, as AppDesigner limits my freedom to choose property access levels, preventing me from creating components in loops and more. However, it should be noted that starting with R2021a, <a href=\"https:\/\/de.mathworks.com\/help\/matlab\/creating_guis\/custom-ui-component-classes-in-app-designer.html\">you can now use custom UI components in AppDesigner<\/a>. This might resolve some of the issues I&#8217;ve had in the past, but I haven&#8217;t tried this yet.<\/div>\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">App Demonstration<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I will now give a demonstration of the core workflow with data from the FSAE Tire Test Consortium. The data has been obscured and de-identified to conform with the license agreement.<\/div>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Install the App<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">There are multiple ways to install the app, but the suggested way is to download it from <a href=\"https:\/\/mathworks.com\/matlabcentral\/fileexchange\/111375-mftyretool\">FileExchange<\/a>. Alternatively, you can download the latest release from <a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-tool\/releases\">GitHub<\/a>, but new releases are synced to FileExchange anyway. Download and install the toolbox (<span style=\"font-family: monospace;\">*.mltbx)<\/span> which also includes the app. You can then start the tool from your app catalog.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-8417\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/2_image.png\" alt=\"\" width=\"424\" height=\"401\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><\/div>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Import Tire Data<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">First, we need to acquire measurement data. If you are a member of the <a href=\"https:\/\/www.fsaettc.org\/\">FSAE TTC<\/a>, you can proceed to their forum and download data from there. Please only use data formatted as MAT and in SI units, otherwise, the pre-installed parsers will fail.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In general, TTC data is split into two types of tests<\/div>\n<ul style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Drive\/Brake<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Cornering<\/li>\n<\/ul>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Drive\/Brake is a maneuver with either zero slip angle or constant slip angles (steering angles). While all other inputs are held constant, the slip ratio is swept (by driving and braking the tire). Cornering does not consider slip ratio at all and only sweeps slip angle while all other inputs are constant. As you can see, to fit a complete Magic Formula Tire model, you need both the Drive\/Brake and Cornering dataset for a given tire. You can follow this example by using the de-identified and obscured data included in the installed toolbox. Simply navigate to the toolbox folder, where you will find example data under <span style=\"font-family: monospace;\">doc\/examples\/fsae-ttc-data\/<\/span>, in case you don&#8217;t have access to the TTC (yet). Just keep in mind that the tire characteristics have been modified and the resulting model will behave like a real tire.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-8420\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/3_image.jpg\" alt=\"\" width=\"512\" height=\"406\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Now navigate to the <span style=\"font-style: italic;\">Tyre Data<\/span> tab and follow the import process as shown.<\/div>\n<div><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-8426 alignnone\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/4_gif.gif\" alt=\"\" width=\"706\" height=\"408\" \/><\/div>\n<h3><\/h3>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Configure and Run Fitter<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">First, we need to create a new tire model. For this, simply navigate back to the <span style=\"font-style: italic;\">Tyre Model <\/span>tab and click <span style=\"font-style: italic;\">New Model,<\/span> choose a file to save to and then you should see the following default model.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-8426 alignnone\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/5_image-1024x592.jpg\" alt=\"\" width=\"706\" height=\"408\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We can navigate to the <span style=\"font-style: italic;\">Tyre Analysis<\/span> tab and see how well this model fits the data. Spoiler alert: it doesn&#8217;t which makes sense, as we haven&#8217;t fitted it yet.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-8429 \" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/6_image-1024x592.jpg\" alt=\"\" width=\"706\" height=\"408\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Next, we have to configure the fit-modes. A fit-mode in this context is the equation we are going to fit. As explained earlier, different equations require different data to be fitted. For example, fitting <span style=\"font-family: monospace;\">Fx0<\/span> requires data with no slip angle (pure longitudinal slip). In any case, you should always fit the modes <span style=\"font-family: monospace;\">Fx0<\/span> and <span style=\"font-family: monospace;\">Fy0<\/span> first. So let&#8217;s do that. Navigating back to the <span style=\"font-style: italic;\">Tyre Model<\/span> tab, we can adjust the fit-modes and start fitting.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-8429 \" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/7_gif.gif\" alt=\"\" width=\"706\" height=\"408\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">When I noticed that the objective function was decreasing very slowly, I canceled the process. You don&#8217;t lose the current state of <span style=\"font-family: monospace;\">fmincon<\/span> though, and the last iteration is saved. Note that I also canceled before <span style=\"font-family: monospace;\">Fy0<\/span> was fitted, so only <span style=\"font-family: monospace;\">Fx0<\/span> should have been improved. We can now look at the fitted values and append them to our model.<\/div>\n<div><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-8429 \" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/8_gif.gif\" alt=\"\" width=\"706\" height=\"408\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In case you don&#8217;t trust the fitted values, you could also manually transfer them by typing into the value field.<\/div>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Verify Model-Data-Fit<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Let us navigate again to the <span style=\"font-style: italic;\">Tyre Analysis<\/span> tab and plot a few steady-state conditions to verify the model fit.<\/div>\n<div><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/9_gif.gif\" width=\"704\" height=\"408\" \/><\/div>\n<div><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The fit is not perfect, but satisfactory. Notice that we have not fitted <span style=\"font-family: monospace;\">Fy0<\/span>, <span style=\"font-family: monospace;\">Fx<\/span> and <span style=\"font-family: monospace;\">Fy<\/span> yet, so we should expect bad results for those modes.<\/div>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Tuning the Model Manually<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In case you want to play around with the model and quickly see the results, I suggest changing the window layout and using the <span style=\"font-style: italic;\">Auto-Refresh<\/span> option of the plot. This is a great way to understand the meaning and effects of the model parameters. It is also a necessary step if your goal is a perfect fit. The fitter is good, but not perfect.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/10_gif.gif\" width=\"707\" height=\"410\" \/><\/div>\n<h3 style=\"margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: bold; text-align: left;\">Export Fitted Tire Model<\/h3>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">You can now either export the model as a TIR-file which is both great for saving and re-importing the model to the Magic Formula Tire tool, but also the interface to many commercial tools in the market (ADAMS, Siemens NX, Simulink, etc). The exported file will look something like this<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">&#8230;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">[LONGITUDINAL_COEFFICIENTS]<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PCX1 = 1.6 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PDX1 = 1.2 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PDX2 = -0.18232 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PDX3 = 15 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PEX1 = -5.6295e-09 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PEX2 = 0.24361 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PEX3 = 0 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">PEX4 = 0 <\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">&#8230;<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Alternatively, you can choose to export as MAT, which will then convert the tire model parameters to a struct and save it to the MAT file. This export makes sense if you need to use the Magic Formula Tire model within MATLAB, using the <span style=\"font-family: monospace;\">mftyre.v62.eval<\/span> function from the <a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-library\">library<\/a> for example.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Note that currently it is not possible to import the MAT file into the tool, so always keep the TIR-file saved apart from the MAT export.<\/div>\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Results and conclusion<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We have now fitted our Magic Formula Tire model to real data from the FSAE TTC. The whole process took less than 5 minutes, although we have skipped some steps for demonstration purposes. As mentioned before, you can either use the TIR-file for third-party simulations or use the exported struct in MATLAB directly. If you want to use the Magic Formula Tire<a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-library\"> MATLAB library<\/a>, use the following syntax.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #bfbfbf;\"><span style=\"white-space: pre;\">[Fx,Fy] = mftyre.v62.eval(p,slipangl,longslip,inclangl,inflpres,FZW,tyreSide)<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Where <span style=\"font-family: monospace;\">p<\/span> is the exported parameter struct. In my experience, this evaluation function has proven to be very fast in execution with little overhead. Since it was created for use in real-time control and estimation algorithms in mind, this was a necessary condition.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">However, the equations are currently not complete. They don&#8217;t calculate the moments <span style=\"font-family: monospace;\">Mz0<\/span>, <span style=\"font-family: monospace;\">Mz<\/span>, <span style=\"font-family: monospace;\">Mx<\/span> and <span style=\"font-family: monospace;\">My<\/span> for example. Also, the turn slip has been neglected. As a great alternative, you can also use the popular <a href=\"https:\/\/mathworks.com\/matlabcentral\/fileexchange\/63618-mfeval\">mfeval<\/a> project created by <a href=\"https:\/\/www.linkedin.com\/in\/marco-furlan-tassara-07b2a989\/\">Marco Furlan<\/a> to evaluate the exported TIR-file. Just keep in mind that the GUI also doesn&#8217;t fit the modes mentioned.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #bfbfbf;\"><span style=\"white-space: pre;\">output = mfeval(TIRfile, inputs, useMode);<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I hope that this tool can benefit some students in Formula Student to finally create a detailed tire model themselves!<\/div>\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Future scope<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The Magic Formula Tire Tool seems to be working great already I have been told by a few beta-testers. But there are still some features planned for the near future.<\/div>\n<ul style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Compatibility with older versions of Magic Formula Tire<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">More Analysis options (e.g. Kamm-Circle)<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Quality-of-Life improvements (usability)<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Weighting functions for Fitter (putting more weight on lower loads for example)<\/li>\n<\/ul>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">If you want to be kept in the loop, consider <span style=\"font-style: italic;\">starring<\/span> my <a href=\"https:\/\/github.com\/teasit\/mftyre-matlab-tool\">GitHub repository<\/a> or rating my tool on <a href=\"https:\/\/mathworks.com\/matlabcentral\/fileexchange\/111375-mftyretool\">FileExchange<\/a>. Both will keep me motivated to add features to the tool. In case you want to contribute yourself, please feel free to do so. Get in touch with me and we will find a way to collaborate!<\/div>\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Acknowledgments<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This project would not have been possible without the data provided by the <a href=\"https:\/\/www.millikenresearch.com\/fsaettc.html\">Formula SAE Tire Test Consortium (FSAE TTC)<\/a> and the <a href=\"https:\/\/calspan.com\/automotive\/fsae-ttc\">Calspan Tire Testing Research Facility (TIRF)<\/a>. De-identified and obscured test data has been used in examples and images or recordings of the application, to conform to the <a href=\"https:\/\/www.millikenresearch.com\/FSAE_TTC_agreement.pdf\">license agreement<\/a>. Special thanks to Dr. Edward M. Kasprzak for granting me permission to provide the user, de-identified and obscured data for demonstration purposes.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I also want to acknowledge <a href=\"https:\/\/www.linkedin.com\/in\/marco-furlan-tassara-07b2a989\/\">Marco Furlan<\/a> with whom I had an enjoyable exchange on LinkedIn. He developed the mentioned <a href=\"https:\/\/mathworks.com\/matlabcentral\/fileexchange\/63618-mfeval\">mfeval<\/a> toolbox, which is still the definitive open-source MATLAB implementation of Magic Formula Tire on the market. His project helped me get started with Magic Formula Tire almost three years back and was greatly appreciated.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Lastly, I want to acknowledge the previously reference blog post by MathWorks staff called <a href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2018\/08\/01\/analyzing-tire-data\/\">Analyzing Tire Test Data<\/a> from which I learned the genius way of using the MATLAB function <span style=\"font-family: monospace;\">histcounts<\/span> to automatically separate time series data into steady-states. Their technique has been used to develop the measurement import parsers.<\/div>\n<\/div>\n<p><script type=\"text\/javascript\">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script><a href=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/06\/JUne7.mlx\"><button class=\"btn btn-sm btn_color_blue pull-right add_margin_10\">Download Live Script<\/button><\/a><div class=\"pull-right\"><div class=\"col-xs-12 containing-block\"><a href=\"#\" class=\"btn btn-sm btn_color_blue add_margin_20  hidden-xs try_live_editor_example\" data-liveeditorexample=\"{\n  &quot;repository&quot; : &quot;Blogs&quot;,\n  &quot;id&quot; : &quot;\/student-lounge\/files\/2022\/06\/JUne7.mlx&quot;\n}\"><span class=\"icon-edit icon_16\"><\/span>Run in your browser<span style=\"color:grey\" class=\"series\"><\/span><\/a><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2022\/08\/0_introduction_gif.gif\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div>\n<p>\nFor today&#8217;s blog post, Veer Alakshendra is happy to host Tom Teasdale from the UPBracing Formula Student team. Tom is here to discuss about the tool that he has developed for tire&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2022\/06\/07\/mf-tyre\/\">read more >><\/a><\/p>\n","protected":false},"author":183,"featured_media":8411,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[30],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/7964"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/users\/183"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/comments?post=7964"}],"version-history":[{"count":19,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/7964\/revisions"}],"predecessor-version":[{"id":11897,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/7964\/revisions\/11897"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media\/8411"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media?parent=7964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/categories?post=7964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/tags?post=7964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}