3 ***************************************************************
6 * <functionality description> *
8 * from: Computer Algebra in Applied Math. *
9 * by Rand (Pitman,1984) *
10 * Programmed by Richard Rand *
11 * These files are released to the public domain *
13 ***************************************************************
14 (d4) This program generates the Taylor series solution
23 Y = F ( X, Y, Y', Y'', ..., Y )
26 for arbitrary initial conditions at X = 0.
36 \rsolution():=(input(),step1(),step2(),v:f,
37 for i from n thru m do (u:u+evaluate(v)*x^i/i!,v:deriv(v)),output())$
38 input():=(n:read("ENTER ORDER OF D.E."),m:read("ENTER DEGREE OF TRUNCATION"),
39 f:read("ENTER RIGHT HAND SIDE OF ODE.\
40 REPRESENT Y BY Y[0], Y' BY Y[1], ETC."),
41 print(" "),print(f),print(" "),
42 for i from 0 thru n-1 do z[i]:read("ENTER INITIAL VALUE OF Y[",i,"]"))$
43 step1():=u:sum(z[i]*x^i/i!,i,0,n-1)$
44 step2():=initial:makelist([y[i] = z[i]],i,0,n-1)$
45 deriv(g):=diff(g,x)+sum(diff(g,y[i])*y[i+1],i,0,n-2)+diff(g,y[n-1])*f$
46 evaluate(g):=ev(g,x:0,initial)$
47 output():=print("Y =",u)$