Resistor
Physical Networks
Run the live example
Free · no sign-up · runs in your browser
The Resistor block models a linear two-terminal electrical resistor governed by Ohm's Law. It provides a constant linear resistance between its positive conserving port p and negative conserving port n, dissipating electrical energy as heat.
Because the Resistor is an acausal conserving component, it does not enforce directional signal flow. Current can flow in either direction depending on the voltage differential between its two terminals, and the branch relationship is stamped directly into the system's conductance matrix during Modified Nodal Analysis (MNA).
Real-World Analog: Represents a discrete carbon-film resistor, heating coil, or parasitic wiring resistance dissipating electrical energy according to Ohm's law.
Mathematical Model
The electrical behavior is defined by Ohm's Law:
Where:
V_pis the electrical potential at the positive terminalp(V).V_nis the electrical potential at the negative terminaln(V).Ris the resistance parameter in Ohms ().Iis the conserving current flowing from terminalpto terminaln(A).
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | p |
+ | number | Required |
| → In | n |
- | number | Required |
| → In | H |
H | number | Optional |
| ← Out | q_diss |
Q_diss | number | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
resistance |
Resistance (Ohm) | number | 100 |
|
temperature_coefficient |
Temperature Coefficient (α) | number | 0 |
Temperature coefficient of resistance (TCR) in 1/K (e.g. 0.00393 for copper, 0 = constant R) |
temperature |
Operating Temperature | number | 293.15 |
Operating temperature in Kelvin (default 20 °C) |
reference_temperature |
Reference Temperature | number | 293.15 |
Reference temperature T0 where R = R0 (default 293.15 K) |
Usage Examples
Voltage Divider
Split an incoming supply voltage using two series resistors:
VoltageSource(+) → Resistor1 → Resistor2 → Ground
Current Limiter
Limit current flow through an electrical branch:
VoltageSource(+) → Resistor(resistance: 220) → LoadRemarks & Best Practices
- Bidirectional Flow: Current flows freely in either direction depending on the signed potential difference.
- MNA Stamping: Adds conductance into the nodal matrix diagonal and off-diagonal entries.
- Minimum Value: Resistance values should remain strictly positive to maintain system matrix numerical conditioning.
- WASM Performance: Fully stamped and solved in compiled WebAssembly.
Related Components
- Capacitor: Linear reactive energy storage component
- Inductor: Magnetic energy storage component
- Ground: Common reference potential node
- VoltageSensor: Measure voltage across the resistor