femagtools 1.8.6__tar.gz → 1.8.8__tar.gz
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-1.8.6/src/femagtools.egg-info → femagtools-1.8.8}/PKG-INFO +1 -1
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/__init__.py +2 -2
- femagtools-1.8.8/src/femagtools/amela.py +141 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/bch.py +11 -7
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/ecloss.py +121 -105
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/femag.py +13 -73
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/fsl.py +11 -8
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/isa7.py +174 -10
- femagtools-1.8.8/src/femagtools/leakinduc.py +63 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/losscoeffs.py +29 -3
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/afpm.py +138 -60
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/effloss.py +13 -1
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/mcv.py +173 -9
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/nc.py +16 -14
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/parstudy.py +3 -1
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/bch.py +126 -44
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/nc.py +13 -0
- femagtools-1.8.8/src/femagtools/shortcircuit.py +378 -0
- femagtools-1.8.8/src/femagtools/templates/psi-torq-rem-rot.mako +127 -0
- femagtools-1.8.8/src/femagtools/templates/psi-torq-rot.mako +98 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/tks.py +1 -1
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/windings.py +65 -0
- {femagtools-1.8.6 → femagtools-1.8.8/src/femagtools.egg-info}/PKG-INFO +1 -1
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools.egg-info/SOURCES.txt +4 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_afpm.py +2 -2
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_amela.py +1 -3
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_fsl.py +4 -4
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_nc.py +10 -0
- femagtools-1.8.6/src/femagtools/amela.py +0 -409
- {femagtools-1.8.6 → femagtools-1.8.8}/LICENSE +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/MANIFEST.in +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/README.md +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/pyproject.toml +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/setup.cfg +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/airgap.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/amazon.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/asm.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/bchxml.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/condor.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/conductor.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/config.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/convert.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dakota.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dakota_femag.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dakotaout.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/docker.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/area.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/areabuilder.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/concat.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/conv.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/converter.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/corner.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/dumprenderer.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/dxfparser.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/femparser.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/fslrenderer.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/functions.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/geom.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/journal.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/machine.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/plotrenderer.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/shape.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/svgparser.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/dxfsl/symmetry.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/erg.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/forcedens.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/getset.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/gmsh.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/google.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/grid.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/heat_source_network.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/hxy.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/jhb.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/job.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/im.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/pm.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/sizing.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/sm.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/machine/utils.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/magnet.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/me.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/model.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moo/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moo/algorithm.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moo/population.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moo/problem.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moo/test/AlgorithmTest.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moo/test/PopulationTest.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moo/test/ProblemTest.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/moproblem.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/multiproc.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/mxw2msh.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/netlist.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/ntib.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/opt.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/char.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/fieldlines.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/fluxdens.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/forcedens.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/machine.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/mcv.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/phasor.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/plot/wdg.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/poc.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/semi_fea.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/svgfsl/converter.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/FE-losses.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/afm_rotor.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/afm_stator.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/airgapinduc.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/asyn_motor.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/basic_modpar.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/bertotti.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/calc_field_ts.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/calc_therm_field.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/cogg_calc.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/colorgrad.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/com_motor_sim.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/conduct-data.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/connect_models.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/cu_losses.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/displ_stator_rotor.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/ec-rotorbar.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/fe-contr.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/fieldcalc.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/gen_hairpin_winding.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/gen_winding.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/inductances.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/ld_lq_fast.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/leak_dist_wind.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/leak_evol_wind.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/leak_tooth_wind.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnet-data.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetFC2.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetIron.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetIron2.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetIron3.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetIron4.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetIron5.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetIronV.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetSector.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetSectorLinear.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetShell.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/magnetShell2.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/mesh-airgap.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/modal_analysis.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/modified_steinmetz.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/mult_cal_fast.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/new_model.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/noloadflux-rot.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/noloadflux.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/noloadfluxdc.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/open.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/plots.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/pm_sym_f_cur.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/pm_sym_fast.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/pm_sym_loss.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/prepare_thermal.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/psd_psq_fast.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/ring.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/rot_hsm.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/rotorAsyn.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/rotorKs2.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/rotor_msh.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/rotor_winding.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/shortcircuit.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/srm.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/stator1.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/stator2.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/stator3Linear.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/stator4.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/statorBG.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/statorRing.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/statorRotor3.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/stator_msh.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/therm-dynamic.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/therm_static.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/templates/torq_calc.mako +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/ts.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/utils.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/vbf.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/vtu.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools/zmq.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools.egg-info/dependency_links.txt +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools.egg-info/entry_points.txt +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools.egg-info/requires.txt +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/femagtools.egg-info/top_level.txt +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/engines/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/engines/test_amazon.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/engines/test_config.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/geom/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/geom/test_functions.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/geom/test_point_inside.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/moo/__init__.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/moo/test_algorithm.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/moo/test_population.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/moo/test_problem.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_airgap_induction.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_asm.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_bchreader.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_conductor.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_convert.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_dxfsl.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_effloss.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_erg.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_femag.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_forcedens.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_heat_source_network.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_hxy.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_im.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_isa7.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_jhb.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_job.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_losscoeffs.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_machine.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_magncurv.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_magnet.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_mcv.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_mcvreader.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_me.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_model.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_parident.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_parstudy.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_pocfile.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_sizing.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_sm.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_tksreader.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_ts.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_vbfreader.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_vtu.py +0 -0
- {femagtools-1.8.6 → femagtools-1.8.8}/src/tests/test_windings.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: femagtools
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.8
|
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
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
"""
|
4
4
|
__title__ = 'femagtools'
|
5
|
-
__version__ = '1.8.
|
5
|
+
__version__ = '1.8.8'
|
6
6
|
__author__ = 'Ronald Tanner'
|
7
7
|
__license__ = 'BSD'
|
8
|
-
__copyright__ = 'Copyright 2023-
|
8
|
+
__copyright__ = 'Copyright 2023-2025 Gamma Technology'
|
9
9
|
|
10
10
|
from .asm import read
|
11
11
|
from .bch import Reader
|
@@ -0,0 +1,141 @@
|
|
1
|
+
'''Calculate Magnet Losses with AMELA
|
2
|
+
|
3
|
+
'''
|
4
|
+
import sys
|
5
|
+
import json
|
6
|
+
import pathlib
|
7
|
+
import logging
|
8
|
+
from pathlib import Path
|
9
|
+
import femagtools.nc
|
10
|
+
import numpy as np
|
11
|
+
from numpy import pi, sin, cos
|
12
|
+
import subprocess
|
13
|
+
|
14
|
+
# set logging
|
15
|
+
logger = logging.getLogger(__name__)
|
16
|
+
|
17
|
+
|
18
|
+
class Amela():
|
19
|
+
'''Run Amela Calculation
|
20
|
+
|
21
|
+
Args:
|
22
|
+
workdir : working directory of femag calculation
|
23
|
+
(The directory that includes the nc file)
|
24
|
+
amela_dir: str (optional) amela directory
|
25
|
+
magnet_data : calculation control name must be provided
|
26
|
+
dict(name='test',
|
27
|
+
-- the following parameters are optional
|
28
|
+
mur=1.05,
|
29
|
+
sigma=625000,
|
30
|
+
hm=3,
|
31
|
+
wm=20,
|
32
|
+
lm=30,
|
33
|
+
speed=1000,
|
34
|
+
nsegwid=0,
|
35
|
+
nseglen=0)
|
36
|
+
'''
|
37
|
+
|
38
|
+
def __init__(self, workdir: str, magnet_data: dict,
|
39
|
+
amela_dir=None):
|
40
|
+
|
41
|
+
self.magn = magnet_data
|
42
|
+
self.workdir = pathlib.Path(workdir)
|
43
|
+
if amela_dir is not None:
|
44
|
+
self.amela_dir = pathlib.Path(amela_dir)
|
45
|
+
else:
|
46
|
+
self.amela_dir = self.workdir
|
47
|
+
|
48
|
+
self.jsonfile = []
|
49
|
+
if sys.platform == 'win32':
|
50
|
+
self.cmd = [str(self.amela_dir / 'AMELA.BAT')]
|
51
|
+
else:
|
52
|
+
self.cmd = [str(self.amela_dir / 'AMELA')]
|
53
|
+
# default batch
|
54
|
+
self.cmd.append('--b')
|
55
|
+
# append calc options
|
56
|
+
if 'speed' in self.magn:
|
57
|
+
self.cmd.append(f"--speed {self.magn['speed']}")
|
58
|
+
if 'nsegwid' in self.magn:
|
59
|
+
self.cmd.append(f"--nsegwid {self.magn['nsegwid']}")
|
60
|
+
if 'nseglen' in self.magn:
|
61
|
+
self.cmd.append(f"--nseglen {self.magn['nseglen']}")
|
62
|
+
|
63
|
+
def get_magnet_data_all(self, num_op):
|
64
|
+
'''get all magnet data for all loadcases'''
|
65
|
+
nc_name = self.workdir / self.magn['name']
|
66
|
+
r = femagtools.nc.read(nc_name)
|
67
|
+
return [r.get_magnet_data(ibeta=i) for i in num_op]
|
68
|
+
|
69
|
+
def export_json(self, pm_data: list):
|
70
|
+
'''Export magnet data to json files
|
71
|
+
|
72
|
+
Args:
|
73
|
+
pm_data: list of magnet data
|
74
|
+
|
75
|
+
'''
|
76
|
+
return
|
77
|
+
pm_dir = self.amela_dir / self.magn['name']
|
78
|
+
pm_dir.mkdir(exist_ok=True)
|
79
|
+
for i in pm_data:
|
80
|
+
filename = (pm_dir / i['name']).with_suffix('.json')
|
81
|
+
self.jsonfile.append(str(filename)) # for the future use
|
82
|
+
# pop out non necessary data
|
83
|
+
i.pop('bl')
|
84
|
+
i.pop('elcp')
|
85
|
+
with filename.open('w') as f:
|
86
|
+
json.dump(i, f)
|
87
|
+
logger.info('Exporting %s ...', i['name'])
|
88
|
+
|
89
|
+
def read_loss(self, pm_data: dict) -> dict:
|
90
|
+
'''Read magnet losses
|
91
|
+
|
92
|
+
Args:
|
93
|
+
pm_data : dict
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
losses
|
97
|
+
'''
|
98
|
+
losses = {}
|
99
|
+
for i in range(len(pm_data)):
|
100
|
+
dirname = self.magn['name'] + '/' + pm_data[i]['name'] + \
|
101
|
+
'/EClosses.tab'
|
102
|
+
result_name = self.amela_dir / dirname
|
103
|
+
with result_name.open() as f:
|
104
|
+
data = np.loadtxt(f)
|
105
|
+
total_loss = np.mean(data[0:-1, -1])
|
106
|
+
losses[pm_data[i]['name']] = {"loss_data":data, "total_loss": total_loss}
|
107
|
+
logger.info("Magnet losses in superelement %s is %.3f W",
|
108
|
+
pm_data[i]['name'].split('se')[-1], total_loss)
|
109
|
+
return losses
|
110
|
+
|
111
|
+
def __call__(self, ialh=False) -> dict:
|
112
|
+
'''Run amela calculation
|
113
|
+
|
114
|
+
Args:
|
115
|
+
ialh: use method IALH if True else 3DI
|
116
|
+
|
117
|
+
Returns:
|
118
|
+
losses
|
119
|
+
'''
|
120
|
+
# get magnet data
|
121
|
+
nc_name = self.workdir / self.magn['name']
|
122
|
+
nc = femagtools.nc.read(nc_name)
|
123
|
+
num_cases = nc.el_fe_induction_1.shape[3] - 1
|
124
|
+
if 'loadcase' in self.magn:
|
125
|
+
indx = self.magn['loadcase'] - 1
|
126
|
+
else:
|
127
|
+
indx = num_cases
|
128
|
+
if indx == 3:
|
129
|
+
indx = num_cases # avoid error
|
130
|
+
|
131
|
+
r = nc.get_magnet_data(indx)
|
132
|
+
# export to json
|
133
|
+
#self.export_json(r)
|
134
|
+
# run amela
|
135
|
+
calc_method = 'IALH' if ialh else '3DI'
|
136
|
+
cmd = self.cmd + ['--calc', calc_method, self.magn['name'] + '/']
|
137
|
+
log_file = self.amela_dir / 'amela.out'
|
138
|
+
logger.info("Calculating magnet losses with AMELA ...")
|
139
|
+
with log_file.open('w') as output:
|
140
|
+
subprocess.run(cmd, stdout=output)
|
141
|
+
return self.read_loss(r)
|
@@ -1057,10 +1057,11 @@ class Reader:
|
|
1057
1057
|
e.g. : idList[-450, -350, -250, -150, -50, 0]
|
1058
1058
|
idList[-500, -400, -300, -200, -100, 0, 0]
|
1059
1059
|
'''
|
1060
|
-
|
1061
|
-
if idList[-1] == 0 and len(idList) > 2 and \
|
1062
|
-
diff[-1] == 0:
|
1060
|
+
if list(idList).count(0) > 1: # femag writes duplicate id==0 values
|
1063
1061
|
idList = idList[:-1]
|
1062
|
+
diff = np.floor(np.abs(np.diff(idList)))
|
1063
|
+
if n := np.trim_zeros(np.diff(diff)).size:
|
1064
|
+
idList = idList[:-n]
|
1064
1065
|
return idList
|
1065
1066
|
|
1066
1067
|
def __read_psidq(self, content):
|
@@ -1085,8 +1086,7 @@ class Reader:
|
|
1085
1086
|
ncols = ncols-1
|
1086
1087
|
|
1087
1088
|
id = np.reshape(m[0], (-1, ncols)).T[0]
|
1088
|
-
|
1089
|
-
id = self.__removeTrailingZero(id)
|
1089
|
+
id = self.__removeTrailingZero(id)
|
1090
1090
|
nrows = len(id)
|
1091
1091
|
if nrows > 1 and id[nrows-1] < id[nrows-2]:
|
1092
1092
|
nrows = nrows-1
|
@@ -1121,8 +1121,7 @@ class Reader:
|
|
1121
1121
|
ncols = ncols-1
|
1122
1122
|
|
1123
1123
|
id = np.reshape(m[0], (-1, ncols)).T[0]
|
1124
|
-
|
1125
|
-
id = self.__removeTrailingZero(id)
|
1124
|
+
id = self.__removeTrailingZero(id)
|
1126
1125
|
nrows = len(id)
|
1127
1126
|
if nrows > 1 and id[nrows-1] < id[nrows-2]:
|
1128
1127
|
nrows = nrows-1
|
@@ -1610,6 +1609,11 @@ class Reader:
|
|
1610
1609
|
losses['staza'] = floatnan(rec[0])
|
1611
1610
|
losses['stajo'] = floatnan(rec[1])
|
1612
1611
|
losses['total'] += losses['staza']+losses['stajo']
|
1612
|
+
|
1613
|
+
elif content[i+1].split() == ['Iron', '----']:
|
1614
|
+
losses['rotfe'] = sum([floatnan(x) for x in rec])
|
1615
|
+
losses['total'] += losses['rotfe']
|
1616
|
+
|
1613
1617
|
else:
|
1614
1618
|
losses['rotfe'] = floatnan(rec[1])
|
1615
1619
|
losses['total'] += losses['rotfe']
|
@@ -5,7 +5,6 @@ __author__ = 'Max Hullmann, Dapu Zhang, Ivan Solc'
|
|
5
5
|
|
6
6
|
import logging
|
7
7
|
import warnings
|
8
|
-
from .amela import Amela
|
9
8
|
import numpy as np
|
10
9
|
from numpy import sinh, sin, cosh, cos, pi
|
11
10
|
from scipy.interpolate import RBFInterpolator
|
@@ -22,6 +21,7 @@ class FrequencyDomain:
|
|
22
21
|
self.phase = s['phase']
|
23
22
|
self.order = s['order']
|
24
23
|
|
24
|
+
|
25
25
|
def fd(s):
|
26
26
|
f = FrequencyDomain(s)
|
27
27
|
return f
|
@@ -53,10 +53,10 @@ def fft(s, fs):
|
|
53
53
|
freq = np.array([i*fs/l for i in range(ll)])
|
54
54
|
|
55
55
|
return fd(dict(cmplx_amp=mag,
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
amp=amp,
|
57
|
+
freq=freq,
|
58
|
+
phase=np.angle(mag[0:ll]),
|
59
|
+
order=freq/freq[idx_max]))
|
60
60
|
|
61
61
|
def dfac(x):
|
62
62
|
return 6/(x)**3*(sinh(x)-sin(x))/ \
|
@@ -76,7 +76,7 @@ def nptns(x, x1, nx):
|
|
76
76
|
|
77
77
|
def ngrid(wm, hm, elxy):
|
78
78
|
'''calculate number of grid points for the interpolation'''
|
79
|
-
be = np.sqrt(wm*hm/elxy['
|
79
|
+
be = np.sqrt(wm*hm/elxy['ecp'].shape[0])
|
80
80
|
nx = np.around(wm/be) + 1
|
81
81
|
ny = np.around(hm/be) + 1
|
82
82
|
|
@@ -91,13 +91,15 @@ def ngrid(wm, hm, elxy):
|
|
91
91
|
|
92
92
|
def binterp(x, y, xq, yq, b):
|
93
93
|
'''interpolate flux density with Rbf interpolator'''
|
94
|
-
f = RBFInterpolator(np.
|
95
|
-
inp = f(np.
|
94
|
+
f = RBFInterpolator(np.vstack((x, y)).T, b)
|
95
|
+
inp = f(np.vstack((xq, yq)).T)
|
96
96
|
return inp.reshape(len(np.unique(yq)), len(np.unique(xq)), -1)
|
97
97
|
|
98
98
|
def binterp_ialh2(x, y, xq, yq, b):
|
99
99
|
'''interpolate flux density with Rbf interpolator'''
|
100
|
-
|
100
|
+
yy = np.vstack((x, y)).T
|
101
|
+
logger.debug("shape y %s b %s", yy.shape, np.shape(b))
|
102
|
+
f = RBFInterpolator(yy, b, kernel='thin_plate_spline')
|
101
103
|
inp = f(np.array([[i, j] for i, j in zip(xq, yq)]))
|
102
104
|
return inp.reshape(len(np.unique(xq)), -1)
|
103
105
|
|
@@ -113,7 +115,7 @@ def Segmentation(wm, hm, lm, elxy, nsegx, nsegy, nsegz):
|
|
113
115
|
x,y coordinates of each element's centerpoint in local reference frame, for entire magnet - xx, yy
|
114
116
|
'''
|
115
117
|
# Default nx,ny,nz without considering the segmentation
|
116
|
-
be = np.sqrt(wm*hm/elxy['
|
118
|
+
be = np.sqrt(wm*hm/np.shape(elxy['ecp'])[1]) #square elements
|
117
119
|
nx_new = int(np.around(wm/be))
|
118
120
|
ny_new = int(np.around(hm/be))
|
119
121
|
nz_new = int(np.around(lm/be))
|
@@ -126,8 +128,8 @@ def Segmentation(wm, hm, lm, elxy, nsegx, nsegy, nsegz):
|
|
126
128
|
|
127
129
|
wms = wm/nsegx
|
128
130
|
hms = hm/nsegy
|
129
|
-
x0 = 0 # offset for
|
130
|
-
y0 = 0 # offset for
|
131
|
+
x0 = 0 # offset for ecpl
|
132
|
+
y0 = 0 # offset for ecpl
|
131
133
|
|
132
134
|
segxcpl = np.linspace(wms/2/nx_new, wms - wms/nx_new/2, nx_new) + x0 # x center points of wanted elements distribution, local ref frame, 1st segment
|
133
135
|
segycpl = np.linspace(hms/2/ny_new, hms - hms/ny_new/2, ny_new) + y0 # y center points of wanted elements distribution, local ref frame, 1st segment
|
@@ -149,21 +151,33 @@ def Segmentation(wm, hm, lm, elxy, nsegx, nsegy, nsegz):
|
|
149
151
|
|
150
152
|
return nx_new, ny_new, nz_new, xx, yy
|
151
153
|
|
152
|
-
class MagnLoss
|
154
|
+
class MagnLoss:
|
153
155
|
'''Calculate Magnet Losses with IALH Methode
|
154
156
|
Parameters
|
155
157
|
----------
|
156
|
-
|
157
|
-
modelname: name of the femag model (*.nc)
|
158
|
+
nc: (object) nc/isa7
|
158
159
|
ibeta: load cases [0, 1, 2]
|
160
|
+
magnet_data: array of pm data (see nc/isa7 get_magnet_data)
|
159
161
|
'''
|
160
|
-
def __init__(self,
|
161
|
-
super().__init__(workdir, magnet_data=dict(name=modelname))
|
162
|
-
|
163
|
-
|
162
|
+
def __init__(self, **kwargs):
|
163
|
+
#super().__init__(workdir, magnet_data=dict(name=modelname))
|
164
|
+
if 'nc' in kwargs:
|
165
|
+
ibeta = kwargs.get('ibeta', [0])
|
166
|
+
nc = kwargs['nc']
|
167
|
+
self.pm = [nc.get_magnet_data(ibeta=i) for i in ibeta]
|
168
|
+
elif 'magnet_data' in kwargs:
|
169
|
+
self.pm = kwargs['magnet_data']
|
164
170
|
self.speed = kwargs.get('speed', self.pm[-1][-1]['speed'])
|
165
|
-
|
166
|
-
|
171
|
+
logger.info("Speed %f", self.speed)
|
172
|
+
try: # move action rotation
|
173
|
+
self.theta = self.pm[-1][-1]['phi'] # rotor pos
|
174
|
+
self.lt = len(self.theta)
|
175
|
+
self.tgrid = 60/self.speed*(self.theta[-1]-self.theta[0])/360
|
176
|
+
except: # move action linear
|
177
|
+
self.displ = self.pm[-1][-1]['displ'] # rotor pos
|
178
|
+
self.lt = len(self.displ)
|
179
|
+
self.tgrid = (self.displ[-1]-self.displ[0])/self.speed
|
180
|
+
|
167
181
|
self.ls = self.pm[-1][-1]['ls']
|
168
182
|
self.th_loss = []
|
169
183
|
try:
|
@@ -187,7 +201,6 @@ class MagnLoss(Amela):
|
|
187
201
|
self.lm = 0
|
188
202
|
|
189
203
|
self.segz = kwargs.get('segz', [0])
|
190
|
-
self.is_meter = False
|
191
204
|
# Determine the number of segments in z direction
|
192
205
|
for i in range(len(self.segz)):
|
193
206
|
if self.segz[i] > 0:
|
@@ -204,78 +217,71 @@ class MagnLoss(Amela):
|
|
204
217
|
|
205
218
|
def periodicity_id(self, b):
|
206
219
|
'''identify the periodicity of a given signal'''
|
207
|
-
|
208
|
-
|
209
|
-
idx = bx.shape[1]
|
220
|
+
bxy = np.array(b['bxyl'])
|
221
|
+
npos = bxy.shape[2]
|
210
222
|
if self.symmetry:
|
211
|
-
|
223
|
+
nels = bxy.shape[1]
|
212
224
|
ff = []
|
213
225
|
|
214
|
-
for i in range(
|
215
|
-
r =
|
226
|
+
for i in range(npos):
|
227
|
+
r = npos//(i + 1)
|
216
228
|
|
217
229
|
if r > 1:
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
ff.append(f/(r-1))
|
225
|
-
|
230
|
+
ff.append(np.sum([np.sum(
|
231
|
+
np.abs(bxy[:, :, :(i+1)]
|
232
|
+
- bxy[:, :, (j+1)*(i+1)-1:(j+2)*(i+1)-1]),
|
233
|
+
axis=1) / ((i+1)*nels)
|
234
|
+
for j in range(r-1)])/(r-1))
|
226
235
|
minf = np.amin(ff)
|
227
236
|
i = np.argmin(ff)
|
228
|
-
bxymax = np.amax(
|
237
|
+
bxymax = np.amax(np.abs(bxy))
|
238
|
+
logger.debug("ll %d idx %d minf %f i %d bxymax %d",
|
239
|
+
nels, npos, minf, i, bxymax)
|
229
240
|
|
230
241
|
if minf < bxymax * 1e-4:
|
231
242
|
ishift = i
|
232
|
-
num_period = (
|
243
|
+
num_period = (npos - 1) // ishift
|
233
244
|
|
234
245
|
for j in range(num_period - 1):
|
235
|
-
|
236
|
-
by[:, 0:i+1] += by[:, i+j*ishift:(i+1)+(j+1)*ishift]
|
246
|
+
bxy[:, :, 0:i+1] += bxy[:, :, i+j*ishift:(i+1)+(j+1)*ishift]
|
237
247
|
|
238
|
-
|
239
|
-
|
240
|
-
idx = i + 1
|
248
|
+
bxy[:, :, 0:i + 1] /= num_period
|
249
|
+
npos = i + 1
|
241
250
|
else:
|
242
|
-
ff = []
|
243
|
-
|
244
|
-
for i in range(idx - 1, 0, -1):
|
245
|
-
f1 = np.sum(np.abs(bx[:, 0] - bx[:, i]))/ll + np.sum(np.abs(by[:, 0] - by[:, i]))/ll
|
246
|
-
ff.append(f1)
|
247
|
-
|
251
|
+
ff = [np.sum(np.abs(bxy[:, :, 0] - bxy[:, :, i]))/nels
|
252
|
+
for i in range(npos - 1, 0, -1)]
|
248
253
|
minf = np.amin(ff)
|
249
254
|
i = np.argmin(ff)
|
250
|
-
|
255
|
+
npos = npos - i
|
251
256
|
|
252
|
-
bx_fft = fft(b['
|
253
|
-
by_fft = fft(b['
|
257
|
+
bx_fft = fft(b['bxyf'][0], (npos-1)/self.tgrid)
|
258
|
+
by_fft = fft(b['bxyf'][1], (npos-1)/self.tgrid)
|
254
259
|
|
255
260
|
if self.symmetry:
|
256
261
|
bxy_amp = bx_fft.amp + by_fft.amp
|
257
|
-
tmp_period = np.array([(
|
258
|
-
|
259
|
-
|
262
|
+
tmp_period = np.array([(npos-1)/i
|
263
|
+
for i in range((npos-1)//2 + 1) if i > 0])
|
264
|
+
npos_nonzero = np.argwhere(tmp_period > 0.1*np.amax(bxy_amp)).squeeze()
|
265
|
+
period = tmp_period[npos_nonzero]
|
260
266
|
|
261
267
|
if np.sum(np.around([period[0]%i for i in period])) == 0:
|
262
|
-
|
263
|
-
if idx > bx.shape[1]:
|
264
|
-
idx = bx.shape[1]
|
265
|
-
|
266
|
-
self.tgrid = 60/self.speed*(self.theta[idx-1] - self.theta[0])/360
|
268
|
+
npos = min(int(np.ceil(np.amax(period))+1), bxy.shape[2])
|
267
269
|
|
268
|
-
|
270
|
+
try:
|
271
|
+
self.tgrid = 60/self.speed*(self.theta[npos-1] - self.theta[0])/360
|
272
|
+
except AttributeError:
|
273
|
+
self.tgrid = (self.displ[npos-1] - self.displ[0])/self.speed
|
274
|
+
logger.debug("Tgrid %f npos %d bx %f by %f xfreq %s yfreq %s",
|
275
|
+
self.tgrid, npos-1,
|
276
|
+
np.max(bx_fft.amp), np.max(by_fft.amp),
|
277
|
+
bx_fft.freq, by_fft.freq)
|
278
|
+
return [npos, bx_fft, by_fft]
|
269
279
|
|
270
280
|
def consider_bx(self, wm, hm, bx_fft, by_fft):
|
271
281
|
'''check if a caculation is necessary for the x direction'''
|
272
282
|
fft_freq = bx_fft.freq
|
273
283
|
fft_freq[fft_freq==0] = 0.5e-2
|
274
284
|
|
275
|
-
if not self.is_meter:
|
276
|
-
self.ls *= 1e-3
|
277
|
-
self.lm *= 1e-3
|
278
|
-
self.is_meter = True
|
279
285
|
# skin depth
|
280
286
|
delta = self.skin_depth(fft_freq)
|
281
287
|
|
@@ -296,9 +302,9 @@ class MagnLoss(Amela):
|
|
296
302
|
krfy = dfac(wm/delta)
|
297
303
|
py = ampf(by_fft, krfy)*wm**3*hm
|
298
304
|
|
299
|
-
if
|
300
|
-
|
301
|
-
|
305
|
+
if py > 0:
|
306
|
+
if px/py > 0.005:
|
307
|
+
self.is_x = True
|
302
308
|
|
303
309
|
def bpm_fft(self, nx, ny, nt, elxy, bxy):
|
304
310
|
'''interpolate the flux density'''
|
@@ -355,7 +361,7 @@ class MagnLoss(Amela):
|
|
355
361
|
c_ef_n0 = 32/pi**5/eta/dfac(xi)*6
|
356
362
|
sum_r = 0.0
|
357
363
|
sum_i = 0.0
|
358
|
-
n = np.
|
364
|
+
n = np.linspace(100)
|
359
365
|
lambda_n = (2*n + 1)*pi
|
360
366
|
beta_n = np.sqrt(lambda_n ** 2 + 2j*xi**2)
|
361
367
|
beta_nr = np.real(beta_n)
|
@@ -398,14 +404,16 @@ class MagnLoss(Amela):
|
|
398
404
|
if self.is_x and nu[ix] < 2:
|
399
405
|
with warnings.catch_warnings():
|
400
406
|
warnings.simplefilter('ignore')
|
401
|
-
px_se[iy,ix,c] = self.calc_pvpm(
|
402
|
-
|
407
|
+
px_se[iy,ix,c] = self.calc_pvpm(
|
408
|
+
bx_fft[iy,ix,c], max(c/self.tgrid, 1e-6),
|
409
|
+
mu[iy], hm, wm/self.segx[jj], 0)
|
403
410
|
|
404
411
|
if mu[iy] < 2:
|
405
412
|
with warnings.catch_warnings():
|
406
413
|
warnings.simplefilter('ignore')
|
407
|
-
py_se[iy,ix,c] = self.calc_pvpm(
|
408
|
-
|
414
|
+
py_se[iy,ix,c] = self.calc_pvpm(
|
415
|
+
by_fft[iy,ix,c], max(c/self.tgrid, 1e-6),
|
416
|
+
nu[ix], wm/self.segx[jj], hm, 0)
|
409
417
|
py_sum = np.sum(py_se)
|
410
418
|
px_sum = np.sum(px_se)
|
411
419
|
pec[jj,kk] = (py_sum + px_sum)*(self.ls/self.lm)*self.numpoles*self.segx[jj]
|
@@ -424,12 +432,10 @@ class MagnLoss(Amela):
|
|
424
432
|
ialh_loss = 0
|
425
433
|
loss_detail = []
|
426
434
|
for i in k:
|
427
|
-
logger.info(
|
435
|
+
logger.info('magnet geom / mm: w %.2f h %.2f l %.2f',
|
436
|
+
i["wm"]*1e3, i["hm"]*1e3, i["lm"]*1e3)
|
428
437
|
[nt, bx_fft, by_fft] = self.periodicity_id(i['bl'])
|
429
438
|
[nx, ny] = ngrid(i['wm'], i['hm'], i['elcp'])
|
430
|
-
keyset = ('wm', 'hm')
|
431
|
-
for j in keyset:
|
432
|
-
i[j]*=1e-3
|
433
439
|
self.consider_bx(i['wm'], i['hm'], bx_fft, by_fft)
|
434
440
|
bfft = self.bpm_fft(nx, ny, nt, i['elcp'], i['bl'])
|
435
441
|
loss = self.loss(*bfft, i['wm'], i['hm'])
|
@@ -483,7 +489,7 @@ class MagnLoss(Amela):
|
|
483
489
|
for m in range (int(ny/2)):
|
484
490
|
symmetry = 4 if (m > 0) & (n > 0) else 2 # symmetry factor 4 due to double symmetry utilization.
|
485
491
|
|
486
|
-
for k in range (0,1000,2): # loop is symmetrical on one side
|
492
|
+
for k in range (0, 1000, 2): # loop is symmetrical on one side
|
487
493
|
complex_xnmkf = sx_ampl[n,m,f]*2/(np.pi*(k+1))*epsilon_z_x/epsilon_z_y*(m*np.pi*wm/hm)/(2j *epsilon**2 + (n*np.pi)**2 + (m*np.pi*wm/hm)**2 + ry*((k+1)*np.pi*wm/lm)**2)
|
488
494
|
complex_ynmkf = sy_ampl[n,m,f]*2/(np.pi*(k+1)) *n*np.pi/(2j *epsilon**2 + (n*np.pi)**2 + (m*np.pi*wm/hm)**2 + rx*((k+1)*np.pi*wm/lm)**2)
|
489
495
|
real_x_nmkf = np.real(complex_xnmkf)
|
@@ -599,8 +605,8 @@ class MagnLoss(Amela):
|
|
599
605
|
break
|
600
606
|
|
601
607
|
filt = np.ones((nf))
|
602
|
-
for ii in range(ilim,nf):
|
603
|
-
filt[ii] =
|
608
|
+
for ii in range(ilim, nf):
|
609
|
+
filt[ii] = feclim/freq[ii]
|
604
610
|
for ii in range(nx): # Derivation in frequency domain
|
605
611
|
for jj in range(ny):
|
606
612
|
complbx[ii,jj,:] = -complbx[ii,jj,:]*freq*filt*np.pi*2j
|
@@ -608,8 +614,8 @@ class MagnLoss(Amela):
|
|
608
614
|
|
609
615
|
for ii in range (nx): # Inverse Fourier-Transformation
|
610
616
|
for jj in range (ny):
|
611
|
-
sx = np.fft.irfftn(complbx[ii,jj,:], [nt - 1])
|
612
|
-
sy = np.fft.irfftn(complby[ii,jj,:], [nt - 1])
|
617
|
+
sx = np.fft.irfftn(complbx[ii,jj,:], s=[nt - 1], axes=[0])
|
618
|
+
sy = np.fft.irfftn(complby[ii,jj,:], s=[nt - 1], axes=[0])
|
613
619
|
sx = np.append(sx, sx[0])
|
614
620
|
sy = np.append(sy, sy[0])
|
615
621
|
sx_pm_3D[ii,jj,:] = sx
|
@@ -636,25 +642,27 @@ class MagnLoss(Amela):
|
|
636
642
|
'''
|
637
643
|
nx_tot = int(nx*nsegx)
|
638
644
|
ny_tot = int(ny*nsegy)
|
639
|
-
|
640
|
-
Bxl_ac = np.zeros((
|
645
|
+
bxyl = np.asarray(bxy['bxyl'])
|
646
|
+
Bxl_ac = np.zeros((bxyl[0].shape))
|
641
647
|
Byl_ac = np.zeros_like(Bxl_ac)
|
642
648
|
|
643
649
|
# Remove the DC component of the original bxl, byl
|
644
650
|
for ii in range(Bxl_ac.shape[0]):
|
645
|
-
Bxl_ac[ii,:] =
|
651
|
+
Bxl_ac[ii,:] = bxyl[0, ii, :] - np.mean(bxyl[0,ii,:])
|
646
652
|
for ii in range(Byl_ac.shape[0]):
|
647
|
-
Byl_ac[ii,:] =
|
648
|
-
|
653
|
+
Byl_ac[ii,:] = bxyl[1,ii,:] - np.mean(bxyl[1,ii,:])
|
649
654
|
xx_ = excpl_new.ravel()
|
650
655
|
yy_ = eycpl_new.ravel()
|
651
656
|
bx_3d_ac = np.zeros((nx_tot,ny_tot,nt))
|
652
657
|
by_3d_ac = np.zeros_like(bx_3d_ac)
|
653
658
|
|
659
|
+
ecpl = elxy['ecpl']
|
654
660
|
# Interpolation to the new resolution -> [nx*nsegx, ny*nsegy, nt]
|
655
|
-
by_3d_ac = binterp_ialh2(
|
661
|
+
by_3d_ac = binterp_ialh2(ecpl[0], ecpl[1],
|
662
|
+
xx_, yy_, Byl_ac[:, 0:nt])
|
656
663
|
if self.is_x:
|
657
|
-
bx_3d_ac = binterp_ialh2(
|
664
|
+
bx_3d_ac = binterp_ialh2(ecpl[0], ecpl[1],
|
665
|
+
xx_, yy_, Bxl_ac[:, 0:nt])
|
658
666
|
bx_3d_ac = bx_3d_ac.reshape(nx_tot,ny_tot,nt)
|
659
667
|
by_3d_ac = by_3d_ac.reshape(nx_tot,ny_tot,nt)
|
660
668
|
|
@@ -725,8 +733,10 @@ class MagnLoss(Amela):
|
|
725
733
|
for ii in range(nsegx):
|
726
734
|
for jj in range(nsegy): # nsegy is always = 1
|
727
735
|
for kk in range(nsegz):
|
728
|
-
Plossx, Plossy = self.ialh2(sx_abs[2*ii*nx:2*(ii+1)*nx, 2*jj*ny:2*(jj+1)*ny,:],
|
729
|
-
|
736
|
+
Plossx, Plossy = self.ialh2(sx_abs[2*ii*nx:2*(ii+1)*nx, 2*jj*ny:2*(jj+1)*ny,:],
|
737
|
+
sy_abs[2*ii*nx:2*(ii+1)*nx, 2*jj*ny:2*(jj+1)*ny,:],
|
738
|
+
sx_phase[2*ii*nx:2*(ii+1)*nx, 2*jj*ny:2*(jj+1)*ny,:],
|
739
|
+
sy_phase[2*ii*nx:2*(ii+1)*nx, 2*jj*ny:2*(jj+1)*ny,:],
|
730
740
|
freq_range, wm/nsegx, hm/nsegy, lm/nsegz, delta_eff)
|
731
741
|
pec[ii,jj,kk] = (Plossx + Plossy)
|
732
742
|
|
@@ -740,8 +750,8 @@ class MagnLoss(Amela):
|
|
740
750
|
Returns: all_load_cases: list of losses for all load cases
|
741
751
|
'''
|
742
752
|
|
743
|
-
nsegx = max(1,nsegx) # 1 = no segmentation
|
744
|
-
nsegz = max(1,nsegz) # 1 = no segmentation
|
753
|
+
nsegx = max(1, nsegx) # 1 = no segmentation
|
754
|
+
nsegz = max(1, nsegz) # 1 = no segmentation
|
745
755
|
nsegy = 1 # y segmentation not supported, nsegy is always = 1
|
746
756
|
|
747
757
|
delta_eff = 0
|
@@ -751,22 +761,28 @@ class MagnLoss(Amela):
|
|
751
761
|
ialh_loss = 0
|
752
762
|
loss_detail = []
|
753
763
|
for i in k: # loop for each superelement in a case
|
754
|
-
logger.info(
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
#
|
759
|
-
|
760
|
-
|
761
|
-
|
764
|
+
logger.info('magnet geom / mm: w %.2f h %.2f l %.2f segments %s',
|
765
|
+
i["wm"]*1e3, i["hm"]*1e3, i["lm"]*1e3,
|
766
|
+
(nsegx, nsegy, nsegz))
|
767
|
+
|
768
|
+
(nt, bx_fft, by_fft) = self.periodicity_id(i['bl']) # finds the time periodic part of the simulation
|
769
|
+
(nx, ny, nz, excpl_new, eycpl_new) = Segmentation(
|
770
|
+
i['wm'], i['hm'], i['lm'], i['elcp'],
|
771
|
+
nsegx, nsegy, nsegz)
|
772
|
+
|
773
|
+
wm = i['wm']
|
774
|
+
hm = i['hm']
|
775
|
+
lm = i['lm']
|
762
776
|
self.consider_bx(wm, hm, bx_fft, by_fft)
|
763
|
-
(sx_abs, sy_abs, sx_phase, sy_phase, freq_range) = self.Process_B_data(
|
764
|
-
|
777
|
+
(sx_abs, sy_abs, sx_phase, sy_phase, freq_range) = self.Process_B_data(
|
778
|
+
nx, ny, nsegx, nsegy, nt, i['elcp'], i['bl'], excpl_new, eycpl_new)
|
779
|
+
loss = self.loss_ialh2(sx_abs, sy_abs, sx_phase, sy_phase, freq_range,
|
780
|
+
nx, ny, wm, hm, lm, nsegx, nsegy, nsegz, delta_eff) * self.numpoles
|
765
781
|
ialh_loss += loss
|
766
|
-
logger.info(
|
782
|
+
logger.info('Loadcase %d, Superelement %s, Total losses = %.3f W',
|
783
|
+
i["loadcase"], i["spel_key"], loss)
|
767
784
|
loss_detail.append([i['spel_key'], loss/self.numpoles])
|
768
785
|
self.th_loss.append(loss_detail)
|
769
786
|
all_load_cases.append(ialh_loss)
|
770
787
|
|
771
788
|
return all_load_cases
|
772
|
-
|