$F(x,y) = a(x-p_1), b(y-p_2)$


In [21]:
import nengo
model = nengo.Network()
with model:
    tau = 0.001
    a = nengo.Ensemble(n_neurons=100, dimensions=2, neuron_type=nengo.Sigmoid())
    def f(x):
        a = -10
        b = -10
        p1 = 0.2
        p2 = 0.3
        return a*(x[0]-p1), b*(x[1]-p2)
    
    def feedback(x):
        dx, dy = f(x)
        return (tau*dx+x[0], tau*dy+x[1])
    nengo.Connection(a, a, function=feedback, synapse=tau, solver=nengo.solvers.Lstsq(rcond=0))
    probe = nengo.Probe(a)
    
sim = nengo.Simulator(model)
sim.run(1)
plot(sim.trange(), sim.data[probe])
show()


Simulation finished in 0:00:01.                                                 

In [42]:
import nengo
model = nengo.Network()
with model:
    tau = 0.001
    a = nengo.Ensemble(n_neurons=100, dimensions=2, neuron_type=nengo.Sigmoid())
    def f(x):
        r = 1
        return (-x[1] + x[0]*(r**2 - x[0]**2 - x[1]**2),
                x[0] + x[1]*(r**2 - x[0]**2 - x[1]**2)) 
    
    def feedback(x):
        dx, dy = f(x)
        scale = 50.0
        return (scale*tau*dx+x[0], scale*tau*dy+x[1])
    nengo.Connection(a, a, function=feedback, synapse=tau, solver=nengo.solvers.Lstsq(rcond=0))
    nengo.Connection(nengo.Node(lambda t: (0.3, 0.3) if t <0.002 else 0,0), a)
    probe = nengo.Probe(a)
    
sim = nengo.Simulator(model)
sim.run(1)
subplot(1,2,1)
plot(sim.trange(), sim.data[probe])
subplot(1,2,2)
plot(sim.data[probe][:,0], sim.data[probe][:,1])

show()


Simulation finished in 0:00:01.                                                 

In [53]:
import nengo
model = nengo.Network()
with model:
    tau = 0.001
    a = nengo.Ensemble(n_neurons=100, dimensions=2, neuron_type=nengo.Sigmoid())
    def f(x):
        mu = 0.3
        w = 0.3
        dx = x[1]
        dy = -mu*(x[0]**2-1)*x[1] - w**2 * x[0]
        return dx, dy
    
    def feedback(x):
        dx, dy = f(x)
        scale = 50.0
        return (scale*tau*dx+x[0], scale*tau*dy+x[1])
    nengo.Connection(a, a, function=feedback, synapse=tau, solver=nengo.solvers.Lstsq(rcond=0))
    nengo.Connection(nengo.Node(lambda t: (0.3, 0.3) if t <0.002 else 0,0), a)
    probe = nengo.Probe(a)
    
sim = nengo.Simulator(model)
sim.run(3)
subplot(1,2,1)
plot(sim.trange(), sim.data[probe])
subplot(1,2,2)
plot(sim.data[probe][:,0], sim.data[probe][:,1])

show()


Simulation finished in 0:00:01.                                                 

In [78]:
import nengo
model = nengo.Network()
with model:
    tau = 0.001
    a = nengo.Ensemble(n_neurons=1000, dimensions=4, neuron_type=nengo.Sigmoid())
    def f(x):
        dx = 0.7*x[1]+10*x[0]*(0.1-x[1]**2)
        dy = -x[0] + 0.25 * x[3]
        da = 1.57 * x[3]
        db = -1.57 * x[2]
        return dx, dy, da, db
    
    def feedback(x):
        scale = 1.0
        return [scale*tau*v + x[i] for i,v in enumerate(f(x))]
    nengo.Connection(a, a, function=feedback, synapse=tau, solver=nengo.solvers.Lstsq(rcond=0))
    nengo.Connection(nengo.Node(lambda t: (1) if t <0.002 else 0), a[3])
    
    probe = nengo.Probe(a)
    
sim = nengo.Simulator(model)
sim.run(100)
subplot(1,2,1)
plot(sim.trange(), sim.data[probe])
subplot(1,2,2)
plot(sim.data[probe][:,0], sim.data[probe][:,1])

show()


Simulation finished in 0:00:44.                                                 

In [ ]:
\