quote:
Original post by lusinho
> And certainly there are more accurate implicit methods.
You can''t just leave it like that Graham.
We are all waiting (well, maybe just me) for a detailed description of these wonderfull methods you talk about.
Better time accuracy may not be important for games, so don''t assume that just becaues more accurate exists that it would be a good idea. For example, the implicit Euler method does happen to have stability characteristics among the best of the implicit methods, and better than probably all of the explicit methods. And stability may likely be more important than accuracy.
HOWEVER, to answer the question.. Implicit Euler is 1st-order accurate in time. What''s better? Almost EVERY other implicit method is more accurate in time. A good choice might be the two-step trapezoidal method, but its just one of dozens/hundreds.
My GDC 2001 paper details some of this. In particular, look at page 30 of the presentation PDF file, available here:
http://www.gdconf.com/archives/2001/rhodes_slides.pdf
On this page, you can see a table of implicit methods and their time accuracy. All are A-Stable, and if you can figure out how to interpret the equation you will be able to figure out how to use the method. I''ll tell you how to use the table and formula using implicit Euler, which is at least somewhat understood here. Take the numeric parameters from the 3 right-most columns and plug those values into the equation to get the formula for the method. Thus, plugging in the table values, implicit Euler becomes:
(1+0)*xn+1-(1+2*0)*xn+0*xn-1=dt*(1*fn+1+(1-1-0)*fn-0*fn-1)
or, simplifying and dropping zero terms,
xn+1-xn=dt*(fn+1)
which can be written,
xn+1 = xn + dt*fn+1
Now, the notation is weird. Those superscripts really represent the time. They are NOT exponents. Thus, "xn+1" means "x at time step n+1" not "x raised to the n+1 power". There''s a reason for that, but it isn''t important to you. Just convert the superscripts into parentheses:
x(n+1) = x(n) + dt*f(n+1)
Now, doesn''t that look familiar? Looks kind of like the following code for using implicit Euler to integrate velocity to obtain position, doesn''t it?
x(n+1) = x(n)+v(n+1)*h
Its exactly the same. We derived implicit Euler using the formula and table. My formula (which is actually courtesy of Hirsch, one of the references in the accompanying paper, gives you any number of implicit formulas for calculating x based on f. When x is position, f is velocity. You can use the same formula substituting velocity for x and acceleration for f.
There are more exotic methods, but this should be all you''d want to know for now.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.