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.

Tire data, specified as an array of tireData objects.

Fit type, specified as one of these values:

  • "Fx Pure"

  • "Fy Pure"

  • "Fx Combined"

  • "Fy Combined"

  • "Mz Pure"

  • "Mz Combined"

  • "Mx"

  • "My"

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 typeResponse FittedDependencyData Expected

Fx Pure

Longitudinal Force

None

Longitudinal slip sweep at zero degrees slip angle

Fy Pure

Lateral Force

None

Slip angle sweep at free rolling

Fx Combined

Combined Longitudinal Force

Fx Pure

Fy Pure

Longitudinal slip sweep at non zero degrees slip angle

Fy Combined

Combined Lateral Force

Fx Pure

Fy Pure

Longitudinal slip sweep at non zero degrees slip angle

Mz Pure

Aligning Torque

Fy Pure

Slip angle sweep at free rolling

Mz Combined

Combined Aligning Torque

Fx Combined

Fy Combined

Mz Pure

Longitudinal slip sweep at non zero degrees slip angle

Mx

Overturning Moment

All applicable Fy fits

Slip angle sweep at free rolling

My

Rolling Resistance

All applicable Fx fits

Longitudinal slip

Data Types: 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, lateral_data, "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.

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.

Data Types: string

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

Note

The vector length must equal the length of the parameter set being fitted.

Data Types: double

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

Note

The vector length must equal the length of the parameter set being fitted.

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.

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)

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

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