Re: Power series solution to differential equations
- To: mathgroup at smc.vnet.net
- Subject: [mg41568] Re: [mg41533] Power series solution to differential equations
- From: Selwyn Hollis <selwynh at earthlink.net>
- Date: Tue, 27 May 2003 01:47:30 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Wolfgang, Here's one method that can be adapted to handle the general problem you describe. It's implemented in my DETools package. (http://www.math.armstrong.edu/faculty/hollis/mmade/DiffEqs) For convenience, define the operator T[y_] := (t + 1)*D[y, t, t] + D[y, t] + t*y; Let's say we want terms up through degree 9. n = 9; terms = Simplify[T[Sum[a[i]*t^i, {i, 0, n}]]] We'll need n-1 equations to determine the coefficients, so Tycoeffs = CoefficientList[terms, t][[Range[n - 1]]] eqns = Map[(# == 0) &, Tycoeffs] Now solve for the coefficients in the solution satisfying y[0]=1, y'[0]=0. ycoeffs1 = Solve[Join[{a[0] == 1, a[1] == 0}, eqns], Table[a[i], {i, 0, n}]] Sum[a[i]*t^i, {i, 0, n}] /. ycoeffs1 And do the same for y[0]=0, y'[0]=1. ycoeffs2 = Solve[Join[{a[0] == 0, a[1] == 1}, eqns], Table[a[i], {i, 0, n}]] Sum[a[i]*t^i, {i, 0, n}] /. ycoeffs2 Prost! ----- Selwyn Hollis http://www.math.armstrong.edu/faculty/hollis On Monday, May 26, 2003, at 05:46 AM, Dr. Wolfgang Hintze wrote: > Given a differential equation of the form > > diffeq = a[x] u''[x] + b[x] u'[x] + f[x, u[x]] == 0 > > where ' means d/dx we assume that u[x] has a power series expansion > about x0 of the form (t = x-x0) > > u[t] = Sum[ c[k] t^(k+z) , {k, 0, Infinity }] > > We have to determine z and the coefficients c[k]. > > Question: what is the best way to tackle this problem in Mathematica? > > Any hint is greatly appreciated. > > Wolfgang > > >