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 x2 and want to substitute x1 and x2 with 
a power series in y to finally obtain a power series in y. The code below 
is an example of the idea and seems to work fine:

c= var('c')

R.<x1,x2>=PowerSeriesRing(SR)
Y.<y>=PowerSeriesRing(SR)

f=x1*x2+R.O(3)

g1=y
g2=c*y

r=f.substitute(x1=g1,x2=g2);r

c*y^2 + O(y^3)

The issue is that at first instance I obtain f as a symbolic expression f_symb, 
not as a power series. So the 
idea is to convert the symbolic expression to a power series first and then 
carry out the same substitution as
above

f_symb(x1,x2)=x1*x2

P.<x1,x2>=PolynomialRing(QQ)
f_poly = P(f_symb)
f2 = R(f_poly)+R.O(3)

It appears that f2 is exactly the same as f:

f;type(f);f2;type(f2)

x1*x2 + O(x1, x2)^3
<class 'sage.rings.multi_power_series_ring_element.MPowerSeries'>
x1*x2 + O(x1, x2)^3
<class 'sage.rings.multi_power_series_ring_element.MPowerSeries'>

However, if I now try to carry out the substitution, an error appears:

r=f2.substitute(x1=g1,x2=g2) 
  
Traceback (click to the left of this block for traceback)
...
AttributeError: 'sage.symbolic.expression.Expression' object has no
attribute 'add_bigoh'


It turns out that the error is due to the part "+R.O(3)" in the definition 
of f2. Leaving out this part, there is no error. But then Sage does not 
know anymore till what order it should expand.

My apologies if this is a basic question, which it seems to be. But as I 
said, I have been stuck with this for quite a while.

Thanks for any help provided!




-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to