Thank you. This is indeed useful. To summarize I am now doing something like
R.=SR[]
K.=R[]
f = K(a*p1+p2)
which is fast also when the expression a*p1+p2 becomes very lengthy.
It leaves me with the problem that f is no longer an expression of the
original type P (P.=SR[]) which seems to cause
Suppose I have a symbolic expression f( t1, t2) which can be interpreted as
a multivariate polynomial in t1 and t2., e.g.
a = var('a')
f(t1,t2) = a*t1+t2
To make this clear to Sage I say
P.=PolynomialRing(SR)
g = f.polynomial(QQ).subs(t1=p1,t2=p2)
This works but becomes very slow when the sy
In a study of the Secant algorithm I am looking for a series expansion of
the algorithm in the form of a polynomial as follows
C2, C3, C4, C5, C6, C7, C8, C9, C10= var('C2 C3 C4 C5 C6 C7 C8 C9 C10')
R.=PowerSeriesRing(SR)
P.=PolynomialRing(SR)
order = 6
f= x+C2*x^2+C3*x^3+C4*x^4+C5*x^5+C6*x^6+C
Suppose I have a polynomial p like
R.=PolynomialRing(SR)
p= x^3+x^4+x^5
Its leading order is 3 and its degree is 5. I know how to get the degree:
p.degree()
and I assume there is something equally simple to get the leading order. I
can't find it though. Thank you for any assistence.
--
You re
>
> Thank you, that takes me a step further. If I formulate the solution for
> my self I would say: take the symbolic expression, turn it into a
> polynomial by the method 'polynomial', then turn it into a power series by
> the proper substitution. That solves my original problem. It is nice t
Thank you. That is a good point although I still do not see how it solves
the issue. Suppose I define f_symb as
f_symb(t1,t2)=t1*t2
to avoid the confusion of using identical variable-names meaning different
things, what would I have to do to convert f_symb to f such that I can do
the substit
Hello,
I am quite new to Sage. I have a science background but am a stranger to
rings, fields and other advanced mathematical topics which seem central in
working with Sage. Having struggled with the issue below for quite a while
though, I decided to post it.
I have a power series f in x1 and x