Beispiel #1
0
def test_2layer_area():
    er1, t1 = 5.0, 1e-3
    er2, t2 = 1.0, 3e-3
    A = 3.0
    pp1 = ParallelPlates((er1, er2), (t1, t2))
    pp2 = ParallelPlates((er1, er2), (t1, t2), area=A)
    Va = 25.0
    X = np.linspace(0, t1 + t2, 11)
    assert pp1.capacitance() == approx(pp2.capacitance() / A)
    assert pp1.efield(X, Va) == approx(pp2.efield(X, Va))
    assert pp1.potential(X, Va) == approx(pp2.potential(X, Va))
Beispiel #2
0
def test_capacitance_2layer():
    er1, t1 = 5.0, 1e-3
    er2, t2 = 1.0, 3e-3
    pp = ParallelPlates((er1, er2), (t1, t2))
    assert pp.capacitance() == approx(2.767e-9)
Beispiel #3
0
def test_capacitance():
    pp = ParallelPlates(3.5, 1e-3)
    assert pp.capacitance() == approx(30.989e-9)
Beispiel #4
0
def test_capacitance_area():
    pp = ParallelPlates(3.5, 1e-3, area=10.0)
    assert pp.capacitance() == approx(309.89e-9, rel=0.001)
Beispiel #5
0
def test_energy():
    pp = ParallelPlates(3.5, 1e-3)
    Va = 10.0
    expected = 0.5 * pp.capacitance() * Va**2
    assert pp.energy(Va) == approx(expected)
Beispiel #6
0
def test_charge():
    pp = ParallelPlates(3.5, 1e-3)
    Va = 10.0
    expected = pp.capacitance() * Va
    assert pp.charge(Va) == approx(expected)