Ask Your Question

Mike Shulman's profile - activity

2021-04-03 08:26:54 +0200 received badge  Nice Question (source)
2020-05-03 09:48:48 +0200 received badge  Famous Question (source)
2016-08-15 07:17:52 +0200 received badge  Scholar (source)
2016-08-15 06:20:00 +0200 commented answer Polar coordinates with negative angle

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...)

2016-08-12 20:55:19 +0200 received badge  Editor (source)
2016-08-12 20:54:29 +0200 asked a question Polar coordinates with negative angle

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?

2016-08-12 20:41:22 +0200 received badge  Notable Question (source)
2015-08-04 10:05:05 +0200 received badge  Popular Question (source)
2013-12-05 13:29:59 +0200 commented answer Symbolic functions without named variables

Okay, I guess I see what the developers were thinking, even if I don't agree with it. (Wouldn't "coproduct" be a more appropriate term?)

2013-12-02 23:50:22 +0200 received badge  Supporter (source)
2013-12-02 23:49:58 +0200 commented answer Symbolic functions without named variables

I'm trying to understand this. Is the expression tree really necessary? It seems like a wrapper around a callable symbolic expression that knows how to reset the variables as needed might be sufficient for what I want. For instance, could you also overload function application, addition, etc.?

2013-12-02 23:34:28 +0200 commented answer Symbolic functions without named variables

Hmm... if it were really consistent about behaving this way, then I would expect `f+h` to be a type error, since you can't add elements of different rings.

2013-12-02 23:31:29 +0200 commented answer Symbolic functions without named variables

Thanks! Why do you refer to defining mathematical functions as "adding more semantics"?

2013-11-29 09:27:53 +0200 received badge  Student (source)
2013-11-27 15:33:17 +0200 asked a question Symbolic functions without named variables

Is there a way to define a symbolic function that can (e.g.) be differentiated, but doesn't remember the name of its input variable(s)? For instance, consider:

sage: f(x) = x^2
sage: g(x) = x^2
sage: h(t) = t^2

Mathematically, f, g, and h, should all be the same function. However, Sage doesn't think so:

sage: f+g
x |--> 2*x^2
sage: f+h
(t, x) |--> t^2 + x^2

I guess that this is happening because a "function" defined with f(x)=x^2 is actually just a symbolic expression equipped with an ordering on its variables, rather than what a mathematician would call a "function". Is there a way to define an actual mathematical function?