# $Source: /u/maple/research/lib/DEtools/diffop/src/RCS/integrate_sols,v $ # $Notify: hoeij@sci.kun.nl $ # The goal of this file is to compute an M of minimal order such that # diff( DEsols(M) ,x) = DEsols(L) # (so that I can replace Int(DEsols(L)) by something nicer). # Note that the algorithm is also applicable for the difference # case, so it may be useful for the LREtools package. # However, it may be better to wait until we have # a Ore_algebra[ratsols] so that it can be written in a # more general way. macro( x=`DEtools/diffop/x`, DF=`DEtools/diffop/DF`, adjoint=readlib(`DEtools/diffop/adjoint`), leftdivision=readlib(`DEtools/diffop/leftdivision`), integrate_sols=`DEtools/diffop/integrate_sols` ): # ISSAC'97 Abramov/Hoeij # (if you look at the size of this program, it's amazing that such a thing # suffices for an ISSAC paper isn't it?). integrate_sols:=proc(L) global x,DF; local A,l,i,d,r; option `Copyright (c) 1997 Waterloo Maple Inc. All rights reserved.`; A:=normal(adjoint(L)); d:=denom(A); A:=collect(numer(A),DF); l:=readlib(`DEtools/ratsols`)( [seq(coeff(A,DF,i),i=0..degree(A,DF))],d,x); if nops(l)=1 then # no rational solutions L*DF else l:=l[2]; # found a rational solution # r satisfies: DF*r=1-l*L # r:=adjoint(quo(adjoint(1-l*L),DF,DF)); r:=leftdivision(1-l*L,DF); # if r[2]<>0 then bug() fi; r:=r[1]; # Ltilde=1-r*DF [collect(1-r*DF,DF),r] fi end: #savelib('integrate_sols','`DEtools/diffop/integrate_sols.m`'):