I want to simulate the electric fields in simple circuits using Python and only free software. My first goal is to reproduce the images given in (1) which are made by the commercial ANSYS Maxwell software. Where to start for such a project? Which libraries are suitable to attack this problem by solving Maxwell's equations numerically? And how to model and implement the circuit geometry?

I don't want a full solution but I am asking for a guide of how to attack this problem.

enter image description here


  1. Müller, Rainer. "A semiquantitative treatment of surface charges in DC circuits." American Journal of Physics 80.9 (2012): 782-788.

1 Answer 1


ANSYS Maxwell is a Finite Element solver for Electromagnetism. So, I assume that you are looking for a Finite Element package that has a Python interface (or is written in Python).

There are some popular options like:

The last one provides a Python interface and a (nice) graphic interface, and is based in Hermes2D (so it supports hp- refinement). I would suggest Agros2D.

Of course, there are many more programs that can be used with Python. You can just make a search for "Finite Elements Python".

  • $\begingroup$ Agros2D looks promising. However it crashes (on linux) every time I want to add a physical field. Does it work for you? $\endgroup$
    – Julia
    Commented Mar 7, 2016 at 15:10
  • $\begingroup$ I just installed in my Linux Mint 17.2 and run a parallel plate capacitor without problem. $\endgroup$
    – nicoguaro
    Commented Mar 7, 2016 at 15:44
  • $\begingroup$ Which agros2d version did you use? $\endgroup$
    – Julia
    Commented Mar 7, 2016 at 15:45
  • $\begingroup$, but I suggest that if you have more questions we move this thread to the chat. $\endgroup$
    – nicoguaro
    Commented Mar 7, 2016 at 15:49
  • $\begingroup$ Yes we can move it to chat if you have a few minutes. $\endgroup$
    – Julia
    Commented Mar 7, 2016 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.