Esempio n. 1
0
 def setUp(self):
     """Run at the begining of every test to setup the gui"""
     self.test_obj = LamHole(Rint=0.1, Rext=0.2)
     self.test_obj.hole = list()
     self.test_obj.hole.append(
         HoleM53(H0=0.10,
                 H1=0.11,
                 H2=0.12,
                 H3=0.13,
                 W1=0.14,
                 W2=0.15,
                 W3=0.16,
                 W4=0.17))
     self.widget = PHoleM53(self.test_obj.hole[0])
Esempio n. 2
0
 def test_init_53(self):
     """Check that you can edit a hole 53"""
     self.test_obj.rotor.hole[0] = HoleM53(Zh=11)
     self.test_obj.rotor.hole[0].magnet_0.mat_type.name = "Magnet1"
     self.widget = SMHoleMag(machine=self.test_obj,
                             matlib=self.matlib,
                             is_stator=False)
     self.assertEqual(self.widget.out_hole_pitch.text(),
                      "Slot pitch = 360 / 2p = 32.73 °")
     self.assertEqual(
         self.widget.tab_hole.widget(0).c_hole_type.currentIndex(), 3)
     self.assertEqual(
         self.widget.tab_hole.widget(0).c_hole_type.currentText(),
         "Slot Type 53")
Esempio n. 3
0
    def setUp(self):
        """Run at the begining of every test to setup the machine"""
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamHole(
            is_internal=True, Rint=0.1, Rext=0.2, is_stator=False, L1=0.7
        )
        test_obj.rotor.hole = list()
        test_obj.rotor.hole.append(
            HoleM53(
                Zh=8,
                W1=15e-3,
                W2=10e-3,
                W3=40e-3,
                W4=pi / 4,
                H0=75e-3,
                H1=5e-3,
                H2=20e-3,
                H3=5e-3,
            )
        )

        self.test_obj = test_obj
Esempio n. 4
0
from numpy import exp, arcsin, ndarray, pi

# For AlmostEqual
DELTA = 1e-6

HoleM53_test = list()

# Two hole
test_obj = LamHole(is_internal=True, Rext=80.2e-3, Rint=0)
test_obj.hole = list()
test_obj.hole.append(
    HoleM53(Zh=8,
            H0=0.02,
            H1=0.001,
            H2=0.01,
            H3=0.003,
            W1=0.005,
            W2=0,
            W3=0.01,
            W4=0.78))
HoleM53_test.append({
    "test_obj": test_obj,
    "S_exp": 3.63836e-4,
    "SM_exp": 0.0002,
    "Rmin": 5.8879558e-2,
    "Rmax": 7.92e-2,
    "W5": 7.78324e-3,
})

# One hole
test_obj = LamHole(is_internal=True, Rext=80.2e-3, Rint=0)