Ask Your Question

PW's profile - activity

2018-10-18 20:49:55 +0200 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-16 03:14:04 +0200 received badge  Scholar (source)
2018-10-15 13:55:38 +0200 received badge  Great Question (source)
2018-10-15 11:27:30 +0200 received badge  Good Question (source)
2018-10-15 11:17:20 +0200 received badge  Nice Question (source)
2018-10-15 08:57:21 +0200 received badge  Editor (source)
2018-10-15 08:37:27 +0200 received badge  Student (source)
2018-10-14 23:27:08 +0200 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?