Comparative analysis of performance, efficiency, and resource usage between COMSOL Multiphysics and the MPh library of Python in the simulation of physical phenomena
DOI:
https://doi.org/10.31349/RevMexFis.70.061003Keywords:
computer resources usage, COMSOL Multiphysics, MPh Phython, performance comparisonAbstract
MPh is a library of Python that makes possible to link the Python computer language with COMSOL Multiphysics. The use of the MPh library opens the possibility to save the computer resources employed when simulating physical phenomena and solving mathematical models and equations. In the Python command interpreter is possible to change or adjust some settings and parameters from the models created in COMSOL, and to execute the COMSOL kernel to solve those models. In this study, we compare the performance of COMSOL Multiphysics and the MPh library of Python when computing the magnetic field generated by a distribution of currents and ferromagnetic material. The metrics employed to do the comparison and the methodology to measure them are described, as well as the computer equipment where the programs ran. The results show that the execution time of the computations are similar in both software, but in the rest of the metrics, the execution in Python surpassed the execution in COMSOL. We showed that the MPh library of Python demands less CPU and RAM usage when solving the mathematical models and the files containing the solutions use less storage memory. As a conclusion, we propose the use of the MPh library of Python to improve the performance of the computer in charge of carrying out the calculations.
References
COMSOL Multiphysics website. https://www.comsol.com/
R.W. Pryor. Multiphysics Modeling Using COMSOL: A First Principles Approach. Engineering Pro collection. Jones & Bartlett Learning, (2009)
G. Ciaburro. Hands-On Simulation Modeling with Python: Develop simulation models to get accurate results and enhance decision-making processes. (Packt Publishing, 2020)
Python website. https://www.python.org
Website with the information about the MPh library of Python. https://mph.readthedocs.io/en/stable/
Website with the information about the MPh library of Python. https://psutil.readthedocs.io/en/latest/
What is a GPU? Document found at https https://www.intel.com/content/www/us/en/products/docs/processors/what-is-a-gpu.html
What hardware do you recommend for COMSOL Multiphysics? Document found at https://www.comsol.com/support/knowledgebase/866
Website with the information about the NumPy library of Python. https://numpy.org/
Specifications of Intel Core i5 1135G7 Processor. Document found at https://www.intel.com/content/www/us/en/products/sku/208658/intel-core-i51135g7-processor-8m-cache-up -to-4-20-ghz/specifications.html
David J. Griffiths. Introduction to electrodynamics. (Pearson, 4th edition, 2013)
John D. Jackson. Classical electrodynamics. (John Wiley & sons, Inc., 3rd edition, 1999)
Understanding the fully coupled vs. segregated approach and direct vs. iterative linear solvers. Document found at https https://www.comsol.com/support/%20knowledgebase/1258#:~:text=The%20Direct%%2020solvers%20available%20within,converge%20%20to%20the%20same%20answer
Solutions to linear systems of equations: Direct and iterative solvers. Document found at https://www.comsol.com/blogs/solutionslinear-systems-equations-direct-iterativesolvers/
The iterative solvers. Document found at https://doc.comsol.com/5.5/doc/com.comsol.help. comsol/comsol_ref_solver.27.123.html
Direct (solvers). Document found at https://doc.comsol.com/5.5/doc/com.comsol.help.comsol/comsol_ref_solver.27.141.html
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2024 Marco Antonio Ortiz Villicaña, Yemby Yahaida Huamani Tapia, Carlos Alejandro Guerrero Mendez
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Authors retain copyright and grant the Revista Mexicana de Física right of first publication with the work simultaneously licensed under a CC BY-NC-ND 4.0 that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.