CurrentSensor
IconCurrentSensor
Creates a circuit component that measures the current flowing through it. Analogous to an ideal ammeter.
Usage
CurrentSensor()
Connectors
p
- (Pin
)n
- (Pin
)i
- This connector represents a real signal as an output from a component (RealOutput
)
Behavior
\[ \begin{align} \mathtt{p.v}\left( t \right) &= \mathtt{n.v}\left( t \right) \\ \mathtt{p.i}\left( t \right) &= i\left( t \right) \\ \mathtt{n.i}\left( t \right) &= - i\left( t \right) \end{align} \]
Source
# Creates a circuit component that measures the current flowing through it. Analogous to an ideal ammeter.
component CurrentSensor
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}}
}
}]
i = RealOutput() [{
"JuliaSim": {
"placement": {
"icon": {"iconName": "pos", "x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}
}
}
}]
relations
p.v = n.v
p.i = i
n.i = -i
metadata {
"JuliaSim": {
"labels": [
{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0},
{"label": "A", "x": 500, "y": 713, "rot": 0}
],
"icons": {"default": "jsml://ElectricalComponents/TwoPinSensor.svg"}
}
}
end
Flattened Source
# Creates a circuit component that measures the current flowing through it. Analogous to an ideal ammeter. component CurrentSensor 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}} } }] i = RealOutput() [{ "JuliaSim": { "placement": { "icon": {"iconName": "pos", "x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90} } } }] relations p.v = n.v p.i = i n.i = -i metadata { "JuliaSim": { "labels": [ {"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}, {"label": "A", "x": 500, "y": 713, "rot": 0} ], "icons": {"default": "jsml://ElectricalComponents/TwoPinSensor.svg"} } } end
Test Cases
Related
- Examples
- Experiments
- Analyses
- Tests