ParallelGLC
IconParallelGLC
Parallel circuit with Conductor
, Inductor
and Capacitor
Usage
ParallelGLC()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( signal_{+}y(t), source_{+}I(t) \right) \\ \mathrm{connect}\left( source_{+}p, inductor_{+}p, capacitor_{+}p, conductor_{+}p, voltage_{sensor_{+}p} \right) \\ \mathrm{connect}\left( source_{+}n, inductor_{+}n, capacitor_{+}n, conductor_{+}n, voltage_{sensor_{+}n}, ground_{+}g \right) \\ \mathtt{signal.y}\left( t \right) = ifelse\left( \mathtt{signal.start\_time} < t, \mathtt{signal.offset} + \mathtt{signal.amplitude} \sin\left( \mathtt{signal.phase} + 6.2832 \mathtt{signal.frequency} \left( - \mathtt{signal.start\_time} + t \right) \right), \mathtt{signal.offset} \right) \\ \mathtt{source.v}\left( t \right) = - \mathtt{source.n.v}\left( t \right) + \mathtt{source.p.v}\left( t \right) \\ \mathtt{source.i}\left( t \right) = \mathtt{source.p.i}\left( t \right) \\ \mathtt{source.p.i}\left( t \right) + \mathtt{source.n.i}\left( t \right) = 0 \\ \mathtt{source.i}\left( t \right) = \mathtt{source.uI} \mathtt{source.I}\left( t \right) \\ \mathtt{inductor.v}\left( t \right) = - \mathtt{inductor.n.v}\left( t \right) + \mathtt{inductor.p.v}\left( t \right) \\ \mathtt{inductor.i}\left( t \right) = \mathtt{inductor.p.i}\left( t \right) \\ \mathtt{inductor.p.i}\left( t \right) + \mathtt{inductor.n.i}\left( t \right) = 0 \\ \mathtt{inductor.L} \frac{\mathrm{d} \mathtt{inductor.i}\left( t \right)}{\mathrm{d}t} = \mathtt{inductor.v}\left( t \right) \\ \mathtt{capacitor.v}\left( t \right) = \mathtt{capacitor.p.v}\left( t \right) - \mathtt{capacitor.n.v}\left( t \right) \\ \mathtt{capacitor.i}\left( t \right) = \mathtt{capacitor.p.i}\left( t \right) \\ \mathtt{capacitor.p.i}\left( t \right) + \mathtt{capacitor.n.i}\left( t \right) = 0 \\ \mathtt{capacitor.C} \frac{\mathrm{d} \mathtt{capacitor.v}\left( t \right)}{\mathrm{d}t} = \mathtt{capacitor.i}\left( t \right) \\ \mathtt{conductor.v}\left( t \right) = \mathtt{conductor.p.v}\left( t \right) - \mathtt{conductor.n.v}\left( t \right) \\ \mathtt{conductor.i}\left( t \right) = \mathtt{conductor.p.i}\left( t \right) \\ \mathtt{conductor.p.i}\left( t \right) + \mathtt{conductor.n.i}\left( t \right) = 0 \\ \mathtt{conductor.i}\left( t \right) = \mathtt{conductor.G} \mathtt{conductor.v}\left( t \right) \\ \mathtt{voltage\_sensor.p.i}\left( t \right) = 0 \\ \mathtt{voltage\_sensor.n.i}\left( t \right) = 0 \\ \mathtt{voltage\_sensor.v}\left( t \right) = \mathtt{voltage\_sensor.p.v}\left( t \right) - \mathtt{voltage\_sensor.n.v}\left( t \right) \\ \mathtt{ground.g.v}\left( t \right) = 0 \\ \end{array} \right] \end{equation} \]
Source
# Parallel circuit with `Conductor`, `Inductor` and `Capacitor`
component ParallelGLC
signal = BlockComponents.Sine(frequency=1, amplitude=1, phase=0) [{
"JuliaSim": {"placement": {"diagram": {"x1": 0, "y1": 400, "x2": 100, "y2": 500}}}
}]
source = CurrentSource() [{
"JuliaSim": {
"placement": {"diagram": {"x1": 150, "y1": 400, "x2": 250, "y2": 500, "rot": 90}}
}
}]
inductor = Inductor(L=1) [{
"JuliaSim": {
"placement": {"diagram": {"x1": 350, "y1": 400, "x2": 450, "y2": 500, "rot": 90}}
}
}]
capacitor = Capacitor(C=1) [{
"JuliaSim": {
"placement": {"diagram": {"x1": 550, "y1": 400, "x2": 650, "y2": 500, "rot": 90}}
}
}]
conductor = Conductor(G=0.1) [{
"JuliaSim": {
"placement": {"diagram": {"x1": 750, "y1": 400, "x2": 850, "y2": 500, "rot": 90}}
}
}]
voltage_sensor = VoltageSensor() [{
"JuliaSim": {
"placement": {"diagram": {"x1": 950, "y1": 400, "x2": 1050, "y2": 500, "rot": 90}}
}
}]
ground = Ground() [{
"JuliaSim": {"placement": {"diagram": {"x1": 550, "y1": 700, "x2": 650, "y2": 800}}}
}]
relations
initial capacitor.v = 0.0
connect(signal.y, source.I) [{"JuliaSim": {"edges": [{"S": 1, "E": 2}]}}]
connect(source.p, inductor.p, capacitor.p, conductor.p, voltage_sensor.p) [{
"JuliaSim": {
"edges": [
{"S": 1, "M": [{"x": 200, "y": 300}], "E": -1},
{"S": 2, "M": [{"x": 400, "y": 300}], "E": -1},
{"S": 3, "E": -1},
{"S": 4, "M": [{"x": 800, "y": 300}], "E": -1},
{"S": 5, "M": [{"x": 1000, "y": 300}], "E": -1}
],
"junctions": [{"x": 600, "y": 300}]
}
}]
connect(source.n, inductor.n, capacitor.n, conductor.n, voltage_sensor.n, ground.g) [{
"JuliaSim": {
"edges": [
{"S": 1, "M": [{"x": 200, "y": 600}], "E": -1},
{"S": 2, "M": [{"x": 400, "y": 600}], "E": -1},
{"S": 3, "E": -1},
{"S": 4, "M": [{"x": 800, "y": 600}], "E": -1},
{"S": 5, "M": [{"x": 1000, "y": 600}], "E": -1},
{"S": 6, "E": -1}
],
"junctions": [{"x": 600, "y": 600}]
}
}]
metadata {
"JuliaSim": {
"tests": {
"case1": {
"stop": 10,
"expect": {
"final": {
"capacitor.i": "-0.0779787323",
"inductor.i": "0.053556296",
"capacitor.v": "0.2442243622",
"inductor.v": "0.2442243622",
"voltage_sensor.v": "0.2442243622"
}
}
}
}
}
}
end
Flattened Source
# Parallel circuit with `Conductor`, `Inductor` and `Capacitor` component ParallelGLC signal = BlockComponents.Sine(frequency=1, amplitude=1, phase=0) [{ "JuliaSim": {"placement": {"diagram": {"x1": 0, "y1": 400, "x2": 100, "y2": 500}}} }] source = CurrentSource() [{ "JuliaSim": { "placement": {"diagram": {"x1": 150, "y1": 400, "x2": 250, "y2": 500, "rot": 90}} } }] inductor = Inductor(L=1) [{ "JuliaSim": { "placement": {"diagram": {"x1": 350, "y1": 400, "x2": 450, "y2": 500, "rot": 90}} } }] capacitor = Capacitor(C=1) [{ "JuliaSim": { "placement": {"diagram": {"x1": 550, "y1": 400, "x2": 650, "y2": 500, "rot": 90}} } }] conductor = Conductor(G=0.1) [{ "JuliaSim": { "placement": {"diagram": {"x1": 750, "y1": 400, "x2": 850, "y2": 500, "rot": 90}} } }] voltage_sensor = VoltageSensor() [{ "JuliaSim": { "placement": {"diagram": {"x1": 950, "y1": 400, "x2": 1050, "y2": 500, "rot": 90}} } }] ground = Ground() [{ "JuliaSim": {"placement": {"diagram": {"x1": 550, "y1": 700, "x2": 650, "y2": 800}}} }] relations initial capacitor.v = 0.0 connect(signal.y, source.I) [{"JuliaSim": {"edges": [{"S": 1, "E": 2}]}}] connect(source.p, inductor.p, capacitor.p, conductor.p, voltage_sensor.p) [{ "JuliaSim": { "edges": [ {"S": 1, "M": [{"x": 200, "y": 300}], "E": -1}, {"S": 2, "M": [{"x": 400, "y": 300}], "E": -1}, {"S": 3, "E": -1}, {"S": 4, "M": [{"x": 800, "y": 300}], "E": -1}, {"S": 5, "M": [{"x": 1000, "y": 300}], "E": -1} ], "junctions": [{"x": 600, "y": 300}] } }] connect(source.n, inductor.n, capacitor.n, conductor.n, voltage_sensor.n, ground.g) [{ "JuliaSim": { "edges": [ {"S": 1, "M": [{"x": 200, "y": 600}], "E": -1}, {"S": 2, "M": [{"x": 400, "y": 600}], "E": -1}, {"S": 3, "E": -1}, {"S": 4, "M": [{"x": 800, "y": 600}], "E": -1}, {"S": 5, "M": [{"x": 1000, "y": 600}], "E": -1}, {"S": 6, "E": -1} ], "junctions": [{"x": 600, "y": 600}] } }] metadata { "JuliaSim": { "tests": { "case1": { "stop": 10, "expect": { "final": { "capacitor.i": "-0.0779787323", "inductor.i": "0.053556296", "capacitor.v": "0.2442243622", "inductor.v": "0.2442243622", "voltage_sensor.v": "0.2442243622" } } } } } } end
Test Cases
Test Case case1
Related
- Examples
- Experiments
- Analyses