Ask Your Question
1

Polar coordinates with negative angle

asked 2016-08-12 20:54:29 +0200

Mike Shulman gravatar image

updated 2016-08-12 20:55:19 +0200

Following the sagemanifolds tutorial I can make $\mathbb{R}^2$ with rectangular and polar coordinates:

R2 = Manifold(2, 'R2', r'\mathbb{R}^2', start_index=1)
Rect.<x,y> = R2.chart()
U = R2.open_subset('U', coord_def={Rect : (y != 0, x < 0)})
RectU = Rect.restrict(U)
Polar.<r,th> = U.chart(r'r:(0,+oo) th:(0,2*pi):\theta')

This uses the range $(0,2\pi)$ for $\theta$, excluding the positive $x$-axis. But if I try to use instead the range $(-\pi,\pi)$ for $\theta$, excluding the negative $x$-axis:

R2 = Manifold(2, 'R2', r'\mathbb{R}^2', start_index=1)
Rect.<x,y> = R2.chart()
U = R2.open_subset('U', coord_def={Rect : (y != 0, x > 0)})
RectU = Rect.restrict(U)
Polar.<r,th> = U.chart(r'r:(0,+oo) th:(-pi,pi):\theta')

SageMathCloud gives me "ValueError: Assumption is redundant". But strangely, SageMathCell doesn't complain at all. What is the problem?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-08-13 15:35:31 +0200

eric_g gravatar image

Sorry, I cannot reproduce your error on SageMathCloud: it works for me, cf.
https://cloud.sagemath.com/projects/5... Could it be that you typed the second example in the same worksheet as the first one? In this case, the error arises because one cannot have the symbolic variable theta both in (0,2pi) and (-pi,pi).

edit flag offensive delete link more

Comments

Ohh... is that true even if I evaluate the first example and then edit it to change it into the second? (Not a very helpful error message, in that case...)

Mike Shulman gravatar imageMike Shulman ( 2016-08-15 06:20:00 +0200 )edit
1

Yes, because assumptions are kept in memory (as you can check by looking at the output of the command assumptions()). To have it work, you have to clear all assumptions by running forget() before editing to the second example. You could also run forget(th>0).

eric_g gravatar imageeric_g ( 2016-08-15 10:31:01 +0200 )edit

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: 2016-08-12 20:54:29 +0200

Seen: 304 times

Last updated: Aug 13 '16