Resistor
IconResistor
A simple linear resistor model
This component extends from TwoPin
Usage
Resistor(R)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
R | Resistance of this Resistor | Ω |
Connectors
Variables
Name | Description | Units |
---|---|---|
v | V | |
i | A |
Behavior
\[ \begin{align} v\left( t \right) &= \mathtt{p.v}\left( t \right) - \mathtt{n.v}\left( t \right) \\ i\left( t \right) &= \mathtt{p.i}\left( t \right) \\ \mathtt{n.i}\left( t \right) + \mathtt{p.i}\left( t \right) &= 0 \\ v\left( t \right) &= R i\left( t \right) \end{align} \]
Source
# A simple linear resistor model
component Resistor
extends TwoPin
# Resistance of this Resistor
parameter R::Resistance
relations
# Ohm's Law
v = i*R
metadata {
"JuliaSim": {
"labels": [
{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0},
{"label": "R=$(R)Ω", "x": 500, "y": 150, "rot": 0}
],
"icons": {"default": "jsml://ElectricalComponents/Resistor.svg"}
}
}
end
Flattened Source
# A simple linear resistor model component Resistor p = Pin() [{ "JuliaSim": { "placement": {"icon": {"iconName": "pos", "x1": -50, "y1": 450, "x2": 50, "y2": 550}} } }] n = Pin() [{ "JuliaSim": { "placement": {"icon": {"iconName": "neg", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}} } }] variable v::Voltage variable i::Current # Resistance of this Resistor parameter R::Resistance relations v = p.v-n.v i = p.i p.i+n.i = 0 # Ohm's Law v = i*R metadata { "JuliaSim": { "labels": [ {"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}, {"label": "R=$(R)Ω", "x": 500, "y": 150, "rot": 0} ], "icons": {"default": "jsml://ElectricalComponents/Resistor.svg"} } } end
Test Cases
Related
- Examples
- Experiments
- Analyses
- Tests