ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 02 Feb 2017 14:15:53 +0100Integration and differentiation symbolshttps://ask.sagemath.org/question/36441/integration-and-differentiation-symbols/I have seen this in the examples but it doesn't appear to be very easy unless I am totally missing something. It is important that the proper symbology be used in presentation form to show the integration symbol and or differentiation symbol. But can't seem to find any way of doing it . This should be straight forward like show(integral()) and it puts the integral symbol on the screen especially in showing symbolic calculations.
How do you get the symbols on the screen? NT4MAXIMUSDThu, 02 Feb 2017 14:15:53 +0100https://ask.sagemath.org/question/36441/problems with product of vector of symbols with square matrixhttps://ask.sagemath.org/question/24077/problems-with-product-of-vector-of-symbols-with-square-matrix/ Hi,
I am trying to do some experiments with symbols (variable vector) and multiplications with a coefficient matrix.
The code is the following:
A = matrix(QQ,[
[2,1,2,-6],
[-1,2,1,7],
[3,-1,-3,-1],
[1,5,6,0]
])
k = A.transpose().kernel()
basis = k.basis()[0]
t = 'real'
var('x1')
assume(x1,t)
var('x2')
assume(x2,t)
var('x3')
assume(x3,t)
var('x4')
assume(x4,t)
x = vector([x1,x2,x3,x4])
print "x",x
xT = x.transpose()
print "xT",xT
print "A*x",A*x
print "xT*A",xT*A
with the following output:
x (x1, x2, x3, x4)
xT [x1]
[x2]
[x3]
[x4]
A*x (2*x1 + x2 + 2*x3 - 6*x4, -x1 + 2*x2 + x3 + 7*x4, 3*x1 - x2 - 3*x3 - x4, x1 + 5*x2 + 6*x3)
xT*A
Traceback (most recent call last):
File "", line 1, in <module>
File "/tmp/tmpuVBZ96/___code___.py", line 27, in <module>
exec compile(u'print "xT*A",xT*A
File "", line 1, in <module>
File "element.pyx", line 2751, in sage.structure.element.Matrix.__mul__ (sage/structure/element.c:19587)
File "coerce.pyx", line 856, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure /coerce.c:8169)
TypeError: unsupported operand parent(s) for '*': 'Full MatrixSpace of 4 by 1 dense matrices over Symbolic Ring' and 'Full MatrixSpace of 4 by 4 dense matrices over Rational Field'
As you can see, `A*x` was successful, but `xT*A` is giving an exception. Do you have any idea on why? How would you solve this?stablumWed, 10 Sep 2014 00:32:46 +0200https://ask.sagemath.org/question/24077/Newbie question: introducing symbols (variables) inside vectors and matriceshttps://ask.sagemath.org/question/23833/newbie-question-introducing-symbols-variables-inside-vectors-and-matrices/Hi,
I would like to have linear algebra operations to be evaluated with symbols instead of numerically.
For example, having the following matrix:
A = matrix(QQ,[
[2,1,2,-6],
[-1,2,1,7],
[3,-1,-3,-1],
[1,5,6,0],
[2,2,1,1]
])
I would like to multiply for a vector with symbolic variables as follows:
t = 'real'
var('x1')
assume(x1,t)
var('x2')
assume(x2,t)
var('x3')
assume(x3,t)
var('x4')
assume(x4,t)
xx = vector(QQ,[x1,x2,x3,x4])
A * xx.transpose()
Unfortunately building the `xx` vector is unsuccessful, producing this error message:
TypeError: Cannot evaluate symbolic expression to a numeric value.
This does not work, so how can I use symbols in sage's linear algebra framework?
thank you very much,
-FrancescostablumTue, 19 Aug 2014 18:18:57 +0200https://ask.sagemath.org/question/23833/