# Difference Between Euler and Forward (Explicit) Euler

This topic is 4310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Not sure if it's the same thing or not but are there differences between the two?

##### Share on other sites
Anyone? It's just a simple yes or no question. I'm thinking it's definitely the same thing, but I could be wrong.

##### Share on other sites
When someone talks about "Euler integration" they are speaking ambiguously but are probably talking about forward Euler.

##### Share on other sites
So Forward Euler is the same as a regular Euler, which is this, right?

x = x + v * dt
v = v + a * dt

##### Share on other sites
There's no such thing as "regular Euler" if you're trying to be precise. Those are a set of equations which do forward Euler integration. More generally, forward Euler integration is y(t+h) = y(t) + y'(t)*h.

##### Share on other sites
Quote:
 Those are a set of equations which do forward Euler integration. More generally, forward Euler integration is y(t+h) = y(t) + y'(t)*h.

And I'd suggest you stayed away from them, because they are only sufficiently accurate for constant y'(t) [grin]

##### Share on other sites
"sufficiently accurate" is a rather vague term. The error term for forward Euler integration is O(h^2), which is worse than many other integrators but perfectly okay for many situations in which simulation speed is more important than accuracy. Forward Euler integration does get used quite a lot in the industry, due to its simplicity and speed.

##### Share on other sites
Well, in fact it is 100% accurate with linear functions (y'(t)=const.), but if I had written instead:
"And I'd suggest you stayed away from them, because they are only 100% accurate for constant y'(t)",
it would imply that all/some other numerical integration methods *are* 100% accurate (which -of course- is false), wouldn't it?

Btw, I've been keeping an eye on this thread, since I have no clue of the answer to the question of the OP... What's the difference anyway?

Does it have to do with being/and not being able to "go back" to time, if needed? e.g. to resolve a collision?

##### Share on other sites
Quote:
 Original post by someusernameAnd I'd suggest you stayed away from them, because they are only sufficiently accurate for constant y'(t) [grin]

I know it's inaccurate, but my physics engine is gonna allow the user to select from a number of different integration methods. I actually got a team of people together to design this engine, which we call DirectPhysics. It's gonna be an add on to DirectX. :D

##### Share on other sites
Quote:
 Original post by someusernameDoes it have to do with being/and not being able to "go back" to time, if needed? e.g. to resolve a collision?

Not really. Forward Euler is distinguished from backward (Implicit) Euler in that it brings the derivative from the beginning of the timestep forwards over the rest of the timestep. Backward Euler is y(t+h) = y(t) + h*y'(t+h), bringing the derivative at the end of the timestep backwards over the rest of the timestep. (Note that backward Euler has no closed-form analytical solution in the general case.)

##### Share on other sites
So, within a loop, integrating acceleration to find position, the two methods would look like:

a)forward (explicit) euler
1.vel = v02.pos = p03.loop{4.  pos += vel*dt;5.  Calculate acceleration6.  vel += acc*dt;7.}

while the other
b) backward (implicit)
1.vel = v02.pos = p03.loop{4.  Calculate acceleration5.  vel += acc*dt6.  pos += vel*dt7.

right?

I've seen both implementations, but I didn't realize they were given different names...
They are different, indeed.

##### Share on other sites
The second one isn't really backward Euler, because it doesn't backwards-evaluate the derivative. I've seen it called "semi-implicit Euler", which strikes me as inaccurate, since it isn't actually an implicit method. Again, there's no closed form analytic solution for backwards Euler.

##### Share on other sites
Also, Euler's method is not particular to displacement/velocity equations.

Typically implicit equations are solved with something like Newton's method or a "semi-implicit" Newton approach. Consider the equation y' = sin(y) for instance. Implicit Euler's method would give

y(n+1) = y(n) + h sin(y(n+1))

where you must solve for y(n+1).

##### Share on other sites

This topic is 4310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.