Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.



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

share|cite|improve this question
what is $\phi$, what is $y$? – user31280 Nov 26 '12 at 2:04
@F'OlaYinka I have edited my original post. – A A Nov 26 '12 at 2:12
up vote 2 down vote accepted

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.

share|cite|improve this answer
I see what you mean. So I would have to do iterations using the different step sizes? – A A Nov 26 '12 at 2:23
@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$ – Ross Millikan Nov 26 '12 at 2:24
@AA: To your comment: yes, you should use the five stepsizes provided. – Ross Millikan Nov 26 '12 at 2:24
Got it, thank you! – A A Nov 26 '12 at 2:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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