ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 01 Feb 2018 08:48:50 -0600How to properly declare indeterminates so that they exist in the coefficient ring.http://ask.sagemath.org/question/40918/how-to-properly-declare-indeterminates-so-that-they-exist-in-the-coefficient-ring/I'm working on a project regarding generalization of symmetric polynomials.
For the sake of simplicity, I will ask my question in the context of a minimalistic (not) working example.
Let say I am working with Symmetric Functions, I'll write an erroneous code so that you get the idea of what I'm looking for
QQt = QQ['t'].fraction_field()
Sym = SymmetricFunctions(QQt); Sym.inject_shorthands()
a0 = var('a0')
expr1 = m[1,1]
expr2 = m[2] + a0*m[1,1]
eqsys = expr1.scalar_jack(expr2)
solve(eqsys, a0)
The I get the error ```unsupported operand parent(s) for *: 'Symbolic Ring' and 'Symmetric Functions over Fraction Field of Univariate Polynomial Ring in alpha over Rational Field in the monomial basis'```
OK, so I tried this instead
QQt = QQ['t,a0'].fraction_field()
t, a0 = QQt.gens()
Sym = SymmetricFunctions(QQt); Sym.inject_shorthands()
expr1 = m[1,1]
expr2 = m[2] + a0*m[1,1]
eqsys = expr1.scalar_jack(expr2)
solve(eqsys, a0)
```a0 is not a valid variable```
So then I did the following
sln = solve(SR(eqsys), SR(a0))
and it works. But the probleme is that I can't convert the solution back
QQt(sln)
```('cannot convert {!r}/{!r} to an element of {}', {a0: 2/(t + 1)}, 1, Fraction Field of Multivariate Polynomial Ring in t, a0 over Rational Field)```
And anyway this last solution does not seem very canonical. How should I proceed?
I guess that somehow what I am asking is how to declare ```a0, a1, ...``` as symbols element of QQt. LAVThu, 01 Feb 2018 08:48:50 -0600http://ask.sagemath.org/question/40918/Sum of two vectorshttp://ask.sagemath.org/question/25331/sum-of-two-vectors/ Hi everybody, i've got this functions and variables:
v = function('v',t)
a_V_ra = function('a_V_ra',t)
a_a_ra=function('a_a_ra',t)
g = var('g')
r_V_ra = vector([v,0,0])
a_V_ra = R_ra*r_V_ra.column()
where R is a matrix and a_V_ra is the vector [cos(psi(t))v(t), sin(psi(t))v(t),0].
But when i do this:
a_a_ra = diff(a_V_ra)+vector([0,0,-g])
it says: *TypeError: unsupported operand parent(s) for '+': 'Full MatrixSpace of 3 by 1 dense matrices over Symbolic Ring' and 'Vector space of dimension 3 over Symbolic Ring'*
I guess it's saying that i'm summing a matrix and a vector, but they're both vectors! What can I do to make it work?
Thank you.
SilviaTue, 23 Dec 2014 03:42:05 -0600http://ask.sagemath.org/question/25331/