On Mon, Jan 18, 2021 at 01:35:38PM -0500, Tobias Neumann wrote:
> Thanks for the detailed answer. I realize that FriCAS is not able to find a
> matching signature of series
> or coerce the arguments into something that works. But it appears strange
> to me, since this is the case even with type annotations for all arguments.

Main reason is that you request rather bizzare operation.  Namely,
main FriCAS 'series' routine does not work for floating point
numers.  This is encoded in type constraints:

(11) -> ExpressionToUnivariatePowerSeries(Float, Expression(Float))
 
   ExpressionToUnivariatePowerSeries(Float,Expression(Float)) is not a 
      valid type.

(12) Se := ExpressionToUnivariatePowerSeries(Integer, Expression(Integer))
(13) -> series(log(sqrt(t+1))*sqrt(t) + 1/t, t = 0)$Se  

                   3      5      7      9
                   -      -      -      -
          - 1   1  2   1  2   1  2      2
   (13)  t    + - t  - - t  + - t  + O(t )
                2      4      6
                       Type: UnivariatePuiseuxSeries(Expression(Integer),t,0)

So to work with floating point numbers you need workarounds,
and interpreter will not introduce them automatically
(because they may fail in more general situations).

> I found that just coercing my full expression into a Puiseux series works.
> For example:
>  > log(sqrt(t+1.0))*sqrt(t) + 1/t ::
> UnivariatePuiseuxSeries(Expression(Float),t,0.0)
> gives the answer.

Above most computations are done at level of series (which is
a workaround for your problem).  This does not solve general
problem of converting 'Expression(Float)' to series:
in general for convertion one need to simplify first
and then "replay" operations in series deomain.  Simplification
part does not work when there are floating point coefficients.
Of course, as long as expression is already simplified
the above works OK.

> What puzzles me is that in the same way I would have expected that
> > series(log(sqrt(t+1.0))*sqrt(t) + 1/t, t=0.0)
> :: UnivariatePuiseuxSeries(Expression(Float),t,0.0)
> should work.

As I wrote 'series' does not work with floating point numbers.

> When I look at
> https://fricas.github.io/api/ExpressionToUnivariatePowerSeries.html
> I see that series (or puiseux) has a signature "puiseux: (FE, Equation FE)
> -> Any",
> where FE can be FunctionSpace R and R is Comparable. Furthermore it is
> > Expression(Float) has FunctionSpace(Float)
> true

'series' needs ability to compute basis over rational numbers
of space spanned by finite number of elements of R.  When
R is Float this is clearly not satisfied: at representaion
level all Float-s are rational numbers so only possiblity
would be to consider Float as one dimensional space over
ratonals, that is treat it as identical to rational numbers.
But due to approximate nature of floating point numbers
basic equalites for vector space fail.

Note that some other systems will quietly convert floating
point numbers to rationals.  But FriCAS takes types
seriously and allows only explicit convertion -- if you
want convertion to rationals you need to add it explicitly.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20210120192754.GA3890%40math.uni.wroc.pl.

Reply via email to