MA 226: LAB 1

Euler's Method Lab


This lab is due Tuesday, September 26, 2017 in class. Late labs will not be graded. You may use any technology that you have available: a spreadsheet, Mathematica, Matlab, etc. You will be graded on exactly what is asked for in the instructions below. You need not turn in any additional data, graphs, paragraphs, etc. You should submit only what is called for, and in the order the questions are asked. Remember that you will be graded on your use of English, including spelling, punctuation, logic, as well as the mathematics.

IMPORTANT: The work you submit should be your own and nobody else's. Any exceptions to this will be dealt with harshly.


Introduction. In this lab, you will need to use two numbers, A and B. These numbers are derived from your student ID (not your Social Security number) as follows. The number A is the last nonzero number in your student ID, while the number B is the second last nonzero number in your ID. For example, if your student ID is 123-45-6789, then A = 9 and B = 8. But if your ID is 100-20-3000, then A = 3 and B = 2.

We have seen in class how to use Euler's Method to approximate the solutions of differential equations. We have also seen that Euler's method usually increases in accuracy if more steps are used (equivalently, if Delta t is chosen smaller. In this lab you will investigate how the accuracy of Euler's method changes as the step size becomes smaller.

Answer each of the following questions in order


0. Give your name and student ID. Specify explicitly A and B.

1. Consider the initial value problem

dy/dt = -2t+3

y(0) = A

where the constant A is determined from your student ID as above. Find the exact solution y(t) to this initial value problem and determine the value y(1). Be sure to check that your answer here is correct and show this computation explicitly. If your answer here is wrong, the rest of this lab makes no sense and we will stop grading at this point.

2. Use Euler's method with a step size of Delta t = 0.1 to approximate y(1). That is, using Euler's Method, compute in succession

t0, y0, t1, y1, ..., t10, y10

where

t0 = 0, y0 = A and t10 = 1

so that y10 is an approximation of y(1). List in table form the values you find for t0, y0, ...y10. Highlight your approximate value for y(1) using this step size. What is the error here (the difference between your approximate value and the actual value of y(1))?

3. Repeat question 2 with a step size of Delta t = 0.05, i.e., with twice as many steps.

4. Repeat question 2 with a step size of Delta t = 0.01, i.e., with ten times as many steps as in question 2. You need not present all of the data here; just give the approximation to y(1) that you find using this step size and the error.

5. In a brief essay (no more than one page), discuss the improvement of the accuracy of Euler's Method as you make the step size smaller by a factor of 1/2 and 1/10. How does this affect your approximation of y(1)? By how much does your approximation improve percentage-wise?

6. Now consider a second initial value problem

dy/dt = 2y +3

y(0) = B/10

where the constant B is determined from your student ID again as above. Remember to use B/10, not just B. Now repeat questions 2-5 for this initial value problem. Remember to check first that your exact solution of this initial value problem is absolutely correct (using this value). Otherwise, we stop grading at this step.

So that everyone starts at the same place, consider the value

e2 = 7.389
to be accurate (it isn't, but it's close enough for our purposes).

Your results to the second part will not be as "clean" as in the first part. In your essay, discuss how close these two different results are.