Currently, MTSCAT MultivariateTaylorSeriesCategory(Coef: Ring,Var: OrderedSet)
exports

 coefficient : (%,List(Var),List(NonNegativeInteger)) -> %
 coefficient : (%,Var,NonNegativeInteger) -> %
 coefficient : (%,IndexedExponents(Var)) -> Coef

and TaylorSeries(Coef: Ring) exports

 coefficient : (%,NonNegativeInteger) -> Polynomial(Coef).


I believe that the intention of 

  coefficient : (%,Var,NonNegativeInteger) -> %

returning a TaylorSeries was to view the Taylor series as a univariate Taylor
series, and then return the coefficient of v^n.  For example, after

(1) -> X := x::TS(FRAC INT); Y := y::TS(FRAC INT);

                                        Type: TaylorSeries(Fraction(Integer))
(2) -> s := (1/(1-X-Y))::TS(FRAC INT)

   (2)
                     2           2      3       2     2     3
     1 + (y + x) + (y  + 2x y + x ) + (y  + 3x y  + 3x y + x )
   + 
       4       3     2 2     3     4
     (y  + 4x y  + 6x y  + 4x y + x ) + O(5)
                                        Type: TaylorSeries(Fraction(Integer))

coefficient(s, y, 1) should probably give

    1 + 2 x + 3 x^2 + ...

This was never implemented.

I think that this was a bad idea anyway, since it is confusing to have also the
coefficient function from AbelianMonoidRing(R: Ring,E: OrderedAbelianMonoid)
where

coefficient(s, monomial(2, y)$IndexedExponents(Var)) yields just 1. I.e., the
coefficient of y^2 x^0.

(not implemented either)

I think it would be better to have a coercion, like perhaps

coerce: % -> UTS(%, var, 0)

One could then say

s::UTS(TaylorSeries(Fraction(Integer)), y, 0) and get something similar to

(3) -> series(str)$UTS(UTS(EXPR INT, x, 0), y, 0)

   (3)
         1  3      5         1  2    1  4      5         1      1  3      5   2
     x - - x  + O(x ) + (1 - - x  + -- x  + O(x ))y + (- - x + -- x  + O(x ))y
         6                   2      24                   2     12
   + 
        1    1  2    1   4      5   3     1      1   3      5   4      5
     (- - + -- x  - --- x  + O(x ))y  + (-- x - --- x  + O(x ))y  + O(y )
        6   12      144                  24     144
Type: 
UnivariateTaylorSeries(UnivariateTaylorSeries(Expression(Integer),x,0),y,0)


Note however, that "coefficient : (%,Var,NonNegativeInteger) -> %" and
"coefficient: (%,List(Var),List(NonNegativeInteger))" would be (if implemented)
slightly more general, since, in the example (2) above, we could also ask for
coefficient(s, y, 2) which should probably give

1 + 3 x + 6 x^2 + ...

With my proposed semantics, this could be done via a mapping function (which
does not exist yet, I think...)

(27) -> map(c +-> coefficient(c, y, 2), [coefficient(s, n) for n in 0..])

                     2
   (27)  [0,0,1,3x,6x ,...]
                                  Type: Stream(Polynomial(Fraction(Integer)))

If there are no comments, I'll try to implement the above behaviour.

Martin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to