Calculate curl of a vector field in Python and plot it with matplotlib
I need to calculate the curl of a vector field and plot it with matplotlib. A simple example of what I am looking for could be put like that: How can I calculate and plot the curl of the vector field in the quiver3d_demo.py in the matplotlib gallery? You can use sympy.curl() to calculate the curl of a vector field. Example : Suppose F (x,y,z) = y 2 z i - xy j + z 2 k , then: y would be R[1] , x is R[0] and z is R[2] the unit vectors i , j , k of the 3 axes, would be respectively R.x , R.y , R.z . The code to calculate the vector field curl is: from sympy.physics.vector import ReferenceFrame