fit
Class: tireModel
Optimize model parameter values to achieve model best fit to the input data
Since R2023b
Syntax
Description
This method requires Extended Tire Features for Vehicle Dynamics Blockset and Optimization Toolbox™.
[
fits a tire model with additional options specified by one or more
fitObj
,diffTable
,errorStat
,optimOutput
,H
]=fit(obj
,data
,fitType
,Name=Value
)Name=Value
arguments.
Input Arguments
obj
— Tire model to fit
tireModel
object
Tire model to fit, specified as a tireModel
object.
data
— Tire data
array of tireData
objects
Tire data, specified as an array of tireData
objects.
fitType
— Fit type
"Fx Pure"
| "Fy Pure"
| "Fx Combined"
| "Fy Combined"
| "Mz Pure"
| "Mz Combined"
| "Mx"
| "My"
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 type | Response Fitted | Dependency | Data Expected |
---|---|---|---|
| Longitudinal Force | None | Longitudinal slip sweep at zero degrees slip angle |
| Lateral Force | None | Slip angle sweep at free rolling |
| Combined Longitudinal Force |
| Longitudinal slip sweep at non zero degrees slip angle |
| Combined Lateral Force |
| Longitudinal slip sweep at non zero degrees slip angle |
| Aligning Torque |
| Slip angle sweep at free rolling |
| Combined Aligning Torque |
| Longitudinal slip sweep at non zero degrees slip angle |
| Overturning Moment | All applicable Fy fits | Slip angle sweep at free rolling |
| 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)
Parameters
— Model parameters to optimize
string vector
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
FixedParameters
— Fixed parameters
string vector
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
LowerBounds
— Lower bounds of parameter optimization limit
column vector
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
UpperBounds
— Upper bounds of parameter optimization limit
column vector
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
Weight
— Weighting scheme
1-D cell array
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
— Solver
"fmincon"
(default) | "fminunc"
| "fsolve"
| "lsqnonlin"
Solver, specified as one of these values:
"fmincon"
"fminunc"
"fsolve"
"lsqnonlin"
Example: Solver="fsolve"
Data Types: string
optimoptions
— Optimization options
output of optimoptions
Optimization options, specified as the output of optimoptions
.
Use this table to find the link to the options table for each solver.
Solver | Link to Options Table |
---|---|
fmincon | options (Optimization Toolbox) |
fminunc | options (Optimization Toolbox) |
fsolve | options (Optimization Toolbox) |
lsqnonlin | options (Optimization Toolbox) |
PlotFit
— Option to plot model fit
false
(default) | true
Option to plot model fit, specified as false
or
true
.
Example: PlotFit=true
Data Types: logical
Output Arguments
fitObj
— Fitted model
tireModel
object
Fitted model, returned as a tireModel
object.
Note
Only parameters specified in the Parameters
argument or
parameters selected by default have revised values.
diffTable
— Table of revised parameters
table object
Table of revised parameters, returned as a table object, with a row for each value changed.
errorStat
— Error statistics of model fit
structure
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.
optimOutput
— Information about optimization process
structure
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.
Solver | Link to Structure Fields |
---|---|
fmincon | output (Optimization Toolbox) |
fminunc | output (Optimization Toolbox) |
fsolve | output (Optimization Toolbox) |
lsqnonlin | output (Optimization Toolbox) |
H
— Handle to axes
object handle
Handle to axes, returned as an object handle.
Version History
Introduced in R2023b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)