Beispiel #1
0
def test_airgap_induction2():
    testPath = os.path.join(os.path.split(__file__)[0], 'data')
    if len(testPath) == 0:
        testPath = os.path.join(os.path.abspath('.'), 'data')
    r = ag.read(os.path.join(testPath, 'bag2.dat'))
    np.testing.assert_almost_equal(r['Bamp'], 0.9272, 3)
    assert r['npoles'] == 32
    harms = [nue for nue, amp in zip(r['nue'],
                                     r['B_nue']) if amp > 1e-2]

    assert harms == [16, 48, 80, 112, 144, 176, 208, 272]
Beispiel #2
0
def test_airgap_induction():
    testPath = os.path.join(os.path.split(__file__)[0], 'data')
    if len(testPath) == 0:
        testPath = os.path.join(os.path.abspath('.'), 'data')
    r = ag.read(os.path.join(testPath, 'bag.dat'))
    np.testing.assert_almost_equal(r['Bamp'], 1.26914, 3)
    assert r['npoles'] == 8
    harms = [nue for nue, amp in zip(r['nue'],
                                     r['B_nue']) if amp > 1e-2]

    assert harms == [4, 12, 20, 28, 36, 44, 52, 60, 68]
Beispiel #3
0
def test_airgap_induction():
    testPath = os.path.join(os.path.split(__file__)[0], 'data')
    if len(testPath) == 0:
        testPath = os.path.join(os.path.abspath('.'), 'data')
    r = ag.read(os.path.join(testPath, 'bag.dat'))
    np.testing.assert_almost_equal(r['Bamp'], 1.271, 3)
Beispiel #4
0
 def read_airgap_induction(self):
     """read airgap induction"""
     return ag.read(os.path.join(self.workdir, 'bag.dat'))
Beispiel #5
0
 def read_airgap_induction(self, modelname='', offset=0):
     """read airgap induction"""
     # we need to figure out the number of poles in model
     bch = self.read_bch(modelname, offset)
     return ag.read(os.path.join(self.workdir, 'bag.dat'),
                    bch.machine['p_sim'])