Thank you very much - that seems to work well. I still think, though,
that it would be nice to either have a "series" option to desolve or
ode2, or a new function 'odeseries' which produces a series.
Thanks again,
Alasdair
On 12/21/05, Stavros Macrakis wrote:
> > Can Maxima produce the solution of an ODE in form of a power series?
> > For example, the Riccati equation:
> >
> > dy/dx=x^2+y^2, y(0)=1
> >
> > has a complicated closed-form solution using Bessel functions, but
> > sometimes a few terms of the series is all you need.
>
> I'm sure there are better ways -- maybe even a share package -- to do
> this, but here's a simple way:
>
> y: taylor(sum(a[i]*x^i,i,0,6),x,0,6)$ /* Generate a truncated series */
>
> eq: x^2+y^2 - diff(y,x)$
>
> tayeq: taylor(eq,x,0,6)$
> /* Taylor step not needed in this case since all terms are polynomials,
> but needed in general */
>
> coeffs: makelist ( ratcoeff(tayeq, x, i), i , 0 , 6) $
>
> solve( cons(subst(0,x,y)=1, /* initial condition */
> coeffs),
> makelist(a[i],i,0,6));
>
> Note that a[6] is not correct, because we were using only a 6th order
> expansion. Unfortunately, Taylor doesn't "know" that the 6th term is
> unknown.
>
> This approach can also be used to solve functional equations. For
> example, applying it to
>
> sin(y)-x
>
> will get you the expansion of arcsin.
>
> -s
>
> _______________________________________________
> Maxima mailing list
> Maxima@math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>