1

I have a function defined in elliptic coordinates. How can I symbolically integrate it in SymPy? Otherwise, do you have an example of implementation of any other non-Cartesian integration?

    import sympy as sym

    r = sym.Symbol('r')
    Z = sym.Symbol('Z', constant = True) 

    #1s normalized orbital definition
    def f(r):
        return (1/(sym.pi)) * (Z**1.5) * sym.exp(-Z*r)

Thanks in advance!

SimpPie
  • 11
  • 1
  • are you looking to integrate f(r) over r ? or are you looking for some change of coordinates from elliptic to carthesian? i'm not sure.. – wsdookadr Dec 04 '20 at 14:54
  • More people will understand you here: https://mattermodeling.stackexchange.com/ – Nike Apr 02 '21 at 20:36

1 Answers1

0
import sympy as sym
from sympy import integrate

r = sym.Symbol('r')
Z = sym.Symbol('Z', constant = True) 
integrate('(1/(pi)) * (Z**1.5) * exp(-Z*r)', r, Z)

Output:

enter image description here

Vandan Revanur
  • 459
  • 6
  • 17