Fit a Tire Model to Tire Data and Export Parameter Set
Use the fit
method to fit tire model parameters to tire data. The fit
method optimizes parameter values of a tire model to match the tire model response to the target tire data as closely as possible.
Use the export
method to write tire model parameters to a tire property file (TIR) or MATLAB file (MAT). The exported file can be imported into these blocks for use in a Simulink® model simulation.
First, import tire data. Next, choose a model as the seed for fitting a new tire model parameter set. You can import an existing tire model or create a new tire model from default parameters for the seed model. Then, fit tire model parameter sets using these fit types. Finally, export the optimized model parameter set.
Fx Pure
Fy Pure
Fx Combined
Fy Combined
Mz Pure
Mz Combined
Mx
My
Pure fit types refer to simple slip in the lateral or longitudinal direction. Combined fit types refer to combined slip in both the lateral and longitudinal direction. The order of fitting is important because some sets of parameters depend on other sets. The previous list reflects the recommended order for fitting. For more information, see fitType.
A tire model has a set of parameters for each response output. The fitType
argument value indicates the response to fit. The fit method optimizes the set of parameters for that response to reduce the error between the tire data and the model output.
This example requires the Extended Tire Features for Vehicle Dynamics Blockset™ support package. See Install Support Package.
Note that using a built-in tire model as a seed model is not supported.
Import Tire Data
Build a string array from the TYDEX filenames that contain the tire data.
tirepath = pwd; tydexdir = dir(fullfile(tirepath,"data_tydex_files","*.tdx")); tydexstr = join([{tydexdir.folder}',{tydexdir.name}'],filesep);
Import the tire data into an array of tireData
objects from the files specified in the string array tydexstr
. The length of the tireData
objects array is the same length as the input string array. Data from each file is stored in a tireData
object. For more information on tire data permitted, see Example Tire Data.
td = tireData(tydexstr);
Use the mean
function to preprocess the Fz
data channel to remove noise and variation.
td = mean(td, "Fz");
Create a tireModel Object
Create a Magic Formula 6.2 tire model type with default parameters to use as the seed model. Set the dimensional properties of the tire, the nominal test conditions, and the model limits to match the test data supplied to fit the model.
tm = tireModel.new("MF"); % Name the new model tm.Name = "New Fitted Model"; % Dimensional properties tm.TireSize = "245/45R18"; tm.UNLOADED_RADIUS = 0.33454; tm.WIDTH = 0.235; tm.ASPECT_RATIO = 0.45; tm.RIM_RADIUS = 0.2286; tm.RIM_WIDTH = 0.2032; % Nominal conditions tm.INFLPRES = 262000; tm.NOMPRES = 262000; tm.FNOMIN = 4300; % Model limits. % Note: in this example, % the model limits are set by the limits of the test data tm.PRESMIN = min(vertcat(td.IP)); tm.PRESMAX = max(vertcat(td.IP)); tm.FZMAX = max(vertcat(td.Fz)); tm.KPUMIN = min(vertcat(td.kappa)); tm.KPUMAX = max(vertcat(td.kappa)); tm.ALPMIN = min(vertcat(td.alpha)); tm.ALPMAX = max(vertcat(td.alpha)); tm.CAMMIN = min(vertcat(td.gamma)); tm.CAMMAX = max(vertcat(td.gamma));
Fit Different Parameter Sets
Follow these steps to fit different tire model parameter sets.
Note that this section provides steps for only some of the available parameter sets. You can use these steps to fit all of the available parameter options.
Fit Pure Fx
Parameters
Extract the longitudinal data from the tire data.
longitudinal_data = td([td.TestMethod] == "Longitudinal");
Using the fit
function, set the fitType
argument to "Fx Pure"
, and set the PlotFit
argument to true
to plot the result.
For additional information available for a fit, see Output Arguments.
[tm, diffTable] = tm.fit(longitudinal_data,"Fx Pure",PlotFit=true);
Local minimum possible. Constraints satisfied. fmincon stopped because the size of the current step is less than the value of the step size tolerance and constraints are satisfied to within the value of the constraint tolerance.
View the diffTable
variable to inspect which variables were optimized.
diffTable
diffTable=19×8 table
Parameter Initial Value Final Value Difference % Difference Lower Bounds Upper Bounds Parameter Description
_________ _____________ ___________ ___________ ____________ ____________ ____________ _______________________________________________________________________
"PCX1" 1.579 1.5138 -0.065167 -4.1 -Inf Inf "Shape factor Cfx for longitudinal force"
"PDX1" 1.0422 1.1786 0.13637 13.1 -Inf Inf "Longitudinal friction Mux at Fznom"
"PDX2" -0.08285 -0.040475 0.042375 -51.1 -Inf Inf "Variation of friction Mux with load"
"PDX3" 0 0.070744 0.070744 Inf -Inf Inf "Variation of friction Mux with camber"
"PEX1" 0.11113 0.33671 0.22558 203 -Inf Inf "Longitudinal curvature Efx at Fznom"
"PEX2" 0.3143 -0.49929 -0.81359 -258.9 -Inf Inf "Variation of curvature Efx with load"
"PEX3" 0 0.16845 0.16845 Inf -Inf Inf "Variation of curvature Efx with load squared"
"PEX4" 0.001719 -0.098788 -0.10051 -5846.8 -Inf Inf "Factor in curvature Efx while driving"
"PKX1" 21.687 46.607 24.92 114.9 -Inf Inf "Longitudinal slip stiffness Kfx/Fz at Fznom"
"PKX2" 13.728 0.001589 -13.726 -100 -Inf Inf "Variation of slip stiffness Kfx/Fz with load"
"PKX3" -0.4098 0.10053 0.51033 -124.5 -Inf Inf "Exponent in slip stiffness Kfx/Fz with load"
"PHX1" 0.00021615 -0.00098607 -0.0012022 -556.2 -Inf Inf "Horizontal shift Shx at Fznom"
"PHX2" 0.0011598 0.00048149 -0.00067831 -58.5 -Inf Inf "Variation of shift Shx with load"
"PVX1" 2.0283e-05 0.049022 0.049002 2.4159e+05 -Inf Inf "Vertical shift Svx/Fz at Fznom"
"PVX2" 0.00010568 -0.0070435 -0.0071492 -6764.9 -Inf Inf "Variation of shift Svx/Fz with load"
"PPX1" -0.3485 -0.3485 0 0 -Inf Inf "Linear influence of inflation pressure on longitudinal slip stiffness"
⋮
Fit Pure Fy
Parameters
Extract the lateral data from the tire data.
lateral_data = td([td.TestMethod] == "Lateral");
Using the fit
function, set the fitType
argument to "Fy Pure"
, and set the PlotFit
argument to true
to plot the result.
For additional information available for a fit, see Output Arguments.
[tm, diffTable] = tm.fit(lateral_data,"Fy Pure",PlotFit=true);
Local minimum possible. Constraints satisfied. fmincon stopped because the size of the current step is less than the value of the step size tolerance and constraints are satisfied to within the value of the constraint tolerance.
View the diffTable
variable to inspect which variables were optimized.
diffTable
diffTable=27×8 table
Parameter Initial Value Final Value Difference % Difference Lower Bounds Upper Bounds Parameter Description
_________ _____________ ___________ __________ ____________ ____________ ____________ ________________________________________________
"PCY1" 1.338 1.4671 0.12914 9.7 -Inf Inf "Shape factor Cfy for lateral forces"
"PDY1" 0.8785 1.086 0.20754 23.6 -Inf Inf "Lateral friction Muy"
"PDY2" -0.06452 -0.12512 -0.060597 93.9 -Inf Inf "Variation of friction Muy with load"
"PDY3" 0 1.8342 1.8342 Inf -Inf Inf "Variation of friction Muy with squared camber"
"PEY1" -0.8057 -1.2618 -0.45608 56.6 -Inf Inf "Lateral curvature Efy at Fznom"
"PEY2" -0.6046 -1.6084 -1.0038 166 -Inf Inf "Variation of curvature Efy with load"
"PEY3" 0.09854 0.039894 -0.058646 -59.5 -Inf Inf "Zero order camber dependency of curvature Efy"
"PEY4" -6.697 -9.1311 -2.4341 36.3 -Inf Inf "Variation of curvature Efy with camber"
"PEY5" 0 38.093 38.093 Inf -Inf Inf "Variation of curvature Efy with camber squared"
"PKY1" -15.324 -34.639 -19.315 126 -Inf Inf "Maximum value of stiffness Kfy/Fznom"
"PKY2" 1.715 1.946 0.23099 13.5 -Inf Inf "Load at which Kfy reaches maximum value"
"PKY3" 0.3695 1.2713 0.9018 244.1 -Inf Inf "Variation of Kfy/Fznom with camber"
"PKY4" 2.0005 1.5173 -0.4832 -24.2 -Inf Inf "Curvature of stiffness Kfy"
"PKY5" 0 -27.421 -27.421 -Inf -Inf Inf "Peak stiffness variation with camber squared"
"PKY6" -0.8987 -1.1744 -0.27568 30.7 -Inf Inf "Fy camber stiffness factor"
"PKY7" -0.23303 -0.54352 -0.31049 133.2 -Inf Inf "Vertical load dependency of camber stiffness"
⋮
Fit Combined Fx
Parameters
Extract the combined data from the tire data.
combined_data = td([td.TestMethod] == "Combined");
Using the fit
function, set the fitType
argument to "Fx Combined"
, and set the PlotFit
argument to true
to plot the result.
For additional information available for a fit, see Output Arguments.
[tm, diffTable] = tm.fit(combined_data,"Fx Combined",PlotFit=true);
Local minimum possible. Constraints satisfied. fmincon stopped because the size of the current step is less than the value of the step size tolerance and constraints are satisfied to within the value of the constraint tolerance.
View the diffTable
variable to inspect which variables were optimized.
diffTable
diffTable=7×8 table
Parameter Initial Value Final Value Difference % Difference Lower Bounds Upper Bounds Parameter Description
_________ _____________ ___________ __________ ____________ ____________ ____________ __________________________________________________
"RBX1" 13.046 26.396 13.35 102.3 -Inf Inf "Slope factor for combined slip Fx reduction"
"RBX2" 9.718 24.341 14.623 150.5 -Inf Inf "Variation of slope Fx reduction with kappa"
"RBX3" 0 237.53 237.53 Inf -Inf Inf "Influence of camber on stiffness for Fx combined"
"RCX1" 0.9995 1.0661 0.066595 6.7 -Inf Inf "Shape factor for combined slip Fx reduction"
"REX1" -0.4403 0.14934 0.58964 -133.9 -Inf Inf "Curvature factor of combined Fx"
"REX2" -0.4663 -0.021369 0.44493 -95.4 -Inf Inf "Curvature factor of combined Fx with load"
"RHX1" -9.968e-05 0.002952 0.0030516 -3061.4 -Inf Inf "Shift factor for combined slip Fx reduction"
Fit Mx
Parameters
Using the fit
function, set the fitType
argument to "Mx"
, use the combined
data, and set the PlotFit
argument to true
to plot the result.
For additional information available for a fit, see Output Arguments.
[tm, diffTable] = tm.fit(lateral_data,"Mx",PlotFit=true);
Solver stopped prematurely. fmincon stopped because it exceeded the function evaluation limit, options.MaxFunctionEvaluations = 9.000000e+03.
View the diffTable
variable to inspect which variables were optimized.
diffTable
diffTable=11×8 table
Parameter Initial Value Final Value Difference % Difference Lower Bounds Upper Bounds Parameter Description
_________ _____________ ___________ __________ ____________ ____________ ____________ _________________________________________________
"QSX1" -0.007764 -0.00025648 0.0075075 -96.7 -Inf Inf "Vertical shift of overturning moment"
"QSX2" 1.1915 63.099 61.908 5195.8 -Inf Inf "Camber induced overturning couple"
"QSX3" 0.013948 -0.003995 -0.017943 -128.6 -Inf Inf "Fy induced overturning couple"
"QSX4" 4.912 8.2812 3.3692 68.6 -Inf Inf "Mixed load lateral force and camber on Mx"
"QSX5" 1.02 2.3311 1.3111 128.5 -Inf Inf "Load effect on Mx with lateral force and camber"
"QSX6" 22.83 431.51 408.68 1790.1 -Inf Inf "B-factor of load with Mx"
"QSX7" 0.7104 -10.635 -11.346 -1597.1 -Inf Inf "Camber with load on Mx"
"QSX8" -0.023393 0.0015782 0.024971 -106.7 -Inf Inf "Lateral force with load on Mx"
"QSX9" 0.6581 65.578 64.92 9864.8 -Inf Inf "B-factor of lateral force with load on Mx"
"QSX10" 0.2824 50.486 50.204 17778 -Inf Inf "Vertical force with camber on Mx"
"QSX11" 5.349 0.0088587 -5.3401 -99.8 -Inf Inf "B-factor of vertical force with camber on Mx"
Continue Fitting Parameter Sets
Use the steps established in the preceding sections to continue fitting the model using the remaining fit types.
Plot Fitted Tire Model Response
After fitting all available fit types, use the plot
method to plot the results and compare to the original default model.
plot([tireModel.new("MF"),tm],"Data",td);
Export Tire Model Parameters
Use the export
method to write the tire model parameters from the tireModel
object TM
to a TIR file.
export(tm,"example.tir", overwrite=true);
Update Mask Values from Exported Data
Use the exported tire model parameters in the Combined Slip Wheel 2DOF block from the Vehicle Dynamics Blockset library.
Double-click on the Combined Slip Wheel 2DOF block.
For Tire type, select External file
.
On the Wheel and Tire Parameters tab, select the exported file and click Update mask values from file.