Created
December 16, 2022 11:30
-
-
Save llandsmeer/dd1e0f7f5ab32fccb662a855dbb9e200 to your computer and use it in GitHub Desktop.
EDEN output for L5PC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated code block BEGIN | |
#define M_PI 3.14159265358979323846 | |
#include <math.h> | |
typedef float * __restrict__ __attribute__((align_value (32))) Table_F32; | |
typedef long long * __restrict__ __attribute__((align_value (32))) Table_I64; | |
typedef union { int i32; float f32; } TypePun_I32F32; typedef char static_assert[ sizeof(int) == sizeof(float) ]; | |
static float EncodeI32ToF32( int i ){ TypePun_I32F32 cast; cast.i32 = i; return cast.f32;} | |
static int EncodeF32ToI32( float f ){ TypePun_I32F32 cast; cast.f32 = f; return cast.i32;} | |
static float stepf( float x ){ if( x < 0 ) return 0; else return 1; } | |
// Credits to Thomas T. Wang: wang@cup.hp.com | |
static unsigned long long hash64shift( unsigned long long key ){ | |
key = (~key) + (key << 21); // key = (key << 21) - key - 1; | |
key = key ^ (key >> 24); | |
key = (key + (key << 3)) + (key << 8); // key * 265 | |
key = key ^ (key >> 14); | |
key = (key + (key << 2)) + (key << 4); // key * 21 | |
key = key ^ (key >> 28); | |
key = key + (key << 31); | |
return key; | |
} | |
static unsigned long long hash_128_to_64( unsigned long long hi, unsigned long long lo ){ | |
return hash64shift( hash64shift( lo ) ^ hi ); | |
} | |
static float randof( float x, long long work_item, long long instance, long long step, int invocation_id ){ | |
// Make a unique stamp for the random number sampled | |
// Unique factors: work item, tabular instance, serial number of RNG invocation in kernel, timestep | |
// Capacities: 1T work items, 16M instances, 64K invocations, 1T timesteps | |
unsigned long long stamp_hi = work_item * (1ULL << 24) | instance % (1ULL << 24); | |
unsigned long long stamp_lo = invocation_id * (1ULL << 40) | step % (1ULL << 40); | |
unsigned long long sample = hash_128_to_64( stamp_hi, stamp_lo ); | |
const/*ant*/int sample_scale = (1 << 23); | |
float result = ( (float) ( sample % sample_scale ) ) / ( (float) (sample_scale) ); | |
return x * result; | |
} | |
void doit( double time, float dt, const float *__restrict__ global_constants, long long const_local_index, | |
const long long *__restrict__ global_const_table_f32_sizes, const Table_F32 *__restrict__ global_const_table_f32_arrays, long long table_cf32_local_index, | |
const long long *__restrict__ global_const_table_i64_sizes, const Table_I64 *__restrict__ global_const_table_i64_arrays, long long table_ci64_local_index, | |
const long long *__restrict__ global_state_table_f32_sizes, const Table_F32 *__restrict__ global_state_table_f32_arrays, Table_F32 *__restrict__ global_stateNext_table_f32_arrays, long long table_sf32_local_index, | |
const long long *__restrict__ global_state_table_i64_sizes, Table_I64 *__restrict__ global_state_table_i64_arrays, Table_I64 *__restrict__ global_stateNext_table_i64_arrays, long long table_si64_local_index, | |
const float *__restrict__ global_state, float *__restrict__ global_stateNext, long long state_local_index, | |
long long step ){ | |
char initial_state = (step <= 0); | |
const float time_f32 = time; //when not accumulating small deltas, double precision is not necessary, and it messes up with SIMD | |
const long long NOT_AN_INSTANCE = ~0xFee1600dLL; // if it's misused to index an array it will probably stop right there ㋡ | |
long long instance = NOT_AN_INSTANCE; // for RNG use | |
long long rng_offset = 0; // for RNG use too | |
const long long const_cell_index = const_local_index; | |
const long long state_cell_index = state_local_index; | |
const long long table_cf32_cell_index = table_cf32_local_index; | |
const long long table_ci64_cell_index = table_ci64_local_index; | |
const long long table_sf32_cell_index = table_sf32_local_index; | |
const long long table_si64_cell_index = table_si64_local_index; | |
const float *cell_constants = global_constants + const_cell_index; | |
const float *cell_state = global_state + state_cell_index; | |
float *cell_stateNext = global_stateNext + state_cell_index; | |
const long long *cell_const_table_f32_sizes = global_const_table_f32_sizes + table_cf32_cell_index; | |
const Table_F32 *cell_const_table_f32_arrays = global_const_table_f32_arrays + table_cf32_cell_index; | |
const long long *cell_const_table_i64_sizes = global_const_table_i64_sizes + table_ci64_cell_index; | |
const Table_I64 *cell_const_table_i64_arrays = global_const_table_i64_arrays + table_ci64_cell_index; | |
const long long *cell_state_table_f32_sizes = global_state_table_f32_sizes + table_sf32_cell_index; | |
const Table_F32 *cell_state_table_f32_arrays = global_state_table_f32_arrays + table_sf32_cell_index; | |
Table_F32 *cell_stateNext_table_f32_arrays = global_stateNext_table_f32_arrays + table_sf32_cell_index; | |
const long long *cell_state_table_i64_sizes = global_state_table_i64_sizes + table_si64_cell_index; | |
Table_I64 *cell_state_table_i64_arrays = global_state_table_i64_arrays + table_si64_cell_index; | |
Table_I64 *cell_stateNext_table_i64_arrays = global_stateNext_table_i64_arrays + table_si64_cell_index; | |
const float temperature = cell_constants[2568]; //a global if there ever was one | |
const float *V = &cell_state[0]; | |
float *V_next = &cell_stateNext[0]; | |
const float *R_Axial = &cell_constants[642]; | |
const float *C = &cell_constants[0]; | |
const float *V_threshold = &cell_constants[1284]; | |
const float *Area = &cell_constants[1926]; | |
const Table_F32 PerComp_InvRC_Axial = cell_const_table_f32_arrays[0]; | |
Table_F32 PerComp_InvRC_Diagonal = cell_state_table_f32_arrays[0]; | |
const int cell_rng_seed = EncodeF32ToI32(cell_constants[2569]); | |
const int rng_object_id = cell_rng_seed; | |
const Table_I64 Comp_Coff = cell_const_table_i64_arrays[0]; | |
const Table_I64 Comp_Soff = cell_const_table_i64_arrays[1]; | |
const Table_I64 Comp_CF32off = cell_const_table_i64_arrays[2]; | |
const Table_I64 Comp_SF32off = cell_const_table_i64_arrays[3]; | |
const Table_I64 Comp_CI64off = cell_const_table_i64_arrays[4]; | |
const Table_I64 Comp_SI64off = cell_const_table_i64_arrays[5]; | |
const Table_I64 Comp_Roff = cell_const_table_i64_arrays[6]; | |
// Internal Code for compartment type 0 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[7]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [7]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
float Acomp = Area[comp]; | |
float Vcomp = V[comp]; | |
float I_internal = 0; | |
float G_internal = 0; | |
// Ion flux sources | |
float I_ion_0 = 0; //total ion current | |
float Conc_ion_0_intra = 0; //ion concentration intra | |
float Conc_ion_0_extra = 0; //ion concentration extra | |
// Ion concentrations | |
{ | |
float Iion = I_ion_0; | |
float InitConcIntra = local_constants[0]; | |
float InitConcExtra = local_constants[1]; | |
// LEMS component | |
float Lems_requirement_0 = Acomp; | |
float Lems_requirement_1 = InitConcIntra; | |
float Lems_requirement_2 = InitConcExtra; | |
float Lems_requirement_3 = Iion; | |
// fixed properties Comp Type 0 Ion 0 pool | |
float Lems_property_0 = local_constants[2]; | |
float Lems_property_1 = local_constants[3]; | |
float Lems_property_2 = local_constants[4]; | |
float Lems_property_3 = local_constants[5]; | |
float Lems_property_4 = local_constants[6]; | |
// state variables Comp Type 0 Ion 0 pool | |
float Lems_state_0 = local_state[0]; | |
float Lems_state_1 = local_state[1]; | |
// declare derived variables Comp Type 0 Ion 0 pool | |
float Lems_derived_0 = NAN; | |
// common read-only namespace? Comp Type 0 Ion 0 pool | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_requirement_2; | |
float *Lems_assigned_3 = &Lems_property_0; | |
float *Lems_assigned_4 = &Lems_property_1; | |
float *Lems_assigned_5 = &Lems_property_2; | |
float *Lems_assigned_6 = &Lems_property_3; | |
float *Lems_assigned_7 = &Lems_property_4; | |
float *Lems_assigned_8 = &Lems_requirement_3; | |
float *Lems_assigned_9 = &Lems_state_0; | |
float *Lems_assigned_10 = &Lems_state_1; | |
float *Lems_assigned_11 = &Lems_derived_0; | |
// compute derived Comp Type 0 Ion 0 pool | |
Lems_derived_0 = ( ( *Lems_assigned_8/* current */ / *Lems_assigned_0/* area */ ) * 1e5f )/* currentDensity */; | |
// exposures Comp Type 0 Ion 0 pool | |
float Lems_exposure_concentration = Lems_state_0; | |
float Lems_exposure_extConcentration = Lems_state_1; | |
Conc_ion_0_intra = Lems_exposure_concentration; | |
Conc_ion_0_extra = Lems_exposure_extConcentration; | |
} | |
const float Ca_concentration = Conc_ion_0_intra; | |
const float Ca_concentration_extra = Conc_ion_0_extra; | |
const float Ca2_concentration = 0; | |
const float Ca2_concentration_extra = 0; | |
// Current from ion channels | |
float I_channels_total = 0; | |
float G_channels_total = 0; | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[7]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[2]; | |
// dynamics for channel 0 gate 0 | |
{ | |
float q10 = local_constants[8]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[9] * ( ( Vcomp == local_constants[10]) ? 1 : ( ( (Vcomp - local_constants[10] ) / local_constants[11] ) / (1 - expf( - (Vcomp - local_constants[10] ) / local_constants[11] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[12] * expf( (Vcomp - local_constants[13] ) / local_constants[14] ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[2] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[2] = (blend_factor) * local_state[2] + (1-blend_factor) * inf; | |
if(!( local_stateNext[2] > (float)(1e-6) )) local_stateNext[2] = 1e-6; | |
if(!( local_stateNext[2] < (float)(1-1e-6) )) local_stateNext[2] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[15]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[16]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[3]; | |
// dynamics for channel 1 gate 0 | |
{ | |
float q10 = local_constants[17]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 1 | |
float Lems_property_0 = local_constants[18]; | |
float Lems_property_1 = local_constants[19]; | |
// state variables HHRate BaseTau 0 for Fixed channel 1 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 1 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 1 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 0 for Fixed channel 1 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = 0; if( 0 ); | |
else if( ( ( *Lems_assigned_3/* unitless */ < ( ( - ( (float)60)/* unitless */ ) )/* unitless */ ) )/* unitless */ ){ | |
Lems_derived_1 = ( ( ( ( ( (float)1.25)/* unitless */ + ( ( ( (float)175.03)/* unitless */ * ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)10)/* unitless */ ) )/* unitless */ * ( (float)0.025999999999999999)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
} | |
else{ | |
Lems_derived_1 = ( ( ( ( ( (float)1.25)/* unitless */ + ( ( ( (float)13)/* unitless */ * ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)10)/* unitless */ ) )/* unitless */ * ( ( - ( (float)0.025999999999999999)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
} | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 1 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[20] / (1 + expf( (local_constants[21] - Vcomp ) / local_constants[22] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[3] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[3] = (blend_factor) * local_state[3] + (1-blend_factor) * inf; | |
if(!( local_stateNext[3] > (float)(1e-6) )) local_stateNext[3] = 1e-6; | |
if(!( local_stateNext[3] < (float)(1-1e-6) )) local_stateNext[3] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[4]; | |
// dynamics for channel 1 gate 1 | |
{ | |
float q10 = local_constants[23]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 1 for Fixed channel 1 | |
float Lems_property_0 = local_constants[24]; | |
float Lems_property_1 = local_constants[25]; | |
// state variables HHRate BaseTau 1 for Fixed channel 1 | |
// declare derived variables HHRate BaseTau 1 for Fixed channel 1 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 1 for Fixed channel 1 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 1 for Fixed channel 1 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)360)/* unitless */ + ( ( ( ( ( (float)1010)/* unitless */ + ( ( ( (float)24)/* unitless */ * ( ( *Lems_assigned_3/* unitless */ + ( (float)65)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * ( expf( ( ( ( ( ( ( - ( (float)1)/* unitless */ ) )/* unitless */ * ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)85)/* unitless */ ) )/* unitless */ / ( (float)48)/* unitless */ ) )/* unitless */ ) )/* unitless */ * ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)85)/* unitless */ ) )/* unitless */ / ( (float)48)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 1 for Fixed channel 1 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[26] / (1 + expf( (local_constants[27] - Vcomp ) / local_constants[28] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[4] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[4] = (blend_factor) * local_state[4] + (1-blend_factor) * inf; | |
if(!( local_stateNext[4] > (float)(1e-6) )) local_stateNext[4] = 1e-6; | |
if(!( local_stateNext[4] < (float)(1-1e-6) )) local_stateNext[4] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[29]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[30]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[5]; | |
// dynamics for channel 2 gate 0 | |
{ | |
float q10 = local_constants[31]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 2 | |
float Lems_property_0 = local_constants[32]; | |
float Lems_property_1 = local_constants[33]; | |
// state variables HHRate BaseTau 0 for Fixed channel 2 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 2 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 2 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 0 for Fixed channel 2 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)0.34000000000000002)/* unitless */ + ( ( ( (float)0.92000000000000004)/* unitless */ * ( expf( ( ( ( ( - ( (float)1)/* unitless */ ) )/* unitless */ * ( powf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)81)/* unitless */ ) )/* unitless */ / ( (float)59)/* unitless */ ) )/* unitless */ , ( (float)2)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 2 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[34] / (1 + expf( (local_constants[35] - Vcomp ) / local_constants[36] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[5] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[5] = (blend_factor) * local_state[5] + (1-blend_factor) * inf; | |
if(!( local_stateNext[5] > (float)(1e-6) )) local_stateNext[5] = 1e-6; | |
if(!( local_stateNext[5] < (float)(1-1e-6) )) local_stateNext[5] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[6]; | |
// dynamics for channel 2 gate 1 | |
{ | |
float q10 = local_constants[37]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 1 for Fixed channel 2 | |
float Lems_property_0 = local_constants[38]; | |
float Lems_property_1 = local_constants[39]; | |
// state variables HHRate BaseTau 1 for Fixed channel 2 | |
// declare derived variables HHRate BaseTau 1 for Fixed channel 2 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 1 for Fixed channel 2 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 1 for Fixed channel 2 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)8)/* unitless */ + ( ( ( (float)49)/* unitless */ * ( expf( ( ( ( ( - ( (float)1)/* unitless */ ) )/* unitless */ * ( powf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)83)/* unitless */ ) )/* unitless */ / ( (float)23)/* unitless */ ) )/* unitless */ , ( (float)2)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 1 for Fixed channel 2 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[40] / (1 + expf( (local_constants[41] - Vcomp ) / local_constants[42] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[6] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[6] = (blend_factor) * local_state[6] + (1-blend_factor) * inf; | |
if(!( local_stateNext[6] > (float)(1e-6) )) local_stateNext[6] = 1e-6; | |
if(!( local_stateNext[6] < (float)(1-1e-6) )) local_stateNext[6] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[43]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[44]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[7]; | |
// dynamics for channel 3 gate 0 | |
{ | |
float q10 = local_constants[45]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[46] * ( ( Vcomp == local_constants[47]) ? 1 : ( ( (Vcomp - local_constants[47] ) / local_constants[48] ) / (1 - expf( - (Vcomp - local_constants[47] ) / local_constants[48] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[49] * ( ( Vcomp == local_constants[50]) ? 1 : ( ( (Vcomp - local_constants[50] ) / local_constants[51] ) / (1 - expf( - (Vcomp - local_constants[50] ) / local_constants[51] ) ) ) ); | |
beta = r; | |
} | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
float Lems_requirement_1 = alpha; | |
float Lems_requirement_2 = beta ; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 3 | |
float Lems_property_0 = local_constants[52]; | |
float Lems_property_1 = local_constants[53]; | |
// state variables HHRate BaseTau 0 for Fixed channel 3 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 3 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
float Lems_derived_2 = NAN; | |
float Lems_derived_3 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 3 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_requirement_1; | |
float *Lems_assigned_4 = &Lems_requirement_2; | |
float *Lems_assigned_5 = &Lems_derived_0; | |
float *Lems_assigned_6 = &Lems_derived_1; | |
float *Lems_assigned_7 = &Lems_derived_2; | |
float *Lems_assigned_8 = &Lems_derived_3; | |
// compute derived HHRate BaseTau 0 for Fixed channel 3 | |
Lems_derived_2 = ( ( *Lems_assigned_4/* per_time */ * *Lems_assigned_1/* time */ ) )/* unitless */; | |
Lems_derived_1 = ( ( *Lems_assigned_3/* per_time */ * *Lems_assigned_1/* time */ ) )/* unitless */; | |
Lems_derived_3 = 0; if( 0 ); | |
else if( ( ( ( ( *Lems_assigned_6/* unitless */ + *Lems_assigned_7/* unitless */ ) )/* unitless */ == ( (float)0)/* unitless */ ) )/* unitless */ ){ | |
Lems_derived_3 = ( ( ( (float)0)/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
} | |
else if( ( ( ( ( *Lems_assigned_6/* unitless */ + *Lems_assigned_7/* unitless */ ) )/* unitless */ > ( (float)0)/* unitless */ ) )/* unitless */ ){ | |
Lems_derived_3 = ( ( ( ( ( (float)6)/* unitless */ / ( ( *Lems_assigned_6/* unitless */ + *Lems_assigned_7/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
} | |
else{ | |
Lems_derived_3 = ( ( ( (float)0)/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
} | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 3 | |
float Lems_exposure_t = Lems_derived_3; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[54] / (1 + expf( (local_constants[55] - Vcomp ) / local_constants[56] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[7] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[7] = (blend_factor) * local_state[7] + (1-blend_factor) * inf; | |
if(!( local_stateNext[7] > (float)(1e-6) )) local_stateNext[7] = 1e-6; | |
if(!( local_stateNext[7] < (float)(1-1e-6) )) local_stateNext[7] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[8]; | |
// dynamics for channel 3 gate 1 | |
{ | |
float q10 = local_constants[57]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[58] * ( ( Vcomp == local_constants[59]) ? 1 : ( ( (Vcomp - local_constants[59] ) / local_constants[60] ) / (1 - expf( - (Vcomp - local_constants[59] ) / local_constants[60] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[61] * ( ( Vcomp == local_constants[62]) ? 1 : ( ( (Vcomp - local_constants[62] ) / local_constants[63] ) / (1 - expf( - (Vcomp - local_constants[62] ) / local_constants[63] ) ) ) ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[64] / (1 + expf( (local_constants[65] - Vcomp ) / local_constants[66] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[8] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[8] = (blend_factor) * local_state[8] + (1-blend_factor) * inf; | |
if(!( local_stateNext[8] > (float)(1e-6) )) local_stateNext[8] = 1e-6; | |
if(!( local_stateNext[8] < (float)(1-1e-6) )) local_stateNext[8] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[67]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[68]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[9]; | |
// dynamics for channel 4 gate 0 | |
{ | |
float q10 = local_constants[69]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[70] * ( ( Vcomp == local_constants[71]) ? 1 : ( ( (Vcomp - local_constants[71] ) / local_constants[72] ) / (1 - expf( - (Vcomp - local_constants[71] ) / local_constants[72] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[73] * ( ( Vcomp == local_constants[74]) ? 1 : ( ( (Vcomp - local_constants[74] ) / local_constants[75] ) / (1 - expf( - (Vcomp - local_constants[74] ) / local_constants[75] ) ) ) ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[9] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[9] = (blend_factor) * local_state[9] + (1-blend_factor) * inf; | |
if(!( local_stateNext[9] > (float)(1e-6) )) local_stateNext[9] = 1e-6; | |
if(!( local_stateNext[9] < (float)(1-1e-6) )) local_stateNext[9] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[10]; | |
// dynamics for channel 4 gate 1 | |
{ | |
float q10 = local_constants[76]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[77] * ( ( Vcomp == local_constants[78]) ? 1 : ( ( (Vcomp - local_constants[78] ) / local_constants[79] ) / (1 - expf( - (Vcomp - local_constants[78] ) / local_constants[79] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[80] * ( ( Vcomp == local_constants[81]) ? 1 : ( ( (Vcomp - local_constants[81] ) / local_constants[82] ) / (1 - expf( - (Vcomp - local_constants[81] ) / local_constants[82] ) ) ) ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[10] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[10] = (blend_factor) * local_state[10] + (1-blend_factor) * inf; | |
if(!( local_stateNext[10] > (float)(1e-6) )) local_stateNext[10] = 1e-6; | |
if(!( local_stateNext[10] < (float)(1-1e-6) )) local_stateNext[10] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[83]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[84]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling ; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[85]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[86]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[11]; | |
// dynamics for channel 6 gate 0 | |
{ | |
float q10 = local_constants[87]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
float Lems_requirement_1 = Ca_concentration; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 6 | |
float Lems_property_0 = local_constants[88]; | |
float Lems_property_1 = local_constants[89]; | |
float Lems_property_2 = local_constants[90]; | |
// state variables HHRate BaseTau 0 for Fixed channel 6 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 6 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
float Lems_derived_2 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 6 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_property_0; | |
float *Lems_assigned_3 = &Lems_property_1; | |
float *Lems_assigned_4 = &Lems_property_2; | |
float *Lems_assigned_5 = &Lems_derived_0; | |
float *Lems_assigned_6 = &Lems_derived_1; | |
float *Lems_assigned_7 = &Lems_derived_2; | |
// compute derived HHRate BaseTau 0 for Fixed channel 6 | |
Lems_derived_2 = ( ( ( (float)1)/* unitless */ * *Lems_assigned_2/* time */ ) )/* time */; | |
Lems_derived_1 = ( ( *Lems_assigned_1/* concentration */ / *Lems_assigned_4/* concentration */ ) )/* unitless */; | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_3/* voltage */ ) )/* unitless */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 6 | |
float Lems_exposure_t = Lems_derived_2; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
float Lems_requirement_1 = Ca_concentration; | |
// fixed properties HHRate BaseInf 0 for Fixed channel 6 | |
float Lems_property_0 = local_constants[91]; | |
float Lems_property_1 = local_constants[92]; | |
float Lems_property_2 = local_constants[93]; | |
// state variables HHRate BaseInf 0 for Fixed channel 6 | |
// declare derived variables HHRate BaseInf 0 for Fixed channel 6 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
float Lems_derived_2 = NAN; | |
// common read-only namespace? HHRate BaseInf 0 for Fixed channel 6 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_property_0; | |
float *Lems_assigned_3 = &Lems_property_1; | |
float *Lems_assigned_4 = &Lems_property_2; | |
float *Lems_assigned_5 = &Lems_derived_0; | |
float *Lems_assigned_6 = &Lems_derived_1; | |
float *Lems_assigned_7 = &Lems_derived_2; | |
// compute derived HHRate BaseInf 0 for Fixed channel 6 | |
Lems_derived_1 = ( ( *Lems_assigned_1/* concentration */ / *Lems_assigned_4/* concentration */ ) )/* unitless */; | |
Lems_derived_2 = ( ( ( (float)1)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( powf( ( ( ( (float)4.3000000000000001e-10)/* unitless */ / *Lems_assigned_6/* unitless */ ) )/* unitless */ , ( (float)4.7999999999999998)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */; | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_3/* voltage */ ) )/* unitless */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseInf 0 for Fixed channel 6 | |
float Lems_exposure_x = Lems_derived_2; | |
x = Lems_exposure_x; | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[11] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[11] = (blend_factor) * local_state[11] + (1-blend_factor) * inf; | |
if(!( local_stateNext[11] > (float)(1e-6) )) local_stateNext[11] = 1e-6; | |
if(!( local_stateNext[11] < (float)(1-1e-6) )) local_stateNext[11] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[94]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[95]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[12]; | |
// dynamics for channel 7 gate 0 | |
{ | |
float q10 = local_constants[96]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 7 | |
float Lems_property_0 = local_constants[97]; | |
float Lems_property_1 = local_constants[98]; | |
// state variables HHRate BaseTau 0 for Fixed channel 7 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 7 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 7 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 0 for Fixed channel 7 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)4)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)46.560000000000002)/* unitless */ ) )/* unitless */ / ( ( - ( (float)44.140000000000001)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 7 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[99] / (1 + expf( (local_constants[100] - Vcomp ) / local_constants[101] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[12] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[12] = (blend_factor) * local_state[12] + (1-blend_factor) * inf; | |
if(!( local_stateNext[12] > (float)(1e-6) )) local_stateNext[12] = 1e-6; | |
if(!( local_stateNext[12] < (float)(1-1e-6) )) local_stateNext[12] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[102]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = ( (float)(8.3144621000000001) * temperature / (float)( 2 * 96485.300000000003) * logf( Ca_concentration_extra / Ca_concentration ) * 1e3f ); | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[13]; | |
// dynamics for channel 8 gate 0 | |
{ | |
float q10 = local_constants[103]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[104] * ( ( Vcomp == local_constants[105]) ? 1 : ( ( (Vcomp - local_constants[105] ) / local_constants[106] ) / (1 - expf( - (Vcomp - local_constants[105] ) / local_constants[106] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[107] * expf( (Vcomp - local_constants[108] ) / local_constants[109] ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[13] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[13] = (blend_factor) * local_state[13] + (1-blend_factor) * inf; | |
if(!( local_stateNext[13] > (float)(1e-6) )) local_stateNext[13] = 1e-6; | |
if(!( local_stateNext[13] < (float)(1-1e-6) )) local_stateNext[13] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[14]; | |
// dynamics for channel 8 gate 1 | |
{ | |
float q10 = local_constants[110]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[111] * expf( (Vcomp - local_constants[112] ) / local_constants[113] ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[114] / (1 + expf( (local_constants[115] - Vcomp ) / local_constants[116] ) ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[14] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[14] = (blend_factor) * local_state[14] + (1-blend_factor) * inf; | |
if(!( local_stateNext[14] > (float)(1e-6) )) local_stateNext[14] = 1e-6; | |
if(!( local_stateNext[14] < (float)(1-1e-6) )) local_stateNext[14] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[117]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
I_ion_0 += I_chan; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = ( (float)(8.3144621000000001) * temperature / (float)( 2 * 96485.300000000003) * logf( Ca_concentration_extra / Ca_concentration ) * 1e3f ); | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[15]; | |
// dynamics for channel 9 gate 0 | |
{ | |
float q10 = local_constants[118]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 9 | |
float Lems_property_0 = local_constants[119]; | |
float Lems_property_1 = local_constants[120]; | |
// state variables HHRate BaseTau 0 for Fixed channel 9 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 9 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 9 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 0 for Fixed channel 9 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)5)/* unitless */ + ( ( ( (float)20)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)35)/* unitless */ ) )/* unitless */ / ( (float)5)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 9 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[121] / (1 + expf( (local_constants[122] - Vcomp ) / local_constants[123] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[15] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[15] = (blend_factor) * local_state[15] + (1-blend_factor) * inf; | |
if(!( local_stateNext[15] > (float)(1e-6) )) local_stateNext[15] = 1e-6; | |
if(!( local_stateNext[15] < (float)(1-1e-6) )) local_stateNext[15] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[16]; | |
// dynamics for channel 9 gate 1 | |
{ | |
float q10 = local_constants[124]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 1 for Fixed channel 9 | |
float Lems_property_0 = local_constants[125]; | |
float Lems_property_1 = local_constants[126]; | |
// state variables HHRate BaseTau 1 for Fixed channel 9 | |
// declare derived variables HHRate BaseTau 1 for Fixed channel 9 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 1 for Fixed channel 9 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 1 for Fixed channel 9 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)20)/* unitless */ + ( ( ( (float)50)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)50)/* unitless */ ) )/* unitless */ / ( (float)7)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 1 for Fixed channel 9 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[127] / (1 + expf( (local_constants[128] - Vcomp ) / local_constants[129] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[16] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[16] = (blend_factor) * local_state[16] + (1-blend_factor) * inf; | |
if(!( local_stateNext[16] > (float)(1e-6) )) local_stateNext[16] = 1e-6; | |
if(!( local_stateNext[16] < (float)(1-1e-6) )) local_stateNext[16] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[130]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
I_ion_0 += I_chan; | |
} | |
// Current from synapses | |
float I_synapses_total = 0; | |
float G_synapses_total = 0; | |
// Current from inputs | |
float I_input_total = 0; | |
float G_input_total = 0; | |
{ | |
const float *Weight = local_const_table_f32_arrays[0]; | |
// Pulse inputs | |
const long long Instances_input_pulse = local_const_table_f32_sizes[1]; //same for all parallel arrays | |
const float *Imax_input_pulse = local_const_table_f32_arrays[1]; | |
const float *Start_input_pulse = local_const_table_f32_arrays[2]; | |
const float *Duration_input_pulse = local_const_table_f32_arrays[3]; | |
float I_input_pulse = 0; | |
for(long long instance = 0; instance < Instances_input_pulse; instance++){ | |
if( Start_input_pulse[instance] <= time && time <= Start_input_pulse[instance] + Duration_input_pulse[instance] ) I_input_pulse += Imax_input_pulse[instance] * Weight[instance]; | |
} | |
I_input_total += I_input_pulse; | |
I_input_total += 0; | |
} | |
// Dynamics for ion 0 | |
{ | |
float Iion = I_ion_0; | |
float InitConcIntra = local_constants[0]; | |
float InitConcExtra = local_constants[1]; | |
// LEMS component | |
float Lems_requirement_0 = Acomp; | |
float Lems_requirement_1 = InitConcIntra; | |
float Lems_requirement_2 = InitConcExtra; | |
float Lems_requirement_3 = Iion; | |
// fixed properties Comp Type 0 Ion 0 pool | |
float Lems_property_0 = local_constants[2]; | |
float Lems_property_1 = local_constants[3]; | |
float Lems_property_2 = local_constants[4]; | |
float Lems_property_3 = local_constants[5]; | |
float Lems_property_4 = local_constants[6]; | |
// state variables Comp Type 0 Ion 0 pool | |
float Lems_state_0 = local_state[0]; | |
float Lems_state_1 = local_state[1]; | |
// declare derived variables Comp Type 0 Ion 0 pool | |
float Lems_derived_0 = NAN; | |
// common read-only namespace? Comp Type 0 Ion 0 pool | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_requirement_2; | |
float *Lems_assigned_3 = &Lems_property_0; | |
float *Lems_assigned_4 = &Lems_property_1; | |
float *Lems_assigned_5 = &Lems_property_2; | |
float *Lems_assigned_6 = &Lems_property_3; | |
float *Lems_assigned_7 = &Lems_property_4; | |
float *Lems_assigned_8 = &Lems_requirement_3; | |
float *Lems_assigned_9 = &Lems_state_0; | |
float *Lems_assigned_10 = &Lems_state_1; | |
float *Lems_assigned_11 = &Lems_derived_0; | |
// compute derived Comp Type 0 Ion 0 pool | |
Lems_derived_0 = ( ( *Lems_assigned_8/* current */ / *Lems_assigned_0/* area */ ) * 1e5f )/* currentDensity */; | |
if(initial_state){ | |
// initialization | |
local_stateNext[0] = *Lems_assigned_1/* concentration */; | |
Lems_assigned_9 = &(local_stateNext[0]) ; | |
local_stateNext[1] = *Lems_assigned_2/* concentration */; | |
Lems_assigned_10 = &(local_stateNext[1]) ; | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
float Lems_derivative_0 = ( ( ( ( ( ( *Lems_assigned_11/* currentDensity */ * *Lems_assigned_3/* unitless */ ) )/* currentDensity */ / ( ( ( ( ( (float)2)/* unitless */ * *Lems_assigned_7/* charge_per_mole */ ) )/* charge_per_mole */ * *Lems_assigned_6/* length */ ) * 1e-6f )/* l^1 * t^1 * i^1 * n^-1 */ ) * 1e-2f )/* l^-3 * t^-1 * n^1 */ - ( ( ( ( *Lems_assigned_9/* concentration */ - *Lems_assigned_4/* concentration */ ) )/* concentration */ / *Lems_assigned_5/* time */ ) * 1e3f )/* l^-3 * t^-1 * n^1 */ ) )/* l^-3 * t^-1 * n^1 */; | |
local_stateNext[0] = local_state[0] + dt * Lems_derivative_0 * 1e-3f; | |
local_stateNext[1] = local_state[1]; | |
// conditional updates, during simulation | |
} | |
// exposures Comp Type 0 Ion 0 pool | |
float Lems_exposure_concentration = Lems_state_0; | |
float Lems_exposure_extConcentration = Lems_state_1; | |
} | |
I_internal = I_channels_total + I_input_total + I_synapses_total; | |
G_internal = G_channels_total + G_input_total + G_synapses_total; | |
PerComp_InvRC_Diagonal[comp] = 1*(G_internal / C[comp] ) + PerComp_InvRC_Axial[comp]; | |
if(initial_state){ | |
// initialize | |
V_next[comp] = V[comp]; | |
}else{ | |
V_next[comp] = V[comp] + ( dt * ( I_internal + ( (V[comp] * G_internal) ) ) / C[comp] ); | |
} } | |
} | |
// Internal Code for compartment type 0 end | |
// Internal Code for compartment type 1 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[8]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [8]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
float Acomp = Area[comp]; | |
float Vcomp = V[comp]; | |
float I_internal = 0; | |
float G_internal = 0; | |
// Ion flux sources | |
// Ion concentrations | |
const float Ca_concentration = 0; | |
const float Ca_concentration_extra = 0; | |
const float Ca2_concentration = 0; | |
const float Ca2_concentration_extra = 0; | |
// Current from ion channels | |
float I_channels_total = 0; | |
float G_channels_total = 0; | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[0]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling ; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[1]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
// Current from synapses | |
float I_synapses_total = 0; | |
float G_synapses_total = 0; | |
// Current from inputs | |
float I_input_total = 0; | |
float G_input_total = 0; | |
I_internal = I_channels_total + I_input_total + I_synapses_total; | |
G_internal = G_channels_total + G_input_total + G_synapses_total; | |
PerComp_InvRC_Diagonal[comp] = 1*(G_internal / C[comp] ) + PerComp_InvRC_Axial[comp]; | |
if(initial_state){ | |
// initialize | |
V_next[comp] = V[comp]; | |
}else{ | |
V_next[comp] = V[comp] + ( dt * ( I_internal + ( (V[comp] * G_internal) ) ) / C[comp] ); | |
} } | |
} | |
// Internal Code for compartment type 1 end | |
// Internal Code for compartment type 2 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[9]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [9]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
float Acomp = Area[comp]; | |
float Vcomp = V[comp]; | |
float I_internal = 0; | |
float G_internal = 0; | |
// Ion flux sources | |
float I_ion_0 = 0; //total ion current | |
float Conc_ion_0_intra = 0; //ion concentration intra | |
float Conc_ion_0_extra = 0; //ion concentration extra | |
// Ion concentrations | |
{ | |
float Iion = I_ion_0; | |
float InitConcIntra = local_constants[0]; | |
float InitConcExtra = local_constants[1]; | |
// LEMS component | |
float Lems_requirement_0 = Acomp; | |
float Lems_requirement_1 = InitConcIntra; | |
float Lems_requirement_2 = InitConcExtra; | |
float Lems_requirement_3 = Iion; | |
// fixed properties Comp Type 2 Ion 0 pool | |
float Lems_property_0 = local_constants[2]; | |
float Lems_property_1 = local_constants[3]; | |
float Lems_property_2 = local_constants[4]; | |
float Lems_property_3 = local_constants[5]; | |
float Lems_property_4 = local_constants[6]; | |
// state variables Comp Type 2 Ion 0 pool | |
float Lems_state_0 = local_state[0]; | |
float Lems_state_1 = local_state[1]; | |
// declare derived variables Comp Type 2 Ion 0 pool | |
float Lems_derived_0 = NAN; | |
// common read-only namespace? Comp Type 2 Ion 0 pool | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_requirement_2; | |
float *Lems_assigned_3 = &Lems_property_0; | |
float *Lems_assigned_4 = &Lems_property_1; | |
float *Lems_assigned_5 = &Lems_property_2; | |
float *Lems_assigned_6 = &Lems_property_3; | |
float *Lems_assigned_7 = &Lems_property_4; | |
float *Lems_assigned_8 = &Lems_requirement_3; | |
float *Lems_assigned_9 = &Lems_state_0; | |
float *Lems_assigned_10 = &Lems_state_1; | |
float *Lems_assigned_11 = &Lems_derived_0; | |
// compute derived Comp Type 2 Ion 0 pool | |
Lems_derived_0 = ( ( *Lems_assigned_8/* current */ / *Lems_assigned_0/* area */ ) * 1e5f )/* currentDensity */; | |
// exposures Comp Type 2 Ion 0 pool | |
float Lems_exposure_concentration = Lems_state_0; | |
float Lems_exposure_extConcentration = Lems_state_1; | |
Conc_ion_0_intra = Lems_exposure_concentration; | |
Conc_ion_0_extra = Lems_exposure_extConcentration; | |
} | |
const float Ca_concentration = Conc_ion_0_intra; | |
const float Ca_concentration_extra = Conc_ion_0_extra; | |
const float Ca2_concentration = 0; | |
const float Ca2_concentration_extra = 0; | |
// Current from ion channels | |
float I_channels_total = 0; | |
float G_channels_total = 0; | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[7]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[2]; | |
// dynamics for channel 0 gate 0 | |
{ | |
float q10 = local_constants[8]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[9] * expf( (Vcomp - local_constants[10] ) / local_constants[11] ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[12] * expf( (Vcomp - local_constants[13] ) / local_constants[14] ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[2] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[2] = (blend_factor) * local_state[2] + (1-blend_factor) * inf; | |
if(!( local_stateNext[2] > (float)(1e-6) )) local_stateNext[2] = 1e-6; | |
if(!( local_stateNext[2] < (float)(1-1e-6) )) local_stateNext[2] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[15]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[16]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[3]; | |
// dynamics for channel 1 gate 0 | |
{ | |
float q10 = local_constants[17]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[18] * ( ( Vcomp == local_constants[19]) ? 1 : ( ( (Vcomp - local_constants[19] ) / local_constants[20] ) / (1 - expf( - (Vcomp - local_constants[19] ) / local_constants[20] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[21] * ( ( Vcomp == local_constants[22]) ? 1 : ( ( (Vcomp - local_constants[22] ) / local_constants[23] ) / (1 - expf( - (Vcomp - local_constants[22] ) / local_constants[23] ) ) ) ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[3] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[3] = (blend_factor) * local_state[3] + (1-blend_factor) * inf; | |
if(!( local_stateNext[3] > (float)(1e-6) )) local_stateNext[3] = 1e-6; | |
if(!( local_stateNext[3] < (float)(1-1e-6) )) local_stateNext[3] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[4]; | |
// dynamics for channel 1 gate 1 | |
{ | |
float q10 = local_constants[24]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[25] * ( ( Vcomp == local_constants[26]) ? 1 : ( ( (Vcomp - local_constants[26] ) / local_constants[27] ) / (1 - expf( - (Vcomp - local_constants[26] ) / local_constants[27] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[28] * ( ( Vcomp == local_constants[29]) ? 1 : ( ( (Vcomp - local_constants[29] ) / local_constants[30] ) / (1 - expf( - (Vcomp - local_constants[29] ) / local_constants[30] ) ) ) ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[4] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[4] = (blend_factor) * local_state[4] + (1-blend_factor) * inf; | |
if(!( local_stateNext[4] > (float)(1e-6) )) local_stateNext[4] = 1e-6; | |
if(!( local_stateNext[4] < (float)(1-1e-6) )) local_stateNext[4] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[31]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[32]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling ; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[33]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[34]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[5]; | |
// dynamics for channel 3 gate 0 | |
{ | |
float q10 = local_constants[35]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
float Lems_requirement_1 = Ca_concentration; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 3 | |
float Lems_property_0 = local_constants[36]; | |
float Lems_property_1 = local_constants[37]; | |
float Lems_property_2 = local_constants[38]; | |
// state variables HHRate BaseTau 0 for Fixed channel 3 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 3 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
float Lems_derived_2 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 3 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_property_0; | |
float *Lems_assigned_3 = &Lems_property_1; | |
float *Lems_assigned_4 = &Lems_property_2; | |
float *Lems_assigned_5 = &Lems_derived_0; | |
float *Lems_assigned_6 = &Lems_derived_1; | |
float *Lems_assigned_7 = &Lems_derived_2; | |
// compute derived HHRate BaseTau 0 for Fixed channel 3 | |
Lems_derived_2 = ( ( ( (float)1)/* unitless */ * *Lems_assigned_2/* time */ ) )/* time */; | |
Lems_derived_1 = ( ( *Lems_assigned_1/* concentration */ / *Lems_assigned_4/* concentration */ ) )/* unitless */; | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_3/* voltage */ ) )/* unitless */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 3 | |
float Lems_exposure_t = Lems_derived_2; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
float Lems_requirement_1 = Ca_concentration; | |
// fixed properties HHRate BaseInf 0 for Fixed channel 3 | |
float Lems_property_0 = local_constants[39]; | |
float Lems_property_1 = local_constants[40]; | |
float Lems_property_2 = local_constants[41]; | |
// state variables HHRate BaseInf 0 for Fixed channel 3 | |
// declare derived variables HHRate BaseInf 0 for Fixed channel 3 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
float Lems_derived_2 = NAN; | |
// common read-only namespace? HHRate BaseInf 0 for Fixed channel 3 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_property_0; | |
float *Lems_assigned_3 = &Lems_property_1; | |
float *Lems_assigned_4 = &Lems_property_2; | |
float *Lems_assigned_5 = &Lems_derived_0; | |
float *Lems_assigned_6 = &Lems_derived_1; | |
float *Lems_assigned_7 = &Lems_derived_2; | |
// compute derived HHRate BaseInf 0 for Fixed channel 3 | |
Lems_derived_1 = ( ( *Lems_assigned_1/* concentration */ / *Lems_assigned_4/* concentration */ ) )/* unitless */; | |
Lems_derived_2 = ( ( ( (float)1)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( powf( ( ( ( (float)4.3000000000000001e-10)/* unitless */ / *Lems_assigned_6/* unitless */ ) )/* unitless */ , ( (float)4.7999999999999998)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */; | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_3/* voltage */ ) )/* unitless */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseInf 0 for Fixed channel 3 | |
float Lems_exposure_x = Lems_derived_2; | |
x = Lems_exposure_x; | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[5] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[5] = (blend_factor) * local_state[5] + (1-blend_factor) * inf; | |
if(!( local_stateNext[5] > (float)(1e-6) )) local_stateNext[5] = 1e-6; | |
if(!( local_stateNext[5] < (float)(1-1e-6) )) local_stateNext[5] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[42]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[43]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[6]; | |
// dynamics for channel 4 gate 0 | |
{ | |
float q10 = local_constants[44]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 4 | |
float Lems_property_0 = local_constants[45]; | |
float Lems_property_1 = local_constants[46]; | |
// state variables HHRate BaseTau 0 for Fixed channel 4 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 4 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 4 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 0 for Fixed channel 4 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)4)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)46.560000000000002)/* unitless */ ) )/* unitless */ / ( ( - ( (float)44.140000000000001)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 4 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[47] / (1 + expf( (local_constants[48] - Vcomp ) / local_constants[49] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[6] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[6] = (blend_factor) * local_state[6] + (1-blend_factor) * inf; | |
if(!( local_stateNext[6] > (float)(1e-6) )) local_stateNext[6] = 1e-6; | |
if(!( local_stateNext[6] < (float)(1-1e-6) )) local_stateNext[6] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[50]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[51]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[7]; | |
// dynamics for channel 5 gate 0 | |
{ | |
float q10 = local_constants[52]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[53] * ( ( Vcomp == local_constants[54]) ? 1 : ( ( (Vcomp - local_constants[54] ) / local_constants[55] ) / (1 - expf( - (Vcomp - local_constants[54] ) / local_constants[55] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[56] * expf( (Vcomp - local_constants[57] ) / local_constants[58] ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[7] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[7] = (blend_factor) * local_state[7] + (1-blend_factor) * inf; | |
if(!( local_stateNext[7] > (float)(1e-6) )) local_stateNext[7] = 1e-6; | |
if(!( local_stateNext[7] < (float)(1-1e-6) )) local_stateNext[7] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[59]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = ( (float)(8.3144621000000001) * temperature / (float)( 2 * 96485.300000000003) * logf( Ca_concentration_extra / Ca_concentration ) * 1e3f ); | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[8]; | |
// dynamics for channel 6 gate 0 | |
{ | |
float q10 = local_constants[60]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[61] * ( ( Vcomp == local_constants[62]) ? 1 : ( ( (Vcomp - local_constants[62] ) / local_constants[63] ) / (1 - expf( - (Vcomp - local_constants[62] ) / local_constants[63] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[64] * expf( (Vcomp - local_constants[65] ) / local_constants[66] ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[8] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[8] = (blend_factor) * local_state[8] + (1-blend_factor) * inf; | |
if(!( local_stateNext[8] > (float)(1e-6) )) local_stateNext[8] = 1e-6; | |
if(!( local_stateNext[8] < (float)(1-1e-6) )) local_stateNext[8] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[9]; | |
// dynamics for channel 6 gate 1 | |
{ | |
float q10 = local_constants[67]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[68] * expf( (Vcomp - local_constants[69] ) / local_constants[70] ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[71] / (1 + expf( (local_constants[72] - Vcomp ) / local_constants[73] ) ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[9] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[9] = (blend_factor) * local_state[9] + (1-blend_factor) * inf; | |
if(!( local_stateNext[9] > (float)(1e-6) )) local_stateNext[9] = 1e-6; | |
if(!( local_stateNext[9] < (float)(1-1e-6) )) local_stateNext[9] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[74]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
I_ion_0 += I_chan; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = ( (float)(8.3144621000000001) * temperature / (float)( 2 * 96485.300000000003) * logf( Ca_concentration_extra / Ca_concentration ) * 1e3f ); | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[10]; | |
// dynamics for channel 7 gate 0 | |
{ | |
float q10 = local_constants[75]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 0 for Fixed channel 7 | |
float Lems_property_0 = local_constants[76]; | |
float Lems_property_1 = local_constants[77]; | |
// state variables HHRate BaseTau 0 for Fixed channel 7 | |
// declare derived variables HHRate BaseTau 0 for Fixed channel 7 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 0 for Fixed channel 7 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 0 for Fixed channel 7 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)5)/* unitless */ + ( ( ( (float)20)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)35)/* unitless */ ) )/* unitless */ / ( (float)5)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 0 for Fixed channel 7 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[78] / (1 + expf( (local_constants[79] - Vcomp ) / local_constants[80] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[10] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[10] = (blend_factor) * local_state[10] + (1-blend_factor) * inf; | |
if(!( local_stateNext[10] > (float)(1e-6) )) local_stateNext[10] = 1e-6; | |
if(!( local_stateNext[10] < (float)(1-1e-6) )) local_stateNext[10] = 1-1e-6; | |
} | |
} | |
float chan_gate_1_q; | |
chan_gate_1_q = local_state[11]; | |
// dynamics for channel 7 gate 1 | |
{ | |
float q10 = local_constants[81]; | |
float tau; | |
{ | |
float t; // define exposure | |
// LEMS component | |
float Lems_requirement_0 = Vcomp; | |
// fixed properties HHRate BaseTau 1 for Fixed channel 7 | |
float Lems_property_0 = local_constants[82]; | |
float Lems_property_1 = local_constants[83]; | |
// state variables HHRate BaseTau 1 for Fixed channel 7 | |
// declare derived variables HHRate BaseTau 1 for Fixed channel 7 | |
float Lems_derived_0 = NAN; | |
float Lems_derived_1 = NAN; | |
// common read-only namespace? HHRate BaseTau 1 for Fixed channel 7 | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_property_0; | |
float *Lems_assigned_2 = &Lems_property_1; | |
float *Lems_assigned_3 = &Lems_derived_0; | |
float *Lems_assigned_4 = &Lems_derived_1; | |
// compute derived HHRate BaseTau 1 for Fixed channel 7 | |
Lems_derived_0 = ( ( *Lems_assigned_0/* voltage */ / *Lems_assigned_2/* voltage */ ) )/* unitless */; | |
Lems_derived_1 = ( ( ( ( ( (float)20)/* unitless */ + ( ( ( (float)50)/* unitless */ / ( ( ( (float)1)/* unitless */ + ( expf( ( ( ( ( *Lems_assigned_3/* unitless */ + ( (float)50)/* unitless */ ) )/* unitless */ / ( (float)7)/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ ) )/* unitless */ * *Lems_assigned_1/* time */ ) )/* time */; | |
// integrate inline | |
if(initial_state){ | |
// initialization | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
// conditional updates, during simulation | |
} | |
// expose inline | |
// exposures HHRate BaseTau 1 for Fixed channel 7 | |
float Lems_exposure_t = Lems_derived_1; | |
t = Lems_exposure_t; | |
tau = t; | |
} | |
float inf; | |
{ | |
float x; // define exposure | |
x = local_constants[84] / (1 + expf( (local_constants[85] - Vcomp ) / local_constants[86] ) ); | |
inf = x; | |
} | |
if(initial_state){ | |
local_stateNext[11] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[11] = (blend_factor) * local_state[11] + (1-blend_factor) * inf; | |
if(!( local_stateNext[11] > (float)(1e-6) )) local_stateNext[11] = 1e-6; | |
if(!( local_stateNext[11] < (float)(1-1e-6) )) local_stateNext[11] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q * chan_gate_0_q * chan_gate_1_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[87]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
I_ion_0 += I_chan; | |
} | |
// Current from synapses | |
float I_synapses_total = 0; | |
float G_synapses_total = 0; | |
// Current from inputs | |
float I_input_total = 0; | |
float G_input_total = 0; | |
// Dynamics for ion 0 | |
{ | |
float Iion = I_ion_0; | |
float InitConcIntra = local_constants[0]; | |
float InitConcExtra = local_constants[1]; | |
// LEMS component | |
float Lems_requirement_0 = Acomp; | |
float Lems_requirement_1 = InitConcIntra; | |
float Lems_requirement_2 = InitConcExtra; | |
float Lems_requirement_3 = Iion; | |
// fixed properties Comp Type 2 Ion 0 pool | |
float Lems_property_0 = local_constants[2]; | |
float Lems_property_1 = local_constants[3]; | |
float Lems_property_2 = local_constants[4]; | |
float Lems_property_3 = local_constants[5]; | |
float Lems_property_4 = local_constants[6]; | |
// state variables Comp Type 2 Ion 0 pool | |
float Lems_state_0 = local_state[0]; | |
float Lems_state_1 = local_state[1]; | |
// declare derived variables Comp Type 2 Ion 0 pool | |
float Lems_derived_0 = NAN; | |
// common read-only namespace? Comp Type 2 Ion 0 pool | |
float *Lems_assigned_0 = &Lems_requirement_0; | |
float *Lems_assigned_1 = &Lems_requirement_1; | |
float *Lems_assigned_2 = &Lems_requirement_2; | |
float *Lems_assigned_3 = &Lems_property_0; | |
float *Lems_assigned_4 = &Lems_property_1; | |
float *Lems_assigned_5 = &Lems_property_2; | |
float *Lems_assigned_6 = &Lems_property_3; | |
float *Lems_assigned_7 = &Lems_property_4; | |
float *Lems_assigned_8 = &Lems_requirement_3; | |
float *Lems_assigned_9 = &Lems_state_0; | |
float *Lems_assigned_10 = &Lems_state_1; | |
float *Lems_assigned_11 = &Lems_derived_0; | |
// compute derived Comp Type 2 Ion 0 pool | |
Lems_derived_0 = ( ( *Lems_assigned_8/* current */ / *Lems_assigned_0/* area */ ) * 1e5f )/* currentDensity */; | |
if(initial_state){ | |
// initialization | |
local_stateNext[0] = *Lems_assigned_1/* concentration */; | |
Lems_assigned_9 = &(local_stateNext[0]) ; | |
local_stateNext[1] = *Lems_assigned_2/* concentration */; | |
Lems_assigned_10 = &(local_stateNext[1]) ; | |
}else{ | |
// dynamics | |
// (highest up is lowest priority) | |
// time derivatives | |
float Lems_derivative_0 = ( ( ( ( ( ( *Lems_assigned_11/* currentDensity */ * *Lems_assigned_3/* unitless */ ) )/* currentDensity */ / ( ( ( ( ( (float)2)/* unitless */ * *Lems_assigned_7/* charge_per_mole */ ) )/* charge_per_mole */ * *Lems_assigned_6/* length */ ) * 1e-6f )/* l^1 * t^1 * i^1 * n^-1 */ ) * 1e-2f )/* l^-3 * t^-1 * n^1 */ - ( ( ( ( *Lems_assigned_9/* concentration */ - *Lems_assigned_4/* concentration */ ) )/* concentration */ / *Lems_assigned_5/* time */ ) * 1e3f )/* l^-3 * t^-1 * n^1 */ ) )/* l^-3 * t^-1 * n^1 */; | |
local_stateNext[0] = local_state[0] + dt * Lems_derivative_0 * 1e-3f; | |
local_stateNext[1] = local_state[1]; | |
// conditional updates, during simulation | |
} | |
// exposures Comp Type 2 Ion 0 pool | |
float Lems_exposure_concentration = Lems_state_0; | |
float Lems_exposure_extConcentration = Lems_state_1; | |
} | |
I_internal = I_channels_total + I_input_total + I_synapses_total; | |
G_internal = G_channels_total + G_input_total + G_synapses_total; | |
PerComp_InvRC_Diagonal[comp] = 1*(G_internal / C[comp] ) + PerComp_InvRC_Axial[comp]; | |
if(initial_state){ | |
// initialize | |
V_next[comp] = V[comp]; | |
}else{ | |
V_next[comp] = V[comp] + ( dt * ( I_internal + ( (V[comp] * G_internal) ) ) / C[comp] ); | |
} } | |
} | |
// Internal Code for compartment type 2 end | |
// Internal Code for compartment type 3 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[10]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [10]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
float Acomp = Area[comp]; | |
float Vcomp = V[comp]; | |
float I_internal = 0; | |
float G_internal = 0; | |
// Ion flux sources | |
// Ion concentrations | |
const float Ca_concentration = 0; | |
const float Ca_concentration_extra = 0; | |
const float Ca2_concentration = 0; | |
const float Ca2_concentration_extra = 0; | |
// Current from ion channels | |
float I_channels_total = 0; | |
float G_channels_total = 0; | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[0]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float chan_gate_0_q; | |
chan_gate_0_q = local_state[0]; | |
// dynamics for channel 0 gate 0 | |
{ | |
float q10 = local_constants[1]; | |
float alpha; | |
{ | |
float r; // define exposure | |
r = local_constants[2] * ( ( Vcomp == local_constants[3]) ? 1 : ( ( (Vcomp - local_constants[3] ) / local_constants[4] ) / (1 - expf( - (Vcomp - local_constants[3] ) / local_constants[4] ) ) ) ); | |
alpha = r; | |
} | |
float beta; | |
{ | |
float r; // define exposure | |
r = local_constants[5] * expf( (Vcomp - local_constants[6] ) / local_constants[7] ); | |
beta = r; | |
} | |
float tau; | |
tau = 1 / ( alpha + beta ); | |
float inf; | |
inf = alpha / ( alpha + beta ); | |
if(initial_state){ | |
local_stateNext[0] = inf; | |
}else{ | |
float tau_factor = (( dt * q10)/ tau) ; | |
float blend_factor = expf( -tau_factor ); | |
local_stateNext[0] = (blend_factor) * local_state[0] + (1-blend_factor) * inf; | |
if(!( local_stateNext[0] > (float)(1e-6) )) local_stateNext[0] = 1e-6; | |
if(!( local_stateNext[0] < (float)(1-1e-6) )) local_stateNext[0] = 1-1e-6; | |
} | |
} | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling * chan_gate_0_q; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[8]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
{ | |
float Vshift = 0; | |
float Erev = local_constants[9]; | |
float ChannelOpenFraction = NAN; | |
float ChannelConductance = NAN; | |
float rateScale = 1; | |
float conductance_scaling = 1; | |
ChannelOpenFraction = conductance_scaling ; | |
float I_chan = NAN; | |
float channel_conductance = NAN; | |
float iDensity = NAN; | |
float gDensity = NAN; | |
float Gbase = local_constants[10]; // conductivity | |
float Gscaled = Gbase * ChannelOpenFraction; | |
iDensity = Gscaled * (Erev - Vcomp) * 1e-5f; | |
gDensity = (Gscaled) * 1e-5f; | |
I_chan = (iDensity * Acomp); | |
channel_conductance = (gDensity * Acomp); | |
I_channels_total += I_chan; | |
G_channels_total += channel_conductance; | |
} | |
// Current from synapses | |
float I_synapses_total = 0; | |
float G_synapses_total = 0; | |
// Current from inputs | |
float I_input_total = 0; | |
float G_input_total = 0; | |
I_internal = I_channels_total + I_input_total + I_synapses_total; | |
G_internal = G_channels_total + G_input_total + G_synapses_total; | |
PerComp_InvRC_Diagonal[comp] = 1*(G_internal / C[comp] ) + PerComp_InvRC_Axial[comp]; | |
if(initial_state){ | |
// initialize | |
V_next[comp] = V[comp]; | |
}else{ | |
V_next[comp] = V[comp] + ( dt * ( I_internal + ( (V[comp] * G_internal) ) ) / C[comp] ); | |
} } | |
} | |
// Internal Code for compartment type 3 end | |
if(!initial_state){ | |
const long long Compartments = cell_state_table_f32_sizes[0]; //same for all parallel arrays | |
const Table_I64 Order = cell_const_table_i64_arrays[11]; | |
const Table_I64 Parent = cell_const_table_i64_arrays[12]; | |
Table_F32 D = PerComp_InvRC_Diagonal; for(long long comp_seq = 0; comp_seq < Compartments; comp_seq++){ | |
D[comp_seq] = 1 + D[comp_seq] * dt ; | |
} | |
for( long long comp_seq = 0; comp_seq < Compartments - 1; comp_seq++ ){ | |
long long i = Order[comp_seq]; | |
long long j = Parent[i]; | |
long long idx = ( ( i > j ) ? i : j ); | |
float R = R_Axial[idx]; | |
float Ui = - dt/( R * C[i]) ; | |
float Uj = - dt/( R * C[j]) ; | |
float Li = Uj; | |
float ratio = Li/D[i]; | |
D[j] -= ratio * Ui; | |
V_next[j] -= ratio * V_next[i]; | |
} | |
long long i = Order[ Compartments - 1 ]; | |
V_next[i] = V_next[i] / D[i]; | |
for( long long comp_seq = Compartments - 2; comp_seq >= 0 ; comp_seq-- ){ | |
long long i = Order[comp_seq]; | |
long long j = Parent[i]; | |
long long idx = ( ( i > j ) ? i : j ); | |
float R = R_Axial[idx]; | |
float Ui = - dt/( R * C[i]) ; | |
V_next[i] = ( V_next[i] - Ui * V_next[j] ) / D[i]; | |
} | |
} | |
// PostUpdate Code for compartment type 0 | |
// Internal Code for compartment type 0 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[7]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [7]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
} | |
} | |
// Internal Code for compartment type 0 end | |
// PostUpdate Code for compartment type 1 | |
// Internal Code for compartment type 1 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[8]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [8]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
} | |
} | |
// Internal Code for compartment type 1 end | |
// PostUpdate Code for compartment type 2 | |
// Internal Code for compartment type 2 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[9]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [9]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
} | |
} | |
// Internal Code for compartment type 2 end | |
// PostUpdate Code for compartment type 3 | |
// Internal Code for compartment type 3 | |
{ | |
const Table_I64 Comp_List = cell_const_table_i64_arrays[10]; | |
const long long Type_Compartments = cell_const_table_i64_sizes [10]; | |
for( long long CompIdx = 0; CompIdx < Type_Compartments; CompIdx++ ){ | |
int comp = (int) Comp_List[CompIdx]; | |
const long long const_comp_index = Comp_Coff [comp]; | |
const long long state_comp_index = Comp_Soff [comp]; | |
const long long table_cf32_comp_index = Comp_CF32off[comp]; | |
const long long table_ci64_comp_index = Comp_CI64off[comp]; | |
const long long table_sf32_comp_index = Comp_SF32off[comp]; | |
const long long table_si64_comp_index = Comp_SI64off[comp]; | |
const long long rng_offset = Comp_Roff [comp]; | |
const float *comp_constants = cell_constants + const_comp_index; | |
const float *comp_state = cell_state + state_comp_index; | |
float *comp_stateNext = cell_stateNext + state_comp_index; | |
const long long *comp_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_comp_index; | |
const Table_F32 *comp_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_comp_index; | |
const long long *comp_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_comp_index; | |
const Table_I64 *comp_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_comp_index; | |
const long long *comp_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_comp_index; | |
const Table_F32 *comp_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_comp_index; | |
Table_F32 *comp_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_comp_index; | |
const long long *comp_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_comp_index; | |
Table_I64 *comp_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_comp_index; | |
Table_I64 *comp_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_comp_index; | |
const long long const_local_index = const_comp_index; | |
const long long state_local_index = state_comp_index; | |
const long long table_cf32_local_index = table_cf32_comp_index; | |
const long long table_ci64_local_index = table_ci64_comp_index; | |
const long long table_sf32_local_index = table_sf32_comp_index; | |
const long long table_si64_local_index = table_si64_comp_index; | |
const float *local_constants = cell_constants + const_local_index; | |
const float *local_state = cell_state + state_local_index; | |
float *local_stateNext = cell_stateNext + state_local_index; | |
const long long *local_const_table_f32_sizes = cell_const_table_f32_sizes + table_cf32_local_index; | |
const Table_F32 *local_const_table_f32_arrays = cell_const_table_f32_arrays + table_cf32_local_index; | |
const long long *local_const_table_i64_sizes = cell_const_table_i64_sizes + table_ci64_local_index; | |
const Table_I64 *local_const_table_i64_arrays = cell_const_table_i64_arrays + table_ci64_local_index; | |
const long long *local_state_table_f32_sizes = cell_state_table_f32_sizes + table_sf32_local_index; | |
const Table_F32 *local_state_table_f32_arrays = cell_state_table_f32_arrays + table_sf32_local_index; | |
Table_F32 *local_stateNext_table_f32_arrays = cell_stateNext_table_f32_arrays + table_sf32_local_index; | |
const long long *local_state_table_i64_sizes = cell_state_table_i64_sizes + table_si64_local_index; | |
Table_I64 *local_state_table_i64_arrays = cell_state_table_i64_arrays + table_si64_local_index; | |
Table_I64 *local_stateNext_table_i64_arrays = cell_stateNext_table_i64_arrays + table_si64_local_index; | |
} | |
} | |
// Internal Code for compartment type 3 end | |
} | |
// Generated code block END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment