[solved] Radial stub convergence confusion

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
mpred
Posts: 4
Joined: Fri 14 Feb 2020, 06:41

[solved] Radial stub convergence confusion

Post by mpred » Fri 14 Feb 2020, 07:13

Hi all, I'm just getting started with openEMS so apologies if this ends up being a stupid question!

I'm trying to model a microstrip distributed element filter that uses radial stubs, and have run into a strange convergence problem. When the MS stub is pointing up (in the +y direction) everything works fine, but when it points down (-y direction) openEMS's Energy fails to converge.

Here's the top configuration and output:
top.png
top.png (72.88 KiB) Viewed 2240 times

Code: Select all

 ----------------------------------------------------------------------
 | openEMS 64bit -- version v0.0.35
 | (C) 2010-2016 Thorsten Liebig <thorsten.liebig@gmx.de>  GPL license
 ----------------------------------------------------------------------
        Used external libraries:
                CSXCAD -- Version: v0.6.2
                hdf5   -- Version: 1.8.12
                          compiled against: HDF5 library version: 1.8.12
                tinyxml -- compiled against: 2.6.2
                fparser
                boost  -- compiled against: 1_57
                vtk -- Version: 6.1.0
                       compiled against: 6.1.0

Create FDTD operator (compressed SSE + multi-threading)
FDTD simulation size: 131x68x19 --> 169252 FDTD cells
FDTD timestep is: 1.89898e-013 s; Nyquist rate: 526 timesteps @5.00569e+009 Hz
Excitation signal length is: 6035 timesteps (1.14603e-009s)
Max. number of timesteps: 100000 ( --> 16.57 * Excitation signal length)
Create FDTD engine (compressed SSE + multi-threading)
Running FDTD engine... this may take a while... grab a cup of coffee?!?
[@        4s] Timestep:         1048 || Speed:   43.1 MC/s (3.926e-003 s/TS) || Energy: ~2.72e-018 (- 0.00dB)
[@        8s] Timestep:         2096 || Speed:   42.2 MC/s (4.013e-003 s/TS) || Energy: ~1.49e-015 (- 0.00dB)
[@       12s] Timestep:         3144 || Speed:   42.1 MC/s (4.021e-003 s/TS) || Energy: ~1.95e-014 (- 0.00dB)
[@       16s] Timestep:         4192 || Speed:   41.9 MC/s (4.036e-003 s/TS) || Energy: ~5.94e-014 (- 0.00dB)
[@       20s] Timestep:         5240 || Speed:   43.3 MC/s (3.906e-003 s/TS) || Energy: ~1.71e-014 (- 5.41dB)
[@       25s] Timestep:         6288 || Speed:   41.9 MC/s (4.035e-003 s/TS) || Energy: ~1.22e-015 (-16.87dB)
[@       29s] Timestep:         7336 || Speed:   41.8 MC/s (4.053e-003 s/TS) || Energy: ~1.27e-017 (-36.71dB)
[@       33s] Timestep:         8384 || Speed:   42.4 MC/s (3.993e-003 s/TS) || Energy: ~3.50e-018 (-42.29dB)
[@       37s] Timestep:         9432 || Speed:   42.2 MC/s (4.009e-003 s/TS) || Energy: ~8.87e-019 (-48.25dB)
[@       41s] Timestep:        10480 || Speed:   41.9 MC/s (4.042e-003 s/TS) || Energy: ~2.28e-019 (-54.15dB)
Time for 10480 iterations with 169252.00 cells : 41.96 sec
Speed: 42.27 MCells/s
And bottom:
bot.png
bot.png (72.88 KiB) Viewed 2240 times

Code: Select all

 ----------------------------------------------------------------------
 | openEMS 64bit -- version v0.0.35
 | (C) 2010-2016 Thorsten Liebig <thorsten.liebig@gmx.de>  GPL license
 ----------------------------------------------------------------------
        Used external libraries:
                CSXCAD -- Version: v0.6.2
                hdf5   -- Version: 1.8.12
                          compiled against: HDF5 library version: 1.8.12
                tinyxml -- compiled against: 2.6.2
                fparser
                boost  -- compiled against: 1_57
                vtk -- Version: 6.1.0
                       compiled against: 6.1.0

Create FDTD operator (compressed SSE + multi-threading)
FDTD simulation size: 131x68x19 --> 169252 FDTD cells
FDTD timestep is: 1.89898e-013 s; Nyquist rate: 526 timesteps @5.00569e+009 Hz
Excitation signal length is: 6035 timesteps (1.14603e-009s)
Max. number of timesteps: 100000 ( --> 16.57 * Excitation signal length)
Create FDTD engine (compressed SSE + multi-threading)
Running FDTD engine... this may take a while... grab a cup of coffee?!?
[@        4s] Timestep:         1048 || Speed:   42.4 MC/s (3.993e-003 s/TS) || Energy: ~2.72e-018 (- 0.00dB)
[@        8s] Timestep:         2096 || Speed:   42.3 MC/s (4.001e-003 s/TS) || Energy: ~1.49e-015 (- 0.00dB)
[@       12s] Timestep:         3144 || Speed:   42.5 MC/s (3.979e-003 s/TS) || Energy: ~1.95e-014 (- 0.00dB)
[@       16s] Timestep:         4192 || Speed:   42.8 MC/s (3.954e-003 s/TS) || Energy: ~5.95e-014 (- 0.00dB)
[@       20s] Timestep:         5240 || Speed:   42.3 MC/s (4.004e-003 s/TS) || Energy: ~1.74e-014 (- 5.34dB)
[@       25s] Timestep:         6288 || Speed:   42.1 MC/s (4.016e-003 s/TS) || Energy: ~1.71e-015 (-15.42dB)
[@       29s] Timestep:         7336 || Speed:   43.4 MC/s (3.902e-003 s/TS) || Energy: ~5.93e-016 (-20.01dB)
[@       33s] Timestep:         8384 || Speed:   42.5 MC/s (3.986e-003 s/TS) || Energy: ~6.30e-016 (-19.75dB)
[@       37s] Timestep:         9432 || Speed:   42.1 MC/s (4.024e-003 s/TS) || Energy: ~6.50e-016 (-19.62dB)
[@       41s] Timestep:        10480 || Speed:   42.1 MC/s (4.018e-003 s/TS) || Energy: ~6.59e-016 (-19.55dB)
[@       45s] Timestep:        11528 || Speed:   43.3 MC/s (3.912e-003 s/TS) || Energy: ~6.63e-016 (-19.53dB)
[@       50s] Timestep:        12576 || Speed:   41.8 MC/s (4.046e-003 s/TS) || Energy: ~6.64e-016 (-19.52dB)
[@       54s] Timestep:        13624 || Speed:   42.0 MC/s (4.032e-003 s/TS) || Energy: ~6.64e-016 (-19.52dB)
[@       58s] Timestep:        14672 || Speed:   42.1 MC/s (4.025e-003 s/TS) || Energy: ~6.63e-016 (-19.53dB)
[@     1m02s] Timestep:        15720 || Speed:   43.3 MC/s (3.909e-003 s/TS) || Energy: ~6.62e-016 (-19.53dB)
[@     1m06s] Timestep:        16768 || Speed:   42.1 MC/s (4.017e-003 s/TS) || Energy: ~6.61e-016 (-19.54dB)
[@     1m11s] Timestep:        17816 || Speed:   41.9 MC/s (4.041e-003 s/TS) || Energy: ~6.59e-016 (-19.55dB)
[@     1m15s] Timestep:        18864 || Speed:   40.8 MC/s (4.152e-003 s/TS) || Energy: ~6.58e-016 (-19.56dB)
[@     1m19s] Timestep:        19912 || Speed:   41.6 MC/s (4.069e-003 s/TS) || Energy: ~6.57e-016 (-19.57dB)
[@     1m24s] Timestep:        20960 || Speed:   41.2 MC/s (4.110e-003 s/TS) || Energy: ~6.55e-016 (-19.58dB)
[@     1m28s] Timestep:        22008 || Speed:   42.1 MC/s (4.017e-003 s/TS) || Energy: ~6.54e-016 (-19.59dB)
[@     1m32s] Timestep:        23056 || Speed:   40.6 MC/s (4.174e-003 s/TS) || Energy: ~6.52e-016 (-19.60dB)
[@     1m36s] Timestep:        24104 || Speed:   41.2 MC/s (4.105e-003 s/TS) || Energy: ~6.51e-016 (-19.61dB)
[@     1m41s] Timestep:        25152 || Speed:   41.3 MC/s (4.099e-003 s/TS) || Energy: ~6.50e-016 (-19.62dB)
[@     1m45s] Timestep:        26200 || Speed:   40.5 MC/s (4.178e-003 s/TS) || Energy: ~6.48e-016 (-19.63dB)
[@     1m49s] Timestep:        27248 || Speed:   40.9 MC/s (4.143e-003 s/TS) || Energy: ~6.47e-016 (-19.63dB)
[@     1m54s] Timestep:        28296 || Speed:   42.9 MC/s (3.942e-003 s/TS) || Energy: ~6.46e-016 (-19.64dB)
[@     1m58s] Timestep:        29344 || Speed:   40.8 MC/s (4.145e-003 s/TS) || Energy: ~6.45e-016 (-19.65dB)
[@     2m02s] Timestep:        30392 || Speed:   40.8 MC/s (4.150e-003 s/TS) || Energy: ~6.43e-016 (-19.66dB)
[@     2m07s] Timestep:        31440 || Speed:   40.5 MC/s (4.177e-003 s/TS) || Energy: ~6.42e-016 (-19.67dB)
[@     2m11s] Timestep:        32488 || Speed:   40.6 MC/s (4.171e-003 s/TS) || Energy: ~6.41e-016 (-19.68dB)
[@     2m15s] Timestep:        33536 || Speed:   40.1 MC/s (4.225e-003 s/TS) || Energy: ~6.40e-016 (-19.69dB)
[@     2m20s] Timestep:        34584 || Speed:   39.7 MC/s (4.261e-003 s/TS) || Energy: ~6.38e-016 (-19.69dB)
[@     2m24s] Timestep:        35632 || Speed:   39.8 MC/s (4.249e-003 s/TS) || Energy: ~6.37e-016 (-19.70dB)
[@     2m29s] Timestep:        36680 || Speed:   41.1 MC/s (4.118e-003 s/TS) || Energy: ~6.36e-016 (-19.71dB)
[@     2m33s] Timestep:        37728 || Speed:   40.4 MC/s (4.189e-003 s/TS) || Energy: ~6.35e-016 (-19.72dB)
[@     2m37s] Timestep:        38776 || Speed:   41.5 MC/s (4.082e-003 s/TS) || Energy: ~6.34e-016 (-19.73dB)
[@     2m42s] Timestep:        39824 || Speed:   41.5 MC/s (4.073e-003 s/TS) || Energy: ~6.32e-016 (-19.73dB)
[@     2m46s] Timestep:        40872 || Speed:   42.6 MC/s (3.970e-003 s/TS) || Energy: ~6.31e-016 (-19.74dB)
[@     2m50s] Timestep:        41920 || Speed:   41.5 MC/s (4.076e-003 s/TS) || Energy: ~6.30e-016 (-19.75dB)
[@     2m54s] Timestep:        42968 || Speed:   41.6 MC/s (4.070e-003 s/TS) || Energy: ~6.29e-016 (-19.76dB)
[@     2m59s] Timestep:        44016 || Speed:   41.0 MC/s (4.124e-003 s/TS) || Energy: ~6.28e-016 (-19.77dB)
[@     3m03s] Timestep:        45064 || Speed:   42.7 MC/s (3.960e-003 s/TS) || Energy: ~6.27e-016 (-19.77dB)
[@     3m07s] Timestep:        46112 || Speed:   41.7 MC/s (4.056e-003 s/TS) || Energy: ~6.26e-016 (-19.78dB)
[@     3m11s] Timestep:        47160 || Speed:   41.1 MC/s (4.118e-003 s/TS) || Energy: ~6.25e-016 (-19.79dB)
[@     3m16s] Timestep:        48208 || Speed:   41.0 MC/s (4.128e-003 s/TS) || Energy: ~6.24e-016 (-19.80dB)
[@     3m20s] Timestep:        49256 || Speed:   42.6 MC/s (3.969e-003 s/TS) || Energy: ~6.22e-016 (-19.80dB)
[@     3m24s] Timestep:        50304 || Speed:   41.6 MC/s (4.071e-003 s/TS) || Energy: ~6.21e-016 (-19.81dB)
[@     3m28s] Timestep:        51352 || Speed:   41.3 MC/s (4.098e-003 s/TS) || Energy: ~6.20e-016 (-19.82dB)
[@     3m33s] Timestep:        52400 || Speed:   40.1 MC/s (4.217e-003 s/TS) || Energy: ~6.19e-016 (-19.83dB)
[@     3m38s] Timestep:        53448 || Speed:   37.3 MC/s (4.533e-003 s/TS) || Energy: ~6.18e-016 (-19.83dB)
[@     3m42s] Timestep:        54496 || Speed:   39.5 MC/s (4.289e-003 s/TS) || Energy: ~6.17e-016 (-19.84dB)
[@     3m46s] Timestep:        55413 || Speed:   38.7 MC/s (4.370e-003 s/TS) || Energy: ~6.16e-016 (-19.85dB)
[@     3m50s] Timestep:        56330 || Speed:   37.9 MC/s (4.463e-003 s/TS) || Energy: ~6.15e-016 (-19.85dB)
[@     3m54s] Timestep:        57378 || Speed:   41.7 MC/s (4.056e-003 s/TS) || Energy: ~6.14e-016 (-19.86dB)
[@     3m59s] Timestep:        58426 || Speed:   41.4 MC/s (4.086e-003 s/TS) || Energy: ~6.13e-016 (-19.87dB)
[@     4m03s] Timestep:        59474 || Speed:   40.0 MC/s (4.229e-003 s/TS) || Energy: ~6.12e-016 (-19.87dB)
[@     4m08s] Timestep:        60522 || Speed:   40.0 MC/s (4.235e-003 s/TS) || Energy: ~6.11e-016 (-19.88dB)
[@     4m12s] Timestep:        61570 || Speed:   42.2 MC/s (4.010e-003 s/TS) || Energy: ~6.10e-016 (-19.89dB)
[@     4m16s] Timestep:        62618 || Speed:   40.7 MC/s (4.161e-003 s/TS) || Energy: ~6.09e-016 (-19.89dB)
[@     4m20s] Timestep:        63666 || Speed:   40.7 MC/s (4.154e-003 s/TS) || Energy: ~6.08e-016 (-19.90dB)
[@     4m25s] Timestep:        64714 || Speed:   40.9 MC/s (4.141e-003 s/TS) || Energy: ~6.07e-016 (-19.91dB)
[@     4m29s] Timestep:        65762 || Speed:   41.8 MC/s (4.049e-003 s/TS) || Energy: ~6.07e-016 (-19.92dB)
[@     4m33s] Timestep:        66810 || Speed:   40.7 MC/s (4.154e-003 s/TS) || Energy: ~6.06e-016 (-19.92dB)
[@     4m38s] Timestep:        67858 || Speed:   40.0 MC/s (4.232e-003 s/TS) || Energy: ~6.05e-016 (-19.93dB)
[@     4m42s] Timestep:        68906 || Speed:   40.1 MC/s (4.219e-003 s/TS) || Energy: ~6.04e-016 (-19.94dB)
[@     4m46s] Timestep:        69954 || Speed:   42.1 MC/s (4.016e-003 s/TS) || Energy: ~6.03e-016 (-19.94dB)
[@     4m51s] Timestep:        71002 || Speed:   40.9 MC/s (4.135e-003 s/TS) || Energy: ~6.02e-016 (-19.95dB)
[@     4m55s] Timestep:        72050 || Speed:   40.8 MC/s (4.144e-003 s/TS) || Energy: ~6.01e-016 (-19.96dB)
[@     4m59s] Timestep:        73098 || Speed:   41.2 MC/s (4.112e-003 s/TS) || Energy: ~6.00e-016 (-19.96dB)
[@     5m04s] Timestep:        74146 || Speed:   42.2 MC/s (4.011e-003 s/TS) || Energy: ~5.99e-016 (-19.97dB)
[@     5m08s] Timestep:        75063 || Speed:   37.9 MC/s (4.464e-003 s/TS) || Energy: ~5.98e-016 (-19.98dB)
[@     5m12s] Timestep:        76111 || Speed:   39.7 MC/s (4.268e-003 s/TS) || Energy: ~5.97e-016 (-19.98dB)
[@     5m16s] Timestep:        76897 || Speed:   31.6 MC/s (5.365e-003 s/TS) || Energy: ~5.97e-016 (-19.99dB)
[@     5m20s] Timestep:        77814 || Speed:   38.4 MC/s (4.407e-003 s/TS) || Energy: ~5.96e-016 (-19.99dB)
[@     5m25s] Timestep:        78862 || Speed:   42.7 MC/s (3.960e-003 s/TS) || Energy: ~5.95e-016 (-20.00dB)
[@     5m29s] Timestep:        79910 || Speed:   42.3 MC/s (4.006e-003 s/TS) || Energy: ~5.94e-016 (-20.01dB)
[@     5m33s] Timestep:        80958 || Speed:   38.5 MC/s (4.396e-003 s/TS) || Energy: ~5.93e-016 (-20.01dB)
[@     5m38s] Timestep:        81875 || Speed:   37.1 MC/s (4.567e-003 s/TS) || Energy: ~5.92e-016 (-20.02dB)
[@     5m42s] Timestep:        82923 || Speed:   40.5 MC/s (4.183e-003 s/TS) || Energy: ~5.91e-016 (-20.03dB)
[@     5m46s] Timestep:        83971 || Speed:   40.3 MC/s (4.199e-003 s/TS) || Energy: ~5.90e-016 (-20.03dB)
[@     5m51s] Timestep:        85019 || Speed:   40.5 MC/s (4.184e-003 s/TS) || Energy: ~5.89e-016 (-20.04dB)
[@     5m55s] Timestep:        85936 || Speed:   38.1 MC/s (4.445e-003 s/TS) || Energy: ~5.89e-016 (-20.04dB)
[@     5m59s] Timestep:        86984 || Speed:   41.6 MC/s (4.066e-003 s/TS) || Energy: ~5.88e-016 (-20.05dB)
[@     6m03s] Timestep:        88032 || Speed:   42.3 MC/s (3.997e-003 s/TS) || Energy: ~5.87e-016 (-20.06dB)
[@     6m08s] Timestep:        89080 || Speed:   39.6 MC/s (4.274e-003 s/TS) || Energy: ~5.86e-016 (-20.06dB)
[@     6m12s] Timestep:        90128 || Speed:   40.6 MC/s (4.173e-003 s/TS) || Energy: ~5.85e-016 (-20.07dB)
[@     6m17s] Timestep:        91176 || Speed:   39.8 MC/s (4.249e-003 s/TS) || Energy: ~5.84e-016 (-20.08dB)
[@     6m21s] Timestep:        92093 || Speed:   38.8 MC/s (4.365e-003 s/TS) || Energy: ~5.84e-016 (-20.08dB)
[@     6m25s] Timestep:        93141 || Speed:   42.6 MC/s (3.971e-003 s/TS) || Energy: ~5.83e-016 (-20.09dB)
[@     6m29s] Timestep:        94189 || Speed:   40.5 MC/s (4.177e-003 s/TS) || Energy: ~5.82e-016 (-20.10dB)
[@     6m33s] Timestep:        95106 || Speed:   37.3 MC/s (4.535e-003 s/TS) || Energy: ~5.81e-016 (-20.10dB)
[@     6m38s] Timestep:        96154 || Speed:   41.1 MC/s (4.118e-003 s/TS) || Energy: ~5.80e-016 (-20.11dB)
[@     6m42s] Timestep:        97202 || Speed:   41.0 MC/s (4.133e-003 s/TS) || Energy: ~5.80e-016 (-20.11dB)
[@     6m46s] Timestep:        98250 || Speed:   41.2 MC/s (4.112e-003 s/TS) || Energy: ~5.79e-016 (-20.12dB)
[@     6m50s] Timestep:        99167 || Speed:   37.6 MC/s (4.501e-003 s/TS) || Energy: ~5.78e-016 (-20.12dB)
RunFDTD: Warning: Max. number of timesteps was reached before the end-criteria of -50dB was reached...
        You may want to choose a higher number of max. timesteps...
Time for 100000 iterations with 169252.00 cells : 414.89 sec
Speed: 40.79 MCells/s
The results seem OK either way, but I'm wondering if there's any way I can get the energy approximation to converge in both cases -- the filter uses butterfly stubs, so the lack of convergence for the downward pointing stub (which is observed with the butterfly also) is a bit frustrating!

I'm using OpenEMS v0.0.35. Full code is attached, the most relevant bits being section 2 (top stub), and section 3 (bottom stub).

More generally if there is any advice on meshing for these stubs I'd love to hear it -- it's not been easy :)
Attachments
stub_test.m
(10.04 KiB) Downloaded 82 times
Last edited by mpred on Tue 18 Feb 2020, 13:10, edited 1 time in total.

mpred
Posts: 4
Joined: Fri 14 Feb 2020, 06:41

Re: Radial stub convergence confusion

Post by mpred » Fri 14 Feb 2020, 07:27

Follow-up: for that code to work, AddMRStub.m needs to be patched, by changing the last line to:

Code: Select all

CSX = AddPolygon( CSX, materialname, prio, idx_elevation-1, elevation, p );
I also tried changing the stub angle in AddMRStub from -90 to 270, in case there was some kind of handedness issue at play, but it seemed to have no effect.

mpred
Posts: 4
Joined: Fri 14 Feb 2020, 06:41

Re: Radial stub convergence confusion

Post by mpred » Mon 17 Feb 2020, 07:43

A little more investigation:
  1. The results seem exactly the same between the runs that terminate early, and those that have the non-decaying energy. In fact, I just kicked NrTS up to a safe number & got some very nice results for my complete filters -- so thank you! :) So this is really just a quality-of-life thing, especially if optimising. Here is a gif of the two configurations, the top has decaying energy approx, the bottom doesn't, but they seem identical on E vs time. Note these were simulated separately, and just stuck together in ParaView.
    Image
    https://i.imgur.com/6yGncxX
  2. I wondered if having most of the action in the -y domain had something to do with it. However, moving the whole "bottom stub" simulation into the +y domain (so the sim box goes from y=0 upwards, and the whole bottom-facing stub has y>0) has no effect.
  3. Tweaking the stub parameters didn't help -- I tried a few values, and consistently the "top" configuration had decaying energy, and the bottom configuration did not.
Any suggestions for diagnostics I could try beyond this?

Hale_812
Posts: 170
Joined: Fri 13 May 2016, 02:54

Re: Radial stub convergence confusion

Post by Hale_812 » Tue 18 Feb 2020, 06:54

I did not get the reason yet, but I see a flaw in your model:

MUR conditions should be placed far away from the model, especially from leaking sides. (Y direction). MUR is a condition for normal far field ONLY. Oblique or evanescent wave hitting MUR will cause problems. Try at least quarterwave, or better λ*3/4 distance from open edge to MUR.
PML can handle almost any incident field.

mpred
Posts: 4
Joined: Fri 14 Feb 2020, 06:41

Re: Radial stub convergence confusion

Post by mpred » Tue 18 Feb 2020, 13:09

Thanks for picking that up -- it seems to have solved the problem!

I changed all absorbing bounds to PML_8 and expanded the box a bit to make sure there are plenty of cells for the boundary, and now both top and bottom configurations converge after ~10k timesteps.

Keep the bigger box but change back to MUR, and we're back to no convergence. Just to explore I ran a few experiments with the boundaries, keeping the box & stub dimensions and meshing fixed:

Code: Select all

Boundary             Convergence
+y     -y     +z              
MUR    MUR    MUR    No
PML_8  PML_8  PML_8  Yes
MUR    MUR    PML_8  Yes
PML_8  PML_8  MUR    Yes
I'm glad it's solved, but now I'm curious... any idea what's going on?

Hale_812
Posts: 170
Joined: Fri 13 May 2016, 02:54

Re: [solved] Radial stub convergence confusion

Post by Hale_812 » Wed 19 Feb 2020, 02:53

If you really want details, try googling for radiating boundary conditions.
The simpler paper on MUR:
https://people.engineering.olemiss.edu/ ... per_27.pdf
The harder paper on all the methods:
https://www.e-fermat.org/files/articles ... adee49.pdf
But if you are not a hardcore numeric programmer, I would recommend just following simple rules of thumb - place non-PML boundaries as far away as you can, at odd number of quarterwaves away. make them parallel to radiating apertures, not oblique. These rules extends on FEM method as well. But in FEM non PML boundaries can give you a great boost because of nonuniform meshing; in FDTD - hardly.

Post Reply