human
I am working on the file "SYDE 556 Lecture 5 Dynamics.ipynb".
The first task is:
So there are dynamics and filtering going on, since there is always a synaptic filter on a connection
Recurrent connections are dynamic as well (i.e. passing past information to future state of the population)
Let's take a look more carefully

Recurrent connections

So a connection actually approximates $f(x(t))*h(t)$

So what does a recurrent connection do?

Also $x(t) = f(x(t))*h(t)$


where $$
h(t) = \begin{cases}
    e^{-t/\tau} &\mbox{if } t > 0 \ 
    0 &\mbox{otherwise} 
    \end{cases}
$$

How can we work with this?

General rule of thumb: convolutions are annoying, so let's get rid of them

We could do a Fourier transform
$X(\omega)=F(\omega)H(\omega)$
But, since we are studying the response of a system (rather than a continuous signal), there's a more general and appropriate transform that makes life even easier:
Laplace transform (it is more general because $s = a + j\omega$)
The Laplace transform of our equations are:
$X(s)=F(s)H(s)$
$H(s)={1 \over {1+s\tau}}$
Rearranging:

$X(s)=F(s){1 \over {1+s\tau}}$
$X(s)(1+s\tau) = F(s)$
$X(s) + X(s)s\tau = F(s)$
$sX(s) = {1 \over \tau} (F(s)-X(s))$

Convert back into the time domain (inverse Laplace):

${dx \over dt} = {1 \over \tau} (f(x(t))-x(t))$
Dynamics

This says that if we introduce a recurrent connection, we end up implementing a differential equation

So what happened with $f(x)=x+1$?

$\dot{x} = {1 \over \tau} (x+1-x)$
$\dot{x} = {1 \over \tau}$

What about $f(x)=-x$?
$\dot{x} = {1 \over \tau} (-x-x)$
$\dot{x} = {-2x \over \tau}$


And $f(x)=x^2$?    

$\dot{x} = {1 \over \tau} (x^2-x)$


What if there's some differential equation we really want to implement?

We want $\dot{x} = f(x)$
So we do a recurrent connection of $f'(x)=\tau f(x)+x$
The resulting model will end up implementing $\dot{x} = {1 \over \tau} (\tau f(x)+x-x)=f(x)$


Inputs

What happens if there's an input as well?

We'll call the input $u$ from another population, and it is also computing some function $g(u)$
$x(t) = f(x(t))h(t)+g(u(t))h(t)$


Follow the same derivation...
Can you write Python program for it?
 Here about $f(x)=-x$?
assistant
#Here about $f(x)=-x$.

import nengo
from nengo.utils.functions import piecewise

tau = 0.01

model = nengo.Network('Eye control', seed=4)

with model:
    stim = nengo.Node(piecewise({.3:1, .6:0 }))
    velocity = nengo.Ensemble(100, dimensions=1)
    position = nengo.Ensemble(100, dimensions=1)
    
    def feedback(x):
        return 1*x
    
    conn = nengo.Connection(stim, velocity)
    conn = nengo.Connection(velocity, position, transform=tau, synapse=tau)
    conn = nengo.Connection(position, position, function=feedback, synapse=tau)

    stim_p = nengo.Probe(stim)
    position_p = nengo.Probe(position, synapse=.01)
    velocity_p = nengo.Probe(velocity, synapse=.01)
    
sim = nengo.Simulator(model)
sim.run(1)

plot(sim.trange(), sim.data[stim_p], label = "stim")
plot(sim.trange(), sim.data[position_p], label = "position")
plot(sim.trange(), sim.data[velocity_p], label = "velocity")
legend(loc="best");