2
$\begingroup$

I am approximating a solution to a first order LODE using Euler's method. I made two tables, one using a step size of .01 and another using .05 ( I had to start at x=0 and end at x=1). I am not understanding the directions for the second part of my assignment:

It states that the order of numerical methods (like Euler's) is based upon the bound for the cummulative error; i.e. for the cummulative error at, say x=2, is bounded by $Ch^n$, where $C$ is a generally unknown constant and $n$ is the order. For Euler's method, plot the points: $(0.1, \phi(1)-y_{10}),$ $(.05, \phi(1)-y_{20}),$ $(.025, \phi(1)-y_{40}),$ $(.0125, \phi(1)-y_{80}),$ $(.00625, \phi(1)-y_{160})$ And then fit a line to the above data of the form $Ch$. I don't understand, am I supposed to plot these using a step size of .1 or .05? Or am I supposed to use another step size?

Any clarification is appreciated.

Thanks

Edit:

The LODE I am given is $y'=x+2y, y(0)=1$ and the exact solution I found was $\phi(x)=\frac{1}{4}(-2x+5e^{2x}-1)$.

  • 0
    @F'OlaYinka I have edited my original post.2012-11-26

1 Answers 1

2

From the way I see it, if $\phi$ is the exact solution, the teacher probably wants you to compare the errors at $x=1$ for different step sizes.

Take for example the one before the last $(0.0125, \phi(1)-y_{80})$ the step size to use here is $h$ such that $n=80$ and $0+nh=1\implies h=1/80=0.0125$ (I didn't see that coming).

The first number in the bracket is the step size to use for each point. For each point evaluate the approximated value of $\phi(1)\approx y_n$ Then ploy the graph of points $(h_n,\epsilon_n)$ where $\epsilon_n=\phi(1)-y_n$ and $h_n$ is the equivalent step size.

  • 1
    @AA: To your comment: yes, you should use the five stepsizes provided.2012-11-26