# Cavity resonator modelling and simulation of em fields inside the cavity

I want to model a cylindrical cavity resonator and study the different modes of em fields inside it using MATLAB/COMSOL. Please refer me books/articles or other resources so that I can achieve my goal.

• In fact, using COMSOL4.2a to solve resonant cavity problem will present nonphysical modes in numerical results, because in COMSOL4.2a, it do not consider divergence-free condition, which will present nonphysical zero modes. For resonant cavity problem with lossless anisotropic media, we can use mixed finite element method to solve this problem, and this method can successfully remove all nonphysical modes, including nonphysical zero modes.
– user112689
Mar 29, 2016 at 13:11
• You can see our paper " Mixed Finite Element Method for Resonant Cavity Problem with Complex Geometric Topology and Anisotropic Lossless Media" by Wei Jiang etal.
– user112689
Mar 29, 2016 at 13:15
• We are considering resonant cavity problem with conducting media. It is very hard to solve it, because this problem is an eigenvalue probelm about curl-curl operator, and this eigenvalue problem is a nonlinear PDE eigenvalue problem.
– user112689
Mar 29, 2016 at 13:21

The idea is that you have to specify the equation to solve, usually it is the Helmholtz equation which is of elliptic type. Then, you have to specify boundary conditions and choose a numerical technique to solve the problem (in a complicated geometry it might be FEM or FDM, sometimes one can use a variational method without a grid). After that, you have to choose a solver or write your own code implementing that numerical (or analytical) method. Depending on the solver, it is better to start with a corresponding manual in order to understand how to use it.

There are plenty of literature. To begin with I would suggest following books

1) Jian-Ming Jin, The Finite Element Method in Electromagnetics, John Wiley & Sons, 2015

2) Umran S. Inan, Robert A. Marshall, Numerical Electromagnetics: The FDTD Method, Cambridge University Press, 2011

3) Matthew N.O. Sadiku, Numerical Techniques in Electromagnetics with MATLAB, CRC Press, 2000

I think the last one suits your needs the best. Again, before using a solver, the most crucial is to understand what kind of equation one has to solve. If your know the equation and boundary conditions, using COMSOL is simple and is well explained in the COMSOL manual by numerous examples.

I just finished doing the same thing using this PDF file provided by COMSOL. On that page, the PDF is under the 'download application files' tab. In the file, they describe step by step how to to calculate modes and q-factors of three different kinds of cavities: rectangular, cylindrical, and spherical.