Class TyreModel
- Namespace
- LibreRally.Vehicle.Physics
- Assembly
- LibreRally.dll
Slip-based tyre physics model combining brush tyre theory with Pacejka-like force curves.
Slip ratio (longitudinal):
κ = (ω·R − Vx) / max(|Vx|, ε)
where ω = wheel angular velocity, R = tyre radius, Vx = longitudinal velocity.
Slip angle (lateral):
α = atan(Vy / |Vx|)
where Vy = lateral velocity at the contact patch.
Forces are computed using a simplified Pacejka "Magic Formula":
F = D · sin(C · atan(B·x − E·(B·x − atan(B·x))))
with load-sensitive peak factor D = µ·Fz and appropriate stiffness B.
Key references:
- Pacejka, "Tire and Vehicle Dynamics", 3rd Ed., Chapters 3–4.
- Brush tyre model: Milliken & Milliken, "Race Car Vehicle Dynamics", §2.5.
- Rally high-slip: Abdulrahim, "Measurement and Analysis of Rally Car Dynamics at High Attitude Angles", SAE 2007.
Designed for struct-based per-wheel state (TyreState) to avoid per-frame heap allocations when simulating 50+ vehicles.
public sealed class TyreModel
- Inheritance
-
TyreModel
- Inherited Members
Constructors
TyreModel(float)
Initializes a tyre model for a wheel radius.
public TyreModel(float radius)
Parameters
radiusfloatUnloaded tyre radius in metres.
Properties
ActiveMode
Selects the active tyre force model.
- Auto — default blended brush+Pacejka behaviour.
- BrushOnly — bypass Pacejka; use only contact-patch brush forces.
- PacejkaOnly — bypass brush transients; use only Magic Formula forces.
Changed at runtime via the physics calibration overlay.
public TyreModelMode ActiveMode { get; set; }
Property Value
AligningTorqueFxMomentArm
Effective longitudinal-force moment arm (m) used for the s * Fx-style aligning-torque term.
This only contributes while the tyre is already generating meaningful lateral force.
public float AligningTorqueFxMomentArm { get; set; }
Property Value
AligningTorqueResidualFactor
Small residual aligning-torque fraction retained after the pneumatic trail has largely collapsed. This captures the non-trail remainder of Mz near the limit without dominating low-slip steering feel.
public float AligningTorqueResidualFactor { get; set; }
Property Value
AmbientTemperature
Ambient temperature (°C).
public float AmbientTemperature { get; set; }
Property Value
BeamNgFullLoadFrictionCoefficient
BeamNG-style asymptotic full-load friction coefficient, when provided by JBeam tyre metadata.
public float? BeamNgFullLoadFrictionCoefficient { get; set; }
Property Value
BeamNgLoadSensitivitySlope
BeamNG-style exponential load-sensitivity slope (1/N), when provided by JBeam tyre metadata.
public float? BeamNgLoadSensitivitySlope { get; set; }
Property Value
BeamNgNoLoadFrictionCoefficient
BeamNG-style zero-load friction coefficient, when provided by JBeam tyre metadata.
public float? BeamNgNoLoadFrictionCoefficient { get; set; }
Property Value
CamberThrustCoefficient
Camber thrust coefficient (N per rad of camber per N of Fz).
public float CamberThrustCoefficient { get; set; }
Property Value
CarcassShearCoefficient
Scaling factor for free-rolling carcass shear resistance. The carcass shear contribution arises from the difference between tread-element speed (Ω·r) and road speed (Ω·rₑ) as the tread compresses through the contact patch. Reference: "A simple model for tyre deformation", The Contact Patch, §Free rolling, Eq. 8.
public float CarcassShearCoefficient { get; set; }
Property Value
CarcassStiffness
Gets or sets the carcass stiffness multiplier, where 1.0 is the baseline tyre-body compliance. Increasing this value reduces transient delay before forces build at the contact patch. Decreasing this value allows more carcass deformation and slower transient response.
public float CarcassStiffness { get; set; }
Property Value
CombinedSlipCoupling
Combined-slip weighting stiffness for the MF-style Gxα/Gyκ reduction functions.
Higher values make cross-slip reduce the other force channel sooner.
public float CombinedSlipCoupling { get; set; }
Property Value
CombinedSlipExponent
Combined-slip weighting shape factor for the MF-style Gxα/Gyκ reduction functions.
Values near 1 are gentle; values near 2 collapse force capacity more aggressively at high cross-slip.
public float CombinedSlipExponent { get; set; }
Property Value
ContactAreaGripExponent
Gets or sets the exponent used for contact-patch-area grip scaling. Larger values make grip more sensitive to contact-patch area changes under load. Smaller values keep grip closer to the baseline friction curve.
public float ContactAreaGripExponent { get; set; }
Property Value
ContactPatchDamping
Lateral contact-patch damping (N·s/m).
public float ContactPatchDamping { get; set; }
Property Value
ContactPatchLength
Obsolete alias for ContactPatchLengthScale retained for backward compatibility. This value is a dimensionless scale factor, not an absolute length in metres.
[Obsolete("ContactPatchLength is a dimensionless scale factor. Use ContactPatchLengthScale instead.")]
public float ContactPatchLength { get; set; }
Property Value
ContactPatchLengthScale
Contact patch length scale factor (dimensionless) applied to the theoretical
rectangular footprint length computed from load, pressure, and width:
length ≈ normalLoad / (pressure × width).
Values above 1.0 lengthen the effective patch for extra compliance; values below 1.0 shorten it.
Reference: The Contact Patch, "The contact patch"; Pacejka §3.2.
public float ContactPatchLengthScale { get; set; }
Property Value
ContactPatchStiffness
Brush stiffness calibration (N/m at 220 kPa and 205 mm width).
The effective brush stiffness scales from the pressure-membrane estimate pressure × width.
public float ContactPatchStiffness { get; set; }
Property Value
CoolingRate
Cooling rate to ambient (W/°C).
public float CoolingRate { get; set; }
Property Value
CoreCoolingRate
Cooling rate from core/carcass to ambient (W/°C).
public float CoreCoolingRate { get; set; }
Property Value
CoreThermalMass
Thermal mass of the tyre core/carcass (J/°C). Higher = slower but more persistent heat storage.
public float CoreThermalMass { get; set; }
Property Value
FrictionEllipseRatio
Ratio of lateral grip limit to longitudinal grip limit. 1.0 gives an equal-grip friction circle; values below 1.0 produce a friction ellipse.
public float FrictionEllipseRatio { get; set; }
Property Value
GripTemperatureSurfaceWeight
Blend of surface and core temperatures used for grip calculations (0 = core only, 1 = surface only).
public float GripTemperatureSurfaceWeight { get; set; }
Property Value
HighSlipForceRetention
Fraction of peak lateral force retained at extreme slip angles (30–40°+). Rally tyres maintain ~60–70% of peak force at large slip to allow controlled drifts. Reference: Abdulrahim, "Measurement and Analysis of Rally Car Dynamics at High Attitude Angles".
public float HighSlipForceRetention { get; set; }
Property Value
HighSlipTransitionEnd
Slip angle (rad) at which the rally high-slip retention curve is fully active. ~40° by default.
public float HighSlipTransitionEnd { get; set; }
Property Value
HighSlipTransitionStart
Slip angle (rad) at which the rally high-slip retention curve begins blending. Below this angle the standard Pacejka curve applies fully. ~15° by default. Adjust per surface type or tyre compound for different drift-entry behaviour.
public float HighSlipTransitionStart { get; set; }
Property Value
HubRadius
BeamNG-derived hub radius hint (m) used to refine wheel inertia estimation when explicit inertia is unavailable.
public float? HubRadius { get; set; }
Property Value
HubWidth
BeamNG-derived hub width hint (m) used to refine wheel inertia estimation when explicit inertia is unavailable.
public float? HubWidth { get; set; }
Property Value
LateralB
Lateral stiffness factor B.
public float LateralB { get; set; }
Property Value
LateralC
Lateral shape factor C. Typically 1.1–1.4 for passenger/rally tyres.
public float LateralC { get; set; }
Property Value
LateralCamberCurvatureSensitivity
Camber sensitivity applied to the lateral pure-slip curvature factor. Higher values reshape the lateral force falloff more strongly under camber.
public float LateralCamberCurvatureSensitivity { get; set; }
Property Value
LateralCamberStiffnessSensitivity
Camber sensitivity applied to the lateral pure-slip stiffness factor. Higher values make cambered tyres build lateral force more aggressively.
public float LateralCamberStiffnessSensitivity { get; set; }
Property Value
LateralE
Lateral curvature factor E.
public float LateralE { get; set; }
Property Value
LateralLoadStiffnessSensitivity
Load sensitivity applied to the lateral pure-slip stiffness factor. Higher values make the cornering-stiffness ramp respond more strongly to load.
public float LateralLoadStiffnessSensitivity { get; set; }
Property Value
LateralSurfaceRelaxationSensitivity
Surface-coupling sensitivity for lateral relaxation length. Higher values make loose/low-grip surfaces build lateral force more slowly.
public float LateralSurfaceRelaxationSensitivity { get; set; }
Property Value
LoadSensitivity
Load sensitivity exponent for the tyre's non-linear grip response to vertical load.
µ_effective = µ_peak × (Fz / Fz_ref)^(-LoadSensitivity)
Higher values make grip fall away faster as load rises. Typical range 0.0–0.20; 0.15 is a representative road-tyre value.
public float LoadSensitivity { get; set; }
Property Value
LongitudinalB
Longitudinal stiffness factor B (cornering stiffness / peak force).
public float LongitudinalB { get; set; }
Property Value
LongitudinalC
Longitudinal shape factor C. Typically 1.5–1.8 for combined slip models.
public float LongitudinalC { get; set; }
Property Value
LongitudinalE
Longitudinal curvature factor E. Negative values extend the curve past the peak.
public float LongitudinalE { get; set; }
Property Value
LongitudinalLoadStiffnessSensitivity
Load sensitivity applied to the longitudinal pure-slip stiffness factor. Higher values make Fx build up more sharply as vertical load rises.
public float LongitudinalLoadStiffnessSensitivity { get; set; }
Property Value
LongitudinalRelaxationLength
Baseline longitudinal relaxation length (m) for the brush tyre transient model. Typically shorter than lateral because the tyre carcass is stiffer in the rolling direction. The effective value is further scaled by surface and local force-curve slope. Default 0.28 m. Reference: Pacejka §5.4; brush model braking transient.
public float LongitudinalRelaxationLength { get; set; }
Property Value
LongitudinalSurfaceRelaxationSensitivity
Surface-coupling sensitivity for longitudinal relaxation length. Higher values make loose/low-grip surfaces delay drive/brake force buildup more strongly.
public float LongitudinalSurfaceRelaxationSensitivity { get; set; }
Property Value
OptimalTemperature
Optimal tyre temperature for peak grip (°C).
public float OptimalTemperature { get; set; }
Property Value
OverturningCamberFactor
Additional camber sensitivity for the overturning couple. Higher values make cambered tyres generate more wheel-axis roll moment.
public float OverturningCamberFactor { get; set; }
Property Value
OverturningCoupleFactor
Scale factor for the tyre overturning couple Mx.
Higher values increase the wheel-axis roll moment generated by lateral load and camber.
public float OverturningCoupleFactor { get; set; }
Property Value
PeakFrictionCoefficient
Peak friction coefficient on reference surface (tarmac).
public float PeakFrictionCoefficient { get; set; }
Property Value
PneumaticTrail
Pneumatic trail at zero slip (m). Mz = trail × Fy. Decreases with slip angle.
public float PneumaticTrail { get; set; }
Property Value
Radius
Unloaded tyre radius (m).
public float Radius { get; }
Property Value
ReferenceLoad
Reference vertical load for µ rating (N).
public float ReferenceLoad { get; set; }
Property Value
RelaxationLength
Baseline lateral relaxation length (m) for the brush tyre transient model. The effective value is further scaled by loose-surface modifiers and the local force-curve slope.
public float RelaxationLength { get; set; }
Property Value
RoadHeatTransferRate
Road-contact heat transfer rate from tread surface (W/°C).
public float RoadHeatTransferRate { get; set; }
Property Value
RollingResistanceCoefficient
Base rolling-resistance coefficient (dimensionless). Typical 0.01–0.015 for tarmac tyres.
public float RollingResistanceCoefficient { get; set; }
Property Value
RollingResistanceMomentFactor
Scale factor for the rolling-resistance moment My.
Higher values increase the axle-axis moment that resists wheel rotation.
public float RollingResistanceMomentFactor { get; set; }
Property Value
RollingResistanceMomentFxFactor
Coupling between longitudinal tyre force and rolling-resistance moment.
Higher values make drive/brake force overlap contribute more strongly to My.
public float RollingResistanceMomentFxFactor { get; set; }
Property Value
SidewallStiffness
Gets or sets the sidewall stiffness multiplier, where 1.0 is the baseline response. Increasing this value sharpens turn-in by building lateral force more quickly. Decreasing this value makes the tyre feel softer and slower to respond.
public float SidewallStiffness { get; set; }
Property Value
StandingWaveCriticalSpeed
Approximate carcass wave speed (m/s) above which standing-wave losses grow rapidly. Lower values increase high-speed rolling resistance sooner.
public float StandingWaveCriticalSpeed { get; set; }
Property Value
StandingWaveResistanceGain
Gain applied to the standing-wave rolling-resistance rise.
Effective rolling resistance scales as 1 + gain × (speed / criticalSpeed)².
public float StandingWaveResistanceGain { get; set; }
Property Value
SurfaceToCoreConductance
Conductance from tread surface to core (W/°C).
public float SurfaceToCoreConductance { get; set; }
Property Value
TemperatureWindow
Temperature window width (°C). Grip falls off outside [optimal ± window].
public float TemperatureWindow { get; set; }
Property Value
ThermalMass
Thermal mass of the tyre surface (J/°C). Higher = slower temp change.
public float ThermalMass { get; set; }
Property Value
TyrePressure
Gets or sets the tyre inflation pressure in kilopascals. Higher values increase carcass stiffness and reduce the effective contact-patch size. Lower values increase compliance and usually improve low-speed grip.
public float TyrePressure { get; set; }
Property Value
VerticalStiffness
Baseline vertical stiffness of the tyre carcass (N/m) at the 220 kPa reference pressure. Used to estimate loaded-radius deflection and therefore effective rolling radius. Higher values reduce loaded deflection and slip generated by carcass compression.
public float VerticalStiffness { get; set; }
Property Value
WaterCoolingGain
Additional road heat-transfer gain per metre of water depth (1/m).
public float WaterCoolingGain { get; set; }
Property Value
WearRate
Wear rate: tread life lost per unit of slip energy (1 / J).
public float WearRate { get; set; }
Property Value
WheelInertia
Wheel rotational inertia (kg·m²). Governs spin-up/spin-down response. Typical values: 1.2–1.8 kg·m² for rally wheels. When set to 0 (default), inertia is estimated from normal load and radius.
angularAccel = appliedTorque / WheelInertia
Reference: Milliken, RCVD §2.3, wheel inertia.
public float WheelInertia { get; set; }
Property Value
WheelOffset
BeamNG-derived wheel offset hint (m). Carried through for wheel-geometry-aware physics work.
public float? WheelOffset { get; set; }
Property Value
Width
Tyre width (m), used for contact patch size estimation.
public float Width { get; set; }
Property Value
WornGripFraction
Minimum grip multiplier when tyre is completely worn (fraction of peak).
public float WornGripFraction { get; set; }
Property Value
Methods
Update(ref TyreState, float, float, float, float, float, float, in SurfaceProperties, float, out float, out float, out float)
Computes all tyre forces and torques for one wheel for one physics step.
Outputs:
longitudinalForce: Fx along wheel heading (N). Positive = forward.lateralForce: Fy perpendicular to heading (N). Positive = rightward.selfAligningTorque: Mz about the vertical axis (N·m). Opposes steering.
public void Update(ref TyreState state, float longitudinalVelocity, float lateralVelocity, float normalLoad, float driveTorque, float brakeTorque, float camberAngle, in SurfaceProperties surface, float dt, out float longitudinalForce, out float lateralForce, out float selfAligningTorque)
Parameters
stateTyreStatePer-wheel mutable state (angular velocity, temperature, wear, deflection).
longitudinalVelocityfloatForward velocity at the contact patch (m/s).
lateralVelocityfloatLateral velocity at the contact patch (m/s). Positive = rightward.
normalLoadfloatVertical load on the tyre (N). Must be > 0 for contact.
driveTorquefloatTorque applied to the wheel from the drivetrain (N·m).
brakeTorquefloatBraking torque magnitude (N·m). Always opposes rotation.
camberAnglefloatCamber angle (rad). Positive = top of wheel tilted outward.
surfaceSurfacePropertiesSurface material properties affecting grip.
dtfloatPhysics timestep (s).
longitudinalForcefloatOutput: longitudinal force (N).
lateralForcefloatOutput: lateral force (N).
selfAligningTorquefloatOutput: self-aligning torque (N·m).
Update(ref TyreState, float, float, float, float, float, float, in SurfaceProperties, float, out float, out float, out float, out float, out float)
Computes all tyre forces and moments for one wheel for one physics step.
public void Update(ref TyreState state, float longitudinalVelocity, float lateralVelocity, float normalLoad, float driveTorque, float brakeTorque, float camberAngle, in SurfaceProperties surface, float dt, out float longitudinalForce, out float lateralForce, out float selfAligningTorque, out float overturningCouple, out float rollingResistanceMoment)
Parameters
stateTyreStatePer-wheel mutable state (angular velocity, temperature, wear, deflection).
longitudinalVelocityfloatForward velocity at the contact patch (m/s).
lateralVelocityfloatLateral velocity at the contact patch (m/s). Positive = rightward.
normalLoadfloatVertical load on the tyre (N). Must be > 0 for contact.
driveTorquefloatTorque applied to the wheel from the drivetrain (N·m).
brakeTorquefloatBraking torque magnitude (N·m). Always opposes rotation.
camberAnglefloatCamber angle (rad). Positive = top of wheel tilted outward.
surfaceSurfacePropertiesSurface material properties affecting grip.
dtfloatPhysics timestep (s).
longitudinalForcefloatOutput: longitudinal force (N).
lateralForcefloatOutput: lateral force (N).
selfAligningTorquefloatOutput: self-aligning torque (N·m).
overturningCouplefloatOutput: overturning couple
Mxabout the wheel longitudinal axis (N·m).rollingResistanceMomentfloatOutput: rolling-resistance moment
Myabout the wheel lateral axis (N·m).