| 1 | initial version |
An alternative is to define f on the Euclidean plane minus a small disk around the origin:
E.<x,y> = EuclideanSpace()
U = E.open_subset('U', coord_def={E.cartesian_coordinates(): x^2+y^2>0.2})
f = U.scalar_field(1/sqrt(x^2+y^2))
grad = f.gradient()
grad.plot(max_range=1, scale=0.1)

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.