# Understanding the transition from integrated form to ODE form of neuron models

I'm trying to convert a fairly complicated neuron model from integrated form (a form of the spike response model) to ODE form for use in the BRIAN simulator.

The BRIAN simulator requires neuron/synapse models to be given as two parts: the differential equation governing the model, and the response of the model to a spike. To use a model given in integrated form (i.e. as a solved membrane potential $$V(t),$$ we must first convert it into ODE form. The documentation (specifically https://brian2.readthedocs.io/en/stable/user/converting_from_integrated_form.html) gives examples of doing this with basic models, and I'm trying to reproduce these before moving on to the model I'm interested in.

The documentation demonstrates this technique with models of the form $$V(t) = \sum_i w_i \sum_i \text{PSP}(t-t_i) + V_{rest}$$ for different forms of $$\text{PSP}(t),$$ and this general form is similar to that which I am trying to work with.

I have no problem reproducing the equations (differentiating both sides and substituting where necessary), but I don't quite understand how to notice the behaviour of the model upon spiking from the integrated form.

For example, using the alpha function $$\text{PSP}(t) = \frac{t}{\tau} e^{\frac{t}{\tau}},$$ we have upon differentiating the expression for V that $$\frac{dV}{dt} = \sum_iw_i\left[\sum_i\frac{1}{\tau}e^{-\frac{t-t_i}{\tau}} - \frac{t-t_i}{\tau^2}e^{-\frac{t-t_i}{\tau}}\right] + V_{rest}$$

where we arrive at the equations $$\tau\frac{dV}{dt} = g- V + V_{rest}, \text{ and } \tau\frac{dg}{dt} = - g$$ upon defining $$g = \sum_i w_i \sum_i e^{-\frac{t-t_i}{\tau}}.$$

This agrees with the example in the documentation. However, upon spiking, the documentation states that the model reacts as $$g \longleftarrow g + w_i,$$ and I'm not sure how this is clear from the integrated model.

If someone could explain how to notice this in this example and in general, it would be greatly appreciated.

Cheers