National Physical Laboratory

2.5-D Simulation of Axi-Symmetric Electromagnetic Structures

This page provides all the COMSOL, Matlab, and Mathematica sources codes behind:

Instructions on how to configure COMSOL (from scratch) can be found in:

However, in the first instance, we recommend that you simply download the posted .mph files, and investigate them for yourself. All feedback gratefully received, contact: Dr Mark Oxborrow

Please note that the correct boundary condition on the r = 0 axis is generally 'null' (i.e. does not impose any explicit constraints at all); previous versions of the .mph files sometimes had the b.c. for this domain edge set to something else (like "electric wall") leading to wholly incorrect results (only) for (non-whispering-gallery) modes with non-negligible amplitude on the r = 0 axis.

flory_taber1

Flory Taber Bragg Reflector:

 

Gold Nanosphere Linear Array:

gold_nano

 

npl_cs_cryo2 

NPL CS Cryo Sapphire Resonator:

 

One Inch Pill Box:

one_inch_pill

 

painter_algaas1

Painter Algaas Microdisk:

 

UWA Sloping Shoulders Cryo Sapphire Resonator:

uwa_sloping1 

 

vahala_silica1

Vahala Silica Toroid:

 

Compatibility:

"_c32" ("_c33a") in a Comsol .mph file name indicates that the file was generated with version 3.2 (3.3a); _c32 files can be read by Comsol 3.3a, but _c33a files cannot be read by Comsol 3.2.

"_mth52" in a Mathematica (notebook) .nb file name indicates that the file was generated with Mathematica 5.2; but these notebooks do not use any snazzy features, so they should be back/for-ward compatible with different releases of Mathematica.

"_m71" in a Matlab .m file name indicates that the M-file was generated using Matlab 7.1; again, these scripts do not use any special features so should be reasonably back/for-ward compatible with different Matlab versions. Note also that the scripts require poly2vert.m to be in Matlab's search path (most simply implemented by placing it in the same directory as the Matlab script that is to be executed).

Mode Energy Evaluation:

Please note:

To evaluate the total energy of a mode one has to add the integrated (imaginary part of the) azimuthal magnetic field squared, imag(Hazi)^2, evaluated in Comsol's '0-degree' setting to the integrated (real part of the) axial and radial magnetic fields squared, real(Haxi)^2+real(Hrad)^2, evaluated in the "90-degree" setting.

This is because the maxima of the azimuthal magnetic field are rotated (azimuthally) by 90/M degrees (M = azimuthal mode order) from the maxima of the "transverse" (axial + radial) magnetic field. The mode energy can of course be alternatively evaluated through the electric field for which a similar statement applies as regards the maxima of its azimuthal versus transverse components.

The COMSOL menus Options --> Expressions --> Scalar Expression contains the necessary expressions allowing the mode-energy integrals to be evaluated using COMSOL's Postprocessing --> Subdomain Integration functionality. Please remember a factor of 2 pi r in these to-be-integrated expressions.

The 0 or 90 degree setting is controlled through Postprocessing -->Plot Parameters --> General --> Solution at angle (phase); one sets the angle here to either 90 or 0 as appropriate.

Generation of Weak-Form Expressions & Coordinate Labels:

For fear of errors, all the weak-form expressions and the various flavours of boundary condition were generated automatically using Mathematica, then text-edited (so as to render their exact syntax compatible with Comsol - emoving spaces etc), then cut-and-pasted into Comsol; the Mathematica notebook weak_form_expressions_r_phi_z_mth52_v.nb contains the code that generated these expressions.

Axsym uses cylindrical coordinates. Note that some of the older .mph simulations label the radial, azimuthal and axial co-ordinates with {x, phi, y}. All work since February 2007 has used the more standard {r, phi, z} co-ordinate labels.

Last Updated: 27 Apr 2012
Created: 4 Mar 2008