Performance of MATLAB and Python for Computational Electromagnetic Problems
Keywords:
Computational electromagnetics, MATLAB, pythonAbstract
MATLAB and Python are two common programming languages commonly used in computational electromagnetics. Both provide simple syntax and debugging tools to make even complicated tasks relatively simple. This paper studies how these programming languages compare in throughput for a variety of tasks when utilizing complex numbers which are common in electromagnetics applications. The compared tasks include basic operations like addition, subtraction, multiplication, and division, along with more complex operations like exponentiation, summation, Fourier transforms, and matrix solving. Each of these tests is performed for both single and double precision on the CPU. A 2D finite difference frequency domain problem and a planar array beamforming problem are also presented for comparison of throughput for realistic simulations.
Downloads
References
J. Unpingco, “Some comparative benchmarks for linear algebra computations in Matlab and Scientific Python,” in 2008 DoD HPCMP Users Group Conference, pp. 503-505, 2008. doi: 10.1109/ DoD.HPCMP.UGC.2008.49.
R. Python, “MATLAB vs Python: Why and how to make the switch – Real Python,” [Online]. Available: https://realpython.com/matlab-vs-python/. [Accessed: 30-Dec-2019].
J. Ranjani, A. Sheela, and K. P. Meena, “Combination of NumPy, SciPy and Matplotlib/ Pylab - A good alternative methodology to MATLAB - A comparative analysis,” in 2019 1st International Conference on Innovations in Information and Communication Technology (ICIICT), pp. 1-5, 2019 doi: 10.1109/ICIICT1. 2019.8741475.
N. Kinayman, “Python for microwave and RF engineers [Application Notes],” IEEE Microwave Magazine, vol. 12, no. 7, pp. 113-122, Dec. 2011. doi: 10.1109/MMM.2011.942704.
M. Capek, P. Hazdra, J. Eichler, P. Hamouz, and M. Mazanek, “Acceleration techniques in Matlab for EM community,” in 2013 7th European Conference on Antennas and Propagation (EuCAP), pp. 2639-2642, 2013.
A. J. Weiss, A. Z. Elsherbeni, V. Demir, and M. F. Hadi, “Using MATLAB’s parallel processing toolbox for multi-CPU and multi-GPU accelerated FDTD simulations,” vol. 34, no. 5, p. 7, 2019.
“Anaconda | The world’s most popular data science platform,” Anaconda. [Online]. Available: https:// www.anaconda.com/. [Accessed: 14-Jan-2020].
“Spyder Website.” [Online]. Available: https:// www.spyder-ide.org/. [Accessed: 14-Jan-2020].
V. Gundersen, “NumPy for MATLAB users.” 2006.
ajolleyx, “Intel® Math Kernel Library (Intel® MKL),” 00:00:14 UTC. [Online]. Available: https:// software.intel.com/en-us/mkl. [Accessed: 13-Jan2020].
“SciPy Roadmap — SciPy v1.4.1 Reference Guide.” [Online]. Available: https://docs.scipy.org/ doc/scipy/reference/roadmap.html. [Accessed: 16- Jan-2020].