Obtain the cylindrical field components in Comsol.

Comsol is a powerful software to solve the Helmholtz equation in Cartesian coordinates. However, there are many problems based on the cylindrical field. The cylindrical field components are more interesting than the cartesian components. Here is how to obtain the cylindrical field components from the cartesian components in Comsol.

The general idea is coordinate transform.

\(E_r=E_x cos(\theta)+E_y sin(\theta) \)

\(E_\theta=-E_x sin(\theta)+E_y cos(\theta)\)

where \(\theta=atan2(y,x)\), so the variables can be defined in definitions as

Er=abs(emw.Excos(atan2(y,x))+emw.Eysin(atan2(y,x)))

Ephi=abs(-emw.Exsin(atan2(y,x))+emw.Eycos(atan2(y,x)))

Then the cylindrical field components could be directly plotted in any surface plot group. Here is an example

Leave a Comment