Ask Your Question

PW's profile - activity

2018-10-18 13:49:55 -0600 asked a question Multiplying sparse matrices

Can Sage multiply sparse matrices? If so, does it require some special syntax? I've been trying to run the following code:

M = Matrix(QQ, 1000001, 1000001, {(3,2): 27, (2,98): 71})
M2 = M*M

and it hasn't been working. If M is being converted to a dense matrix for multiplication then of course I wouldn't expect this to run. But it shouldn't be hard to do as sparse matrices, right?

2018-10-15 20:14:04 -0600 received badge  Scholar (source)
2018-10-15 06:55:38 -0600 received badge  Great Question (source)
2018-10-15 04:27:30 -0600 received badge  Good Question (source)
2018-10-15 04:17:20 -0600 received badge  Nice Question (source)
2018-10-15 01:57:21 -0600 received badge  Editor (source)
2018-10-15 01:37:27 -0600 received badge  Student (source)
2018-10-14 16:27:08 -0600 asked a question desolve initial condition involving e gives strange answer

I'm trying to do some basic differential equations in Sage. When I run the following:

var('t') 
y = function('y')(t)
de1 = t^3*diff(y, t) + 4*t^2*y == e^(t^2)
desolve(de1, y, ics = [1,e])

The output is

1/2*(e^(t^2) + y(t))/t^4

My expectation is that there shouldn't by any y(t) term in the output. If I make a seemingly meaningless tweak to my initial conditions:

desolve(de1, y, ics = [1,e*1])

I get the expected output of

1/2*(e + e^(t^2))/t^4

If I change the initial conditions to [1, e/2], I again get the output I expect. I haven't been able to reproduce this issue with any other example. Maybe the issue just comes in converting Sage's version of e into Maxima? Does anyone know what is going on here?