Esempio n. 1
0
def test_dielectric(er, cond, f):
    thk = 0.5
    total_time = max(1.0 / f, 40e-9)
    dx = 0.005
    grid = fdtd.Grid1D(dx, 2.0)
    print(grid)
    grid.set_material(1.0, 1.0 + thk, er=er, cond=cond)

    amplitude = 1.0
    source = fdtd.Sinusoid(0.1, 'Sine', amplitude, f)
    grid.add_source(source)
    transmission_probe = fdtd.Probe(1.9)
    grid.add_probe(transmission_probe)
    grid.solve(total_time)
    result = transmission_probe.data.max()

    air = shield.Material()
    dielectric = shield.Material(er=er, cond=cond, thickness=thk)
    expected = 1 / shield.shielding_effectiveness(f, air, dielectric)

    assert result == approx(expected, rel=0.01)
Esempio n. 2
0
def test_absorption(ur, cond_r, result):
    f = 1e6
    t = 3.175e-3
    shld = ps.Material(ur=ur, cond=(cond_r * COND_CU), thickness=t)
    se_db = ps.db(ps.absorption_loss(f, shld))
    assert se_db == approx(result, rel=0.01)
Esempio n. 3
0
def test_reflection(ur, cond_r, result):
    f = 1e6
    air = ps.Material()
    shld = ps.Material(ur=ur, cond=(cond_r * COND_CU))
    se_db = ps.db(ps.reflection_loss(f, air, shld))
    assert se_db == approx(result, rel=0.01)
Esempio n. 4
0
def test_skin_depth(ur, cond_r, result):
    f = 1e6
    shld = ps.Material(ur=ur, cond=(cond_r * COND_CU))
    assert shld.skin_depth(f) == approx(result, rel=0.01)
Esempio n. 5
0
def test_impedance(er, ur, cond, f, result):
    mat = ps.Material(er=er, ur=ur, cond=cond)
    assert mat.impedance(f) == approx(result)