models.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import brian2 as br
  2. from brian2 import umetre, ufarad, cm, siemens, mV, msiemens, nS, ms
  3. # Hodgkin Huxley model from Brian2 documentation
  4. # The model
  5. area = 20000 * umetre ** 2
  6. hodgkin_huxley_params = {
  7. "Cm": 1 * ufarad * cm ** -2 * area,
  8. "gl": 5e-5 * siemens * cm ** -2 * area,
  9. "El": -65 * mV,
  10. "EK": -90 * mV,
  11. "ENa": 50 * mV,
  12. "g_na": 100 * msiemens * cm ** -2 * area,
  13. "g_kd": 30 * msiemens * cm ** -2 * area,
  14. "VT": -63 * mV,
  15. "E_i": -80 * mV
  16. }
  17. hodgkin_huxley_eqs_with_synaptic_conductance = br.Equations('''
  18. dv/dt = (gl*(El-v) - g_na*(m*m*m)*h*(v-ENa) - g_kd*(n*n*n*n)*(v-EK) + I - g_syn*(v-E_i))/Cm : volt
  19. dm/dt = 0.32*(mV**-1)*(13.*mV-v+VT)/
  20. (exp((13.*mV-v+VT)/(4.*mV))-1.)/ms*(1-m)-0.28*(mV**-1)*(v-VT-40.*mV)/
  21. (exp((v-VT-40.*mV)/(5.*mV))-1.)/ms*m : 1
  22. dn/dt = 0.032*(mV**-1)*(15.*mV-v+VT)/
  23. (exp((15.*mV-v+VT)/(5.*mV))-1.)/ms*(1.-n)-.5*exp((10.*mV-v+VT)/(40.*mV))/ms*n : 1
  24. dh/dt = 0.128*exp((17.*mV-v+VT)/(18.*mV))/ms*(1.-h)-4./(1+exp((40.*mV-v+VT)/(5.*mV)))/ms*h : 1
  25. I : amp
  26. g_syn: siemens
  27. ''')
  28. lif_interneuron_eqs = """
  29. dv/dt =1.0/tau* (-v + u_ext) :volt (unless refractory)
  30. u_ext : volt
  31. tau : second
  32. """
  33. lif_interneuron_params = {
  34. "v_threshold": -40 * mV,
  35. "v_reset": -60 * mV,
  36. "tau_refractory": 0.0 * ms,
  37. "u_ext_const": -50 * mV
  38. }
  39. lif_interneuron_options = {
  40. "threshold": "v>v_threshold",
  41. "reset": "v=v_reset",
  42. "refractory": "tau_refractory",
  43. 'method': 'euler'
  44. }
  45. delta_synapse_model = 'synaptic_strength: volt'
  46. delta_synapse_on_pre = 'v+=synaptic_strength'
  47. delta_synapse_param = {}
  48. exponential_synapse = """
  49. dg/dt = -g/tau_syn : siemens (clock-driven)
  50. g_syn_post = g :siemens (summed)
  51. synaptic_strength : siemens
  52. """
  53. exponential_synapse_on_pre = "g+=synaptic_strength"
  54. exponential_synapse_params = {
  55. "tau_syn": 2 * ms
  56. }