Customized Waveguide Port

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
Fengfeng
Posts: 1
Joined: Wed 01 Jul 2020, 20:45

Customized Waveguide Port

Post by Fengfeng » Wed 01 Jul 2020, 21:48

Hi Thorsten and the forum,

I'm a student working on fiber optics, and want to use openEMS as a simulation tool. Although even a small piece of optical fiber is too large for FDTD method, it still makes sense when on other software is available. So thanks for your hard work!

Since the fundamental mode of a single mode fiber is HE11 (LP01) mode, a customized port is needed to excite the source. I tried to use AddWaveGuidePort function to set a customized port with the learning of AddCircWaveGuidePort. The Bessel function of the first kind (J_alpha) and the modified Bessel function of the second kind (K_alpha) will be used to calculate the electric and the magnetic field. However, seems the use of the Bessel function is different from Matlab code when I read the AddCircWaveGuidePort function. For example, in line 92 of AddCircWaveGuidePort.m, the magnetic field is:
func_Hr = [ num2str(-1/kc_draw,15) '*sin(' angle ')*0.5*(j0(' num2str(kc_draw,15) '*rho)-jn(2,' num2str(kc_draw,15) '*rho))'];
I suppose "rho" is the radius, j0(...) is the Bessel function of the first kind of with order 0, jn(2, ...) is the Bessel function of the first kind with order 2, is this right? And how can I express the modified Bessel function of the second kind? I tried to use k0(...) but seems it is incorrect.

I'll be appreciate for your help, Thanks much!

Fengfeng

thorsten
Posts: 1393
Joined: Mon 27 Jun 2011, 12:26

Re: Customized Waveguide Port

Post by thorsten » Thu 02 Jul 2020, 09:32

It is all defined here: https://github.com/thliebig/CSXCAD/blob ... Parser.cpp

If I read my already eight year old code correctly it should be "y0" and "y2".
The reason for y is that this is the name in "math.h". Don't ask me why...

Post Reply