Ask Your Question

Revision history [back]

You can define a vector field by providing its components in the default frame like this:

v = E.vector_field((function('v_r')(r, θ, ϕ), 
                    function('v_θ')(r, θ, ϕ), 
                    function('v_ϕ')(r, θ, ϕ)),
                   name='v')

and then compute its divergence and curl via

v.divergence().display()

and

v.curl().display()

See https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/vectorfield.html#sage.manifolds.differentiable.vectorfield.VectorFieldParal for more details.

You can define a vector field by providing its components in the default frame like this:

v = E.vector_field((function('v_r')(r, θ, ϕ), 
                    function('v_θ')(r, θ, ϕ), 
                    function('v_ϕ')(r, θ, ϕ)),
                   name='v')

and then compute its divergence and curl via

v.divergence().display()

and

v.curl().display()

See https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/vectorfield.html#sage.manifolds.differentiable.vectorfield.VectorFieldParal https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/vectorfield.html#sage.manifolds.differentiable.vectorfield.VectorFieldParal and https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/manifold.html#sage.manifolds.differentiable.manifold.DifferentiableManifold.vector_field for more details. details.