19#ifndef _NEURON_MODEL_IZH_CURR_IMPL_H_
20#define _NEURON_MODEL_IZH_CURR_IMPL_H_
96static inline void neuron_ode(
99 REAL V_now = stateVar[1];
100 REAL U_now = stateVar[2];
101 log_debug(
" sv1 %9.4k V %9.4k --- sv2 %9.4k U %9.4k\n", stateVar[1],
102 neuron->V, stateVar[2], neuron->U);
111 dstateVar_dt[2] = neuron->A * (neuron->B * V_now - U_now);
132 REAL lastV1 = neuron->V;
133 REAL lastU1 = neuron->U;
138 REAL alpha = pre_alph
145 neuron->V += h * (pre_alph - beta
148 neuron->U += a * h * (-lastU1 - beta + b * eta);
167 uint16_t num_excitatory_inputs,
const input_t *exc_input,
168 uint16_t num_inhibitory_inputs,
const input_t *inh_input,
173 for (
int i =0; i<num_excitatory_inputs; i++) {
174 total_exc += exc_input[i];
176 for (
int i =0; i<num_inhibitory_inputs; i++) {
177 total_inh += inh_input[i];
181 + external_bias + neuron->I_offset + current_offset;
185 neuron->this_h = neuron->reset_h;
195 neuron->V = neuron->C;
198 neuron->U += neuron->D;
213static inline void neuron_model_print_state_variables(
const neuron_t *neuron) {
219static inline void neuron_model_print_parameters(
const neuron_t *neuron) {
void log_debug(const char *message,...)
#define REAL_CONST(x)
Define a constant of type REAL.
accum REAL
Type used for "real" numbers.
static REAL kdivui(REAL a, uint32_t b)
Divides an accum by an unsigned integer.
#define REAL_HALF(x)
Divide by two.
REAL state_t
The type of a state variable.
REAL input_t
The type of an input.
static uint n_steps_per_timestep
The number of steps to run per timestep.
The API for neuron models themselves.
static const REAL SIMPLE_TQ_OFFSET
For linear membrane voltages, 1.5 is the correct value. However with actual membrane voltage behaviou...
static state_t neuron_model_get_membrane_voltage(const neuron_t *neuron)
get the neuron membrane voltage for a given neuron parameter set
static state_t neuron_model_state_update(uint16_t num_excitatory_inputs, const input_t *exc_input, uint16_t num_inhibitory_inputs, const input_t *inh_input, input_t external_bias, REAL current_offset, neuron_t *restrict neuron)
primary function called in timer loop after synaptic updates
static void neuron_model_has_spiked(neuron_t *restrict neuron)
Indicates that the neuron has spiked.
static const REAL MAGIC_MULTIPLIER
The original model uses 0.04, but this (1 ULP larger?) gives better numeric stability.
static void rk2_kernel_midpoint(REAL h, neuron_t *neuron, REAL input_this_timestep)
Midpoint is best balance between speed and accuracy so far.
REAL reset_h
timestep to reset to when not just spiked
REAL next_h
next value of this_h (saved)
REAL I_offset
offset current [nA]
UREAL time_step
The timestep of the neuron being used.
REAL this_h
current timestep
REAL I_offset
offset current [nA]
definition of neuron parameters
definition for LIF neuron state
static uint16_t * input_this_timestep
The inputs to be sent at the end of this timestep.
static stdp_params params
Configuration parameters.