## Mathematics & Science
Learning Center |
|||||||||||||||||||||||||||

## Numerical Methods for Solving Differential Equations## Euler's Method## Theoretical IntroductionThroughout this course we have repeatedly made use of the numerical differential equation solver packages built into our computer algebra system. Back when we first made use of this feature I promised that we would eventually discuss how these algorithms are actually implemented by a computer. The current laboratory is where I make good on that promise. Until relatively recently, solving differential equations numerically meant coding the method into the computer yourself. Today there are numerous solvers available that can handle the majority of classes of initial value problems with little user intervention other than entering the actual problem. However, occasionally it still becomes necessary to do a some customized coding in order to attack a problem that the prewritten solvers can't quite handle. This laboratory is intended to introduce you to the basic thinking processes underlying numerical methods for solving initial value problems. Sadly, it probably won't turn you into an expert programmer of numerical solver packages (unless some miracle occurs.) The laboratory introduces you to a very simple technique for handling ## The Nature of Numerical SolutionsFrom the point of view of a mathematician, the So we often have to "make do" with a numerical solution, i.e. a table of values consisting of points which lie along the solution's curve. This can be a perfectly usable form of the answer in many applied problems, but before we go too much further, let's make sure that we are aware of the shortcomings of this form of solution. By it's very nature, a numerical solution to an initial value problem consists
of a ## An ExampleSay we were to solve the initial value problem:
It's so simple, you could find a formulaic solution in your head, namely
Notice that the graph derived from the ## Using Numerical SolutionsSo what good is the numerical solution if it leaves out so much of the real answer? Well, we can respond to that question in several ways: The numerical solution still looks like it is capturing the general trend of the "real" solution, as we can see when we look at the side-by-side graphs. This means that if we are seeking a qualitative view of the solution, we can still get it from the numerical solution, to some extent. The numerical solution could even be "improved" by playing "join-the-dots" with the set of points it produces. In fact this is exactly what some solver packages, such as *Mathematica*, do do with these solutions. (*Mathematica*produces a join-the-dots function that it calls InterpolatingFunction.)When actually *using*the solutions to differential equations, we often aren't so much concerned about the nature of the solution at*all*possible points. Think about it! Even when we are able to get formulaic solutions, a typical use we make of the formula is to substitute values of the independent variable into the formula in order to find the values of the solution at specific points. Did you hear that? Let me say it again:**to find the values of the solution at specific points**. This is exactly what we can*still*do with a*numerical*solution.
## The Pitfalls of Numerical SolutionsOne last word of warning, however, before we move on to actually finding numerical solutions. In a problem where a numerical solution would really be necessary, i.e. one which we can't solve by any other method, there is no formulaic solution for us to compare our answers with. This means that there is always an element of doubt about the data we produce by using these numerical techniques. Say, for example, you obtained a set of numerical data as a solution, which led to the following graph: Any reasonable observer of this picture would, in the absence of any other evidence, assume that the underlying solution had a graph that looks something like this: In other words, you'd play join-the-dots visually. But how do you know that
the Notice that this graph fits the data points just as well as the first attempt we made at joining the dots, see: So how can you tell whether or not your data is leading you to the wrong
conclusion? There are ways, both qualitative and quantitative, that can be
used to help in making this kind of decision. A whole field of study
called In reality, the kind of errors we need to be careful of are much more
subtle. What tends to happen with numerical solutions is that the This difficulty can be overcome to some degree by calculating these points
Now that we have been exposed a little to the type of solutions that we'll be finding, and the problems inherent in this kind of solution, it's time we found out how they can be generated. |
|||||||||||||||||||||||||||

ODE Laboratories: A Sabbatical Project by Christopher A. Barker©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA e-mail: cbarker@deltacollege.edu |