Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question

Mike Shulman's profile - activity

4 years ago received badge  Nice Question (source)
5 years ago received badge  Famous Question (source)
8 years ago received badge  Scholar (source)
8 years ago 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...)

8 years ago received badge  Editor (source)
8 years ago asked a question Polar coordinates with negative angle

Following the sagemanifolds tutorial I can make R2 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π) for θ, excluding the positive x-axis. But if I try to use instead the range (π,π) for θ, 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?

8 years ago received badge  Notable Question (source)
9 years ago received badge  Popular Question (source)
11 years ago 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?)

11 years ago received badge  Supporter (source)
11 years ago 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.?

11 years ago 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.

11 years ago commented answer Symbolic functions without named variables

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

11 years ago received badge  Student (source)
11 years ago 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?