355f2001_inhrec - Inhomogeneous Linear Recurrence...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Inhomogeneous Linear Recurrence Equations: Method of Undetermined Coefficients Date: Nov 13, 2001 Last Revision: Nov 15, 2001 Bent E. Petersen bent@alum.mit.edu petersen@math.orst.edu Course: Mth 355 (a.k.a. Mth 399) Term: Fall 2001 File name: 355f2001_inhrec.mws Assignment 7 (problems at end) - due Nov 21, 2001 > restart; Introduction Maple has no difficulty solving simple inhomogeneous linear recurrence equations. For example, > eqn0:=a(n)=4*a(n-1)-4*a(n-2)+3^n+4^n; := eqn0 = () a n + + 4( ) a n 14 ( ) a n 23 n 4 n > init0:=a(0)=A,a(1)=B; := init0 , = a0 A = a1 B > soln0:=rsolve({eqn0,init0},a(n)); := soln0 + + + + A 1 2 B + n 12 n 1 2 B 2 A 2 n 17 2 n 17 2 2 n 9 2 2 n 93 n 44 n This means > a(n)=soln0; = a n + + + + A 1 2 B + n n 1 2 B 2 A 2 n 17 2 n 17 2 2 n 9 2 2 n n n Very convenient, but not very illuminating! After all, of what importance is the solution to a contrived problem? It is the underlying ideas and the method of solution that are important. If we were doing this example by hand we would first find the characteristic polynomial of the associated homogeneous equation. Then we would observe the characteristic roots are 2, 2. In particular, 3 and 4 are not characteristic. Thus we would expect a particular solution of the form A 3^n + B 4^n. We would substitute this trial solution and find A = 9 and B = 4 (as we see above). This
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
is not so bad, but it can involve a lot of algebra. In this worksheet we get Maple to do the algebra. Nothing we do here is needed if we just want a solution! The purpose of this worksheet is to provide support for hand calculation so we can see how things work without being distracted by algebra errors. It will be convenient, but not necessary, to have a procedure to normalize a polynomial, that is, to divide by the leading coefficient to make the polynomial monic. The degree() function fails easily so monic() is a bit tricky to get to work. In addition we have to simplify the result to avoid problems with roots() later. > monic:=proc(p,z) > local k,c,q; > q:=sort(collect(p,z),z); > k:=degree(simplify(q),z); > c:=coeff(q,z,k); > return(simplify(q/c)); > end: Method of Undetermined Coefficients The procedures presented here are not very robust. In particular we assume our linear recurrence equations are in normal form. > ‘a(n) = c[1]*a(n-1) + . .. +c[m]*a(n-m) + f(n)‘; a(n) = c[1]*a(n-1) + . .. +c[m]*a(n-m) + f(n) The labels a, n, c, m, f can of course be "anything" but otherwise any other form will likely cause an error.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

355f2001_inhrec - Inhomogeneous Linear Recurrence...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online