A question we get asked all of the time is: “Which of the COMSOL products should be used for modeling a particular electromagnetic device or application?” In addition to the capabilities of the core package of the COMSOL Multiphysics® software, there are currently six modules within the “Electromagnetic Modules” branch of our product tree, and another six modules spread throughout the remaining product structure that address various forms of Maxwell’s equations coupled to other physics. Let’s take a look through these and see what they offer.
Note: This blog post was originally published on September 10, 2013. It has since been updated with additional information and examples.
Computational Electromagnetics: Maxwell’s Equations
Maxwell’s equations relate the electric charge density, \rho; electric field, \mathbf{E}; electric displacement field, \mathbf{D}; and current, \mathbf{J}; as well as the magnetic field intensity, \mathbf{H}, and the magnetic flux density, \mathbf{B}:
\nabla \cdot \mathbf{D} = \rho

\nabla \cdot \mathbf{B} = 0

\nabla \times \mathbf{E} = \frac{\partial}{\partial t} \mathbf{B}

\nabla \times \mathbf{H} = \mathbf{J} + \frac{\partial}{\partial t} \mathbf{D}

To solve these equations, we need a set of boundary conditions, as well as material constitutive relations that relate the \mathbf{E} to the \mathbf{D} field, the \mathbf{J} to the \mathbf{E} field, and the \mathbf{B} to the \mathbf{H} field. Under varying assumptions, these equations are solved, and coupled to the other physics, in the different modules within the COMSOL product suite.
Note: Most of the equations presented here are shown in an abbreviated form to convey the key concepts. To see the full form of all governing equations, and to see all of the various constitutive relationships available, please consult the Product Documentation.
Let’s start off with a few concepts…
Steady State, Time, or Frequency Domain?
When solving Maxwell’s equations, we try to make as many assumptions as are reasonable and correct, with the purpose of easing our computational burden. Although Maxwell’s equations can be solved for any arbitrary timevarying inputs, we can often reasonably assume that the inputs, and computed solutions, are either steadystate or sinusoidally timevarying. The former is also often referred to as the DC (direct current) case, and the latter is often to as the AC (alternating current), or frequency domain, case.
The steadystate (DC) assumption holds if the fields do not vary at all in time, or vary so negligibly as to be unimportant. That is, we would say that the timederivative terms in Maxwell’s equations are zero. For example, if your device is connected to a battery (which might take hours or longer to drain appreciably), this would be a very reasonable assumption to make. More formally, we would say that: \frac{\partial \mathbf{B} }{\partial t} = \frac{\partial \mathbf{D} }{\partial t} = 0, which immediately omits two terms from Maxwell’s equations.
The frequencydomain assumption holds if the excitations on the system vary sinusoidally and if the response of the system also varies sinusoidally at the same frequency. Another way of saying this is that the response of the system in linear. In such cases, rather than solving the problem in the time domain, we can solve in the frequency domain using the relationship: \mathbf{E}(\mathbf{x},t) = \Re \left( \exp ^{j \omega t }\mathbf{E_c(x)} \right), where \mathbf{E}(\mathbf{x},t) is the space and timevarying field; \mathbf{E_c(x)} is a spacevarying, complexvalued field; and \omega is the angular frequency. Solving Maxwell’s equations at a set of discrete frequencies is very computationally efficient as compared to the time domain, although the computational requirements grow in proportion to the number of different frequencies being solved for (with some caveats that we will discuss later).
Solving in the time domain is needed when the solution varies arbitrarily in time or when the response of the system is nonlinear (although even to this, there are exceptions, which we will discuss). Timedomain simulations are more computationally challenging than steadystate or frequencydomain simulations because their solution times increase in proportion to how long the time span of interest is, and the nonlinearities that are being considered. When solving in the time domain, it is helpful to think in terms of the frequency content of your input signal, especially the highest frequency that is present and significant.
Electric Fields, Magnetic Fields, or Both?
Although we can solve Maxwell’s equations for both the electric and the magnetic fields, it is often sufficient to neglect one, or the other, especially in the DC case. For example, if the currents are quite small in magnitude, the magnetic fields are going to be small. Even in cases where the currents are high, we might not actually concern ourselves about the resultant magnetic fields. On the other hand, sometimes there is solely a magnetic field, but no electric field, as in the case of a device composed only of magnets and magnetic materials.
In the time and frequency domains, though, we have to be a bit more careful. The first quantity we will want to check here is the skin depth of the materials in our model. The skin depth of a metallic material is usually approximated as \delta = \sqrt{2/{\omega \mu \sigma} }, where \mu is the permeability and \sigma is the conductivity. If the skin depth is much larger than the characteristic size of the object, then it is reasonable to say that skin depth effects are negligible and one can solve solely for the electric fields. However, if the skin depth is equal to, or smaller than, the size of the object, then inductive effects are important and we need to consider both the electric and magnetic fields. It’s good to do a quick check of the skin depth before starting any modeling.
As one increases the excitation frequency, it is also important to know the first resonance of the device. At this fundamental resonant frequency, the energy in the electric fields and magnetic fields are exactly in balance, and we would say that we are in the highfrequency regime. Although it is generally difficult to estimate the resonant frequency, a good rule of thumb is to compare the characteristic object size, L_c, to the wavelength, \lambda = c/f. If the object size approaches a significant fraction of the wavelength, L_c \approx \lambda/100, then we are approaching the highfrequency regime. In this regime, power flows primarily via radiation through dielectric media, rather than via currents within conductive materials. This leads to a slightly different form of the governing equations. Frequencies significantly lower than the first resonance are often termed the lowfrequency regime.
Let’s now look at how these various different assumptions are applied to Maxwell’s equations, and give us different sets of equations to solve, and then see which modules we would need to use for each.
SteadyState Electric Field Modeling
Under the assumption of steadystate conditions, we can further assume that we are dealing solely with conductive materials, or perfectly insulative materials. In the former case, we can assume that current flows in all domains, and Maxwell’s equations can be rewritten as:
This equation solves for the electric potential field, V, which gives us the electric field, \mathbf{E} = \nabla V, and the current, \mathbf{J} = \sigma \mathbf{E}. This equation can be solved with the core COMSOL Multiphysics package and is solved in the introductory example to the software. The AC/DC Module and the MEMS Module extend the capabilities of the core package, for example, by offering terminal conditions that simplify model setup and boundary conditions for modeling of relatively thin conductive and insulative regions, as well as separate physics interfaces for modeling the current flow solely through geometrically thin, possibly multilayered, structures.
On the other hand, under the assumption that we are interested in the electric fields in perfectly insulating media, with material permittivity, \epsilon, we can solve the equation:
This computes the electric field strength in the dielectric regions between objects at different electric potentials. This equation can also be solved with the core COMSOL Multiphysics package, and again, the AC/DC and MEMS modules extend the capabilities via, for example, terminal conditions, boundary conditions for modeling thin dielectric regions, and thin gaps in dielectric materials. Furthermore, these two products additionally offer the boundary element formulation, which solves the same governing equation, but has some advantages for models composed of just wires and surfaces, as discussed in this previous blog post.
Time and FrequencyDomain Electric Field Modeling
As soon as you want to model timevarying electric fields, there will be both conduction and displacement currents, and you will want to use either the AC/DC Module or MEMS Module. The equations here are only slightly different from the first equation, above, and in the timedomain case, are written as:
This transient equation solves for both conduction currents, \mathbf{J}_c = \sigma \mathbf{E}, and displacement currents, \mathbf{J}_d = \frac{ \partial \mathbf{D} }{\partial t}. This is appropriate to use when the source signals are nonharmonic and you wish to monitor system response over time. You can see an example of this in the Transient Modeling of a Capacitor in a Circuit model.
In the frequency domain, we can instead solve the stationary equation:
The displacement currents in this case are \mathbf{J}_d = j \omega \epsilon \mathbf{E}. An example of the usage of this equation is the Frequency Domain Modeling of a Capacitor model.
Keep in mind that, when modeling only the electric fields, inductive effects such as eddy currents are being neglected. To consider these effects, we must also solve for the timevarying magnetic field.
Magnetic Field Modeling with the AC/DC Module
Modeling of magnetic fields, in the steadystate, timedomain, or lowfrequency regime, is addressed within the AC/DC Module.
For models that have no current flowing anywhere, such as models of magnets and magnetic materials, it is possible to simplify Maxwell’s equations and solve for V_m, the magnetic scalar potential:
This equation can be solved using either the finite element method or the boundary element method.
Once there are steadystate currents in the model, we must instead solve for \mathbf{A}, the magnetic vector potential.
This magnetic vector potential is used to compute \mathbf{B} = \nabla \times \mathbf{A}, and the current, \mathbf{J}, can be either imposed or simultaneously computed via augmenting with the previous equation for the electric scalar potential and current. A typical example of such a case is the magnetic field of a Helmholz coil.
As we move to the time domain, we solve the following equation:
where \mathbf{E} = \frac{ \partial \mathbf{A}}{\partial t} .
This equation considers solely the conduction currents and induced currents, but not the displacement currents. This is reasonable if the power transfer is primarily via conduction and not radiation. One strong motivation behind solving this equation is if there are material nonlinearities, such as a BH nonlinear material, as in this example of an Ecore transformer. It should be noted, though, that there are alternative ways of solving BH nonlinear materials via an effective HB curve approach.
As we move into the frequency domain, the governing equation becomes:
Note that this equation considers both conduction currents, \mathbf{J}_c = j \omega \sigma \mathbf{A}, and displacement currents, \mathbf{J}_d = \omega^2 \epsilon \mathbf{A}, and is starting to look quite similar to a wave equation. In fact, this equation can solve up to and around the resonance of a structure under the assumption that there is negligible radiation, as demonstrated in this example: Modeling of a 3D Inductor.
For a more complete introduction to the usage of the above sets of equations for magnetic field modeling, also see our lecture series on electromagnetic coil modeling.
It is also possible to mix the magnetic scalar potential and vector potential equations, and this has applications for modeling of motors and generators.
In addition to the above static, transient, and frequencydomain equations in terms of the magnetic vector potential and scalar potential, there also exists a separate formulation in terms of the magnetic field, which is appropriate for modeling of superconducting materials, as in this example of a superconducting wire.
Wave Equation Modeling in the Frequency and Time Domains with the RF or Wave Optics Modules
As we get into the highfrequency regime, the electromagnetic fields become wavelike in nature, as in the modeling of antennas, microwave circuits, optical waveguides, microwave heating, and scattering in free space, as well as scattering from an object on a substrate, and we solve a slightly different form of Maxwell’s equations in the frequency domain:
This equation is written in terms of the electric field, \mathbf{E}, and the magnetic field is computed from: j \omega \mathbf{B} = \nabla \times \mathbf{E} . It can be solved either at a specified set of frequencies, or as an eigenfrequency problem, which directly solves for the resonant frequency of the device. Examples of eigenfrequency analysis include several benchmarks of closed cavities, coils, and Fabry–Perot cavities, and such models compute both resonant frequencies and quality factor.
When solving for the system response over a range of specified frequencies, one can directly solve at a set of discrete frequencies, in which case the computational cost scales linearly with number of specified frequencies. One can also instead exploit hardware parallelism on both single computers and clusters to parallelize and speed up solutions. There are also FrequencyDomain Modal and Adaptive Frequency Sweep (also called Asymptotic Waveform Evaluation) solvers that accelerate the solutions to some types of problems, as introduced in a general sense in this blog post, and demonstrated in this waveguide iris filter example.
If you’re instead solving in the time domain with the RF or Wave Optics modules, then we solve an equation that looks very similar to the earlier equation from the AC/DC Module:
This equation again solves for the magnetic vector potential, but includes both first and second derivatives in time, thus considering both conduction and displacement currents. It has applicability in modeling of optical nonlinearities, dispersive materials, and signal propagation. Time domain results can also be converted into the frequency domain via a Fast Fourier Transform solver, as demonstrated in this example.
The computational requirements for these equations, in terms of memory, also are a concern. The device of interest, and the space around it, are discretized via the finite element mesh, and this mesh must be fine enough to resolve the wave. That is, at a minimum, the Nyquist criterion must be fulfilled. In practice, this means that a domain size of about 10 x 10 x 10 wavelengths in size (regardless of the operating frequency) represents about the upper limit of what is addressable on a desktop computer with 64 GB of RAM. As the domain size increases (or the frequency increases), the memory requirements will grow in proportion to the number of cubic wavelengths being solved for. This means that the above equation is well suited for structures that have characteristic size roughly no larger that 10 times the wavelength at the highest operating frequency of interest. There are, however, two ways to get around this limit.
One approach for solving for the wavelike fields around an object much smaller than the wavelength is the Time Explicit formulation. This solves a different form of the timedependent Maxwell’s equations that can be solved using much less memory. It is primarily meant for linear material modeling, and is attractive in some cases such as for computing wideband scattering off an object in a background field.
Another alternative exists for certain types of optical waveguiding structures, solved in the frequency domain, where it is known that the electric field varies quite slowly in the direction of propagation. In such cases, the beam envelopes method in the Wave Optics Module becomes quite attractive. This interface solves the equation:
Where the electric field is \mathbf{E} = \mathbf{E_e} \exp \left (i \phi \right) and \mathbf{E_e} is the envelope of the electric field.
The additional field, \phi, is a socalled phase function that must be known, at least approximately, and specified as an input. Luckily, for many optical waveguiding problems, this is indeed the case. It is possible to solve for either just one, or two, such beam envelope fields at the same time. The advantage of this approach, when it can be used, is that the memory requirements are far lower than for the fullwave equation presented at the beginning of this section. Other examples of its usage include models of a directional coupler as well as modeling of selffocusing in optical glass.
Deciding Between the AC/DC Module, RF Module, and Wave Optics Module
The dividing line between the AC/DC Module and the RF Module is a bit of a fuzzy line. It’s helpful to ask yourself a few questions:
 Are the devices I’m working with radiating significant amounts of energy? Am I interested in computing resonances? If so, the RF Module is more appropriate.
 Are the devices much smaller than the wavelength at the highest operating wavelength? Am I primarily interested int the magnetic fields? If so, the AC/DC Module is more appropriate.
If you’re right at the line between these, then it can even be reasonable to have both products in your suite of modules.
Deciding between the RF Module and Wave Optics Module involves asking yourself about your applications. Although there is a lot of overlap in functionality in terms of the fullwave form of Maxwell’s equations in the time and frequency domains, there are some small differences in the boundary conditions. There are socalled Lumped Port and Lumped Element boundary conditions, applicable for microwave device modeling, which are solely part of the RF Module. Also keep in mind that only the Wave Optics Module contains the beam envelopes formulation.
As far as material properties, the two products come with different libraries of materials: The RF Module offers a suite of common dielectric substrates, while the Wave Optics Module includes refractive indices of over a thousand different materials in the optical and IR band. For more details on this, and the other available libraries of materials, see this blog post. Of course, if you have specific questions about your device modeling needs, contact us.
A summary of the approximate dividing lines between these modules is given in the figure below.
Ray Tracing with the Ray Optics Module
If you are modeling devices many thousands of times the wavelength in size, then it is no longer possible to resolve the wavelength via a finite element mesh. In such cases, we also offer a geometrical optics approach in the Ray Optics Module. This approach does not directly solve Maxwell’s equations, but instead traces rays through the modeling space. This approach requires only that reflective surfaces and dielectric domains, but not uniform free space, be meshed. It is applicable for modeling of lenses, telescopes, large laser cavities, as well as structuralthermaloptical performance (STOP) analysis. It can even be combined with the output of a fullwave analysis, as demonstrated in this tutorial model.
Multiphysics Modeling
In addition to solving Maxwell’s equations on their own, one of the core strengths of COMSOL Multiphysics is solving problems where there are couplings between several physics. One of the most common is the coupling between Maxwell’s equations and temperature, wherein the rise in temperature affects the electrical (as well as the thermal) properties. For an overview of the ways in which these kinds of electrothermal problems can be addressed, please see this blog post.
It is also common to couple structural deformations to electric and magnetic fields. Sometimes, this just involves deformation, but sometimes, this also involves piezoelectric, piezoresistive, or magnetostrictive material response, or even a stressoptical response. The MEMS Module has a dedicated user interface for electrostatically actuated resonators, wherein an applied electric field biases a device. Structural contact and the flow of current between contacting parts can also be considered in the context of electric currents modeling.
Beyond just temperature and deformation, though, you can also couple Maxwell’s equations for electric current to chemical processes, as addressed by the Electrochemistry, Battery Design, Electrodeposition, and Corrosion modules. In the Plasma Module, you can even couple to plasma chemistry, and with the Particle Tracing Module, you can trace charged particles through electric and magnetic fields. Lastly (for now!) our Semiconductor Module solves for charge transport using the driftdiffusion equations. Each of these modules is a topic in and of itself, so we won’t try to address them all right here.
Of course, if you would like to discuss any of these modules in greater depth, and find out how it is applicable to your device of interest, don’t hesitate to contact us via the button below.
Comentários (14)
Krupali Donda
February 1, 2015This article is really helpful to understand which module should be chosen. Keep updating us.
Deyler Castilla
October 15, 2015Hi,
Could you please suggest me which module I need to use in order to solve the radiative transfer equation in a medium which contains UV absorbing particles? I need to calculate the total particles ‘ UV photon absorption and the UV scattering in the medium.
I would appreciate your help a lot,
Regards,
Deyler Castilla
Walter Frei
October 19, 2015Hello Deyler,
This is a fairly deep question. The radiative transfer equation for absorbing and scattering media does fall a bit outside of the scope of this blog. We would suggest that you contact your COMSOL Support Team for individualized guidance about the type of modeling that you want to do here.
Best Regards,
Deyler Castilla
October 19, 2015Thank you Walter. I will do it.
Kind regards,
Deyler
Walter Frei
January 25, 2017We do also recommend as additional reading:
https://www.comsol.com/blogs/introducingrayopticsmodule/
Mohammed Mohammed
April 5, 2018Dear Mr Frei
I am a PhD student and I want to know about the meaning of a computational model, What it is? How could it be obtained by COMSOL? Can you help me to understand the computational model very well?Please.
Best regards
Manoj Dhiman
April 20, 2018Thanks Walter!
The computational domain of my problem is just above the one hundredth of wavelength and it involves multiple layers of different materials, which should cause reflection and transmission of waves from and through the interfaces. Now if I go for RF module I don’t find any such option and if AC/DC module is used how does COMSOL takes this effect into account?
Caty Fairclough
April 26, 2018Hi Manoj,
Thanks for your comment!
For your question, I would suggest contacting our Support team.
Online Support Center: https://www.comsol.com/support
Email: support@comsol.com
ch santosh subudhi
June 29, 2018What modules should I use for a time domain simulation of HF pulse (510ns rise time) injected into a RF transformer made of 31 material ferrite core?
Michael Kotelyanskii
November 11, 2019DO I understand it correctly that the only difference between RF Module and Wave Optics Module is the Beam Envelope Interface.
On the frequencywavelengthmodel dimensions chart above – can the area covered by RF Module be also served with the WaveOptics Module, or is there cases where RF would apply but WaveOptics would not?
Is the Wave Optics Model essentially RF Module + Beam Envelope Interface?
In other words if I am getting Wave Optics Module there is no need for me to also buy RF Module?
Thanks,
Michael
Walter Frei
November 11, 2019 COMSOL EmployeeHello Michael,
You are close to correct. Both the RF Module and the Wave Optics Module can solve wave electromagnetic problems, and the Wave Optics Module also has the Beam Envelopes method. There are some features that the RF Module has that the Wave Optics Module does not, however. The RF Module includes a transmission line interface. (See, for example: https://www.comsol.com/model/transmissionlinelowpassfilter41681 & https://www.comsol.com/model/transmissionlinewilkinsonpowerdivider42061)
The RF Module also has a set of boundary conditions (the lumped port boundary conditions) that are not in the Wave Optics Module. These conditions are meant for exciting microwave circuits, coaxial cables, and other microwave regime transmission lines.
The two products are geared towards different audiences, and we do have different plans for the future functionality of these products.
Ho Yin Wong
May 4, 2020Hi,
I am trying to model a magnet rotor with surface charge density, and wanting to study the field.
Should I use the electrostatic study or mfnc/mf study?
Electrostatic study allows me to input the surface charge density boundary, however, both mfnc and mf do not allow that.
Is there any suggestion? Thank you.
Best,
D.W.
Jiri Ctyroky
August 4, 2020I appreciate this blog as very helpful. I have only a very minor but important comment. In the introductory part, the complex formalism for harmonic fields is introduced using the equation E(x,t) = Re[E(x)exp(iwt)], while in the rest of the blog, the timedependence exp(+jwt) is used, which might be misleading for some readers. Both conventions using exp(iwt) or exp(jwt) are equivalent, of course, but it should be always very clearly said, which of them is used. Just for example, the permitttivity of a lossy material is complex, and its imaginary part is positive in the convention exp(iwt) but it is negative in the convention exp(jwt).
Walter Frei
August 4, 2020 COMSOL EmployeeThank you Jiri, this will be corrected shortly.