[reactive] Status of Reactive "feedback" (recursive integral, etc)

Peter Verswyvelen bugfact at gmail.com
Wed Dec 3 10:57:16 EST 2008


Okay.
It would be nice to experiment with higher order integration techniques too.
Right now Reactive uses Euler integration but the user should be able to
choose between Euler, Midpoint, Simpson (or whatever other quadrature rule).
However, aren't we actually interested in approximating ordinary
differential equations (or more exactly, initial value problems), instead of
using integral directly? In which case we should choose between 1-th, 2nd,
or 4th order Runge Kutta or something?

I'm not an expert here, but it would be nice to think about this I guess.

On Wed, Dec 3, 2008 at 12:49 AM, Conal Elliott <conal at conal.net> wrote:

> Hi Peter,
>
> Thanks for asking about this issue.
>
> If I understood it correctly, it Conal's aim to provide just a single
>> integral function that can handle both the  recursive and regular cases?
>>
>> But, is this even possible?
>>
>
> Yes.  The semantics of reactivity, plus the laziness of Haskell and some
> careful programming, makes it possible.  I did it long ago in Fran.
>
> Currently the implementation of snapshot (which integral uses) is not lazy
> enough for recursive snapshots to work.  Chuan-kai Lin came up with a
> solution, which I think created a space leak.  Richard Smith came up with
> essentially the same solution (and leak), and has been continuing to pursue
> a sufficiently lazy and space-tight.  Today, Richard attached his patch to
> ticket # 14 on the Reactive tracker (
> http://trac.haskell.org/reactive/ticket/14).  I'll check it out and
> integrate it if I think it will improve things.
>
> In case anyone's curious, the crucial semantic decision is to have reactive
> behaviors change immediately after an event occurs.  (Really immediately --
> not some finite positive delay.)  Thus an event can take a snapshot of a
> behavior at the moment that the behavior is reacting to that very event.
> The behavior and event are defined in terms of each other, in a well-defined
> and useful way.
>
>   - Conal
>
> 2008/12/2 Peter Verswyvelen <bugfact at gmail.com>
>
>> This has been brought up before, but I'm not sure about the current status
>> our consensus regarding "recursive feedback" in Reactive.
>> In Yampa this is solved by the ArrowLoop instance, and by having two
>> different integral functions: one with a delay and without a delay.
>>
>> If I understood it correctly, it Conal's aim to provide just a single
>> integral function that can handle both the  recursive and regular cases?
>>
>> But, is this even possible?
>>
>> A nice example of this is David's "boingee" example: a ball on the screen
>> gets dragged towards the current mouse position.
>>
>> Mathematically, this is
>>
>> vb(t) = s * ( pm(t) - pb(t) )
>> pb(t) = pb0 + integral [0..t] vb(t)
>>
>> where
>>    pb(t) is the position of the ball at time t
>>    pb0 is the initial position of the ball at time t=0,
>>    pm(t) is the position of the mouse at time t
>>    s is some arbitrary scale factor
>>
>> Of course this is not really realistic but it is a simple example of
>> recursive feedback: pb(t) depends on vb(t) and vice versa.
>>
>> Can we make such behaviors with Reactive?
>>
>>
>>
>>
>> _______________________________________________
>> Reactive mailing list
>> Reactive at haskell.org
>> http://www.haskell.org/mailman/listinfo/reactive
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/reactive/attachments/20081203/851d3e78/attachment.htm


More information about the Reactive mailing list