suboptimumg.vehicle.vehicle_models#
- class suboptimumg.vehicle.vehicle_models.AlignmentModel[source]#
Bases:
BaseModelWheel alignment configuration.
Fields# Field
Type
Required
Default
floatYes
floatYes
floatYes
floatYes
- 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.DynamicsPriorBoundsModel[source]#
Bases:
BaseModelSoft +/- percentage bounds for the yaw-response bicycle priors.
Used by an LPV output-error fit to build the optimizer’s parameter box around
Ca_front,Ca_rearandIzz.Fields# Field
Type
Required
Default
Constraints
floatYes
ge=0
floatYes
ge=0
floatYes
ge=0
- Parameters:
Ca_front_pct (Annotated[float, Ge(ge=0)])
Ca_rear_pct (Annotated[float, Ge(ge=0)])
Izz_pct (Annotated[float, Ge(ge=0)])
- Ca_front_pct: float#
- Ca_rear_pct: float#
- Izz_pct: float#
- class suboptimumg.vehicle.vehicle_models.DynamicsSetupModel[source]#
Bases:
BaseModelLinear-region bicycle-model parameters used as soft priors for a LPV yaw-response output-error fit
- Backsolve from four cornering operating points (skidpad / steady turns) using SAE bicycle algebra:
delta_tire = L/R + (m/L)(l_r/Ca_f - l_f/Ca_r) V^2/R beta = l_r/R - (m a_y l_f) / (L Ca_r)
Ca_r is the multi-point consensus from three well-conditioned points. Ca_f comes from the lowest-a_y point only (front tires saturate above ~1g, biasing fits low). Izz should be an FSAE rule-of-thumb (~0.7 m wb track / 4).
Fields# Field
Type
Required
Default
Constraints
floatYes
gt=0
floatYes
gt=0
floatYes
gt=0
Yes
- Parameters:
Ca_front_N_per_rad (Annotated[float, Gt(gt=0)])
Ca_rear_N_per_rad (Annotated[float, Gt(gt=0)])
Izz_kg_m2 (Annotated[float, Gt(gt=0)])
prior_bounds (DynamicsPriorBoundsModel)
- Ca_front_N_per_rad: float#
- Ca_rear_N_per_rad: float#
- Izz_kg_m2: float#
- prior_bounds: DynamicsPriorBoundsModel#
- class suboptimumg.vehicle.vehicle_models.ExtendedVehicleModel[source]#
Bases:
VehicleModelVehicleModel extended with real-world session setup parameters.
Set
type: irl_setupin the YAML to trigger this model. Includes alignment, steering ackermann, suspension setup, and yaw-response dynamics priors on top of the base car parameters.Fields# Field
Type
Required
Default
Constraints
accumYes
aeroYes
Yes
cg_hfloatYes
gt=0
chassChassisModel|NoneNo
NonedriYes
Yes
front_trackfloatYes
gt=0
massfloatYes
gt=0
pwrtnYes
rear_trackfloatYes
gt=0
rolling_coefffloatYes
ge=0
Yes
susYes
Yes
tiresYes
Literal[‘irl_setup’]No
'irl_setup'w_distr_bfloatYes
gt=0, lt=1
wbfloatYes
gt=0
Validators# Validator
Mode
Fields
after
- Parameters:
type (Literal['irl_setup'])
mass (Annotated[float, Gt(gt=0)])
w_distr_b (Annotated[float, Gt(gt=0), Lt(lt=1)])
cg_h (Annotated[float, Gt(gt=0)])
wb (Annotated[float, Gt(gt=0)])
front_track (Annotated[float, Gt(gt=0)])
rear_track (Annotated[float, Gt(gt=0)])
rolling_coeff (Annotated[float, Ge(ge=0)])
aero (AeroModel)
pwrtn (PowertrainModel)
accum (AccumulatorModel)
tires (TireModel)
dri (DriverInterfaceModel)
chass (ChassisModel | None)
alignment (AlignmentModel)
steering_setup (SteeringSetupModel)
suspension_setup (SuspensionSetupModel)
dynamics_setup (DynamicsSetupModel)
- alignment: AlignmentModel#
- dynamics_setup: DynamicsSetupModel#
- steering_setup: SteeringSetupModel#
- suspension_setup: SuspensionSetupModel#
- type: Literal['irl_setup']#
- class suboptimumg.vehicle.vehicle_models.FittedCurve(data, poly_order)[source]#
Bases:
objectPolynomial 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:
NDArray[np.float64]
- poly_order#
- Type:
int
- coeffs#
Polynomial coefficients in descending degree order
[c_n, c_{n-1}, ..., c_1, c_0], matchingnp.polyfitoutput and the order Horner’s method consumes directly.- Type:
NDArray[np.float64]
- coeffs: NDArray[float64]#
- evaluate(x)[source]#
Evaluate the fitted polynomial via Horner’s method.
- Parameters:
x (float | NDArray[np.float64]) – Input value(s) at which to evaluate.
- Returns:
Evaluated polynomial value(s).
- Return type:
np.float64 | NDArray[np.float64]
- x_raw: NDArray[float64]#
- y_raw: NDArray[float64]#
- class suboptimumg.vehicle.vehicle_models.FittedCurveData[source]#
Bases:
TypedDictRaw YAML shape for a FittedCurve before it is constructed.
- data: list[list[float]]#
- poly_order: int#
- class suboptimumg.vehicle.vehicle_models.SteeringSetupModel[source]#
Bases:
BaseModelSteering geometry and ackermann curve configuration.
Fields# Field
Type
Required
Default
Yes
Validators# Validator
Mode
Fields
before
- Parameters:
ackermann (FittedCurve)
- ackermann: FittedCurve#
- classmethod coerce_ackermann(v)[source]#
- Parameters:
v (FittedCurve | FittedCurveData)
- Return type:
- class suboptimumg.vehicle.vehicle_models.SuspensionSetupModel[source]#
Bases:
BaseModelReal-world suspension setup parameters.
Fields# Field
Type
Required
Default
Constraints
floatYes
ge=0, le=1
floatYes
ge=0, le=1
floatYes
gt=0
floatYes
gt=0
floatYes
gt=0
floatYes
gt=0
floatYes
gt=0
floatYes
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:
BaseModelFull vehicle configuration composed of all subsystem models.
Fields# Field
Type
Required
Default
Constraints
Yes
Yes
floatYes
gt=0
ChassisModel|NoneNo
NoneYes
floatYes
gt=0
floatYes
gt=0
Yes
floatYes
gt=0
floatYes
ge=0
Yes
Yes
Literal[‘base’]No
'base'floatYes
gt=0, lt=1
floatYes
gt=0
Validators# Validator
Mode
Fields
after
- Parameters:
type (Literal['base'])
mass (Annotated[float, Gt(gt=0)])
w_distr_b (Annotated[float, Gt(gt=0), Lt(lt=1)])
cg_h (Annotated[float, Gt(gt=0)])
wb (Annotated[float, Gt(gt=0)])
front_track (Annotated[float, Gt(gt=0)])
rear_track (Annotated[float, Gt(gt=0)])
rolling_coeff (Annotated[float, Ge(ge=0)])
aero (AeroModel)
pwrtn (PowertrainModel)
accum (AccumulatorModel)
tires (TireModel)
dri (DriverInterfaceModel)
chass (ChassisModel | None)
- accum: AccumulatorModel#
- cg_h: float#
- chass: ChassisModel | None#
- front_track: float#
- mass: float#
- pwrtn: PowertrainModel#
- rear_track: float#
- rolling_coeff: float#
- property track: float#
- type: Literal['base']#
- w_distr_b: float#
- property w_distr_front: float#
- wb: float#