Beispiel #1
0
 def test_inductor(self):
     '''
     '''
     fname = os.path.join(self.files_dir,\
             'inductor,p1nH.s2p')
     qucs_ntwk = Network(fname)
     self.dummy_media.frequency = qucs_ntwk.frequency
     skrf_ntwk = self.dummy_media.inductor(.1e-9)
     self.assertEqual(qucs_ntwk, skrf_ntwk)
Beispiel #2
0
 def test_resistor(self):
     '''
     '''
     fname = os.path.join(self.files_dir,\
             'resistor,1ohm.s2p')
     qucs_ntwk = Network(fname)
     self.dummy_media.frequency = qucs_ntwk.frequency
     skrf_ntwk = self.dummy_media.resistor(1)
     self.assertEqual(qucs_ntwk, skrf_ntwk)
Beispiel #3
0
 def test_capacitor(self):
     '''
     '''
     fname = os.path.join(self.files_dir,\
             'capacitor,p01pF.s2p')
     qucs_ntwk = Network(fname)
     self.dummy_media.frequency = qucs_ntwk.frequency
     skrf_ntwk = self.dummy_media.capacitor(.01e-12)
     self.assertEqual(qucs_ntwk, skrf_ntwk)
    def test_line(self):
        '''
        '''
        fname = os.path.join(self.files_dir,\
                'rectangularWaveguideWR10,200mil.s2p')

        qucs_ntwk = Network(fname)
        wg = RectangularWaveguide(frequency=qucs_ntwk.frequency, a=100 * mil)
        skrf_ntwk = wg.thru(Z0=50)**wg.line(200 * mil, 'm')**wg.thru(Z0=50)
        self.assertEqual(qucs_ntwk, skrf_ntwk)
Beispiel #5
0
    def test_impedance_mismatch(self):
        '''
        '''
        fname = os.path.join(self.files_dir,\
                'impedanceMismatch,50to25.s2p')
        qucs_ntwk = Network(fname)
        self.dummy_media.frequency = qucs_ntwk.frequency
        skrf_ntwk = self.dummy_media.thru(z0=50)**\
            self.dummy_media.thru(z0=25)

        self.assertEqual(qucs_ntwk, skrf_ntwk)
Beispiel #6
0
    def setUp(self):
        """

        """
        self.files_dir = os.path.join(
            os.path.dirname(os.path.abspath(__file__)), 'qucs_prj')
        fname = os.path.join(self.files_dir,\
                'distributedCircuit,line1mm.s2p')
        qucs_ntwk = Network(fname)
        self.a_media = DistributedCircuit(frequency=qucs_ntwk.frequency,
                                          R=1e5,
                                          G=1,
                                          L=1e-6,
                                          C=8e-12)
Beispiel #7
0
    def test_line(self):
        """
        """
        fname = os.path.join(self.files_dir,\
                'distributedCircuit,line1mm.s2p')
        qucs_ntwk = Network(fname)

        a_media = DistributedCircuit(frequency=qucs_ntwk.frequency,
                                     R=1e5,
                                     G=1,
                                     L=1e-6,
                                     C=8e-12)
        skrf_ntwk = a_media.thru(z0=50)**a_media.line(1e-3,'m')\
                    **a_media.thru(z0=50)
        self.assertEqual(qucs_ntwk, skrf_ntwk)
 def test_conductor_loss(self):
     '''
     This only compares the magnitude of the generated line, because
     the loss approximation doesnt account for reactance of field on
     sidewalls.
     '''
     ntwk = Network(os.path.join(self.pwd, 'wr1p5_1in_swg_Al_0rough.s2p'))
     wg = RectangularWaveguide(
         frequency=ntwk.frequency,
         a=15 * mil,
         z0=50,
         rho=1 / (3.8e7),
     )
     self.assertTrue(
         max(abs(wg.line(1, 'in').s_mag[:, 1, 0] -
                 ntwk.s_mag[:, 1, 0])) < 1e-3)