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.
Example: fit(tm,td,"Limits")
specifies the tire model
tm
to fit.
data
— Tire data
array of tireData
objects
Tire data, specified as an array of tireData
objects.
Example: fit(tm,td,"Limits")
specifies the tire data
td
to use for fitting.
fitType
— Fit type
"Limits"
| "Dimensions"
| "Fx Pure"
| "Fy Pure"
| "Fx Combined"
| "Fy Combined"
| ...
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 type | Description | Dependency | Recommended Data |
---|---|---|---|
| Revises these
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
| Not applicable | Not applicable |
| Sets model saturation limits to the maximum and minimum values from
the These optional input arguments are ignored when you
specify
| Not applicable | Not applicable |
| Fit longitudinal force response |
| Longitudinal slip sweep at zero degrees slip angle |
| Fit lateral force response |
| Slip angle sweep at free rolling |
| Fit combined longitudinal force response |
| Longitudinal slip sweep at non zero degrees slip angle |
| Fit combined lateral force response |
| Longitudinal slip sweep at non zero degrees slip angle |
| Fit aligning torque response |
| Slip angle sweep at free rolling |
| Fit combined aligning torque response |
| Longitudinal slip sweep at non zero degrees slip angle |
| Fit overturning moment response | All applicable | Slip angle sweep at free rolling |
| Fit rolling resistance response | All applicable | Longitudinal slip |
| Fit loaded radius response | All applicable | Sweep varying normal loads at a constant velocity, or sweep varying velocities at a constant normal load. |
| Fit effective rolling radius response |
| Sweep varying normal loads at a constant velocity, or sweep varying velocities at a constant normal load. |
| Fit longitudinal relaxation length response | None | Calculated relaxation lengths at varying normal loads |
| Fit lateral relaxation length response | None | Calculated relaxation lengths at varying normal loads |
| Fit contact patch width response |
| Contact patch width data at varying normal loads |
| Fit contact patch length |
| 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)
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.
Example: fit(tm,td,"My",Parameters=["QSY1","QSY3","QSY4","QSY7"])
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.
Example: fit(tm,td,"Fx
Pure",FixedParameters=["PPX1","PPX2","PPX3","PPX4"])
Data Types: string
LowerBounds
— Lower bounds of parameter optimization limit
scalar | column vector
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
UpperBounds
— Upper bounds of parameter optimization limit
scalar | column vector
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
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.
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
— 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) |
Example: optimoptions="fmincon"
PlotFit
— Option to plot model fit
false
(default) | true
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
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 R2023bR2024b: New fitType
options
Starting from R2024b, you can specify fitType
using these new options:
Dimensions
Limits
RL
Re
Fx Relaxation Length
Fy Relaxation Length
Contact Patch Width
Contact Patch Length
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)