コード例 #1
0
    def test_input_reflection_coefficient(self):
        """
        Test the input reflection coefficient value of the line.        
        """
        Gamma_in = rf.zl_2_Gamma0(self.z0, self.zin)

        expected_Gamma_in = (self.zin - self.z0) / (self.zin + self.z0)

        assert_equal(Gamma_in, expected_Gamma_in)
コード例 #2
0
    def test_shunt_admittance(self):
        Ys = [1, 1 + 1j, rf.INF]
        for Y in Ys:
            assert_array_almost_equal(
                rf.Circuit.ShuntAdmittance(self.freq, Y, 'imp').s,
                self.media.shunt(
                    self.media.load(rf.zl_2_Gamma0(self.media.z0, 1 / Y))).s)

        # Y=INF is a a 2-ports short, aka a ground
        assert_array_almost_equal(
            rf.Circuit.ShuntAdmittance(self.freq, rf.INF, 'imp').s,
            rf.Circuit.Ground(self.freq, 'ground').s)
コード例 #3
0
    def test_propagation_constant_from_reflection_coefficient(self):
        """
        Test the propagation constant value deduced from reflection coef
        """
        Gamma_in = rf.zl_2_Gamma0(self.z0, self.zin)
        Gamma_l = -1  # short

        gamma = rf.reflection_coefficient_2_propagation_constant(
            Gamma_in, Gamma_l, self.d)
        expected_gamma = 0.02971 + 1.272j

        assert_almost_equal(real(gamma), real(expected_gamma), decimal=4)
        assert_almost_equal(imag(gamma), imag(expected_gamma), decimal=4)