DeSauty
AC bridge circuit for comparing capacitances
This component models a De Sauty bridge, an electrical circuit configuration used for measuring capacitances. The bridge consists of four arms: Arm 1: capacitor1
(with capacitance C₁
) Arm 2: resistor1
(with resistance R1 = 5.0 Ohm
) Arm 3: capacitor2
(with capacitance C₂
) Arm 4: resistor2
(with resistance R2 = 2.0 Ohm
) An AC voltage, generated by input_signal
and applied through source
, is connected across the overall bridge structure. Specifically, one terminal of the source (source.p
) connects to the common point of capacitor1.n
and capacitor2.n
. The other terminal of the source (source.n
) connects to the common point of resistor1.p
and resistor2.p
, which is also connected to ground
. A current_sensor
acts as a detector, connected between the junction of capacitor1.p
/resistor1.n
and the junction of capacitor2.p
/resistor2.n
. The bridge is said to be balanced when no current flows through the current_sensor
. This occurs when the potentials at its connection points are equal. The condition for balance in this De Sauty bridge configuration is given by the equation:
where R₁
is the resistance of resistor1
and C₁
is the capacitance of capacitor1
, and R₂
is the resistance of resistor2
and C₂
is the capacitance of capacitor2
. This model allows for the simulation of the bridge's behavior under AC excitation, including observing whether it is balanced for the given parameter values C₁
and C₂
, and fixed resistances resistor1.R = 5.0
and resistor2.R = 2.0
. The initial voltage across capacitor2
is set to 0.0V
by the statement initial capacitor2.v = 0.0
in the relations section.
Usage
DeSauty(C₁=30μ, C₂=45μ)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
C₁ | Capacitance of the first capacitor (capacitor1 ). | F | 0.000029999999999999997 |
C₂ | Capacitance of the second capacitor (capacitor2 ). | F | 0.000044999999999999996 |
Behavior
Source
# AC bridge circuit for comparing capacitances
#
# This component models a De Sauty bridge, an electrical circuit configuration used for measuring capacitances.
# The bridge consists of four arms:
# Arm 1: `capacitor1` (with capacitance `C₁`)
# Arm 2: `resistor1` (with resistance `R1 = 5.0 Ohm`)
# Arm 3: `capacitor2` (with capacitance `C₂`)
# Arm 4: `resistor2` (with resistance `R2 = 2.0 Ohm`)
# An AC voltage, generated by `input_signal` and applied through `source`, is connected across the overall bridge structure.
# Specifically, one terminal of the source (`source.p`) connects to the common point of `capacitor1.n` and `capacitor2.n`.
# The other terminal of the source (`source.n`) connects to the common point of `resistor1.p` and `resistor2.p`, which is also connected to `ground`.
# A `current_sensor` acts as a detector, connected between the junction of `capacitor1.p`/`resistor1.n` and the junction of `capacitor2.p`/`resistor2.n`.
# The bridge is said to be balanced when no current flows through the `current_sensor`. This occurs when the potentials at its connection points are equal.
# The condition for balance in this De Sauty bridge configuration is given by the equation:
# ```math
# R_1 C_1 = R_2 C_2
# ```
# where `R₁` is the resistance of `resistor1` and `C₁` is the capacitance of `capacitor1`, and
# `R₂` is the resistance of `resistor2` and `C₂` is the capacitance of `capacitor2`.
# This model allows for the simulation of the bridge's behavior under AC excitation, including observing whether it is balanced for the given parameter values `C₁` and `C₂`,
# and fixed resistances `resistor1.R = 5.0` and `resistor2.R = 2.0`.
# The initial voltage across `capacitor2` is set to `0.0V` by the statement `initial capacitor2.v = 0.0` in the relations section.
example component DeSauty
# First resistor in one arm of the De Sauty bridge.
resistor1 = Resistor(R=5.0) [{
"Dyad": {
"placement": {"icon": {"x1": 800, "y1": 700, "x2": 1000, "y2": 900, "rot": 180}}
}
}]
# Second resistor in the other arm of the De Sauty bridge.
resistor2 = Resistor(R=2.0) [{
"Dyad": {
"placement": {"icon": {"x1": 800, "y1": 1300, "x2": 1000, "y2": 1500, "rot": 180}}
}
}]
# First capacitor in one arm of the De Sauty bridge, with capacitance C₁.
capacitor1 = Capacitor(C=C₁) [{
"Dyad": {
"placement": {"icon": {"x1": 200, "y1": 700, "x2": 400, "y2": 900, "rot": 180}}
}
}]
# Second capacitor in the other arm of the De Sauty bridge, with capacitance C₂.
capacitor2 = Capacitor(C=C₂) [{
"Dyad": {
"placement": {"icon": {"x1": 200, "y1": 1300, "x2": 400, "y2": 1500, "rot": 180}}
}
}]
# Measures the current between the two branches of the bridge, acting as the detector.
current_sensor = CurrentSensor() [{
"Dyad": {
"placement": {"icon": {"x1": 500, "y1": 1000, "x2": 700, "y2": 1200, "rot": 90}}
}
}]
# AC voltage source supplying the bridge.
source = VoltageSource() [{"Dyad": {"placement": {"icon": {"x1": 500, "y1": 400, "x2": 700, "y2": 600}}}}]
# Generates the sinusoidal input voltage for the AC source.
input_signal = BlockComponents.Sine(frequency=100.0, amplitude=1, phase=0) [{
"Dyad": {"placement": {"icon": {"x1": 500, "y1": 100, "x2": 700, "y2": 300, "rot": 90}}}
}]
# Reference ground for the circuit.
ground = Ground() [{
"Dyad": {"placement": {"icon": {"x1": 1150, "y1": 1150, "x2": 1350, "y2": 1350}}}
}]
# Capacitance of the first capacitor (`capacitor1`).
parameter C₁::Capacitance = 30μ
# Capacitance of the second capacitor (`capacitor2`).
parameter C₂::Capacitance = 45μ
relations
initial capacitor2.v = 0.0
connect(input_signal.y, source.V) [{"Dyad": {"edges": [{"S": 1, "E": 2}]}}]
connect(source.p, capacitor1.n, capacitor2.n) [{
"Dyad": {
"edges": [
{"S": 1, "M": [{"x": 100, "y": 500}, {"x": 100, "y": 1100}], "E": -1},
{"S": 2, "M": [{"x": 150, "y": 800}], "E": -1},
{"S": 3, "M": [{"x": 150, "y": 1400}], "E": -1}
],
"junctions": [{"x": 150, "y": 1100}]
}
}]
connect(source.n, resistor1.p, resistor2.p) [{
"Dyad": {
"edges": [
{"S": 1, "M": [{"x": 1100, "y": 500}, {"x": 1100, "y": 1100}], "E": -1},
{"S": 2, "M": [{"x": 1050, "y": 800}], "E": -1},
{"S": 3, "M": [{"x": 1050, "y": 1400}], "E": -1}
],
"junctions": [{"x": 1050, "y": 1100}]
}
}]
connect(source.n, ground.g) [{
"Dyad": {
"edges": [{"S": 2, "M": [{"x": 1250, "y": 1100}], "E": -1}],
"junctions": [{"x": 1100, "y": 1100}]
}
}]
connect(resistor1.n, current_sensor.n, capacitor1.p) [{
"Dyad": {
"edges": [{"S": 1, "E": -1}, {"S": 2, "E": -1}, {"S": 3, "E": -1}],
"junctions": [{"x": 600, "y": 800}]
}
}]
connect(resistor2.n, current_sensor.p, capacitor2.p) [{
"Dyad": {
"edges": [{"S": 1, "E": -1}, {"S": 2, "E": -1}, {"S": 3, "E": -1}],
"junctions": [{"x": 600, "y": 1400}]
}
}]
end
Flattened Source
# AC bridge circuit for comparing capacitances
#
# This component models a De Sauty bridge, an electrical circuit configuration used for measuring capacitances.
# The bridge consists of four arms:
# Arm 1: `capacitor1` (with capacitance `C₁`)
# Arm 2: `resistor1` (with resistance `R1 = 5.0 Ohm`)
# Arm 3: `capacitor2` (with capacitance `C₂`)
# Arm 4: `resistor2` (with resistance `R2 = 2.0 Ohm`)
# An AC voltage, generated by `input_signal` and applied through `source`, is connected across the overall bridge structure.
# Specifically, one terminal of the source (`source.p`) connects to the common point of `capacitor1.n` and `capacitor2.n`.
# The other terminal of the source (`source.n`) connects to the common point of `resistor1.p` and `resistor2.p`, which is also connected to `ground`.
# A `current_sensor` acts as a detector, connected between the junction of `capacitor1.p`/`resistor1.n` and the junction of `capacitor2.p`/`resistor2.n`.
# The bridge is said to be balanced when no current flows through the `current_sensor`. This occurs when the potentials at its connection points are equal.
# The condition for balance in this De Sauty bridge configuration is given by the equation:
# ```math
# R_1 C_1 = R_2 C_2
# ```
# where `R₁` is the resistance of `resistor1` and `C₁` is the capacitance of `capacitor1`, and
# `R₂` is the resistance of `resistor2` and `C₂` is the capacitance of `capacitor2`.
# This model allows for the simulation of the bridge's behavior under AC excitation, including observing whether it is balanced for the given parameter values `C₁` and `C₂`,
# and fixed resistances `resistor1.R = 5.0` and `resistor2.R = 2.0`.
# The initial voltage across `capacitor2` is set to `0.0V` by the statement `initial capacitor2.v = 0.0` in the relations section.
example component DeSauty
# First resistor in one arm of the De Sauty bridge.
resistor1 = Resistor(R=5.0) [{
"Dyad": {
"placement": {"icon": {"x1": 800, "y1": 700, "x2": 1000, "y2": 900, "rot": 180}}
}
}]
# Second resistor in the other arm of the De Sauty bridge.
resistor2 = Resistor(R=2.0) [{
"Dyad": {
"placement": {"icon": {"x1": 800, "y1": 1300, "x2": 1000, "y2": 1500, "rot": 180}}
}
}]
# First capacitor in one arm of the De Sauty bridge, with capacitance C₁.
capacitor1 = Capacitor(C=C₁) [{
"Dyad": {
"placement": {"icon": {"x1": 200, "y1": 700, "x2": 400, "y2": 900, "rot": 180}}
}
}]
# Second capacitor in the other arm of the De Sauty bridge, with capacitance C₂.
capacitor2 = Capacitor(C=C₂) [{
"Dyad": {
"placement": {"icon": {"x1": 200, "y1": 1300, "x2": 400, "y2": 1500, "rot": 180}}
}
}]
# Measures the current between the two branches of the bridge, acting as the detector.
current_sensor = CurrentSensor() [{
"Dyad": {
"placement": {"icon": {"x1": 500, "y1": 1000, "x2": 700, "y2": 1200, "rot": 90}}
}
}]
# AC voltage source supplying the bridge.
source = VoltageSource() [{"Dyad": {"placement": {"icon": {"x1": 500, "y1": 400, "x2": 700, "y2": 600}}}}]
# Generates the sinusoidal input voltage for the AC source.
input_signal = BlockComponents.Sine(frequency=100.0, amplitude=1, phase=0) [{
"Dyad": {"placement": {"icon": {"x1": 500, "y1": 100, "x2": 700, "y2": 300, "rot": 90}}}
}]
# Reference ground for the circuit.
ground = Ground() [{
"Dyad": {"placement": {"icon": {"x1": 1150, "y1": 1150, "x2": 1350, "y2": 1350}}}
}]
# Capacitance of the first capacitor (`capacitor1`).
parameter C₁::Capacitance = 30μ
# Capacitance of the second capacitor (`capacitor2`).
parameter C₂::Capacitance = 45μ
relations
initial capacitor2.v = 0.0
connect(input_signal.y, source.V) [{"Dyad": {"edges": [{"S": 1, "E": 2}]}}]
connect(source.p, capacitor1.n, capacitor2.n) [{
"Dyad": {
"edges": [
{"S": 1, "M": [{"x": 100, "y": 500}, {"x": 100, "y": 1100}], "E": -1},
{"S": 2, "M": [{"x": 150, "y": 800}], "E": -1},
{"S": 3, "M": [{"x": 150, "y": 1400}], "E": -1}
],
"junctions": [{"x": 150, "y": 1100}]
}
}]
connect(source.n, resistor1.p, resistor2.p) [{
"Dyad": {
"edges": [
{"S": 1, "M": [{"x": 1100, "y": 500}, {"x": 1100, "y": 1100}], "E": -1},
{"S": 2, "M": [{"x": 1050, "y": 800}], "E": -1},
{"S": 3, "M": [{"x": 1050, "y": 1400}], "E": -1}
],
"junctions": [{"x": 1050, "y": 1100}]
}
}]
connect(source.n, ground.g) [{
"Dyad": {
"edges": [{"S": 2, "M": [{"x": 1250, "y": 1100}], "E": -1}],
"junctions": [{"x": 1100, "y": 1100}]
}
}]
connect(resistor1.n, current_sensor.n, capacitor1.p) [{
"Dyad": {
"edges": [{"S": 1, "E": -1}, {"S": 2, "E": -1}, {"S": 3, "E": -1}],
"junctions": [{"x": 600, "y": 800}]
}
}]
connect(resistor2.n, current_sensor.p, capacitor2.p) [{
"Dyad": {
"edges": [{"S": 1, "E": -1}, {"S": 2, "E": -1}, {"S": 3, "E": -1}],
"junctions": [{"x": 600, "y": 1400}]
}
}]
metadata {}
end
Test Cases
This is setup code, that must be run before each test case.
using ElectricalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames
snapshotsdir = joinpath(dirname(dirname(pathof(ElectricalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/ElectricalComponents/bmmPM/test/snapshots"
Related
Examples
Experiments
Analyses