Main Content

fit

Class: tireModel

Optimize model parameter values to achieve model best fit to the input data

Since R2023b

Description

This method requires Extended Tire Features for Vehicle Dynamics Blockset and Optimization Toolbox™.

[fitObj,diffTable,errorStat,optimOutput,H]=fit(obj,data,fitType) fits a tire model specified by obj with the data specified by data using the model fit type specified by fitType.

[fitObj,diffTable,errorStat,optimOutput,H]=fit(obj,data,fitType,Name=Value) fits a tire model with additional options specified by one or more Name=Value arguments.

Input Arguments

expand all

Tire model to fit, specified as a tireModel object.

Example: fit(tm,td,"Limits") specifies the tire model tm to fit.

Tire data, specified as an array of tireData objects.

Example: fit(tm,td,"Limits") specifies the tire data td to use for fitting.

Fit type, specified as one of the values listed in this table.

Note

The order in which parameters are fit is important. If you fit a set of parameters that have a dependency to another parameter set, do not refit the upstream parameter set without refitting the parameter set with the dependency. Refer to the table for dependencies between parameters.

Fit typeDescriptionDependencyRecommended Data

Dimensions

Revises these tireModel object parameters with values calculated from the specified tireData object parameters:

fitObj.UNLOADED_RADIUS = data.OverallDiameter / 2

fitObj.WIDTH = data.SectionWidth / 1000

fitObj.ASPECT_RATIO = data.AspectRatio / 100

fitObj.RIM_RADIUS = data.RimDiameter / 2 * 0.0254

fitObj.RIM_WIDTH = data.RimWidth * 0.0254

These optional input arguments are ignored when you specify Dimensions:

Not applicableNot applicable

Limits

Sets model saturation limits to the maximum and minimum values from the tireData object data channel values. For example, model saturation limits for slip angle will be set to the minimum and maximum slip angle values from the specified tireData object.

These optional input arguments are ignored when you specify Limits:

  • Weight

  • Solver

  • optimoptions

  • PlotFit

Not applicableNot applicable

Fx Pure

Fit longitudinal force response

Dimension

Longitudinal slip sweep at zero degrees slip angle

Fy Pure

Fit lateral force response

Dimension

Slip angle sweep at free rolling

Fx Combined

Fit combined longitudinal force response

Fx Pure

Fy Pure

Longitudinal slip sweep at non zero degrees slip angle

Fy Combined

Fit combined lateral force response

Fx Pure

Fy Pure

Longitudinal slip sweep at non zero degrees slip angle

Mz Pure

Fit aligning torque response

Fy Pure

Slip angle sweep at free rolling

Mz Combined

Fit combined aligning torque response

Fx Combined

Fy Combined

Mz Pure

Longitudinal slip sweep at non zero degrees slip angle

Mx

Fit overturning moment response

All applicable Fy fits

Slip angle sweep at free rolling

My

Fit rolling resistance response

All applicable Fx fits

Longitudinal slip

RL

Fit loaded radius response

All applicable Fx and Fy fits

Sweep varying normal loads at a constant velocity, or sweep varying velocities at a constant normal load.

Re

Fit effective rolling radius response

RL

Sweep varying normal loads at a constant velocity, or sweep varying velocities at a constant normal load.

Fx Relaxation Length

Fit longitudinal relaxation length response

None

Calculated relaxation lengths at varying normal loads

Fy Relaxation Length

Fit lateral relaxation length response

None

Calculated relaxation lengths at varying normal loads

Contact Patch Width

Fit contact patch width response

RL

Contact patch width data at varying normal loads

Contact Patch Length

Fit contact patch length

RL

Contact patch length data at varying normal loads

Example: fit(tm,td,"Limits") specifies the fitType as "Limits".

Data Types: char | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: fit(tm,td,"Fy Pure",solver="fminunc",PlotFit=true)

Model parameters to optimize, specified as a string vector.

Note

By default, if the Parameters argument is not specified, the parameters to optimize are determined by the input tire model and fit type.

Example: fit(tm,td,"My",Parameters=["QSY1","QSY3","QSY4","QSY7"])

Data Types: string

Fixed parameters, specified as a string vector.

Note

By default, if the FixedParameters argument is not specified, the parameters to fix are determined by the input tire model and fit type.

Example: fit(tm,td,"Fx Pure",FixedParameters=["PPX1","PPX2","PPX3","PPX4"])

Data Types: string

Lower bounds of the parameter optimization limit, specified as a scalar or a column vector.

Note

If you specify a vector, the length must equal the length of the parameter set being fitted.

Example: fit(tm,td,"Contact Patch Length",LowerBounds=[0.02,0.02],UpperBounds=[0.08,0.08])

Data Types: double

Upper bounds of the parameter optimization limit, specified as a scalar or a column vector.

Note

If you specify a vector, the length must equal the length of the parameter set being fitted.

Example: fit(tm,td,"Contact Patch Length",LowerBounds=[0.02,0.02],UpperBounds=[0.08,0.08])

Data Types: double

Weighting scheme, specified as a 1-D cell array.

Note

The 1-D cell array length must be the same length as the tire data input array. Each cell of the array must be a numeric vector that is the same length as the corresponding tireData object. Elements must be nonnegative.

Example

Create a weighting scheme giving more weight to near-zero slip angle values.

weight=cell(length(td),1);
for i=1:length(td)
    weight{i}=ones(length(td(i).alpha),1);
    weight{i}(abs(td(i).alpha)>0.01)=1;
end
model.fit(tm,td,"Fy Pure", Weight=weight);

Data Types: cell

Solver, specified as one of these values:

  • "fmincon"

  • "fminunc"

  • "fsolve"

  • "lsqnonlin"

Example: Solver="fsolve"

Data Types: string

Optimization options, specified as the output of optimoptions. Use this table to find the link to the options table for each solver.

SolverLink to Options Table
fminconoptions (Optimization Toolbox)
fminuncoptions (Optimization Toolbox)
fsolveoptions (Optimization Toolbox)
lsqnonlinoptions (Optimization Toolbox)

Example: optimoptions="fmincon"

Option to plot model fit, specified as false or true.

Note

Data that is excluded from the model fit optimization as a result of the specified value for Limits is represented in the resulting plot with gray 'x' markers.

Example: PlotFit=true

Data Types: logical

Output Arguments

expand all

Fitted model, returned as a tireModel object.

Note

Only parameters specified in the Parameters argument or parameters selected by default have revised values.

Table of revised parameters, returned as a table object, with a row for each value changed.

Error statistics of the model fit, returned as a structure. The structure contains the error algorithm, the initial error before the fit, and the final error after the fit.

Information about the optimization process, returned as a structure. The returned structure fields depend on the selected solver. This table provides links to the fields returned for each solver.

SolverLink to Structure Fields
fminconoutput (Optimization Toolbox)
fminuncoutput (Optimization Toolbox)
fsolveoutput (Optimization Toolbox)
lsqnonlinoutput (Optimization Toolbox)

Handle to axes, returned as an object handle.

Version History

Introduced in R2023b

expand all