# Resistor (`resistor`)

> Limits current in proportion to the voltage across it.

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

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

**Group:** Passive · **Kind:** `{"kind":"resistor"}`

## When to use it

Use it for loads, dividers and damping. To measure current, use Ammeter instead of a tiny resistor.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `p` | electrical | One end; positive current flows from p to n |
| `n` | electrical | The other end |

## Common parameters

- `r`: Resistance (Default: required)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `r` | Ω | required |  | Resistance |

_Parameter descriptions are in English in both languages._

**Use for:** Loads · Voltage dividers · Damping · Gate resistors

**Not for:** Measuring a current → [`ammeter`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/meters/ammeter/) · Inrush current limiting → [`ntc`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/passive/ntc/)

## Formulas

| Formula | Equation | Source |
|---|---|---|
| Ohm's law | i = v / r | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 2 (Ohm's law) |
| Dissipated power | P = v² / r = i²·r | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 2 (power absorbed by a resistor) |

## Quick check

Inputs:

- `r`: Resistance = 100 Ω, `r`
- `v`: Voltage across it = 12 V

Outputs:

- `i`: Current = `v/r` A
- `p`: Dissipated power = `v^2/r` W

## Model logic

- It is stamped as the constant conductance 1/r between p and n, and r must be above zero or the run is refused.
- It is linear and has no memory: no temperature coefficient, tolerance, stray inductance or stray capacitance.
- The power is not limited: a resistor far above its rating simulates without a warning, so check i²·r yourself.

## Model

The current is i = (v(p) - v(n)) / r, and r must be above zero. The part has no temperature drift, tolerance, power rating or stray inductance.

## Common mistakes

- A missing prefix is easy to make, such as 10 for 10k. Type the prefix with the number, and values outside 1u to 1G ohm are flagged.
- A resistor with one end connected to nothing carries no current. Connect both ends or delete it.

Problems rules: `param.non_positive`, `param.out_of_range`, `net.dangling`

## Datasheet and sources

r is the value printed on the part or taken from your design. The solver does not check the power rating, so check it yourself.

## Example

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

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