Hello, I have the following code in sage: E.<x,y,z> = EuclideanSpace() CA = E.cartesian_coordinates(); CA BP.<r, θ,="" ϕ>="E.chart()" bp_to_ca="BP.transition_map(CA," [r="" *="" sin(θ)="" *="" cos(ϕ),="" r="" *="" sin(θ)="" *="" sin(ϕ),="" r="" *="" cos(θ)])="" g="E.metric()</p">
E.set_default_chart(BP) E.set_default_frame(BP.frame()) show( g.display() ) show( g.display_comp())
f = E.scalar_field({BP: function('F')(r, θ, ϕ)}, name='f') f.display(BP) f.laplacian().expr(BP).factor()
The transition map here is for spherical coordinates, I want to use it for other coordiante systems, so I don't want to use the spherical coordinates in sagemath. So I can define a scalar field and use gradient / laplacian-functions. Works fine. In order to calculate divergence and curl, I need to define a vector field. How can I do this? Thank's for your effort