Hi all. I've been having a bit of trouble just understanding Euler's method, which I need to know (and probably should have known for a while now) for a question on an assignment. I'm going to provide an example with confusing wording (at least to me) and show what I've done to try to understand it. I think I get it but I want to be absolutely sure.(adsbygoogle = window.adsbygoogle || []).push({});

1. The problem statement, all variables and given/known data

So for the question we have (dx/dt) = f(x) = -x with initial condition x(0) = 1. The first part asks us to give an exact solution to x(1). I believe the solution is (e^-1) and I'm not having trouble with this part (but if that's incorrect then maybe that's my problem - I reasoned that you could just separate variables and integrate both sides, giving -lnx=t+K for some constant K. x=1 at t=0 so K=0 since ln1=0. So then if t=1 and K=0, lnx=-1 which means x=e^-1).

The second part says "using Euler's method with step size D=1 [delta was used in the text but I can't seem to get a "Delta" symbol working], estimate x(1) numerically ... then repeat using D=(10^-n) for n=1,2,3..."

2. Relevant equations

3. The attempt at a solution

Now here's what I did. The text tells us that to approximate solutions with euler's method we use the recursion x_{n+1}=x_{n}+f(x_{n})*D. So I take x_{0}=1 since x(0)=1 is the initial condition. Therefore f(x_{0})=-1 since f(x)=-x, and with D=t that gives us the approximation x_{1}=0 (because this is such a poor approximation I assume I may have gone wrong here, ie maybe I just don't understand which values to plug where).

Now when it asks us to repeat with different step sizes D=(10^-n), I'm not sure if it means that for approximating x_{n+1}we should use D=(10^-n), or if the text is asking us to repeat using that step size for the approximation of x_{1}. The latter doesn't really make sense to me, because that would lead to an even worse approximation for all n>0. My problem though is that if I repeat the incursion for n>0, I'm pretty sure I get

x_{n+1}=0 for all n>1 since the approximation x_{1}=0, so x_{2}=x_{1}+f(x_{1})*D=0 no matter what D is. I realize that this could still be the intended way of solving the problem, it just doesn't seem very nice because the actual step size doesn't matter and I'm used to having to use every part of a problem to solve it (and in this case the step size seems like a red herring).

Keep in mind I've never worked with euler's method before (shock), and I may just be over-thinking the problem

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Euler's method

**Physics Forums | Science Articles, Homework Help, Discussion**