femagtools 1.6.2__py3-none-any.whl → 1.6.2a0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
femagtools/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  """
4
4
  __title__ = 'femagtools'
5
- __version__ = '1.6.2'
5
+ __version__ = '1.6.2a'
6
6
  __author__ = 'Ronald Tanner'
7
7
  __license__ = 'BSD'
8
8
  __copyright__ = 'Copyright 2016-2022 SEMAFOR Informatik & Energie AG'
femagtools/machine/pm.py CHANGED
@@ -681,17 +681,23 @@ class PmRelMachine(object):
681
681
  iq, id, T = self.mtpa(i1max)
682
682
  w1type = self.w1_umax(u1max, iq, id)
683
683
  Pmax = w1type/self.p*T
684
- w1max = 2*np.pi*speedmax*self.p
685
- # check max speed:
686
- if with_pmconst:
687
- iq, id, tq = self.iqd_pmech_imax_umax(
688
- speedmax, Pmax, i1max, u1max,
689
- with_mtpa, with_tmech)
690
- else:
691
- iq, id, tq = self.iqd_imax_umax(
692
- i1max, w1max, u1max,
693
- T, with_mtpv=False,
694
- with_tmech=with_tmech)
684
+ sp = speedmax
685
+ while sp > w1type/2/np.pi/self.p:
686
+ w1max = 2*np.pi*sp*self.p
687
+ try:
688
+ if with_pmconst:
689
+ iq, id, tq = self.iqd_pmech_imax_umax(
690
+ sp, Pmax, i1max, u1max,
691
+ with_mtpa, with_tmech)
692
+ else:
693
+ iq, id, tq = self.iqd_imax_umax(
694
+ i1max, w1max, u1max,
695
+ T, with_mtpv=False,
696
+ with_tmech=with_tmech)
697
+ break
698
+ except ValueError:
699
+ sp -= 5e-2*speedmax
700
+ speedmax = sp
695
701
  i1 = betai1(iq, id)[1]
696
702
  if (abs(i1max) >= i1
697
703
  and round(u1max, 1) >= round(np.linalg.norm(
@@ -922,6 +928,8 @@ class PmRelMachine(object):
922
928
 
923
929
  if speedrange[-1] < speedrange[-2]:
924
930
  speedrange = speedrange[:-1]
931
+ if speedrange[-1] < nmax:
932
+ logger.warning("adjusted nmax %f -> %f", nmax, speedrange[-1])
925
933
  logger.info("Speedrange T=%g Nm %s", Tf, speedrange)
926
934
  n3 = speedrange[-1]
927
935
  nstab = [int(nsamples*(x1-x2)/n3)
@@ -1264,10 +1272,10 @@ class PmRelMachineLdq(PmRelMachine):
1264
1272
  r = self._losses['magnet'](beta, i1)*(f1/self.fo)**2
1265
1273
  try:
1266
1274
  idx = np.argwhere(r < 0)
1267
- if len(idx.squeeze()):
1275
+ if len(idx.squeeze()):
1268
1276
  r[idx.squeeze()] = 0.0
1269
- except:
1270
- pass
1277
+ except:
1278
+ pass
1271
1279
  return r
1272
1280
 
1273
1281
  def iqd_plmag(self, iq, id, f1):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: femagtools
3
- Version: 1.6.2
3
+ Version: 1.6.2a0
4
4
  Summary: Python API for FEMAG
5
5
  Author-email: Ronald Tanner <tar@semafor.ch>, Dapu Zhang <dzhang@gtisoft.com>, Beat Holm <hob@semafor.ch>, Günther Amsler <amg@semafor.ch>, Nicolas Mauchle <mau@semafor.ch>
6
6
  License: Copyright (c) 2016-2023, Semafor Informatik & Energie AG, Basel
@@ -1,4 +1,4 @@
1
- femagtools/__init__.py,sha256=UUpTqpPxTE9-KNmWFDhqdB2Sy56sR68HZdRSYl0X3BA,1615
1
+ femagtools/__init__.py,sha256=aHxVazfD0o2bt2ZlLb6sDCb99osgT90FABxCVlQLI4Q,1616
2
2
  femagtools/airgap.py,sha256=ZCIZTYf6BbuNYx68y9fUDBQo3taN8RuGl8q-jJ7ygiA,1577
3
3
  femagtools/amazon.py,sha256=O1ICuv21XDAJi1qK1Sigs2TdS6hDZP19OzvmE2t76wU,12069
4
4
  femagtools/amela.py,sha256=pHjfXzpANI-7oz8MtrqNcyDZ6PxVM91vCJuvYhHy1rk,13891
@@ -62,7 +62,7 @@ femagtools/machine/__init__.py,sha256=U8W65K7jr7jDdC1KnJh0WjYd8DFaLnIFVvlh-TKcV9
62
62
  femagtools/machine/afpm.py,sha256=hNyDFRLGmCuWRPZl_u1ztJ4pA-Y_mxLaVvg3UJkzRuE,24766
63
63
  femagtools/machine/effloss.py,sha256=I8s2Fog6klhgcRYw3448qfGvzaQ0AQUJXFdNoeDyhfE,13138
64
64
  femagtools/machine/im.py,sha256=ScIOLrlc4CPLYFNx2MmJqkpmbky_HXxFGZbMWUNGBrk,37881
65
- femagtools/machine/pm.py,sha256=R8RWzQrMI_fNaUU7ruHnQxg3-Lubh1vp-6EG6z5QbRk,56229
65
+ femagtools/machine/pm.py,sha256=fyl5DXtrz2vLahcDyM4-bYwMlEZnSPfEQ2gq9zJTFR4,56572
66
66
  femagtools/machine/sizing.py,sha256=aN_OahewjTTBHnpRNfLh1AGFhqnoeZVuMBeb_3MCIVI,23096
67
67
  femagtools/machine/sm.py,sha256=pkik913kU41PPiUpwDy_6BEKfCIhvY6FEp-fbU2Lqew,34320
68
68
  femagtools/machine/utils.py,sha256=g9q4j9KxUWdb_iUOUQDuaAwwJx8XM0kZMpgnwsNz8hU,18616
@@ -200,9 +200,9 @@ tests/moo/__init__.py,sha256=l8HD-AY8EwxOoo_VrG3HgEZb2MaHypvnhKCVSkR-DTA,808
200
200
  tests/moo/test_algorithm.py,sha256=Em8sFm2vzPmuIzRrBBnUQLU_TYuJHSf-kEeozw0XeX4,2563
201
201
  tests/moo/test_population.py,sha256=FvX9LRCxQx0_E2GxHQ5vKwOYFBQiNbT6Lmv5GmNWjTQ,5471
202
202
  tests/moo/test_problem.py,sha256=ALeP4u7g-dFhfwWL8vxivdrrYzVKPjHMCAXzzgyNZbs,467
203
- femagtools-1.6.2.dist-info/LICENSE,sha256=V5OED7AzEaOtvbfgNheKOSUeNtijvKQuo84FtSJNkJU,1316
204
- femagtools-1.6.2.dist-info/METADATA,sha256=_Fn2D61D0C-a96X_49iBhYauUSoeaM6AAR28-QDL1is,5685
205
- femagtools-1.6.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
206
- femagtools-1.6.2.dist-info/entry_points.txt,sha256=UXpu6KnrykN89sCUaFAIIzn_dYwuxizUS0GcPdoekro,195
207
- femagtools-1.6.2.dist-info/top_level.txt,sha256=Ri4YWtU8MZTzNje9IKyXhTakNbsrCynuWdon4Yq94Dc,17
208
- femagtools-1.6.2.dist-info/RECORD,,
203
+ femagtools-1.6.2a0.dist-info/LICENSE,sha256=V5OED7AzEaOtvbfgNheKOSUeNtijvKQuo84FtSJNkJU,1316
204
+ femagtools-1.6.2a0.dist-info/METADATA,sha256=mrvzMtITjmM8cTGBg156SorCQU5JJ2TDVGDYrvBSPEM,5687
205
+ femagtools-1.6.2a0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
206
+ femagtools-1.6.2a0.dist-info/entry_points.txt,sha256=UXpu6KnrykN89sCUaFAIIzn_dYwuxizUS0GcPdoekro,195
207
+ femagtools-1.6.2a0.dist-info/top_level.txt,sha256=Ri4YWtU8MZTzNje9IKyXhTakNbsrCynuWdon4Yq94Dc,17
208
+ femagtools-1.6.2a0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5