Closed KJ7LNW closed 8 months ago
Hi, the FDTD algorithm is very deterministic and should give consistent results (even with multiple threads), but openEMS does check minimum every ~4s if the energy has decayed enough to stop. And this means the number of total timesteps simulated can vary depending on the machine and workload. If you want this to be more stable, disable the energy decay stop criteria and always run a fixed number of steps.
Got it, thanks!
I was getting up to speed on running simulations in python by making some structural changes to the simple patch antenna tutorial. The intention was to not make any computation changes until I had a good understanding of the graphs, how it worked, and how to maintain accuracy in the result.
While testing, I became confused when simple non-computational changes would produce slightly different values in the result. Thinking that the computation was repeatedly accurate, I assumed my code was to blame. However, it seems that multiple runs of that same tutorial produce different outputs almost every time!
To troubleshoot this and confirm this theory, I modified the simple patch antenna tutorial to display only the maximum impedance measurement that is graphed, and ran it multiple times without any other changes. The patch for that is below. I also set it to run a single thread, but even in single threaded mode it still produced varying results with every run. Here are the results for several single thread runs:
I realize that these values change by only a relatively small amount, but all we care about is consistency for testing/validating. We want them to be the same within floating point rounding error, so within 1e-6 or better. Below is the patch that I used for testing.
Questions:
Is this expected behavior?
Thank you for your help!
-Eric