Le 17/04/2013 00:36, felipe zapata a écrit :
Hello,
I'm trying to write some simulator of
physical systems using Yampa.
The fundamental idea is to integrate
the position and velocity, using
the following algorithm:
... ...
Nothing to do with Haskell.
Where do you get this factor 0.5 in your formula: v = v0 + integral ( 0.5 * force * recip mass) ?
With constant acceleration v=v0+a*Dt =>  1.01, not 1.05

What is that:  let x = x0 + vdt2 ??
Again, a constant acceleration movement gives : x = x0 + v0*Dt + a*Dt^2/2.

Yampa or not Yampa, I suspect that your implementation of physics is simply wrong.
==

In general, even correcting all, you might have reasonable results in some trivial cases, but in general the extrapolating Euler schema is unstable, produces growing errors (e. g. in the oscillating case).

Jerzy Karczmarczuk





_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to