[Bf-committers] Verlet integration patch (Farsthary)

Janne Karhu jhkarh at utu.fi
Sun Nov 22 00:30:35 CET 2009


The overall idea looks nice, but the patch isn't complete. For example the  
oldpos and diff vectors aren't declared anywhere and oldpos isn't even  
defined in the patch. Besides isn't oldpos just pa->prev_state.loc? I'd  
also like to see vector macros used in the calculation like with the other  
integration methods (you should always try to stick to the surrounding  
code's style when poking around somebody else's code).

And while it's true that the error per timestep is fourth order (meaning  
third order total accumulated error) for location, the error per timestep  
for velocity (which you btw use to calculate the location) is second order  
(first order total accumulated error!), so I'm not convinced it's better  
than midpoint for all cases and without proper testing I can't yet comment  
on making verlet the default integration method, but I'll be happy to  
apply the patch once the couple of code issues I mentioned above are  
fixed. The question about making it default can be addressed later.

jahka

On Sat, 21 Nov 2009 20:02:37 +0200, Raul Fernandez Hernandez  
<raulf at info.upr.edu.cu> wrote:

> Hi all :)
>
>   Currently the particle system support 3 integrators types (in english
> integrators are what actually advance particles in space and time)
> and for many users that´s the kind of options that fall under the
> I-always-will-use-the-default-value category,
> and while for many set ups different integrators provide very similar
> results, in others they could make the difference.
>
>  The simplest integrator, Euler, is very fast but not very accurate,
> internally Blender performs only one cycle of some calculations.
>
>  The second integrator, Midpoint , is sligthly slower because it performs
> 2 cycles but is more accurate than Euler and is the default integrator.
>
>
>  And the third , RK4 (Runge-Kutta) , as you may guess is the slowest and
> more accurate of them, and performs 4 cycles of calculations in Blender
>
>
>  The good news here is that I have implemented another integrator type
> that is as fast as the Euler integrator (the fastest) since it requires
> only one cycle of calculations and is more accurate than the Midpoint
> even, the error is of fourth order: The Verlet integrator
> http://en.wikipedia.org/wiki/Verlet_integration#Basic_Verlet
>  have several advantages over the others and is very stable , fast, and
> gives realistic results.
>
>   this is the manual patch (is very small so will not cause any troubles
> patching Blender): http://www.pasteall.org/9292/diff
>
>  Check my site: http://farsthary.wordpress.com for more details
>
>  I have implemented it in Blender seamlessly and I suggest it as the
> default integrator, the previous integrators suffer from an increase of
> energy in time, note how the amplitude of each bounce is biger than the
> others in the previos integrators while in the Verlet is uniform as
> should behave in a conservative enviroment (no friction,damping,etc).
>
>  Also for many particles interacting each others the Verlet integrator
> clearly shows its speed even compared with Euler. Is very easy to
> implement in Blender and is a small step toward improvement.
>
>  Could some core dev review it for commit?
>                                                                                                                                            Cheers
>
> Farsthary
>
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



More information about the Bf-committers mailing list