MagnetiCalc

Avatar-FotoVeröffentlicht von

📊 Seitenaufrufe: 548

MagnetiCalc berechnet auf interaktive, komfortable und performante Weise die statische magnetische Flussdichte, das Vektorpotential, die Energie, die Selbstinduktivität und das magnetische Dipolmoment beliebig geformter Spulen. In einer VisPy / OpenGL-beschleunigten PyQt5 GUI wird die statische magnetische Flussdichte (-Feld, in Tesla) oder das magnetische Vektorpotential (-Feld, in Tesla-Meter) dreidimensional und interaktiv dargestellt; zum Hervorheben der Feldeigenschaften werden verschiedene Metriken verwendet.

Experimentelles Feature: Zur Berechnung der Energie und Selbstinduktivität permeabler (i.e. ferromagnetischer) Kernmedien können diese als Regionen variabler relativer Permeabilität modelliert werden; da die Kernsättigung momentan jedoch nicht modelliert wird, führt dies zu überhöhten Werten der Flussdichte.

Zur Beschleunigung der Feldberechnung verwendet MagnetiCalc Just-In-Time-Kompilierung (JIT) und, falls eine unterstützte Grafikkarte verfügbar ist, sogar GPU-Beschleunigung (CUDA).

Download

Der Quellcode und die Installationsanleitung finden sich im MagnetiCalc GitHub-Repository:

Funktionsweise

Die Feldberechnung wurde mithilfe des Biot-Savart-Gesetzes [1] implementiert und erlaubt die Verwendung mehrerer Prozessorkerne. Durch den Einsatz leicht zu parametrisierender Abtastvolumen (engl. sampling volume) lässt sich die Berechnung selektiv auf Gitter beliebiger Form und beliebiger Permeabilität beschränken (experimentell).

Die Form eines elektischen Leiters wird als dreidimensionale, stückweise stetige Kurve repräsentiert. Beliebige Leiterschleifen werden in differenzielle Leiterelemente (engl. slices) zerlegt, wovon jedes zum gesamten resultierenden Feld ( oder ) an einem festen Abtastpunkt beiträgt.

Die Feldstärke (oder der Feldwinkel in einer Ebene) wird an jedem Abtastpunkt durch Pfeile und/oder Kügelchen dargestellt, deren Farbe und Transparenz (Alpha-Wert) jeweils individuell durch eine der verfügbaren Metriken abgebildet werden.

[1]: Jackson, Klassische Elektrodynamik, 5. Auflage, S. 204, (5.4).

Weitere Informationen und alle relevanten Formeln finden sich im MagnetiCalc GitHub-Repository.

Verifikation

Magnetische Flussdichte

Im Zentrum einer Leiterschleife von 1 cm Radius, durch die ein Strom von 1 A fließt, berechnet MagnetiCalc eine magnetische Flussdichte von 62,8 Mikrotesla. In einem axialen Abstand von 1 cm ist das B-Feld bereits auf 22,2 Mikrotesla abgefallen.

Ergebnis von MagnetiCalc

Dieses von MagnetiCalc berechnete Ergebnis deckt sich hervorragend mit der Theorie. Auf der HyperPhysics-Website gibt es einen simplen Online-Rechner für das Biot-Savart-Gesetz, dessen Ergebnisse exakt mit denen von MagnetiCalc übereinstimmen:

Ergebnis von HyperPhysics

Selbstinduktivität

Als experimentelles Feature kann MagnetiCalc auch die Selbstinduktivität von permeablen (i.e. ferromagnetischen) Kernen berechnen. Für diesen Test habe ich mich an dem Ferrit-Ringkern FT-87A-J von Amidon [1] orientiert, welcher eine besonders hohe Anfangspermeabilität von µr = 5000 aufweist.

[1]: Ferrit-Ringkerne von Amidon, FUNKAMATEUR (Übersichtstabelle)

Die Geometrie und die relative Permeabilität des Kernmaterials kann durch Beschränkung des Abtastvolumens festgelegt werden; hierfür dient der Constraint Editor:

Die dritte Zeile deaktiviert die Feldberechnung außerhalb der Ringerkern-Geometrie.

Bei 30 Windungen berechnet MagnetiCalc eine Selbstinduktivität von 5,6 mH:

Der simple Online-Rechner Ham Calc liefert bei 30 Windungen mit einer Selbstinduktivität von 5,4 mH ein vergleichbares Ergebnis:

Videos

Galerie

4 Kommentare

  1. Dear sir,
    Thank you for your sharing this useful code. I am a PhD candidate from Peking university in China. I want to figure out how to export the field from GUI. If not available , could you please show me some examples about how to model in python IDE? Indeed GUI is convenient. And there must be moe potential advantages in python scripts.
    Kind regard,
    Jie Li

    1. Hello Mr. Li,

      I’m very glad to hear that my software is useful to you! 🙂
      First, please make sure that you are using the latest version of MagnetiCalc (v1.15.1 at the time of writing).

      Then go to File > Export Container … and choose the items to export.
      You can export the Wire Points, Wire Current, A-Field and B-Field (must have been calculated before starting the export).
      The output format will be HDF, which is a data container format that is widely used in the scientific community.

      Of course, to start working with the exported data in your own Python scripts, MagnetiCalc offers an API!
      Please refer to the corresponding section in the README file: https://github.com/shredEngineer/MagnetiCalc#example-field-import

      Please let me know if this has been helpful to you, also also if you have any further suggestions or questions! 🙂

      Best regards
      Paul

  2. Dear professor,
    Thank you very much for your detailed answer. This code gives me considerable help. There is another question. If I want to model several separate closed coils, what should I do? It seems that I can only add the field of the coils after exporting the files one by one.
    Looking forward to your reply.
    Kind regards,
    Jie Li

    1. Dear Mr Li,

      I am deeply flattered, but I am by no means a Professor. 😀 (I am, however, currently also working on my PhD thesis, at least.)

      Unfortunately, MagnetiCalc does not yet support separate coils.
      (Although this is planned to be supported in a major v2.0.0 release in the future, latetly I rarely find time to work on that, so it’s gonna take some time.)

      However, if having separate wires is absolutely crucial for your use case right now, I can think of a workaround that should be relatively easy to implement.
      First, you would need to define one „special“ coordinate, like (-10000, -10000, -10000).
      Then you insert this into the wire points table wherever the wire should be broken up, i.e. the point before and after this special coordinate should not get connected.
      Finally, handle these special coordinates inside the function recalculate() in Wire.py:
      – Skip the special coordinate during slicing, i.e. don’t create any points between the disjunct points (skip linear interpolation).
      – Skip the special corrdinate during calculation of the wire elements (center points and direction vectors), i.e. prevent these points from getting returned to the Biot-Savart Backend.

      The wire elements will then get passed to the Biot-Savart backend which does not care about the relations between the current elements.
      It will thus correctly calculate the resulting field due to the two disjunct wires.

      (Also, make sure to disable the „Close Loop“ checkbox in the Wire group box on the left sidebar in the GUI.)

      Please be aware that this solution would still only allow all current elements to have the same current flowing through them;
      if your separate wires should carry different amounts of current, still some extra work would be required.

      Unforunately, I don’t have much time on my hands to implement this workaround right now,
      but if you really need separate wire support as outlined above, please feel free to open an issue on the GitHub repository so we can keep track of your requests!

      Also, it would be great if you could „star“ the MagnetiCalc GitHub repository and tell your colleagues about it! 🙂
      We are still looking for contributors and beta testers, and any feedback is very welcome!

      Best regards
      Paul

Kommentar hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert