Skip to content

Need an efficient way to truncate power series on-the-fly #1641

@ProfAJRoberts

Description

@ProfAJRoberts

My core research computes asymptotic series with complicated coefficients, such as the simple example u=asin(x)+a^3/12sin(3*x)+O(a^4), and sometimes with numerical matrix coefficients (up to thousands of elements), sometimes mixed numerics-algebra coefficients, and sometimes constructed to high-order (20th--50th). The first hurdle is to efficiently truncate algebra done with such asymptotic power series. I find that using the Symbolics.taylor() function is far too slow. Is there any tweak to Symbolics to truncate asymptotics efficiently?

For the very simplest example, the following code in Julia.Symbolics takes about one second to find the series solution of x(a) to 20th order, whereas the corresponding code in Reduce-algebra takes just 2 ms to find it to 31st order.

@variables a
oErr=20       # >20 fails on factorial(21)
x=1           # set initial approx to root
for iter=1:99 # iterative refinement
    global x,Res
    Res=taylor(x^2+a*x-1,a,0:oErr)  # current residual of quadratic
    x=expand(x-Res/2)               # correct approx using residual
    if isequal(Res,0); println("Success: iter=",iter); break; end
end      

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions