suboptimumg.vehicle.vehicle_models#

class suboptimumg.vehicle.vehicle_models.AlignmentModel[source]#

Bases: BaseModel

Fields#

Field

Type

Required

Default

camber_front_deg

float

Yes

camber_rear_deg

float

Yes

toe_front_deg

float

Yes

toe_rear_deg

float

Yes

Parameters:
  • camber_front_deg (float)

  • camber_rear_deg (float)

  • toe_front_deg (float)

  • toe_rear_deg (float)

camber_front_deg: float#
camber_rear_deg: float#
toe_front_deg: float#
toe_rear_deg: float#
class suboptimumg.vehicle.vehicle_models.ExtendedVehicleModel[source]#

Bases: VehicleModel

VehicleModel extended with real-world session setup parameters.

Set type: irl_setup in the YAML to trigger this model. Includes alignment, steering ackermann, and suspension setup fields on top of the base car parameters.

Fields#

Field

Type

Required

Default

Constraints

accum

AccumulatorModel

Yes

aero

AeroModel

Yes

alignment

AlignmentModel

Yes

cg_h

float

Yes

gt=0

chass

ChassisModel | None

No

None

dri

DriverInterfaceModel

Yes

front_track

float

Yes

gt=0

mass

float

Yes

gt=0

pwrtn

PowertrainModel

Yes

rear_track

float

Yes

gt=0

rolling_coeff

float

Yes

ge=0

steering_setup

SteeringSetupModel

Yes

sus

SimpleSuspensionModel | ComplexSuspensionModel

Yes

suspension_setup

SuspensionSetupModel

Yes

tires

TireModel

Yes

type

Literal[‘irl_setup’]

No

'irl_setup'

w_distr_b

float

Yes

gt=0, lt=1

wb

float

Yes

gt=0

Validators#

Validator

Mode

Fields

validate_rolling_coeff

after

rolling_coeff

Parameters:
alignment: AlignmentModel#
steering_setup: SteeringSetupModel#
suspension_setup: SuspensionSetupModel#
type: Literal['irl_setup']#
class suboptimumg.vehicle.vehicle_models.FittedCurve(data, poly_order)[source]#

Bases: object

Polynomial fit of tabulated [x, y] data with Horner evaluation.

Parameters:
  • data (list of [x, y] pairs) – Raw tabulated input data.

  • poly_order (int) – Polynomial degree for the least-squares fit.

x_raw, y_raw

Original input arrays.

Type:

np.ndarray

poly_order#
Type:

int

coeffs#

Polynomial coefficients in descending degree order [c_n, c_{n-1}, ..., c_1, c_0], matching np.polyfit output and the order Horner’s method consumes directly.

Type:

np.ndarray

evaluate(x)[source]#

Evaluate the fitted polynomial via Horner’s method.

Parameters:

x (float | npt.NDArray[np.float64]) – Input value(s) at which to evaluate.

Returns:

Evaluated polynomial value(s).

Return type:

np.float64 | npt.NDArray[np.float64]

class suboptimumg.vehicle.vehicle_models.SteeringSetupModel[source]#

Bases: BaseModel

Fields#

Field

Type

Required

Default

ackermann

FittedCurve

Yes

Validators#

Validator

Mode

Fields

coerce_ackermann

before

ackermann

Parameters:

ackermann (FittedCurve)

ackermann: FittedCurve#
classmethod coerce_ackermann(v)[source]#
class suboptimumg.vehicle.vehicle_models.SuspensionSetupModel[source]#

Bases: BaseModel

Fields#

Field

Type

Required

Default

Constraints

anti_dive_pct

float

Yes

ge=0, le=1

anti_squat_pct

float

Yes

ge=0, le=1

heave_stiffness_front_N_per_m

float

Yes

gt=0

heave_stiffness_rear_N_per_m

float

Yes

gt=0

motion_ratio_front

float

Yes

gt=0

motion_ratio_rear

float

Yes

gt=0

roll_stiffness_front_Nm_per_rad

float

Yes

gt=0

roll_stiffness_rear_Nm_per_rad

float

Yes

gt=0

Parameters:
  • roll_stiffness_front_Nm_per_rad (Annotated[float, Gt(gt=0)])

  • roll_stiffness_rear_Nm_per_rad (Annotated[float, Gt(gt=0)])

  • heave_stiffness_front_N_per_m (Annotated[float, Gt(gt=0)])

  • heave_stiffness_rear_N_per_m (Annotated[float, Gt(gt=0)])

  • anti_dive_pct (Annotated[float, Ge(ge=0), Le(le=1.0)])

  • anti_squat_pct (Annotated[float, Ge(ge=0), Le(le=1.0)])

  • motion_ratio_front (Annotated[float, Gt(gt=0)])

  • motion_ratio_rear (Annotated[float, Gt(gt=0)])

anti_dive_pct: float#
anti_squat_pct: float#
heave_stiffness_front_N_per_m: float#
heave_stiffness_rear_N_per_m: float#
motion_ratio_front: float#
motion_ratio_rear: float#
roll_stiffness_front_Nm_per_rad: float#
roll_stiffness_rear_Nm_per_rad: float#
class suboptimumg.vehicle.vehicle_models.VehicleModel[source]#

Bases: BaseModel

Fields#

Field

Type

Required

Default

Constraints

accum

AccumulatorModel

Yes

aero

AeroModel

Yes

cg_h

float

Yes

gt=0

chass

ChassisModel | None

No

None

dri

DriverInterfaceModel

Yes

front_track

float

Yes

gt=0

mass

float

Yes

gt=0

pwrtn

PowertrainModel

Yes

rear_track

float

Yes

gt=0

rolling_coeff

float

Yes

ge=0

sus

SimpleSuspensionModel | ComplexSuspensionModel

Yes

tires

TireModel

Yes

type

Literal[‘base’]

No

'base'

w_distr_b

float

Yes

gt=0, lt=1

wb

float

Yes

gt=0

Validators#

Validator

Mode

Fields

validate_rolling_coeff

after

rolling_coeff

Parameters:
accum: AccumulatorModel#
aero: AeroModel#
cg_h: float#
chass: ChassisModel | None#
dri: DriverInterfaceModel#
front_track: float#
mass: float#
pwrtn: PowertrainModel#
rear_track: float#
rolling_coeff: float#
sus: SimpleSuspensionModel | ComplexSuspensionModel#
tires: TireModel#
property track: float#
type: Literal['base']#
classmethod validate_rolling_coeff(v)[source]#
w_distr_b: float#
property w_distr_front: float#
wb: float#