Ask Your Question

Tomas's profile - activity

2018-12-10 08:03:37 -0500 received badge  Famous Question (source)
2018-11-16 07:50:26 -0500 received badge  Notable Question (source)
2018-01-16 09:44:21 -0500 received badge  Popular Question (source)
2016-09-11 23:03:40 -0500 received badge  Notable Question (source)
2016-06-28 09:30:11 -0500 received badge  Notable Question (source)
2016-06-28 09:30:11 -0500 received badge  Famous Question (source)
2016-06-28 09:30:11 -0500 received badge  Popular Question (source)
2016-02-04 18:09:35 -0500 received badge  Popular Question (source)
2014-01-22 01:57:11 -0500 received badge  Student (source)
2014-01-22 00:43:46 -0500 asked a question sage-mode in emacs

I'm trying to get the syntax highlighting to work in emacs. I have tried to install sage-mode following the manual on the https://bitbucket.org/gvol/sage-mode/...

This fail on running the first command: $ sage -f sage_mode with error message sage-run received unknown option: -f

I use Sage Version 5.9.

Could someone help me with this please?

2013-08-29 22:40:04 -0500 commented question Long expression in printed-out documents

I have the same problem. My equations are way too long to be shown on one line in pdf file. I have tried to export it to LaTeX and split manually, but it is not an easy job to do. Have you found any solution for that?

2013-08-20 00:06:15 -0500 commented answer vector derivative returns a scalar

Anyway, I reckon that the first example is probably a bug. The derivative of n-dimensional vector should have n-dimensions again no matter to which ring it belongs to. Would you know how to report that, please?

2013-08-19 23:57:21 -0500 marked best answer vector derivative returns a scalar

Look at the help of derivative. It works on symbolic functions, polynomials, and symbolic expressions. Your variable u is not a function, so it is not really being considered a two dimensional symbolic expression or function. If you do

sage: u(x,y) = matrix(1,2,[-1,1])
sage: derivative(u, x)
(x, y) |--> 0

then you can see that it is considering it as a two dimensional function. In the second case, you have a function of one variable in the variable x.

The alternative fix is to work in the symbolic ring:

sage: u = matrix(SR, [-1,1])
sage: derivative(u,x)
[0 0]
2013-08-19 23:57:21 -0500 received badge  Scholar (source)
2013-08-19 23:56:47 -0500 commented answer vector derivative returns a scalar

Thanks, the fix with a symbolic ring is helpful. In my problem the $\vec{u}$ really is a function, just happens to be a constant at this occasion.

2013-08-19 05:45:42 -0500 commented question vector derivative returns a scalar

Compared to: a(x) = function('a',x) b(x) = function('b',x) u = matrix(1,2,[a,b]) r = derivative(u,x);r Which gives a vector as expected: [x |--> D[0](a)(x) x |--> D[0](b)(x)]

2013-08-19 05:38:26 -0500 asked a question vector derivative returns a scalar

Trying to obtain the derivative of $\vec{u} = [-1,1]$ using the following code:

u = matrix(1,2,[-1, 1])

r = derivative(u,x); r

I get a scalar value 0.

Although according the following relation it should be a 2-dimensional zero vector.

$$\frac{\mathrm{d} \vec{u}}{\mathrm{d} x} =\frac{\mathrm{d}}{\mathrm{d} x} [-1, 1] = [ \frac{\mathrm{d}}{\mathrm{d} x}(-1), \frac{\mathrm{d}}{\mathrm{d} x}(1) ] = [0, 0]$$

Why does it happen? In the case it's a bug where could I report it?

Thanks

2013-08-15 03:10:02 -0500 received badge  Teacher (source)
2013-08-15 03:10:02 -0500 received badge  Self-Learner (source)
2013-08-15 01:36:41 -0500 answered a question append a variable to a vector

So an solution which work is to convert the vector to a list, append the new variable and convert to a vector again. The code for that would be as follows:

u = x.list()

u.append(sigma)

u = vector(u)

Do you see any potential problems with this solution? Why there is no method append in vector? Could I do better?

2013-08-15 01:07:50 -0500 received badge  Supporter (source)
2013-08-14 23:26:48 -0500 received badge  Editor (source)
2013-08-14 23:23:40 -0500 asked a question append a variable to a vector

I would like to define a new vector in Sage $\vec{u} = [O, P, \sigma]$ using a previously defined vecotor $\vec{x} = [O, P]$ and a new variable $\sigma$.

My code looks like:

var(’O, P');

var('sigma');

x = vector([O,P]);

u = vector([x, sigma]);

Which gives an error:

TypeError: unable to find a common ring for all elements

Apparently this is because vector() requires the variables to be of the same ring. In my case

x.parent()

Vector space of dimension 2 over Symbolic Ring

and

sigma.parent() Symbolic Ring

There is any way how to connect this two objects ($\vec{x}$, $\sigma$) together to create one vector?