A Finite Element Based Tool to Support the Understanding of Electromagnetism Concepts

—A significant pedagogical innovation in teaching and learning Electromagnetics in undergraduate engineering programmes is the resource to simulations, preferably interactive. A classical approach would require a vector calculus background and three-dimensional geometrical resourcefulness, typically not maturated by undergraduate students. On the other hand, interactive simulations are able to support a meaningful visual insight into the fundamental laws and concepts of electromagnetic theory. This work describes an educational tool which relies in an open source graphical user interface to finite element software, able to provide interaction, accuracy and visual interpretations of the Electromagnetics fundamental laws and classical problems, able to hasten the students’ understanding, by lessening the abstract nature of vector fields, level curves and gradient fields. This tool is to be further developed to gather a set of vast examples and typical problems, able to support a web-based training platform.


I. INTRODUCTION
The electrical engineering industry is under a significant paradigm shift and engineering programmes are under pressure to accommodate trending subjects, such as blockchain, cybersecurity and machine learning, to name a few. Under this scenario, learning Electromagnetics in undergraduate engineering programmes is a matter of concern due to mathematical complexity, abstract nature and the shortage of time to apprehend basic concepts under the pressure of other course materials, especially in the current environment of the European higher education system [1].
The classical approach to address electromagnetic theory and its applications requires a vector calculus background and three-dimensional geometrical skills framed in the common Cartesian, cylindrical and spherical systems (cf. with [2]), which, typically, are undeveloped by the students. Moreover, students' underperformance, in both mathematics and electromagnetics topics, relates to the doubtful perception of their usefulness, either by students and industry, when compared with other subjects. A typical complaint relates to the conceptual gap between the mathematical skills demand and their future engineering tasks [3,4]. Notwithstanding this, electromagnetics theory represents an essential and fundamental background that underlies future advances in many branches of electrical and computer engineering and indirectly impacts many other branches. Even though electromagnetics may currently be seen as outmoded, there is always a gain from its understanding, given the rationale promoted, which can be exported to other sciences and problem solving. The study of Electromagnetism is not only of practical importance but also essential for all engineers.
Several approaches and pedagogical strategies have been largely documented to grapple with the necessary shift to support the understanding of Electromagnetics [5][6][7][8]. For instance, laboratory experiences, project-based learning (PBL), innovative course structures and simulation tools have been used and tested, able to minimize the difficulties described. Experiments in a laboratory are very time consuming, costly and, in consequence, not always feasible. Concerns may be raised whether PBL can be applied to Electromagnetics contents without compromising the coverage of the required technical knowledge. In [9] an approach to undergraduate Electromagnetics is outlined by addressing electrostatics and magnetostatics as quasi-statics, trying to capture the student interest provided by practical demonstrations. Another approach suggests electromagnetism to be explored in terms of potentials instead of Maxwell's equations [10]. On the other hand, the introduction of computer-numerical simulations has been frequently adopted to overcome the difficulties above identified [11].
This work proposes an educational tool, which allows the use of interactive simulations, able to support a meaningful insight into the fundamental laws and concepts of electromagnetic theory. This tool is being designed to support the course unit Electromagnetism in the second year of the bachelor in Electrical and Computers Engineering and is being developed as part of the activities of the final Project unit of the same degree. The tool is still under development, and it has been used on an experimental basis in the academic year 2021/22. The paper is organized as follows: the following section gives an overview of Maxwell's equations, presenting Electromagnetism in its abstract and ubiquitous nature, through a small and concise set of equations. Section III introduces the problem firstly assigned through the computeraided education for electrostatics, more specifically, Coulomb's law and section IV presents the didactic simulations, which are under development, and, finally, section V rounds up the paper with the main conclusions.

II. MAXWELL'S EQUATIONS
"From a long view of the history of mankind -seen from, say, ten thousand years from now -there can be little doubt that the most significant event of the nineteenth century will be judged as Maxwell's discovery of the laws of electrodynamics", Richard Feynman [12].
Four of the most influential equations in all of science are the Maxwell's equations. The theory of electromagnetism was developed on the previous ideas of many scientists (for instance, Coulomb, Poisson, Gauss, Ørsted, Ampère and Faraday, among others) out of which, in the middle of the nineteenth century, James Clerk Maxwell unified the theories of electricity, magnetism and light. He showed that the science of light and optics is merely a branch of electromagnetism and, additionally, he introduced the electric displacement, stating that a time-varying electric field could produce a magnetic field, just like a conduction current in a wire, which was an audacious remark because there was no practical evidence for it, at that time.
At the time of his death, in 1879, Maxwell's theory was one of several. Its accuracy and strength were established approximately a decade later, with the work of Oliver Lodge, George Francis FitzGerald and Heinrich Hertz by discovering electromagnetic radiation at microwave frequencies, and demonstrating that electromagnetic waves are transverse (oscillating in a direction perpendicular to the direction of their propagation), with a behaviour just as light does, as postulated by Maxwell [13].
The context of the remarkable discovery and development of Maxwell's work regarding electromagnetic theory is highlighted by the fact that it impacted and remained completely unchanged in the two main physics' triumphs of the twentieth century: the theory of relativity and the field equations of quantum mechanics. The breakthrough of Maxwell's work on the nature of light, i.e., its constant speed, supported the theory of relativity, developed by Hendrik Lorentz and Albert Einstein. Regarding quantum mechanics, the link to electromagnetism is less obvious but still originated in the Faraday-Maxwell paradigm of the field theory [14,15]. It is worth noting that Maxwell's light wave theory established its propagation on the aether, i.e., an invisible all-penetrating medium through which the electromagnetic field propagates. After Maxwell's death, in the beginning of the twentieth century, the aether concept became obsolete, but the equations remain valid in their description of all electromagnetic phenomena [16].
Nowadays, the expression "Maxwell's equations" designates a group of four relations, synthesizing the relations between electric and magnetic fields and their properties. In fact, the synthesis of some counterintuitive variables and simplification of Maxwell's theory into four equations was made by Oliver Heaviside, who presented a condensed version of the original formulation set of twenty equations [16]. Formerly, the equations of electromagnetism had been known as the Hertz-Heaviside and Maxwell-Hertz equations. The actual designation was popularized in 1940, by Albert Einstein, in his monograph "Considerations Concerning the Fundamentals of Theoretical Physics" [17].

A. The Four Equations
Maxwell's equations for general time-varying fields are usually formulated in the differential form, involving the divergence and curl operators, in terms of four vector fields: (4) In these equations, E denotes the electric field, D is the electric displacement or electric flux field, H is the magnetic field and B is the magnetic flux density field. J denotes the free current density and ρ is the free electric charge density.
Equations (1) and (2) are two forms of Gauss' law, the electric and magnetic forms, respectively. Equations (3) and (4) are also known as Faraday's law and Maxwell-Ampère's law, respectively.
The electric form of Gauss' law describes the electric field surrounding a distribution of electric charge, characterized by ρ . This law states that electric field lines diverge from areas of positive charge and converge into areas of negative charge. On the other hand, from the magnetic form of Gauss' law, the magnetic field lines curl to form closed loops, which implies that every north pole engages a south pole. Faraday's and Maxwell-Ampère's laws describe the relationship between electric and magnetic fields: the first one describes how a time-varying magnetic field will cause an electric field to curl around it and the second one, the Maxwell-Ampère's law, describes how a magnetic field curls around a time-varying electric field or an electric current flowing in a conductor.
Another fundamental relation, inferred from (4) and (1), is the equation of continuity which translates the principle of electric charge conservation, as follows: Previous equations can only be solved exactly for simple geometries with a high level of symmetry. However, since the mid-1960s, the huge computational progress and the development of numerical finite-difference techniques made possible the widespread application of the electromagnetic theory unconstrained.

B. Constitutive Relations
Out of the five equations mentioned above, only three are independent: Faraday's law and Maxwell-Ampère's law combined with either the electric form of Gauss' law or the equation of continuity.
To bound a given problem in terms of matter, i.e., defining a closed system, the macroscopic properties of the medium are added through the consideration of the constitutive relationships, H M (7) σ = J E (8) here 0 ε is the permittivity of vacuum, 0 µ is the permeability of vacuum, and σ is the electrical conductivity. In the SI units, 0 µ is  (7) can be rewritten as where r ε and ε are the relative and absolute permittivity and r µ and µ are the relative and absolute permeability of the material, respectively.

C. Potentials
The electromagnetism theory formulated by the first-order equations (1) to (4) can be also formulated in terms of the electric scalar potential, V , and the magnetic vector potential, A , through two independent equations: Eq. (11) is a direct consequence of magnetic Gauss' law and (12) results from Faraday's law.

D. The Quasi-Static Approximation
Maxwell's equations state that changes in the sources, i.e., currents and charges, are not synchronous with changes in the electromagnetic fields. In fact, the latter are always delayed with reference to the sources, due to the finite speed of propagation of electromagnetic waves. If the frequency of the sources is low such that the changes in time of the charge density are negligible compared with the divergence of the current density vector field, it may be considered that, for that frequency, there is no electric displacement. Finite propagation speed is neglected and it is assumed that field changes are experienced simultaneously throughout the geometry under analysis.
This quasi-static approximation may be applied to electromagnetic fields whose wave lengths, given by 0 c f λ = , are higher than the dimensions involved. A practical indication for the application of this approximation is a ratio between the wave length and the major distance between two points of the geometry under analysis higher than 10 [18]. ∇ × H = J (13) 0 ∇ ⋅ = J (14) E

. The Static Approximation
In stationary systems, electromagnetic quantities do not vary with time. Therefore, it is possible to decouple Maxwell's equations into two sets of equations, the electrostatic system and the magnetostatic system, given, respectively, by (16) These systems, apparently restrictive, find lots of practical applications and are, frequently, the first approach to engineering Electromagnetics curriculum.

III. COULOMB'S LAW VERSUS GAUSS' LAW
The advances through the eighteenth century in understanding electric charges and currents culminated in the work of Charles-Augustin de Coulomb. In 1785, he reported that the electric force, F , between two stationary point charges, 1 q and 2 q , is proportional to their product and varies with the inverse square of the distance r : The electric field is defined by Maxwell as the space around an electrified object q (assuming it is located in the origin of the coordinate system) in which electric forces act, or in a pragmatic way, it is the electric force per unit charge exerted on a charged object [19]: Equations (17) and (18) are "rationalized" by the factor 4π in SI electromagnetic units, in opposition to the "unrationalized" Gaussian units.
This law (together with a similar form established for magnets) was later generalized by the work of Poisson and Gauss in the early nineteenth century, leading to the electrical form of Gauss' law. In fact, from (18) it is possible to find the total electric field in r due to the infinitesimal charge at each point given by s in space:  (19) where ( ) s ρ is the charge density. Taking the divergence of both sides, it follows that (20) being ( ) δ − r s the Dirac delta function. Solving the timedelayed Dirac, the differential form of Gauss' law is achieved: Coulomb's law only applies to stationary charges while Gauss' law does apply to moving charges, and, in this aspect, represents a generalized form.
The similarity of Coulomb's law with one of Maxwell's equations establishes the first approach to Electromagnetics contents while assembling mathematical concepts such as vector fields, potentials and level curves, among others.

IV. DIDACTIC SIMULATIONS
Nowadays, numerical computation is a well-established modelling tool, able to be used as a virtual laboratory from a teaching/learning perspective. Most of the didactic simulations make use of the finite element method, but other techniques such as finite-difference time-domain or boundary element methods are also viable options. The finite element method (FEM) is a numerical approach used to solve boundary-value problems characterized by a partial differential equation and a group of boundary conditions. The idea underlying the FEM is to decompose the partial differential equation domain into a finite number of subdomains, called finite elements, and approximate the distribution of the partial differential equation' dependent variable at the nodes of each of the finite elements, by solving a system of linear equations. This system is obtained via a formulation in terms of integral-differential equations, using a polynomial interpolation process or the minimization of a suitable functional. In both cases, the formulation in terms of the integral-differential equations is applied to each finite element. The grouping of all elements results in a (global) system of linear equations, corresponding to the problem domain under study [20].
The simulation tool under development aims at filling the need for lightweight and speed while allowing dynamic and three-dimensional visualizations of the concepts under analysis. The tool is developed using ONELAB software (Open Numerical Engineering LABoratory), an open-source, lightweight interface to finite element software [21]. The default ONELAB software contains the mesh generator and post-processor Gmsh [22], the finite element solver GetDP [23] and an optimization library framework. The implementation is based on a client-server model, being the database provided by the server-side and a graphical front-end developed to facilitate the upload of the parameter set. In this way, the problem specification, including the geometry, defined by the user, dynamically interacts with the ONELAB libraries. Under the electrostatics contents, the didactic tool enables to shape the concept of the electric vector field and electric potential in a graphical and interactive way. Instead of the classical approach of introducing the electric field as the Coulomb's force per unit charge, it is presented as a modification of the space created by the presence of charges, through physical vector entities that take variable intensities and directions continuously in the space.
A simple user interface is available to allow students to interact with simulations, by setting the coordinates and the value of each charge (Fig. 1).   An electrostatic field is governed by (15), stating that any static field is irrotational, and therefore conservative. The gradient field of the corresponding scalar potential equals , -E which translates in vectors pointing out the direction of maximum decrease of the potential surface. The visualization of the scalar potential variation (and/or level curves) in space can be accomplished as shown in the examples of Fig. 3, for two equal charges, and Fig. 4, with three charges, being the middle one negative with the same absolute value of the positive ones.  Another didactic simulation in electrostatics is the planar capacitor, as presented in Fig. 5, consisting of two planes of opposite charge densities in a two-dimensional view, and with the air as dielectric. It is worth noting that the visualization complexity of any simulation and time processing is typically proportional to the complexity of the physics theory and the degrees of freedom in use. Although most of the problems are three-dimensional in the real world, it would be preferable to use a twodimensional approach, whenever there is no variation in the third dimension or it is possible to neglect the influence of the finite extension in the third dimension.

V. CONCLUSION
The increasing role of numerical computation suggests a different way or, at least, an auxiliary tool, to learn Electromagnetics. Simulation tools allow an alternative to experiments in laboratory, which are very time consuming, costly and, as a consequence, not always feasible. This paper introduces an interactive didactic simulation tool that aims to simplify the Electromagnetics understanding in undergraduate engineering programmes. This tool is being developed as an auxiliary tool able to support the underlain physics while assembling vector calculus concepts. The theoretical development of the contents aided by this tool makes the learning experience more meaningful to students, empowering them to integrate theory and practice.
This tool is to be further developed to gather a set of vast examples and typical problems, including Magnetostatics and Electrodynamics, aiming to support a web-based training platform. Further work will also include the investigation on how students perceive the utility of the tool in the learning context of Electromagnetism, using predominantly survey data and approval rates.