主要内容

fit

R2026b

Fit K and C data and return suspension block parameters

Since R2026b

Description

fit(knc,StrgEnByAxl,AntiSwayEnByAxl,SuspType,DrivetrainType) aggregates imported K and C data sets, fits segmented polynomial curves, and generates suspension block parameters. The method also calculates linear gradients within default regression ranges.

example

fit(knc,StrgEnByAxl,AntiSwayEnByAxl,SuspType,DrivetrainType,Name=Value) fits curves with additional options specified by one or more name-value arguments. Use name-value arguments to control fit order, data range, gradient calculation, and regression ranges.

example

Input Arguments

expand all

K and C service object, specified as a vdynsuspension.KnCService handle-class object created using kncSuspension.

Steering enabled by axle, specified as a 1-by-2 logical vector in the format [front, rear]. For example, [1,0] indicates front-steer only.

Data Types: logical

Anti-sway bar enabled by axle, specified as a 1-by-2 logical vector in the format [front, rear]. For example, [1,1] indicates both front and rear anti-sway bars are connected.

Data Types: logical

Suspension type, specified as "Independent front and rear" or "Independent front and twist-beam rear".

Data Types: string

Drivetrain type, specified as "AWD" (all-wheel drive), "FWD" (front-wheel drive), or "RWD" (rear-wheel drive).

Data Types: string

Name-Value Arguments

expand all

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: kncSuspension.fit(FitOrder=1, CalculateGradient=true) specifies a linear fit and calculation of the gradient.

Polynomial order for curve fitting, specified as a positive integer. The default value is 1 (linear fit).

Data Types: int32

Fractional bounds of data range to use for fitting, specified as a 1-by-2 vector with values in the range [0, 1]. The default is [0.3, 0.7], which keeps the middle 40% of the data range.

Data Types: double

Number of fitted output data points, specified as a positive integer.

Data Types: int32

Option to enable linear gradient calculation, specified as true or false. When true, the method calculates linear gradients within the specified regression ranges. Default is true.

Option to remove lateral wheel center displacement offsets, specified as true or false.

Vertical wheel displacement regression range, specified as a 1-by-2 vector, in m.

Data Types: double

Roll angle regression range, specified as a 1-by-2 vector, in deg.

Data Types: double

Steer angle regression range, specified as a 1-by-2 vector, in deg.

Data Types: double

Longitudinal wheel force regression range, specified as a 1-by-2 vector, in kN.

Data Types: double

Lateral wheel force regression range, specified as a 1-by-2 vector, in kN.

Data Types: double

Aligning wheel torque regression range, specified as a 1-by-2 vector, in kNm.

Data Types: double

Examples

expand all

After importing K and C data, fit the data for an AWD vehicle with independent front and rear suspension, front steering, and both anti-sway bars connected.

knc = kncSuspension;
knc.import("bounceData.mat", TestType="bounce", FrontAntiRollBar=true, RearAntiRollBar=true);
knc.import("rollData.mat", TestType="roll", FrontAntiRollBar=true, RearAntiRollBar=true);
knc.fit([1,0], [1,1], "Independent front and rear", "AWD")

Fit K and C data with custom regression ranges for wheel displacement and roll angle.

knc.fit([1,0], [1,1], "Independent front and rear", "AWD", ...
    FitOrder=1, FitLimits=[0.3, 0.7], FitNumPt=10, ...
    WheelZDisplacementRange=[-0.02, 0.02], ...
    RollAngleRange=[-1, 1])

Version History

Introduced in R2026b