vectors in SymPy and use of dot cross and the Laplacian
Published 2020-09-20T18:49:00.008Z by Physics Derivation Graph
Converting "\vec{\psi}(r, t)" into SymPy is feasible Function('vecpsi')(Symbol('r'), Symbol('t'))
but I can't figure out how to apply the dot product with a vector:
>>> import sympy
>>> from sympy import * >>> from sympy.vector import CoordSys3D, Del, curl, divergence, gradient >>> Symbol('vecp').dot( Function('vecpsi')(Symbol('r'), Symbol('t')) ) Traceback (most recent call last): AttributeError: 'Symbol' object has no attribute 'dot'
The issue is that a vector needs to be specified in a specific dimension (e.g., 3) and have specific coefficients with respect to the basis.