suboptimumg.loganalysis.irl_car#
IrlCar — real-world car wrapper combining Car + vehicle_setup parameters.
- class suboptimumg.loganalysis.irl_car.IrlCar(car, setup)[source]#
Bases:
objectCar + real-world setup parameters for log analysis.
Wraps a
Carinstance (loaded fromcar.yaml) with the extra session-specific parameters fromvehicle_setup.yaml. Provides derived computation methods that combine both sources.- Parameters:
car (Car) – Simulation car object (carries mass, wheelbase, track widths, CG height, etc. via
car.params).setup (dict) – Processed vehicle setup dict (from
load_vehicle_setup()). Curve entries should already beFittedCurveobjects.
- aero_force_from_pots(front_pot_delta_mm, rear_pot_delta_mm, ax_g=0.0)[source]#
Estimate front/rear aero downforce from shock pot deltas.
- Parameters:
front_pot_delta_mm (float | ndarray) – Change in average axle pot displacement from a reference (zero-aero) state, in mm. Positive = compression.
rear_pot_delta_mm (float | ndarray) – Change in average axle pot displacement from a reference (zero-aero) state, in mm. Positive = compression.
ax_g (float | ndarray) – Longitudinal acceleration in g’s (positive = forward accel, negative = braking). Used to subtract weight transfer through the springs (accounting for anti-dive/squat).
- Returns:
Estimated aero downforce at each axle in Newtons.
- Return type:
(front_aero_N, rear_aero_N)
- classmethod from_yaml(car_yaml='parameters/car.yaml', setup_yaml='parameters/vehicle_setup.yaml')[source]#
Load both YAML files and construct an IrlCar.
- Parameters:
car_yaml (str)
setup_yaml (str)
- Return type:
- heave_to_force(heave_m, axle)[source]#
Heave displacement (m) -> vertical spring force (N).
F = heave_stiffness * heave_m- Parameters:
heave_m (float | ndarray)
axle (str)
- Return type:
float | ndarray
- lateral_weight_transfer(ay_g)[source]#
Lateral weight transfer per axle.
Combines elastic (roll stiffness distribution) and geometric (direct load path through CG) components.
- Parameters:
ay_g (float or array) – Lateral acceleration in g’s (positive = turning left).
- Returns:
Weight transfer at the front and rear axles in Newtons. Positive values indicate load transfer to the outside wheel.
- Return type:
(front_wt_N, rear_wt_N)
- left_tire_angle(sw_deg)[source]#
Left tire steer angle via ackermann symmetry:
-f(-x).- Parameters:
sw_deg (float | ndarray)
- Return type:
ndarray
- longitudinal_weight_transfer(ax_g)[source]#
Longitudinal weight transfer on the front axle.
- Parameters:
ax_g (float or array) – Longitudinal acceleration in g’s (positive = accelerating forward, negative = braking).
- Returns:
Change in front axle normal force (N). Negative under acceleration (rear loads up), positive under braking (front loads up). Anti-dive/squat percentages reduce the geometric weight transfer through the springs.
- Return type:
float or np.ndarray
- pot_to_force(pot_mm, axle)[source]#
Shock pot displacement (mm) -> vertical spring force (N).
Combines
pot_to_heave()andheave_to_force().- Parameters:
pot_mm (float | ndarray)
axle (str)
- Return type:
float | ndarray
- pot_to_heave(pot_mm, axle)[source]#
Shock pot displacement (mm) -> chassis heave displacement (m).
heave_m = pot_mm / 1000 * MR- Parameters:
pot_mm (float | ndarray)
axle (str)
- Return type:
float | ndarray
- right_tire_angle(sw_deg)[source]#
Right tire steer angle from the ackermann curve.
- Parameters:
sw_deg (float or array) – Steering wheel angle in degrees. Positive = right turn (right tire is inner, steers more); negative = left turn (right tire is outer, steers less).
- Return type:
ndarray