RLCModel
IconRLCModel
This is an RLC model. This should support markdown. That includes HTML as well.
Usage
RLCModel()
Behavior
\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( signal_{+}y(t), source_{+}V(t) \right) \\ \mathrm{connect}\left( source_{+}n, inductor_{+}p \right) \\ \mathrm{connect}\left( inductor_{+}n, resistor_{+}n, capacitor_{+}n \right) \\ \mathrm{connect}\left( resistor_{+}p, ground_{+}g, capacitor_{+}p, source_{+}p \right) \\ \mathtt{resistor.v}\left( t \right) = - \mathtt{resistor.n.v}\left( t \right) + \mathtt{resistor.p.v}\left( t \right) \\ \mathtt{resistor.i}\left( t \right) = \mathtt{resistor.p.i}\left( t \right) \\ \mathtt{resistor.p.i}\left( t \right) + \mathtt{resistor.n.i}\left( t \right) = 0 \\ \mathtt{resistor.v}\left( t \right) = \mathtt{resistor.R} \mathtt{resistor.i}\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{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{signal.y}\left( t \right) = \mathtt{signal.k} \\ \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.v}\left( t \right) = \mathtt{source.uV} \mathtt{source.V}\left( t \right) \\ \mathtt{ground.g.v}\left( t \right) = 0 \\ \end{array} \right] \end{equation} \]
Source
# This is an RLC model. This should support markdown. That includes
# HTML as well.
example component RLCModel
resistor = Resistor(R=100) [{
"JuliaSim": {
"placement": {"diagram": {"x1": 850, "y1": 450, "x2": 950, "y2": 550, "rot": -90}}
}
}]
capacitor = Capacitor(C=1m) [{
"JuliaSim": {
"placement": {"diagram": {"x1": 550, "y1": 450, "x2": 650, "y2": 550, "rot": -90}}
}
}]
inductor = Inductor(L=1) [{
"JuliaSim": {
"placement": {"diagram": {"x1": 375, "y1": 250, "x2": 475, "y2": 350, "rot": 0}}
}
}]
signal = BlockComponents.Constant(k=30) [{
"JuliaSim": {"placement": {"icon": {"x1": 0, "y1": 450, "x2": 100, "y2": 550}}}
}]
source = VoltageSource() [{
"JuliaSim": {
"placement": {"diagram": {"x1": 200, "y1": 450, "x2": 300, "y2": 550, "rot": -90}}
}
}]
ground = Ground() [{
"JuliaSim": {
"placement": {"diagram": {"x1": 550, "y1": 800, "x2": 650, "y2": 900, "rot": 0}}
}
}]
relations
initial inductor.i = 0
initial capacitor.v = 10
connect(signal.y, source.V) [{"JuliaSim": {"edges": [{"S": 1, "E": 2}]}}]
connect(source.n, inductor.p) [{"JuliaSim": {"edges": [{"S": 1, "M": [{"x": 250, "y": 300}], "E": 2}]}}]
connect(inductor.n, resistor.n, capacitor.n) [{
"JuliaSim": {
"edges": [
{"S": 1, "E": -1},
{"S": 2, "M": [{"x": 900, "y": 300}], "E": -1},
{"S": 3, "E": -1}
],
"junctions": [{"x": 600, "y": 300}]
}
}]
connect(resistor.p, ground.g, capacitor.p, source.p) [{
"JuliaSim": {
"edges": [
{"S": 1, "M": [{"x": 900, "y": 700}], "E": -1},
{"S": 2, "E": -1},
{"S": 3, "E": -1},
{"S": -1, "M": [{"x": 250, "y": 700}], "E": 4}
],
"junctions": [{"x": 600, "y": 700}]
}
}]
metadata {
"JuliaSim": {
"labels": [
{
"label": "RLC Model",
"x": 800,
"y": 100,
"layer": "diagram",
"attrs": {"font-size": "100"}
}
],
"tests": {
"case1": {
"stop": 10,
"expect": {"initial": {"capacitor.v": 10}, "final": {"capacitor.v": 30}}
}
}
}
}
end
Flattened Source
# This is an RLC model. This should support markdown. That includes # HTML as well. example component RLCModel resistor = Resistor(R=100) [{ "JuliaSim": { "placement": {"diagram": {"x1": 850, "y1": 450, "x2": 950, "y2": 550, "rot": -90}} } }] capacitor = Capacitor(C=1m) [{ "JuliaSim": { "placement": {"diagram": {"x1": 550, "y1": 450, "x2": 650, "y2": 550, "rot": -90}} } }] inductor = Inductor(L=1) [{ "JuliaSim": { "placement": {"diagram": {"x1": 375, "y1": 250, "x2": 475, "y2": 350, "rot": 0}} } }] signal = BlockComponents.Constant(k=30) [{ "JuliaSim": {"placement": {"icon": {"x1": 0, "y1": 450, "x2": 100, "y2": 550}}} }] source = VoltageSource() [{ "JuliaSim": { "placement": {"diagram": {"x1": 200, "y1": 450, "x2": 300, "y2": 550, "rot": -90}} } }] ground = Ground() [{ "JuliaSim": { "placement": {"diagram": {"x1": 550, "y1": 800, "x2": 650, "y2": 900, "rot": 0}} } }] relations initial inductor.i = 0 initial capacitor.v = 10 connect(signal.y, source.V) [{"JuliaSim": {"edges": [{"S": 1, "E": 2}]}}] connect(source.n, inductor.p) [{"JuliaSim": {"edges": [{"S": 1, "M": [{"x": 250, "y": 300}], "E": 2}]}}] connect(inductor.n, resistor.n, capacitor.n) [{ "JuliaSim": { "edges": [ {"S": 1, "E": -1}, {"S": 2, "M": [{"x": 900, "y": 300}], "E": -1}, {"S": 3, "E": -1} ], "junctions": [{"x": 600, "y": 300}] } }] connect(resistor.p, ground.g, capacitor.p, source.p) [{ "JuliaSim": { "edges": [ {"S": 1, "M": [{"x": 900, "y": 700}], "E": -1}, {"S": 2, "E": -1}, {"S": 3, "E": -1}, {"S": -1, "M": [{"x": 250, "y": 700}], "E": 4} ], "junctions": [{"x": 600, "y": 700}] } }] metadata { "JuliaSim": { "labels": [ { "label": "RLC Model", "x": 800, "y": 100, "layer": "diagram", "attrs": {"font-size": "100"} } ], "tests": { "case1": { "stop": 10, "expect": {"initial": {"capacitor.v": 10}, "final": {"capacitor.v": 30}} } } } } end
Test Cases
Test Case case1
Related
- Examples
- Experiments
- Analyses