# Vehicle Load (`vehicle`)

> A road vehicle seen at its wheel shaft: mass, rolling resistance, air drag and road grade.

![vehicle](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/vehicle.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/mechanical/vehicle/)

**Group:** Mechanical · **Kind:** `{"element":"vehicle","kind":"mechanical"}`

## When to use it

Use it on the wheel side of a Gear to load an electric vehicle drive with a drive cycle's physics, or to size the motor and the battery for a speed and a slope.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `shaft` | mechanical | Wheel shaft, ω = v/r |

## Common parameters

- `m`: Vehicle mass with its load (Default: required)
- `r`: Wheel radius under load (Default: required)
- `crr`: Rolling resistance coefficient (Default: 0)
- `cda`: Drag coefficient times frontal area (Default: 0)
- `grade`: Road slope, rise over run, uphill positive (Default: 0)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `m` | kg | required |  | Vehicle mass with its load |
| `r` | m | required |  | Wheel radius under load |
| `crr` | — | 0 |  | Rolling resistance coefficient |
| `cda` | m² | 0 |  | Drag coefficient times frontal area |
| `rho` | kg/m³ | 1.225 |  | Air density |
| `grade` | % | 0 |  | Road slope, rise over run, uphill positive |
| `v0` | m/s | 0 |  | Vehicle speed at the start |

_Parameter descriptions are in English in both languages._

## Model

The vehicle mass acts as the inertia m·r² on the wheel shaft, starting at v0/r. The road load torque is r·(m·g·crr·cos α + ½·ρ·CdA·v·abs(v) + m·g·sin α), with v = ω·r, g = 9.80665 m/s² and α = atan(grade/100). Rolling resistance opposes the motion and fades linearly to zero below 0.1 rad/s. Drag and rolling resistance use the speed of the last accepted step. Wheel slip, tyre and wind are not modelled.

## Common mistakes

- The part is the whole vehicle at one wheel shaft. Put the final drive ratio in a Gear between the motor and this part, and r is the loaded wheel radius, not the rim.
- grade is in percent (rise over run), not degrees. A positive grade is uphill for positive speed, and the vehicle rolls back when nothing holds it.
- Rolling resistance fades to zero at standstill, so a vehicle on a slope does not stay parked. Hold it with a Speed Source or the drive.

Problems rules: `pin.unconnected`, `compile.error`

## Datasheet and sources

m is the test mass from the vehicle homologation document, r the dynamic rolling radius of the tyre size. crr comes from the tyre label (the EU tyre label class gives its range) or a coast-down test, and CdA from the manufacturer or the coast-down test. rho is the ISO 2533 sea-level air density, 1.225 kg/m³.

## Example

Open the example with the command `file.openExample` and the name `demo:vehicle`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
