Math 240 Home,
Launch Difference Equations Lab
Difference Equations Lab Instructions
Last week, we started with a function satisfying a differential equation
and showed that the coefficients of its Taylor series expansion satisfied
a recurrence relation. In many situations, we will have a sequence of numbers
{an} related by a formula like those recurrence relations.
Such a situation is called a "difference equation." For example, a constant
coefficient second order difference equation would ask to find a sequence
{an} satisfying the relationship
P*an+2 + Q*an+1
+ R*an = 0.
For an initial value problem, you would be given the initial terms in
the sequence. For a second order problem, you would need two initial values,
a0 and a1. At this stage you should be
thinking this looks a lot like differential equations, and you are right.
Many of the ideas we've developed in this class work for both differential
and difference equations. Furthermore, just as we have found it useful to
analyze solutions to differential equations using series techniques to reduce
the situations to questions about Taylor coefficients, it is often useful
to analyze a sequence by treating the terms as the coefficients of a Taylor
series. In mathematics this technique is called computing the generating
function, while in engineering it is referred to as a z-transform (and in
statistics as the moment generating function). In this lab, we will explore
a little bit about difference equations and their associated generating functions.
- Launch the difference equation applet. In the applet, you can define
a second order constant coefficient difference equation. Initial values are
set by filling in text boxes and pressing a button to signal you want the
values updated, just as in previous labs. You adjust the coefficients by moving
the slidersm which is a different interface than we've used before. The advantage
of this interface is that you can slide through many values quickly to get
a sense of what the different possibilities are. The downside is that you
don't have as fine a control over the values, and you can scroll through
the possibilities too quickly so you can find different possibilities
without having to think too much (and as your teacher, my interest is in
your thinking). But since this isn't a course in difference equations and
I just want you to get a basic sense of some of the connections that may
come up in later courses, this interface is appropriate here. Below the first
25 terms of the sequence are illustrated in the left graph and the generating
function (actually, the degree 100 Taylor polynomial approximation to the
generating function) is illustrated in the right graph, with the radius of
convergence marked by the red dotted lines.
- Slide the sliders back and forth and see how the graphs change. You
should see situations where the coefficients (as graphed on the left) grow
to inifinity, shrink to 0, reach a constant value and stay put, oscillate
at constant amplitude, oscillate with increasing amplitude, and oscillate
with decreasing amplitude. Write a paragraph that describes how the character
of the sequence changes as you vary the P, Q, and R values in turn. By
the way, note that the different types of sequences match the different types
of solutions we had to constant coefficient second order equations. This
is not an accident, though the connections are a bit complicated so I don't
expect you to work out all the rules for exactly which values of P, Q, and
R correspond to which types of sequences, though any rules you can figure
out will improve your paragraph.
- Next consider how the graph of the generating function is related to
graph of the sequence of coefficients. In particular, consider how the radius
of convergence changes. As in last week's lab, you can usually identify the
radius of convergence easily from the graph, and as in last week's lab any
parts of the graph past the radius of convergence should be ignored as garbage.
Write a short paragraph describing how the radius of convergence of
the generating function is related to the character (increasing, decreasing,
etc.) of the sequence of coefficients.
- You should have noted in the last part that when the sequence of coefficients
is increasing (or the amplitude is increasing when the sequence is oscillating),
that the radius of convergence is less than 1, while when the radius of convergence
is greater than 1 the sequence of coefficients is decreasing (or at least
the amplitude of the oscillations is decreasing). Write a paragraph to
explain why this is reasonable. You may find it easiest to explain by
using the raio test to define the radius of convergence. Or perhaps you will
find it easier to explain if you consider the connection between Sn=0inf an
and f(1), where f is the generating function.
- So far we haven't played around much with a0 and a1.
Try out some different values and see what happens. Based on your experience
with second order differential equations, you shouldn't be too surprised
when the initial values don't have much effect on the overall character of
the sequence of terms. On the other hand, you should see some changes. Write
a paragraph that explains how and why changing the values of a0
and a1 change the graph of the generating function about
the point x = 0.
Your lab report this week will consist of the 4 paragraphs assigned (in
bold face) above. If you want to know more about difference equations and
generating functions, you are, as always, welcome to stop by my office.
Please report any problems with this page to bennett@math.ksu.edu