class:: DoubleWell			

summary:: Forced DoubleWell Oscillator
related:: Classes/DoubleWell2, Classes/DoubleWell3
categories:: UGens>Generators>Chaotic

//SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html
keyword:: SLUGens

Description::

Runge-Kutta ODE solver implementation of the chaotic Forced Double Well Oscillator (see Strogatz, Steven H. (1994) Nonlinear Dynamics and Chaos. Addison-Wesley, Reading, MA. pp441-7). 

D2x +delta*Dx-x+x^3 = F*cos(w*t)

All inputs can have .kr rate UGens plugged in.

note for me: add a t rate control? or arbitary oscillator input rather than Fcos(wt)

classmethods::

method::ar


argument::reset
restart with new initial conditions sampled from initx, inity
argument::ratex
update rate for x
argument::ratey
update rate for y 
argument::f
equation constant
argument::w
equation constant
argument::delta
equation constant
argument::initx
reset value for x
argument::inity
reset value for y


Examples::

code::

//Can be very noisy, high pitched and aliases badly: e.g., great fun, but watch out for your ears, filter, try out odd param settings. I've turned all the amplitudes down in the following


//defaults, high pitched! WARNING
{Out.ar(0,Pan2.ar(0.1*DoubleWell.ar(Impulse.kr(0),MouseX.kr(0.01,1,'exponential'),MouseY.kr(0.01,1,'exponential'),0.9,0.0001,0.25,LFNoise0.kr(1,0.4,0.5),LFNoise0.kr(1,0.4,0.5)),0.0))}.play


//2 per second
(
{Out.ar(0,Pan2.ar(

CombN.ar(
Resonz.ar(DoubleWell.ar(Impulse.kr(2),MouseX.kr(0.01,1,'exponential'),MouseY.kr(0.01,1,'exponential'),3.9,MouseX.kr(0.0001,0.01,'exponential'),0.25,LFNoise0.kr(1,0.4,0.5),LFNoise0.kr(1,10.4,10.5)),500,0.1),
0.05,0.05,2
)
,0.0))}.play
)


//plotting check of first samples
{DoubleWell.ar(1,0.025,0.025,0.4,1,0.25,-0.5,-0.2)}.plot(0.01, minval:-1, maxval:1)

::

