Plot Tire Model Response with Imported Tire Data for Visual Inspection
Use the tireModel
and tireData
classes and supporting methods to import tire data to plot the response of a tire model or calculate and plot a tire response.
First, create a tireModel
object using the tireModel.builtin
method. This example uses the built-in "Mid-size passenger car 235/45R18"
model. Next, import the tire data from Tyre Data Exchange Format (TYDEX) v1.3 files. Then, specify arguments in the plot
method to compare the tire model response versus the imported tire data. Finally, use the compute
method calculate a tire response and plot the original tire data versus the calculated response to inspect the difference.
This example requires the Extended Tire Features for Vehicle Dynamics Blockset™ support package. See Install Support Package.
Note that all built-in models are Magic Formula 6.2 tire type models.
Create Tire Model from Built-In Model
Create the tireModel object tm
from the built-in model "Mid-size passenger car 235/45R18"
.
tm = tireModel.builtin("Mid-size passenger car 235/45R18");
Display the result using disp
.
Import Tire Data
Build a string array of the TYDEX filenames.
tirepath = pwd; tydexdir = dir(fullfile(tirepath,"data_tydex_files","*.tdx")); tydexstr = join([{tydexdir.folder}',{tydexdir.name}'],filesep);
Import the data and create an array of tireData
objects, td
.
td = tireData(tydexstr);
Use the mean
function to preprocess the Fz
data channel to remove noise and variation.
td = mean(td, "Fz");
Autoplot Tire Data
Specifying the input argument Data, plot the array of tire data objects overlaid with the tire model. Generic plots automatically generate providing a fast way to observe how a model behaves compared to the tire data for a variety of sweep directions and data channels.
plot(tm,"Data",td);
Plot Imported Data Overlaid with Simulated Model Response
Specifying the input arguments Data
, DataVariableNames, and ColorBy, plot the longitudinal force versus longitudinal slip of the tire model overlaid with the tire data. Use the normal force to assign legend colors and values.
plot(tm,"Data",td(1:8),"DataVariableNames",["kappa","Fx"],"ColorBy","Fz");
Simulate Tire Model Response
Specify the input argument Model to simulate the model response at the plotted data conditions.
plot(td,"Model",tm);
Compare Tire Data and Tire Model Response Defining Additional Operating Conditions
Specifying the input arguments DataVariableNames
, ColorBy
, FilterBy, FilterByValues, and Model
plot the longitudinal force versus lateral force of the tire data overlaid with the tire model response. Use the slip angle to assign colors and legend values to the plot. Filter by the combined data and inclination angle values of -0.2
and 0.2
.
plot(td,"DataVariableNames",["Fy","Fx"],"ColorBy","alpha", ... "FilterBy",["TestMethod","gamma"], ... "FilterByValues",{"Combined",[-0.02 0.02]},"Model",tm);
Calculate Tire Response Using Tire Model Parameters
Use the compute
method to calculate the tire response from the tire model tm
using the data in td
. A tireData
object, td_response
, is returned with the simulated data.
Note that if a data channel is empty when executing the model solver, the data channel will be estimated or assigned to the model nominal condition.
td_response = compute(tm,td(1));
Plot Tire Data
Use the plot
method to visually inspect the difference between the original data and simulated data.
td(1).Comments = "Original Data"; td_response.Comments = "Simulated Data"; plot([td(1),td_response],"DataVariableName",["kappa","Fx"], ... "ColorBy","Comments","MarkerSize",15)