# From QIF equations to a working Brian2 implementation

**URL:** <https://brian.discourse.group/t/from-qif-equations-to-a-working-brian2-implementation/614>\
**Category:** Science, Projects, and Showcases\
**Created:** [24 February 2022 16:13 UTC](https://brian.discourse.group/t/from-qif-equations-to-a-working-brian2-implementation/614 "2022-02-24T16:13:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [9 March 2022 15:05 UTC](https://brian.discourse.group/t/from-qif-equations-to-a-working-brian2-implementation/614/2 "2022-03-09T15:05:56Z")

</div>

Hi @nvar. This is a very abstract model that is convenient for analytical results, but not so much for simulation. For example, the membrane potential is supposed to be reset to -∞, and a spike happens when it goes to +∞… From a quick look at the [paper they cite](https://doi.org/10.1103/PhysRevX.5.021028), it seems that as if for actual simulations they use values of ±100 instead of ∞. The “refractory period” is the time it takes from 100 to ∞ and from -∞ to -100, which apparently is 2/Vk “time units”. I discussed abstract equations that do not have actual time quantities in seconds in this post: [Coupled Van der Pol oscillators - #2 by mstimberg](https://brian.discourse.group/t/coupled-van-der-pol-oscillators/230/2)  
The same applies here. In models like this, the membrane potential would not be in volt, but just a dimensionless quantity – a number of Brian examples use this approach as well: [Example: non\_reliability — Brian 2 2.5.0.3 documentation](https://brian2.readthedocs.io/en/stable/examples/non_reliability.html) Having the value squared is not a problem then.  
Regarding the refractoriness, this is also expressed relative to some time unit. In principle there’d be ways to make this dependent on the exact value of the membrane potential when it crossed the threshold, but I guess just using the value of the threshold should be good enough (I think the 2/Vk kind of assumes this, in fact).

The `on_pre` statement is the most straightforward: this is actually the same as in the simple LIF examples, each spike makes the membrane potential jump up by the given amount. There is an additional normalization term, but you could simply include this in the weight.

Hope that helps a bit!

---

_[View the full topic](https://brian.discourse.group/t/from-qif-equations-to-a-working-brian2-implementation/614)._
