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)$.

$\endgroup$
  • $\begingroup$ what is $\phi$, what is $y$? $\endgroup$ – user31280 Nov 26 '12 at 2:04
  • $\begingroup$ @F'OlaYinka I have edited my original post. $\endgroup$ – A A Nov 26 '12 at 2:12
2
$\begingroup$

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.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ I see what you mean. So I would have to do iterations using the different step sizes? $\endgroup$ – A A Nov 26 '12 at 2:23
  • 1
    $\begingroup$ @AA: as you say, you expect the error to be of the form $Ch^n$, where $h$ is the stepsize. You are checking that assumption. The points you are to plot are (stepsize, error). Then see if you can fit them to a form $Ch^n$ $\endgroup$ – Ross Millikan Nov 26 '12 at 2:24
  • 1
    $\begingroup$ @AA: To your comment: yes, you should use the five stepsizes provided. $\endgroup$ – Ross Millikan Nov 26 '12 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.