为了从sage中的一个普通生成函数中提取系数,我这样做。
sage: var('z')
z
sage: T=-1/2*(sqrt(-4*z + 1) - 1)/z
sage: T.series(z,101).coefficient(z,100)
896519947090131496687170070074100632420837521538745909320给出了$T(z)=1+z\cdot T(Z)^2$的系数100。然而,有一种更简单的方法,那就是使用Lazy Power Series
sage: L.<z> = LazyPowerSeriesRing(QQ)
sage: T = L()
sage: T._name = 'C'
sage: T.define (1+z*T^2)
sage: T.coefficient(100)
896519947090131496687170070074100632420837521538745909320我的问题是,我想从表皮生长因子e^{e^z-1}$中提取系数,并使用第一种方法(如果有效的话)。
sage: var('z')
z
sage: F=exp(exp(z)-1)
sage: F.taylor(z,0,21).coefficient(z,20)
263898766507/12412765347840000我的问题是,如何使用F.coefficient(20)提取系数,因为在这种情况下,LazyPowerSeriesRing不起作用。
发布于 2022-10-07 14:24:52
为什么要使用Lazy构造函数?!我也尝试过类似的方式
sage: PREC = 30 # use a higher precision then the needed coefficient(s)
sage: L.<z> = PowerSeriesRing(QQ, default_prec=PREC)
sage: L
Power Series Ring in z over Rational Field
sage: L.default_prec()
30
sage: F = exp( exp(z) - 1 )
sage: F.coefficients()[:6]
[1, 1, 1, 5/6, 5/8, 13/30]
sage: F.coefficients()[20]
263898766507/12412765347840000并对所需系数进行了再现。具体而言:
sage: L.<z> = PowerSeriesRing(QQ, default_prec=30)
sage: F =exp( exp(z) - 1 )
sage: F.coefficients()[20]
263898766507/12412765347840000https://stackoverflow.com/questions/73920447
复制相似问题