A multilayer cortical model to study seizure propagation across microdomains (Basu et al. 2015)

 Download zip file 
Help downloading and running models
Accession:206238
A realistic neural network was used to simulate a region of neocortex to obtain extracellular LFPs from ‘virtual micro-electrodes’ and produce test data for comparison with multisite microelectrode recordings. A model was implemented in the GENESIS neurosimulator. A simulated region of cortex was represented by layers 2/3, 5/6 (interneurons and pyramidal cells) and layer 4 stelate cells, spaced at 25 µm in each horizontal direction. Pyramidal cells received AMPA and NMDA inputs from neighboring cells at the basal and apical dendrites. The LFP data was generated by simulating 16-site electrode array with the help of ‘efield’ objects arranged at the predetermined positions with respect to the surface of the simulated network. The LFP for the model is derived from a weighted average of the current sources summed over all cellular compartments. Cell models were taken from from Traub et al. (2005) J Neurophysiol 93(4):2194-232.
References:
1 . Basu I, Kudela P, Korzeniewska A, Franaszczuk PJ, Anderson WS (2015) A study of the dynamics of seizure propagation across micro domains in the vicinity of the seizure onset zone. J Neural Eng 12:046016 [PubMed]
2 . Basu I, Kudela P, Anderson WS (2014) Determination of seizure propagation across microdomains using spectral measures of causality. Conf Proc IEEE Eng Med Biol Soc 2014:6349-52 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism: Neocortex;
Cell Type(s): Neocortex U1 L2/6 pyramidal intratelencephalic GLU cell; Neocortex U1 L5B pyramidal pyramidal tract GLU cell; Thalamus reticular nucleus GABA cell; Neocortex spiking low threshold (LTS) neuron; Neocortex spiking regular (RS) neuron; Neocortex layer 2-3 interneuron; Neocortex layer 5 interneuron;
Channel(s): I Na,p; I Na,t; I K; I A; I M; I h; I K,Ca; I A, slow; I L high threshold; I T low threshold; I Calcium;
Gap Junctions: Gap junctions;
Receptor(s): AMPA; GabaA; NMDA;
Gene(s):
Transmitter(s): Glutamate; Gaba; Amino Acids;
Simulation Environment: GENESIS;
Model Concept(s): Activity Patterns; Epilepsy;
Implementer(s): Anderson, WS ; Kudela, Pawel ;
Search NeuronDB for information about:  Thalamus reticular nucleus GABA cell; Neocortex U1 L5B pyramidal pyramidal tract GLU cell; Neocortex U1 L2/6 pyramidal intratelencephalic GLU cell; GabaA; AMPA; NMDA; I Na,p; I Na,t; I L high threshold; I T low threshold; I A; I K; I M; I h; I K,Ca; I Calcium; I A, slow; Amino Acids; Gaba; Glutamate;
/
BasuEtAl2015
axonaldelays.g
B23FS.g
B23FS_B23FS.g
B23FS_B23FS_Gap.g
B23FS_B23FS_TraubGap.g
B23FS_C23FS.g
B23FS_I23LTS.g
B23FS_P23FRBa.g
B23FS_P23RSa.g
B23FS_P23RSb.g
B23FS_P23RSc.g
B23FS_P23RSd.g
B23FS_raninput.g
B23FS_ST4RS.g
B23FS_synapsedefs.g
B23FScell3Dpk.p
B23FSchanpk.g
B23FSprotodefs.g
B23FSsyncond.g
B5FS.g
B5FS_B5FS.g
B5FS_B5FS_Gap.g
B5FS_B5FS_TraubGap.g
B5FS_C5FS.g
B5FS_I5LTS.g
B5FS_P5IBa.g
B5FS_P5IBb.g
B5FS_P5IBc.g
B5FS_P5IBd.g
B5FS_P5RSa.g
B5FS_P6RSa.g
B5FS_P6RSb.g
B5FS_P6RSc.g
B5FS_P6RSd.g
B5FS_raninput.g
B5FS_ST4RS.g
B5FS_synapsedefs.g
B5FScell3Dpk.p
B5FSchanpk.g
B5FSprotodefs.g
B5FSsyncond.g
BinarySpikeClasswrite.g
C23FS.g
C23FS_P23FRBa.g
C23FS_P23RSa.g
C23FS_P23RSb.g
C23FS_P23RSc.g
C23FS_P23RSd.g
C23FS_P5IBa.g
C23FS_P5IBb.g
C23FS_P5IBc.g
C23FS_P5IBd.g
C23FS_P5RSa.g
C23FS_P6RSa.g
C23FS_P6RSb.g
C23FS_P6RSc.g
C23FS_P6RSd.g
C23FS_raninput.g
C23FS_ST4RS.g
C23FS_synapsedefs.g
C23FScell3Dpk.p
C23FSchanpk.g
C23FSprotodefs.g
C23FSsyncond.g
C5FS.g
C5FS_P23FRBa.g
C5FS_P23RSa.g
C5FS_P23RSb.g
C5FS_P23RSc.g
C5FS_P23RSd.g
C5FS_P5IBa.g
C5FS_P5IBb.g
C5FS_P5IBc.g
C5FS_P5IBd.g
C5FS_P5RSa.g
C5FS_P6RSa.g
C5FS_P6RSb.g
C5FS_P6RSc.g
C5FS_P6RSd.g
C5FS_raninput.g
C5FS_ST4RS.g
C5FS_synapsedefs.g
C5FScell3Dpk.p
C5FSchanpk.g
C5FSprotodefs.g
C5FSsyncond.g
celldefs.g
compartments.g *
constants.g
Gapdefs.g
GenrrunIshita
hosts144
hosts81
I23LTS.g
I23LTS_B23FS.g
I23LTS_B5FS.g
I23LTS_C23FS.g
I23LTS_C5FS.g
I23LTS_I23LTS.g
I23LTS_I23LTS_Gap.g
I23LTS_I23LTS_TraubGap.g
I23LTS_I5LTS.g
I23LTS_P23FRBa.g
I23LTS_P23RSa.g
I23LTS_P23RSb.g
I23LTS_P23RSc.g
I23LTS_P23RSd.g
I23LTS_P5IBa.g
I23LTS_P5IBb.g
I23LTS_P5IBc.g
I23LTS_P5IBd.g
I23LTS_P5RSa.g
I23LTS_P6RSa.g
I23LTS_P6RSb.g
I23LTS_P6RSc.g
I23LTS_P6RSd.g
I23LTS_raninput.g
I23LTS_ST4RS.g
I23LTS_synapsedefs.g
I23LTScell3Dpk.p
I23LTSchanpk.g
I23LTSprotodefs.g
I23LTSsyncond.g
I5LTS.g
I5LTS_B23FS.g
I5LTS_B5FS.g
I5LTS_C23FS.g
I5LTS_C5FS.g
I5LTS_I23LTS.g
I5LTS_I5LTS.g
I5LTS_I5LTS_Gap.g
I5LTS_I5LTS_TraubGap.g
I5LTS_P23FRBa.g
I5LTS_P23RSa.g
I5LTS_P23RSb.g
I5LTS_P23RSc.g
I5LTS_P23RSd.g
I5LTS_P5IBa.g
I5LTS_P5IBb.g
I5LTS_P5IBc.g
I5LTS_P5IBd.g
I5LTS_P5RSa.g
I5LTS_P6RSa.g
I5LTS_P6RSb.g
I5LTS_P6RSc.g
I5LTS_P6RSd.g
I5LTS_raninput.g
I5LTS_ST4RS.g
I5LTS_synapsedefs.g
I5LTScell3Dpk.p
I5LTSchanpk.g
I5LTSprotodefs.g
I5LTSsyncond.g
icons.g *
LFP16s.g
LFP8s.g
LFP8sASCIIwrite.g
LFPlist
LFPmultiarray.g
LFPmultiarrayASCIIwrite.g
ModelDescription.pdf
mvapich2_pgenesis_command
Neocortex.g
Neosyn_utils.g
netdefs.g
netparams.g
nodes
nodes4
nRT.g
nRT_nRT.g
nRT_nRT_Gap.g
nRT_nRT_TraubGap.g
nRT_raninput.g
nRT_synapsedefs.g
nRT_TCR.g
nRTcellpk.p
nRTchanpk.g
nRTprotodefs.g
nRTsyncond.g
nxpgenesis.out
orient_sim.g
P23FRBa.g
P23FRBa_B23FS.g
P23FRBa_B5FS.g
P23FRBa_C23FS.g
P23FRBa_C5FS.g
P23FRBa_I23LTS.g
P23FRBa_I5LTS.g
P23FRBa_P23FRBa.g
P23FRBa_P23FRBa_Gap.g
P23FRBa_P23RSa.g
P23FRBa_P23RSb.g
P23FRBa_P23RSc.g
P23FRBa_P23RSd.g
P23FRBa_P5IBa.g
P23FRBa_P5IBb.g
P23FRBa_P5IBc.g
P23FRBa_P5IBd.g
P23FRBa_P5RSa.g
P23FRBa_P6RSa.g
P23FRBa_P6RSb.g
P23FRBa_P6RSc.g
P23FRBa_P6RSd.g
P23FRBa_raninput.g
P23FRBa_ST4RS.g
P23FRBa_synapsedefs.g
P23FRBacell3Dpk.p
P23FRBachanpk.g
P23FRBaprotodefs.g
P23RSa.g
P23RSa_B23FS.g
P23RSa_B5FS.g
P23RSa_C23FS.g
P23RSa_C5FS.g
P23RSa_I23LTS.g
P23RSa_I5LTS.g
P23RSa_output.g
P23RSa_P23FRBa.g
P23RSa_P23FRBa_Gap.g
P23RSa_P23FRBa_TraubGap.g
P23RSa_P23RSa.g
P23RSa_P23RSa_Gap.g
P23RSa_P23RSb.g
P23RSa_P23RSb_Gap.g
P23RSa_P23RSc.g
P23RSa_P23RSc_Gap.g
P23RSa_P23RSd.g
P23RSa_P23RSd_Gap.g
P23RSa_P5IBa.g
P23RSa_P5IBb.g
P23RSa_P5IBc.g
P23RSa_P5IBd.g
P23RSa_P5RSa.g
P23RSa_P6RSa.g
P23RSa_P6RSb.g
P23RSa_P6RSc.g
P23RSa_P6RSd.g
P23RSa_raninput.g
P23RSa_ST4RS.g
P23RSa_synapsedefs.g
P23RSacell3Dpk.p
P23RSachanpk.g
P23RSaprotodefs.g
P23RSb.g
P23RSb_B23FS.g
P23RSb_B5FS.g
P23RSb_C23FS.g
P23RSb_C5FS.g
P23RSb_I23LTS.g
P23RSb_I5LTS.g
P23RSb_P23FRBa.g
P23RSb_P23FRBa_Gap.g
P23RSb_P23FRBa_TraubGap.g
P23RSb_P23RSa.g
P23RSb_P23RSb.g
P23RSb_P23RSb_Gap.g
P23RSb_P23RSc.g
P23RSb_P23RSc_Gap.g
P23RSb_P23RSd.g
P23RSb_P23RSd_Gap.g
P23RSb_P5IBa.g
P23RSb_P5IBb.g
P23RSb_P5IBc.g
P23RSb_P5IBd.g
P23RSb_P5RSa.g
P23RSb_P6RSa.g
P23RSb_P6RSb.g
P23RSb_P6RSc.g
P23RSb_P6RSd.g
P23RSb_raninput.g
P23RSb_ST4RS.g
P23RSb_synapsedefs.g
P23RSbcell3Dpk.p
P23RSbchanpk.g
P23RSbprotodefs.g
P23RSc.g
P23RSc_B23FS.g
P23RSc_B5FS.g
P23RSc_C23FS.g
P23RSc_C5FS.g
P23RSc_I23LTS.g
P23RSc_I5LTS.g
P23RSc_P23FRBa.g
P23RSc_P23FRBa_Gap.g
P23RSc_P23FRBa_TraubGap.g
P23RSc_P23RSa.g
P23RSc_P23RSb.g
P23RSc_P23RSc.g
P23RSc_P23RSc_Gap.g
P23RSc_P23RSd.g
P23RSc_P23RSd_Gap.g
P23RSc_P5IBa.g
P23RSc_P5IBb.g
P23RSc_P5IBc.g
P23RSc_P5IBd.g
P23RSc_P5RSa.g
P23RSc_P6RSa.g
P23RSc_P6RSb.g
P23RSc_P6RSc.g
P23RSc_P6RSd.g
P23RSc_raninput.g
P23RSc_ST4RS.g
P23RSc_synapsedefs.g
P23RSccell3Dpk.p
P23RScchanpk.g
P23RScprotodefs.g
P23RSd.g
P23RSd_B23FS.g
P23RSd_B5FS.g
P23RSd_C23FS.g
P23RSd_C5FS.g
P23RSd_I23LTS.g
P23RSd_I5LTS.g
P23RSd_P23FRBa.g
P23RSd_P23FRBa_Gap.g
P23RSd_P23FRBa_TraubGap.g
P23RSd_P23RSa.g
P23RSd_P23RSb.g
P23RSd_P23RSc.g
P23RSd_P23RSd.g
P23RSd_P23RSd_Gap.g
P23RSd_P5IBa.g
P23RSd_P5IBb.g
P23RSd_P5IBc.g
P23RSd_P5IBd.g
P23RSd_P5RSa.g
P23RSd_P6RSa.g
P23RSd_P6RSb.g
P23RSd_P6RSc.g
P23RSd_P6RSd.g
P23RSd_raninput.g
P23RSd_ST4RS.g
P23RSd_synapsedefs.g
P23RSdcell3Dpk.p
P23RSdchanpk.g
P23RSdprotodefs.g
P23RSsyncond.g
P5IBa.g
P5IBa_B23FS.g
P5IBa_B5FS.g
P5IBa_C23FS.g
P5IBa_C5FS.g
P5IBa_I23LTS.g
P5IBa_I5LTS.g
P5IBa_P23FRBa.g
P5IBa_P23RSa.g
P5IBa_P23RSb.g
P5IBa_P23RSc.g
P5IBa_P23RSd.g
P5IBa_P5IBa.g
P5IBa_P5IBa_Gap.g
P5IBa_P5IBb.g
P5IBa_P5IBb_Gap.g
P5IBa_P5IBc.g
P5IBa_P5IBc_Gap.g
P5IBa_P5IBd.g
P5IBa_P5IBd_Gap.g
P5IBa_P5RSa.g
P5IBa_P5RSa_Gap.g
P5IBa_P6RSa.g
P5IBa_P6RSb.g
P5IBa_P6RSc.g
P5IBa_P6RSd.g
P5IBa_raninput.g
P5IBa_ST4RS.g
P5IBa_synapsedefs.g
P5IBacell3Dpk.p
P5IBachanpk.g
P5IBaprotodefs.g
P5IBb.g
P5IBb_B23FS.g
P5IBb_B5FS.g
P5IBb_C23FS.g
P5IBb_C5FS.g
P5IBb_I23LTS.g
P5IBb_I5LTS.g
P5IBb_P23FRBa.g
P5IBb_P23RSa.g
P5IBb_P23RSb.g
P5IBb_P23RSc.g
P5IBb_P23RSd.g
P5IBb_P5IBa.g
P5IBb_P5IBb.g
P5IBb_P5IBb_Gap.g
P5IBb_P5IBc.g
P5IBb_P5IBc_Gap.g
P5IBb_P5IBd.g
P5IBb_P5IBd_Gap.g
P5IBb_P5RSa.g
P5IBb_P5RSa_Gap.g
P5IBb_P6RSa.g
P5IBb_P6RSb.g
P5IBb_P6RSc.g
P5IBb_P6RSd.g
P5IBb_raninput.g
P5IBb_ST4RS.g
P5IBb_synapsedefs.g
P5IBbcell3Dpk.p
P5IBbchanpk.g
P5IBbprotodefs.g
P5IBc.g
P5IBc_B23FS.g
P5IBc_B5FS.g
P5IBc_C23FS.g
P5IBc_C5FS.g
P5IBc_I23LTS.g
P5IBc_I5LTS.g
P5IBc_P23FRBa.g
P5IBc_P23RSa.g
P5IBc_P23RSb.g
P5IBc_P23RSc.g
P5IBc_P23RSd.g
P5IBc_P5IBa.g
P5IBc_P5IBb.g
P5IBc_P5IBc.g
P5IBc_P5IBc_Gap.g
P5IBc_P5IBd.g
P5IBc_P5IBd_Gap.g
P5IBc_P5RSa.g
P5IBc_P5RSa_Gap.g
P5IBc_P6RSa.g
P5IBc_P6RSb.g
P5IBc_P6RSc.g
P5IBc_P6RSd.g
P5IBc_raninput.g
P5IBc_ST4RS.g
P5IBc_synapsedefs.g
P5IBccell3Dpk.p
P5IBcchanpk.g
P5IBcprotodefs.g
P5IBd.g
P5IBd_B23FS.g
P5IBd_B5FS.g
P5IBd_C23FS.g
P5IBd_C5FS.g
P5IBd_I23LTS.g
P5IBd_I5LTS.g
P5IBd_P23FRBa.g
P5IBd_P23RSa.g
P5IBd_P23RSb.g
P5IBd_P23RSc.g
P5IBd_P23RSd.g
P5IBd_P5IBa.g
P5IBd_P5IBb.g
P5IBd_P5IBc.g
P5IBd_P5IBd.g
P5IBd_P5IBd_Gap.g
P5IBd_P5RSa.g
P5IBd_P5RSa_Gap.g
P5IBd_P6RSa.g
P5IBd_P6RSb.g
P5IBd_P6RSc.g
P5IBd_P6RSd.g
P5IBd_raninput.g
P5IBd_ST4RS.g
P5IBd_synapsedefs.g
P5IBdcell3Dpk.p
P5IBdchanpk.g
P5IBdprotodefs.g
P5IBsyncond.g
P5RSa.g
P5RSa_B23FS.g
P5RSa_B5FS.g
P5RSa_C23FS.g
P5RSa_C5FS.g
P5RSa_I23LTS.g
P5RSa_I5LTS.g
P5RSa_P23FRBa.g
P5RSa_P23RSa.g
P5RSa_P23RSb.g
P5RSa_P23RSc.g
P5RSa_P23RSd.g
P5RSa_P5IBa.g
P5RSa_P5IBb.g
P5RSa_P5IBc.g
P5RSa_P5IBd.g
P5RSa_P5RSa.g
P5RSa_P5RSa_Gap.g
P5RSa_P6RSa.g
P5RSa_P6RSb.g
P5RSa_P6RSc.g
P5RSa_P6RSd.g
P5RSa_raninput.g
P5RSa_ST4RS.g
P5RSa_synapsedefs.g
P5RSacell3Dpk.p
P5RSachanpk.g
P5RSaprotodefs.g
P6RSa.g
P6RSa_B23FS.g
P6RSa_B5FS.g
P6RSa_C23FS.g
P6RSa_C5FS.g
P6RSa_I23LTS.g
P6RSa_I5LTS.g
P6RSa_nRT.g
P6RSa_P23FRBa.g
P6RSa_P23RSa.g
P6RSa_P23RSb.g
P6RSa_P23RSc.g
P6RSa_P23RSd.g
P6RSa_P5IBa.g
P6RSa_P5IBb.g
P6RSa_P5IBc.g
P6RSa_P5IBd.g
P6RSa_P5RSa.g
P6RSa_P6RSa.g
P6RSa_P6RSa_Gap.g
P6RSa_P6RSb.g
P6RSa_P6RSb_Gap.g
P6RSa_P6RSc.g
P6RSa_P6RSc_Gap.g
P6RSa_P6RSd.g
P6RSa_P6RSd_Gap.g
P6RSa_raninput.g
P6RSa_ST4RS.g
P6RSa_synapsedefs.g
P6RSa_TCR.g
P6RSacell3Dpk.p
P6RSachanpk.g
P6RSaprotodefs.g
P6RSb.g
P6RSb_B23FS.g
P6RSb_B5FS.g
P6RSb_C23FS.g
P6RSb_C5FS.g
P6RSb_I23LTS.g
P6RSb_I5LTS.g
P6RSb_nRT.g
P6RSb_P23FRBa.g
P6RSb_P23RSa.g
P6RSb_P23RSb.g
P6RSb_P23RSc.g
P6RSb_P23RSd.g
P6RSb_P5IBa.g
P6RSb_P5IBb.g
P6RSb_P5IBc.g
P6RSb_P5IBd.g
P6RSb_P5RSa.g
P6RSb_P6RSa.g
P6RSb_P6RSb.g
P6RSb_P6RSb_Gap.g
P6RSb_P6RSc.g
P6RSb_P6RSc_Gap.g
P6RSb_P6RSd.g
P6RSb_P6RSd_Gap.g
P6RSb_raninput.g
P6RSb_ST4RS.g
P6RSb_synapsedefs.g
P6RSb_TCR.g
P6RSbcell3Dpk.p
P6RSbchanpk.g
P6RSbprotodefs.g
P6RSc.g
P6RSc_B23FS.g
P6RSc_B5FS.g
P6RSc_C23FS.g
P6RSc_C5FS.g
P6RSc_I23LTS.g
P6RSc_I5LTS.g
P6RSc_nRT.g
P6RSc_P23FRBa.g
P6RSc_P23RSa.g
P6RSc_P23RSb.g
P6RSc_P23RSc.g
P6RSc_P23RSd.g
P6RSc_P5IBa.g
P6RSc_P5IBb.g
P6RSc_P5IBc.g
P6RSc_P5IBd.g
P6RSc_P5RSa.g
P6RSc_P6RSa.g
P6RSc_P6RSb.g
P6RSc_P6RSc.g
P6RSc_P6RSc_Gap.g
P6RSc_P6RSd.g
P6RSc_P6RSd_Gap.g
P6RSc_raninput.g
P6RSc_ST4RS.g
P6RSc_synapsedefs.g
P6RSc_TCR.g
P6RSccell3Dpk.p
P6RScchanpk.g
P6RScprotodefs.g
P6RSd.g
P6RSd_B23FS.g
P6RSd_B5FS.g
P6RSd_C23FS.g
P6RSd_C5FS.g
P6RSd_I23LTS.g
P6RSd_I5LTS.g
P6RSd_nRT.g
P6RSd_P23FRBa.g
P6RSd_P23RSa.g
P6RSd_P23RSb.g
P6RSd_P23RSc.g
P6RSd_P23RSd.g
P6RSd_P5IBa.g
P6RSd_P5IBb.g
P6RSd_P5IBc.g
P6RSd_P5IBd.g
P6RSd_P5RSa.g
P6RSd_P6RSa.g
P6RSd_P6RSb.g
P6RSd_P6RSc.g
P6RSd_P6RSd.g
P6RSd_P6RSd_Gap.g
P6RSd_raninput.g
P6RSd_ST4RS.g
P6RSd_synapsedefs.g
P6RSd_TCR.g
P6RSdcell3Dpk.p
P6RSdchanpk.g
P6RSdprotodefs.g
P6RSsyncond.g
pgenesis_command
protodefs.g
protospikeB23FS.g
protospikeB5FS.g
protospikeC23FS.g
protospikeC5FS.g
protospikeI23LTS.g
protospikeI5LTS.g
protospikenRT.g
protospikeP23FRBa.g
protospikeP23RSa.g
protospikeP23RSb.g
protospikeP23RSc.g
protospikeP23RSd.g
protospikeP5IBa.g
protospikeP5IBb.g
protospikeP5IBc.g
protospikeP5IBd.g
protospikeP5RSa.g
protospikeP6RSa.g
protospikeP6RSb.g
protospikeP6RSc.g
protospikeP6RSd.g
protospikeST4RS.g
protospikeTCR.g
randominputdefs.g
spikedefs.g
ST4RS.g
ST4RS_B23FS.g
ST4RS_B5FS.g
ST4RS_C23FS.g
ST4RS_C5FS.g
ST4RS_I23LTS.g
ST4RS_I5LTS.g
ST4RS_P23FRBa.g
ST4RS_P23RSa.g
ST4RS_P23RSb.g
ST4RS_P23RSc.g
ST4RS_P23RSd.g
ST4RS_P5IBa.g
ST4RS_P5IBb.g
ST4RS_P5IBc.g
ST4RS_P5IBd.g
ST4RS_P5RSa.g
ST4RS_P6RSa.g
ST4RS_P6RSb.g
ST4RS_P6RSc.g
ST4RS_P6RSd.g
ST4RS_raninput.g
ST4RS_ST4RS.g
ST4RS_ST4RS_Gap.g
ST4RS_synapsedefs.g
ST4RScell3Dpk.p
ST4RSchanpk.g
ST4RSprotodefs.g
ST4RSsyncond.g
synapticdelays.g *
synapticprobsTraub.g
synchansB23FS.g *
synchansB5FS.g *
synchansC23FS.g *
synchansC5FS.g *
synchansI23LTS.g *
synchansI5LTS.g *
synchansnRT.g *
synchansP23FRBa.g *
synchansP23RSa.g *
synchansP23RSb.g *
synchansP23RSc.g *
synchansP23RSd.g *
synchansP5IBa.g *
synchansP5IBb.g *
synchansP5IBc.g *
synchansP5IBd.g *
synchansP5RSa.g *
synchansP6RSa.g *
synchansP6RSb.g *
synchansP6RSc.g *
synchansP6RSd.g *
synchansSPIKEs.g *
synchansSPIKEs_base.g
synchansST4RS.g
synchansTCR.g *
syncond.g
syncond2.g
TCR.g
TCR_B23FS.g
TCR_B5FS.g
TCR_C23FS.g
TCR_C5FS.g
TCR_nRT.g
TCR_P23FRBa.g
TCR_P23RSa.g
TCR_P23RSb.g
TCR_P23RSc.g
TCR_P23RSd.g
TCR_P5IBa.g
TCR_P5IBb.g
TCR_P5IBc.g
TCR_P5IBd.g
TCR_P5RSa.g
TCR_P6RSa.g
TCR_P6RSb.g
TCR_P6RSc.g
TCR_P6RSd.g
TCR_raninput.g
TCR_ST4RS.g
TCR_synapsedefs.g
TCRcellpk.p
TCRchanpk.g
TCRprotodefs.g
TCRsyncond.g
                            
// genesis

// Setting the Resistance of the Gap Junction (1/conductance)
float Rgap = 1.0e9	// Ohms (1/Mhos) from Traub 2005 paper

//float	B23FS_SEPX = 25e-6
//float	B23FS_SEPY = 25e-6
//float	B23FS_NX = 5
//float	B23FS_NY = 5

int i,j,dexN,dexE,dexS,dexW
int conn1dex, conn2dex
float test1, test2
str conn1loc="", conn2loc=""
float globalconnprob=0.069 //after Traub 2005
float randconn
int jnodedex,inodedex,jnodecalc

echo B23FS - B23FS TraubGap!!! Junctions

for (i=0;i<=(B23FS_NY-1);i=i+1)
    for (j=0;j<=(B23FS_NX/2-1);j=j+1)

        dexN=i-1
        dexE=j+1
        dexS=i+1
        dexW=j-1

        // N
        randconn = { rand 0 1.0 }

        if ({dexN>=0} && {randconn<{globalconnprob}})
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i-1)*B23FS_NX/2+j

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}  RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm

        end

        if ({dexN==-1} && {randconn<{globalconnprob}} && { {mynode} >= {sqrtNnodes} }) //for nodal edge
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(B23FS_NY-1)*B23FS_NX/2+j

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - {sqrtNnodes}} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} - {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + {sqrtNnodes}} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end



        // NE
        randconn = { rand 0 1.0 }

        if ({dexN>=0} && {dexE<B23FS_NX/2} && {randconn<{globalconnprob}})
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i-1)*B23FS_NX/2+j+1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm

        end

        float jnodecalcarg = {mynode}/{sqrtNnodes}

        jnodecalc = {trunc {jnodecalcarg} }

        jnodedex = {mynode} - {sqrtNnodes}*jnodecalc

        if ({dexN==-1} && {randconn<{globalconnprob}} && {dexE<B23FS_NX/2} && { {mynode} >= {sqrtNnodes} }) //for nodal edge
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(B23FS_NY-1)*B23FS_NX/2+j+1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - {sqrtNnodes}} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} - {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + {sqrtNnodes}} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

        if ({dexN==-1} && {randconn<{globalconnprob}} && {dexE==B23FS_NX/2} && { {mynode} >= {sqrtNnodes} } && {jnodedex} < {sqrtNnodes-1}) //for nodal edge corner

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(B23FS_NY-1)*B23FS_NX/2

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - {sqrtNnodes} + 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} - {sqrtNnodes} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + {sqrtNnodes} - 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - {sqrtNnodes} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm
        end

        if ( {dexE==B23FS_NX/2} && {dexN>-1} && {randconn<{globalconnprob}} && { {jnodedex} < {sqrtNnodes-1} } ) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i-1)*B23FS_NX/2

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm
        end

        // E
        randconn = { rand 0 1.0 }

        if ({dexE<B23FS_NX/2} && {randconn<{globalconnprob}})
            conn1dex=i*B23FS_NX/2+j
            conn2dex=i*B23FS_NX/2+j+1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm

        end

        float jnodecalcarg = {mynode}/{sqrtNnodes}

        jnodecalc = {trunc {jnodecalcarg} }

        jnodedex = {mynode} - {sqrtNnodes}*jnodecalc

        if ({dexE==B23FS_NX/2} && {randconn<{globalconnprob}} && { {jnodedex} < {sqrtNnodes-1} }) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=i*B23FS_NX/2

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

        // SE
        randconn = { rand 0 1.0 }

        //pk if ({dexE<B23FS_NX/2} && {dexS>B23FS_NY} && {randconn<{globalconnprob}})
             if ({dexE<B23FS_NX/2} && {dexS<B23FS_NY} && {randconn<{globalconnprob}})

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i+1)*B23FS_NX/2+j+1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm

        end

        float jnodecalcarg = {mynode}/{sqrtNnodes}

        jnodecalc = {trunc {jnodecalcarg} }

        jnodedex = {mynode} - {sqrtNnodes}*jnodecalc

        if ({dexE==B23FS_NX/2} && {randconn<{globalconnprob}} && {dexS<B23FS_NY} && { {jnodedex} < {sqrtNnodes-1} }) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i+1)*B23FS_NX/2

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end
//pk    if ({dexS==B23FS_NY} && {randconn<{globalconnprob}} && {dexE==B23FS_NX/2} && { {jnodedex} < {sqrtNnodes-1} }) //for nodal edge corner
        if ({dexS==B23FS_NY} && {randconn<{globalconnprob}} && {dexE==B23FS_NX/2} && { {jnodedex} < {sqrtNnodes-1} } && {{mynode} < {{sqrtNnodes}*{sqrtNnodes-1}}}) //for nodal edge corner

            conn1dex=i*B23FS_NX/2+j
            conn2dex=0

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + {sqrtNnodes} + 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} + {sqrtNnodes} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - {sqrtNnodes} - 1} RAXIAL {Rgap} Vm 
            raddmsg@{{mynode} + {sqrtNnodes} + 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

        if ( {dexE<B23FS_NX/2} && {dexS==B23FS_NY} && {randconn<{globalconnprob}} && { {mynode} < {{sqrtNnodes}*{sqrtNnodes-1}} } ) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(j+1)

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + {sqrtNnodes}} RAXIAL {Rgap} Vm
            //pk  raddmsg@{{mynode} + {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - {sqrtNnodes}} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} + {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm
        end

        // S
        randconn = { rand 0 1.0 }

        if ({dexS<B23FS_NY} && {randconn<{globalconnprob}})
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i+1)*B23FS_NX/2+j

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm

        end

        //pk if ({dexS==B23FS_NY} && {randconn<{globalconnprob}} && { {mynode} >= {sqrtNnodes}*{sqrtNnodes-1} }) //for nodal edge
             if ({dexS==B23FS_NY} && {randconn<{globalconnprob}} && { {mynode} < {sqrtNnodes}*{sqrtNnodes-1} }) //for nodal edge
            conn1dex=i*B23FS_NX/2+j
            conn2dex=j

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + {sqrtNnodes}} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} + {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - {sqrtNnodes}} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} + {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm
        end

        // SW
        randconn = { rand 0 1.0 }

        if ({dexS<B23FS_NY} && {dexW>=0} && {randconn<{globalconnprob}})
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i+1)*B23FS_NX/2+j-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm

        end

        float jnodecalcarg = {mynode}/{sqrtNnodes}

        jnodecalc = {trunc {jnodecalcarg} }

        jnodedex = {mynode} - {sqrtNnodes}*jnodecalc

        if ({dexE==1} && {randconn<{globalconnprob}} && {dexS<B23FS_NY} && { {jnodedex} > 0 }) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i+2)*B23FS_NX/2-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

        //pk if ({dexS==B23FS_NY} && {randconn<{globalconnprob}} && {dexE==1} && { {jnodedex} > 0 }) //for nodal edge corner
        if ({dexS==B23FS_NY} && {randconn<{globalconnprob}} && {dexE==1} && { {jnodedex} > 0 } && { {mynode} < {{sqrtNnodes}*{sqrtNnodes-1}}}) //for nodal edge corner

            conn1dex=i*B23FS_NX/2+j
            conn2dex=B23FS_NX/2-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + {sqrtNnodes} - 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} + {sqrtNnodes} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - {sqrtNnodes} + 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} + {sqrtNnodes} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

        if ( {dexE>1} && {dexS==B23FS_NY} && {randconn<{globalconnprob}} &&{ {mynode} < {{sqrtNnodes}*{sqrtNnodes-1}} } ) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(j-1)

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} + {sqrtNnodes}} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} + {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} - {sqrtNnodes}} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} + {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

        // W
        randconn = { rand 0 1.0 }

        if ({dexW>=0} && {randconn<{globalconnprob}})
            conn1dex=i*B23FS_NX/2+j
            conn2dex=i*B23FS_NX/2+j-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm

        end

        float jnodecalcarg = {mynode}/{sqrtNnodes}

        jnodecalc = {trunc {jnodecalcarg} }

        jnodedex = {mynode} - {sqrtNnodes}*jnodecalc

        if ({dexW==-1} && {randconn<{globalconnprob}} && { {jnodedex} > 0 }) //for nodal edge
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i+1)*B23FS_NX/2-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm
        end

        // NW
        randconn = { rand 0 1.0 }

        if ({dexW>=0} && {dexN>=0} && {randconn<{globalconnprob}})
            conn1dex=i*B23FS_NX/2+j
            conn2dex=(i-1)*B23FS_NX/2+j-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            addmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} RAXIAL {Rgap} Vm
            addmsg /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc} RAXIAL {Rgap} Vm
        end

        float jnodecalcarg = {mynode}/{sqrtNnodes}

        jnodecalc = {trunc {jnodecalcarg} }

        jnodedex = {mynode} - {sqrtNnodes}*jnodecalc

        if ({dexN==-1} && {randconn<{globalconnprob}} && {dexE>1} && { {mynode} >= {sqrtNnodes} }) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(B23FS_NY-1)*B23FS_NX/2+j-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - {sqrtNnodes}} RAXIAL {Rgap} Vm
           //pk  raddmsg@{{mynode} - {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + {sqrtNnodes}} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - {sqrtNnodes}} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

        if ({dexN==-1} && {randconn<{globalconnprob}} && {dexE==1} && { {mynode} >= {sqrtNnodes} } && { {jnodedex} > 0 }) //for nodal edge corner

            conn1dex=i*B23FS_NX/2+j
            conn2dex=(B23FS_NY*B23FS_NX/2)-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - {sqrtNnodes} - 1} RAXIAL {Rgap} Vm
           //pk raddmsg@{{mynode} - {sqrtNnodes} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + {sqrtNnodes} + 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - {sqrtNnodes} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

            if ( {dexE==1} && {dexN>-1} && {randconn<{globalconnprob}} && { {jnodedex} > 0 } ) //for nodal edge

            conn1dex=i*B23FS_NX/2+j
            conn2dex=i*B23FS_NX/2-1

            conn1loc=""
            conn2loc=""

            test1 = { rand 0 8 }
            test2 = { rand 0 8 }

            if ({test1<1})
                conn1loc="distdendNlongf"
            end
            if ({test1>=1} && {test1<2})
                conn1loc="distdendNlongg"
            end
            if ({test1>=2} && {test1<3})
                conn1loc="distdendElongf"
            end
            if ({test1>=3} && {test1<4})
                conn1loc="distdendElongg"
            end
            if ({test1>=4} && {test1<5})
                conn1loc="distdendSlongf"
            end
            if ({test1>=5} && {test1<6})
                conn1loc="distdendSlongg"
            end
            if ({test1>=6} && {test1<7})
                conn1loc="distdendWlongf"
            end
            if ({test1>=7} && {test1<=8})
                conn1loc="distdendWlongg"
            end

            if ({test2<1})
                conn2loc="distdendNlongf"
            end
            if ({test2>=1} && {test2<2})
                conn2loc="distdendNlongg"
            end
            if ({test2>=2} && {test2<3})
                conn2loc="distdendElongf"
            end
            if ({test2>=3} && {test2<4})
                conn2loc="distdendElongg"
            end
            if ({test2>=4} && {test2<5})
                conn2loc="distdendSlongf"
            end
            if ({test2>=5} && {test2<6})
                conn2loc="distdendSlongg"
            end
            if ({test2>=6} && {test2<7})
                conn2loc="distdendWlongf"
            end
            if ({test2>=7} && {test2<=8})
                conn2loc="distdendWlongg"
            end        

            raddmsg /B23FSnet/B23FS[{conn1dex}]/{conn1loc} /B23FSnet/B23FS[{conn2dex}]/{conn2loc}@{{mynode} - 1} RAXIAL {Rgap} Vm
            //pk raddmsg@{{mynode} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{{mynode} + 1} RAXIAL {Rgap} Vm
            raddmsg@{{mynode} - 1} /B23FSnet/B23FS[{conn2dex}]/{conn2loc} /B23FSnet/B23FS[{conn1dex}]/{conn1loc}@{mynode} RAXIAL {Rgap} Vm

        end

    end
end


Loading data, please wait...