Processing math: 100%
Ask Your Question
0

Weird plot of a constant vector field with cylindrical coordinates

asked 0 years ago

updated 0 years ago

FrédéricC gravatar image

I just started using sagemath for some visualizations with vector fields and I stumbled upon some behaviour I cannot explain myself. I hope this is the correct place to ask this.

E.<rh,ph,z> = EuclideanSpace(coordinates='cylindrical')
r = E.vector_field(1, 0.01, 0, name='r')
r.plot()

I'm creating a field with constant vectors, which to my mathematical understanding should all look the same, the plot however looks rather different. (I cannot upload a picture as I'm new here)

Increasing the angle phi just a bit more leads to insanely large vectors in the first row in the plot. And the plot getting umanagable and also incorrect. Is this a bug or did I do something incorrectly?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 0 years ago

eric_g gravatar image

updated 0 years ago

This is because when you write r.plot(), the plot is performed in terms of the default chart on E, which is that of cylindrical coordinates in your case. Accordingly, the axes of the plot are /ρ, /ϕ and /z. I guess you'd rather want the plot to be performed in a Cartesian frame instead, with the axes /x, /y and /z. You should then specify it by means of the keyword argument chart:

r.plot(chart=E.cartesian_coordinates())

For a better sampling, you may use

r.plot(chart=E.cartesian_coordinates(), number_values=7)
Preview: (hide)
link

Comments

After scouring the wiki a little bit more I at least found what you are talking about, but I couldn't get it to properly work. I'm now super confused about atlases, Riemann manifolds, charts and the like.

I think I'm lacking some very fundamental knowledge about topology, which I didn't think I'd need here, so I give up.

Sorry to anyone finding this thread later on, maybe eric's solution works for you.

I still thank you for trying to help. It seems to be a me problem not a sagemath problem

MrMugame gravatar imageMrMugame ( 0 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 0 years ago

Seen: 588 times

Last updated: Jan 30