Sign in to follow this  

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.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When someone talks about "Euler integration" they are speaking ambiguously but are probably talking about forward Euler.

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by someusername
And 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 this post


Link to post
Share on other sites
Quote:
Original post by someusername
Does 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 this post


Link to post
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 = v0
2.pos = p0
3.loop{
4. pos += vel*dt;
5. Calculate acceleration
6. vel += acc*dt;
7.}


while the other
b) backward (implicit)

1.vel = v0
2.pos = p0
3.loop{
4. Calculate acceleration
5. vel += acc*dt
6. pos += vel*dt
7.


right?

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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this