Range Space and Similarity Transformation Using Symbolic Mathematics in Python - Wisassakwichai, Chainarong; Phaochoo, Prasert (IEEE access, 2024)
Linear systems involved in engineering and scientific calculations can be more easily analyzed using similarity transformation. However, understanding the numerous abstract linear algebra theorems associated with this transformation can be challenging. This paper proposes a systematic approach to organizing these theorems using SymPy, a symbolic mathematics library in Python, and develops an innovative Python module that leverages SymPy. It covers important theorems, including vector space basis, range space, null space, rank and nullity, eigenvalues, generalized eigenvectors, eigenspaces, and diagonal-Jordan canonical form transformations. These theorems are transformed into abstract data models and represented as programmatic objects using object-oriented programming to process input and output data. Two classes, 'rangeSpace' and 'similarTrnsfrm,' were created to handle computations related to range space and similarity transformation, respectively. The effectiveness of these classes has been validated through numerical results, which, when compared to MATLAB functions (null(), pinv(), sym(), and jordan()), demonstrate that the exact symbolic solutions from both classes significantly improve numerical precision for selected application examples from numerical algorithms, power systems and linear algebra. These classes have been uploaded to GitHub as open-source code, providing a versatile Python module that can be used for programming both offline on PCs and online through the web application "SymPy Live," producing satisfactory results even on mobile devices. This user-friendly module enables electrical engineering students and professionals to easily apply abstract linear algebra theorems to practical problems, facilitating computer-based solutions for linear systems that are consistent with analytical results.