SYNETSIM

Software for quantitative realistic modeling of neural networks

Page updated: October 9, 1996

SYNETSIM is a program for simulation of simple neural nets using multicompartmental reprogrammable neurons having realistic cellular properties and second-messenger-mediated modulation thereof.
Descriptions of the program can be found in the following papers:

  • Hartline, D.K. (1989) "Simulation of restricted neural networks with reprogrammable neurons" IEEE Trans. Circuits Systems 36: 653-660
  • Hartline, D.K. (1991) "The neuron as a reprogrammable computing element in neural networks" in Fraser, M., ed., Advances in Control Networks and Large Scale Parallel Distributed Processing Models vol. 1, Ablex, Norwood, NJ pp 58-82.
    This manual describes the use of the software. To retrieve a functioning copy, you must have a copy of Microsoft QuickBASIC 4.5 to compile the source code. Proceed as follows:
    1. Download the source module for the main program SYNETSIM.33B into a text file, strip the HTML material above and below the two rows of "###### ..." and compile a stand-alone .EXE version using QuickBASIC version 4.5.
    2. Download the source module for the net compiler NET2PRM.V18 into a text file, strip the HTML material above and below the "########..." rows and compile a stand-alone .EXE version using QuickBASIC.
    3. Download the auxiliary page SYNETSIM-AUX into a text file and parcel the parts sandwiched between the "xxxxxxx ################# ...." delineations into separate text files named as given by the "xxxxxxx"
    4. You should now have the following files on your DOS disk:
      • SYNETSIM.33B
      • SYNETSIM.EXE
      • NET2PRM.V18
      • NET2PRM.EXE
      • NET2MST.CNF
      • NET2PRM.CNF
      • NET2SBT.CNF
      • SYNTEST.NET
      • SYNTEST.PSP
    5. You should be able to run the test network as follows (see manualbelow):
      • NET2PRM SYNTEST
      • SYNETSIM SYNTEST
    The manual below also contains instructions for loading and running the program from a distribution floppy disk. Please contact the author for further information:
                    ***********************************************
                    *                                             *                  
                    *                                             *
                    *          SYNETSIM 3.3 USERS' MANUAL         *
                    *                                             *                 
                    *                                             *
                    ***********************************************
                                Copyright (C) 1990, 1996 by
                                    Daniel K. Hartline
                                    Bekesy Lab
                                    1993 East-West Rd.
                                    Honolulu, HI 96822
    
    
    
    [interim version; not fully updated; use cautiously!]
    
    
    
    SYNETSIM-3 and this manual were produced under the support of NIH grant 
    NS15314.  NET2PRM was written by Greg Wolodkin, Dept. of Electrical 
    Engineering, Univ. of Maryland, College Park, MD.
         The software may be used without license fees for non-profit 
    scientific or educational purposes only.  Inquiries regarding licensing 
    other applications should be addressed to D. Hartline.
    
    Copyright (C) 1990, D. Hartline
    
    This manual is valid for SYNETSIM 3.3, revision B dated 8/23/90.
    See file READ.ME for updates pertaining to subsequent releases.
                            TABLE OF CONTENTS
    
    I. GENERAL INFORMATION                  APPENDICES                    
         A.  Overview                        I:   Error messages          
         B.  Hardware/Software required      II:  Implementation notes    
         C.  Installation and checkout             Program logic in brief 
         D.  Common problems                       Hodgkin-Huxley branches
         E.  Availability of help                  Synaptic potentials    
         F.  References                            Facilitation           
                                             III: User-generated additions
    II. USING SYNETSIM 3.3                   IV:  Netlist manual          
         A.  Startup                               (by Greg Wolodkin)     
         B.  Main menu                       V:   Input file structures   
         C.  Output                          VI:  SYNTEST.NET             
         D.  End-of-run display              VII: Variable list           
         E.  SYNTEST                         VII: Speed tests             
                                             IX:  Source listing          
    III. MODEL DESCRIPTION
         A.  Netlist structure
         B.  Compartmental representation of branching neurons
              CMPT    - Basic electrical compartment
              SOMA    - Spherical compartment
              CYL     - Cylindrical segment
              INFCYL  - Infinite-cylinder cable termination
    
         C.  Electrical properties
              TRIGR   - Trigger zone simulation
              ELECTN  - Electrotonic connections
              DIODE   - Rectifying electrical connections
              SPIKE   - Schmitt-trigger type spike generation
              COND    - Simple conductance and battery
              DRIVER  - Driver and plateau potentials
              HHFXD   - Hodgkin-Huxley kinetics with fixed time-constants
              HH      - Full Hodgkin-Huxley kinetics
              CONNOR  - Hodgkin-Huxley kinetics for crab axon A-current
              SYNAPSE - Spike-generated chemical synapse
              CHEMOX  - Chemotonic (non-spiking) synapse
    
         D.  Pools, second messengers, and biochemistry
              POOL    - Basic chemical compartment
              POOLK   - Chemical reaction and diffusion kinetics
              POOLX   - Pool-dependent modulation
    
         E.  Other netlist features
              .DEFINE block structure
              .BLOCK block structure
              .BATCH block structure
    
         F.  Data files
              Synaptic transmitter file (*.PSP)
              Save file (*.SAV)
              Output file (*.PRN)
    
    IV.  PROGRAM COMPATIBILITY
    V.   PROGRAM BUGS
    VI.  UPDATES IN 3.0 AND 3.2
    
    
    
    
                                         GENERAL INFORMATION
    
    -->  Persons already familiar with SYNETSIM should read the information in 
    the UPDATES section.  A major addition in version 3.3 and later is the 
    "netlist compiler", written by Greg Wolodkin, which makes setting model 
    parameters much easier than before.
    
    A.  OVERVIEW
    
         The SYNETSIM series of neural network models has been developed for 
    the realistic simulation of small networks of individually distinct 
    neurons using parameters measured from physiological experiment.  Previous 
    models of the series have been limited by certain simplifications made to 
    facilitate derivation of model parameters, or by restrictions on computer 
    memory or speed.  The SYNETSIM-3 versions represent a more advanced and 
    versatile model written in BASIC to run on various microcomputers and 
    capable of simulating a variety of electrical and biochemical integrative 
    properties of neural networks.   
    
         SYNETSIM-3 includes the following design features:
    
         1. Compartmental structure:   The network consists of an array of 
    compartments treated uniformly in model computations.   Each is 
    characterized by a capacitance, a leak resistance, and a leak battery.  In 
    addition, any number of active "branches" may  be included to generate 
    appropriate electrical properties.   Cells are constructed through 
    resistive coupling of appropriate compartments.   Electrotonic connections 
    between cells are generated similarly.  A separate set of "diffusionally" 
    connected compartments, termed "pools", is used for chemical components. 
    
         2.  Current-based representations are used for synaptic interactions, 
    for active responses, and optionally for spike-generating regions.   This 
    improves the physiological accuracy of the simulations compared to 
    voltage-based representations (e.g. SYNETSIM 2.4: Hartline 1987), although 
    deriving parameters is more difficult.
    
         3.  Synaptic interactions, both spike-mediated and non-spiking 
    chemical ("chemotonic") operate through simulation of transmitter released 
    and bound to postsynaptic receptors.  Facilitation/antifacilitation of 
    spike-mediated PSPs is featured.
    
         4.  Active responses, such as plateau potentials and delaying 
    mechanisms are simulated (as in earlier versions) by Hodgkin-Huxley type 
    representations.   Modular branch paradigm coding permits easy addition of 
    user-defined algorithms.
    
         5.  Pools can be used to simulate second messenger systems, trapping 
    of ions in extracellular spaces, and electrogenic pumps, as well as  
    biochemical reaction chains of quite general character.  Modulation of any 
    of the parameters of any compartment can be effected through the pools.  
    This provides much flexibility in the integrative capabilities simulable.  
    
         6.  Intracellular messengers of three kinds are simulated:  a) those 
    produced by voltage-gated processes (e.g.  Ca);   b) those dependent on 
    transmitter (or hormone) binding; and  c) those dependent on other 
    internal messengers  (e.g. internally-released Ca; enzymatically activated 
    pathways).  
    
         7. The model does not directly simulate post-spike integration 
    effects (e.g. branch-point failure).
    
    
    B.  HARDWARE/SOFTWARE REQUIRED
    
         The compiled module of SYNETSIM should run as is on an IBM PC-
    compatible machine having 640K of memory.  Exact memory requirements 
    depend on the particular net being run, but nets are likely to be limited 
    to only two or three cells without extended memory capabilities.  The 
    output requires a graphics board (CGA, EGA or VGA) and monitor configured 
    to operate with BASIC graphics commands (SCREEN x; PSET) [default graphics 
    mode is CGA using SCREEN 2; color capabilities were added to version 3.3B 
    and are more likely to cause problems; they may also cause slowing of 
    execution times].  Note that the compiled version of SYNETSIM requires the 
    Microsoft Run-time module BRUN30, which is protected by Microsoft 
    copyrights.  For even faster execution, you can recompile SYNETSIM.3xx.  
    (QuickBASIC 3 supports a math chip using BRUN3087.EXE; QuickBASIC 4 and 
    4.5 detect the presence of a math chip and use BRUN40.EXE or allow a 
    stand-alone option).  Substantial speed increases can be achieved by 
    compiling with the debug feature deselected.
    
    
    C.  INSTALLATION AND CHECK-OUT (diskette distribution only)
    
         Check to be sure the distribution package is complete.  In addition 
    to this file (SYNETDOC.TXT), the following files should be on the 
    distribution diskette:
          DEMO     - Subdirectory with demonstration modules
          HH.NET        - Net file for Hodgkin-Huxley simulations
          NET2PRM.BAS   - Net-list compiler source code
         @NET2PRM.CNF   - Configuration file for NET2PRM
         @NET2MST.CNF   - Configuration file for NET2PRM
         @NET2SBT.CNF   - Configuration file for NET2PRM
         @NET2PRM.EXE   - Net-list compiler (compiled by QuickBASIC 4.5)
          READ.ME       - Update information on more recent releases, etc.
          SYNETSIM.3xx  - Source program (xx= version number)
         *SYNETSIM.EXE  - A compiled form using Microsoft's QuickBASIC 4.5
         *SYNTEST.MST   - Master file for test run
         @SYNTEST.NET   - Net file for test run
         *SYNTEST.PRM   - Parameter file for test run
         *SYNTEST.PSP   - PSP File for test run
         *SYNTEST.SBT   - Batch file for test run
    
    Copy the "*" files to your logged disk area, then type:
    
       SYNETSIM SYNTEST /B
    
    Press the "Enter" key () when the appropriate prompt appears to test 
    whether the program is operating properly.  The screen should plot out the 
    bursting trajectories shown in the SYNTEST figure at the end of Appendix 
    VI.  To test the net-list compiler, copy the "@" files to your disk and 
    type:
    
       NET2PRM SYNTEST
    
    then proceed as above.  The .MST, .PRM, and .SBT files produced by the 
    compiler should be identical to the ones on the distribution disk.
    
    
    D.  COMMON PROBLEMS
    
    DURING STARTUP
    
         a.  "Subscript out of range in line 495":  Not enough space for the 
    display array.  The space needed can be calculated from:
         (number of compartments) x XSCALE / (TINC x SKIP)
    To retain the same amount of model time without changing the time 
    increment, increase the skip-index to skip more time between plotted 
    points.
    
    DURING RUN
    
         a.  "Overflow":  Time increment too large; reduce it.
    
         b.  Plotted points "blow up" ... going off scale.  Problem may be too 
    large a time increment; also the y-scale value (VSCALE, ISCALE, etc. in 
    the .MASTER section of the net file) may be too small.  
    
    
    E.  AVAILABILITY OF HELP
    
         The file SYNETDOC.TXT [this document] contains documentation for the 
    version of SYNETSIM indicated on the cover page for IBM-PC and AT 
    compatible microcomputers.  This is a program under continual development, 
    so parts have not been fully tested, and reliability is not guaranteed.  
    In case of intractable problems, call the author at (808) 956-8003 (FAX 
    808-956-6984).  Please have hardware and software configuration 
    information available, including:  a) make and model of your computer; b) 
    amount of memory; c) print-out of CONFIG.SYS.  Please assure yourself that 
    GWBASIC works on your system (including PRINT #3, INPUT #3, SCREEN 0, 
    SCREEN 2, and PSET statements) and that neither the compiled 
    (SYNETSIM.EXE) nor the interpreted version (SYNETSIM.3xx) work.  In some 
    cases I may be able to modify the program to fit your particular needs (no 
    guarantees, but I am interested in making it useful to others).  Your 
    suggestions will be appreciated.  A final caution: please note the section 
    PROGRAM BUGS, and please read the file READ.ME for update information not 
    contained herein.
    
    F.  REFERENCES
    
         Hartline, D.K. (1976a) "Simulation of phase-dependent pattern changes 
    to perturbations of regular firing in crayfish stretch receptor."  Brain 
    Res. 110: 245-257.
    
         Hartline, D.K. (1976b) "SNAX: A language for interactive neuronal 
    modeling and data processing." In Brown, P.B., ed, Computer Technology in 
    Neuroscience, Hemisphere, Washington, D.C. pp. 41-65.
    
         Hartline, D.K. (1979) "Pattern generation in the lobster (Panulirus) 
    stomatogastric ganglion.  II.  Pyloric network simulations."  Biol. 
    Cybern. 33: 223-236.
    
         Hartline, D.K. (1987) "Modeling stomatogastric ganglion" in 
    Selverston, A.I. and Moulins, M., eds The Crustacean Stomatogastric 
    System, Springer-Verlag, Berlin, pp 181-197
    
         Hartline, D.K. (1989) "Simulation of restricted neural networks with 
    reprogrammable neurons" IEEE Trans. Circuits Systems 36: 653-660 
    
         Hartline, D.K.(1991) "The neuron as a reprogrammable computing 
    element" in Fraser, M., (ed) Advances in Control Networks and Large Scale 
    Parallel Distributed Processing Models, Ablex, Norwood N.J. pp. [in press]
    
    
    II.                           USING SYNETSIM 3.3
    
    
    A.   STARTUP
         Running this version of SYNETSIM is a two-step process.  First, the 
    "netlist" (.NET) file, specifying the properties and connections of the 
    neural network to be simulated must be compiled using the program 
    NET2PRM.EXE.  This generates three output files with default extensions of 
    PRM, MST, and SBT.  The .PRM (parameter) file contains parameters for 
    properties and connections; the .MST (master) file contains parameters 
    related to the running of the model (integration time step, x and y 
    scales, colors, etc.); the .SBT (SYNETSIM batch) file allows for batch-
    like operation of the various menu options at run-time.  After compilation 
    of the netlist, SYNETSIM.EXE is run to perform the actual simulation.  
    After invoking SYNETSIM, the screen should display parameters from the 
    master file, then loading of PSPs (if any), and ending up with:
    
         "HIT ANY KEY TO CONTINUE"
    
    Doing so leads to the main menu (in batch mode, a sequence of menu options 
    will be executed: see BATCH OPERATIONS below):
    
    
    B.   MAIN MENU
    
    (NO .PRN)
      = RETURN TO DOS
         1= FREE_RUN - Run model with no further perturbations
         2= I_PULSEs - 2-pulse current injection paradigm
         3= PSP_TRAIN - Fire spike train in presynaptic cell
         4= Voltage clamp of a compartment [--> submenu]
         5= POOL INCrement - Change level of a selected pool
         6= TOXINS - Enable/disable specific branch types
         7= Initiate batch mode
         8= CHANGE_PARAMeters - Change selected model parameters
         9= OUTPUT_PRN - Write model output to disk on next sweep
        10= SAVE the model state state on a disk file
        11= RESTORE previous model state from disk file
        12= CHANGE_DISPLAY to output new state variable
        13= Options [--> submenu]
    ?
         Respond to this according to the following list of desired model 
    actions (names of parameters for menu-driven and .BATCH operation are 
    given in caps; names with "*" in left margin can be netlist names in  
    driven operation)
    
         SELECTION 1 (Free_run) will run the main network without perturbation 
    for several sweeps, plotting the display-variable (default = membrane 
    potential; changeable with selection 12).  It is often a good idea to run 
    the model for several sweeps to allow transients associated with non-
    initialized variables to decay.
         NSWEEPS = Number of sweeps to be made before returning to menu.
    
         SELECTION 2 (I_pulse) applies a sequence of two current pulses to any 
    compartment: a "conditioning" pulse of arbitrary size and duration, 
    followed by a test pulse of arbitrary size and duration.  It will also 
    apply a bias current that persists through subsequent sweeps.  The program 
    will prompt you for the compartment to be perturbed, the magnitude of the 
    bias current (in nA: see section Model Units below), the magnitudes of the 
    conditioning and test pulses, and the durations of same (time to be 
    specified in seconds).  Type the parameters on one line separated by 
    commas.  The conditioning pulse will start with no delay at the beginning 
    of the sweep.
    *    CMPT      =    Compartment ID to which pulse is to be applied;
         BIAS      =    Bias current to be applied throughout;
         COND_I    =    Conditioning pulse magnitude;
         COND_DUR  =    Duration of conditioning pulse (sec);
         TEST_I    =    Test pulse magnitude;
         TEST_DUR  =    Duration of test pulse (sec).
    
         SELECTION 3 (PSP_train):  This will produce a train of spikes of 
    specified frequency and duration (following a specified delay) in any unit 
    desired.
    *    SPKFLG    =    Spike flag ID for presynaptic spike;
         RATE      =    Stimulation rate for presynaptic unit;
         DELAY     =    Delay from beginning of sweep to start of PSP train;
         DURATION  =    Duration of presynaptic train (sec).
    
         SELECTION 4 (voltage clamp):  This will clamp one specified 
    compartment as indicated by a submenu:
      1 = HOLD - to a given hold potential for a specified number of sweeps.
    *         CMPT      =    Compartment clamped;
              HOLD_V    =    Hold potential;
              NSWEEPS   =    Number of sweeps hold will be applied;
              SAVFILE   =    Name of file to save final model state.
    
      2 = VC_CT - gives conditioning and test clamp commands as in Selection 
    2.  
                  The display for the specified compartment indicates clamp 
    current, 
                  rather than voltage. 
    *         CMPT      =    Compartment clamped;
              COND_V    =    Conditioning pulse level (abs mV);
              COND_DUR  =    Duration of conditioning pulse (sec);
              TEST_V    =    Test pulse level (abs mV);
              TEST_DUR  =    Duration of test pulse (sec);
              HOLD_V    =    Hold potential to be returned to after test.
    
      3 = IV - gives runs of the condition/test type, systematically stepping 
    through a set of 
                  test values, then changing the conditioning level and 
    rerunning.  
                  Current at the end of each test pulse is stored in a .IV 
    file.
    *         CMPT      =    Compartment clamped;
              COND_V    =    Conditioning pulse level (abs mV);
              COND_DUR  =    Duration of conditioning pulse (sec);
              COND_STEP =    Increment size for conditioning pulses (mV);
              NCOND     =    Number of conditioning pulses (minimum is 0);
              TEST_V    =    Test pulse level (abs mV);
              TEST_DUR  =    Duration of test pulse (sec);
              TEST_STEP =    Increment size for test pulses (mV);
              NTEST     =    Number of test pulses (minimum is 1);
              SAVFILE   =    .SAV File holding initial state;
              IVFILE    =    File for storage of I(V) output.
    
    
    
         SELECTION 5 (Pool_inc):  This permits the abrupt increment of any 
    pool, permitting the effects of that pool by itself to be examined.
    *    POOL =    ID of pool to be incremented;
         INC  =    Increment
    
         SELECTION 6 (Toxins) allows control of which physiological properties 
    are enabled.  It functions like a set of specific toxins for particular 
    property types.  Any property ("branch type" ... see below) except the 
    principal compartment type can be blocked by giving the property mnemonic 
    code and answering "B" to the input request (answer "U" to unblock a 
    previously blocked property). 
         CODENAME  =    Name of property to be blocked;
         FLAG      =    B or U for blocked or unblocked
    
         SELECTION 8 (Change_param):  Model parameters are specified by a 
    branch code [WHICH AT THIS POINT MUST BE NUMERIC RATHER THAN MNEMONIC], a 
    branch number, and a parameter number.  For interaction parameters (codes 
    3 and 21), the branch and parameter numbers are replaced with the numbers 
    of the two compartments or pools between which the interaction takes 
    place. [.BATCH mode operation of this has not yet been implemented]
    
         SELECTION 9 (Output_prn): is used to activate output to disk for one 
    sweep.  The status display "(NO .PRN)" on the main menu will change to 
    "(.PRN OUTPUT)" when this option is active.  Answer the next query with 
    the name of a disk file, which may include a drive\directory 
    specification, but must not include an extension (see OUTPUT below).  A 
    second use of selection 9 before an output run will cancel the output 
    mode.
         PRNFILE   =    Output file name (.PRN will be added as extension)
    
         SELECTIONS 10 and 11 (Save; Restore): allow storing and recalling the 
    model state (all state variables and the PSP summation array).  This 
    allows saving a state just prior to a manipulation, so that several 
    parameters in the manipulation can be tested if desired.  Note that the 
    model must already have the appropriate .MST, .PRM, and .PSP files in 
    memory. 
         SAVFILE   =    Save-file name (.SAV extension must be specified)
    
         SELECTION 12 (Change_display):  allows changing which state variables 
    are plotted on the screen, or written to the output .PRN file, if the 
    latter option has been selected.  The default option is compartment 
    membrane potential (V).  The menu selection first asks for the mnemonic 
    code for the branch-type of the state variable desired (e.g. "CMPT"), then 
    for the mnemonic for the state variable (same as the variable name given 
    in the parameter file block of the Model Description section)[UNTESTED]
         
         SELECTION 13 (Options):  The following options may be elected
    through this selection (the assignment FLAG=ON or FLAG=OFF is used in 
    BATCH operations):
         1= TIME_RESET - Sets U-variable [time] for reset/no reset at 
    beginning of sweep.
         2= BELL - Turns bell on/off (beeps at end of sweep, for slow models).
         3= ZERO_LINE - Turns y=zero axis plot on/off.
         4= SPIKE_TIC - Turns spike plot on/off
         5= Y_OFFSET - Permits the y-offset of the plot to be changed
              OFFSET = offset in mV (no FLAG)
         6= DEBUG_MODE - Activates/inactivates a debug mode
              NSWEEPS = the number of sweeps in .BATCH mode
    
         Following menu selections 5 and above, the model program returns to 
    the main menu and waits for another selection.  Following menu selections 
    1-4, the model will plot membrane potential (or another selected display 
    variable), along with spikes fired, for one (or in some cases more) sweep, 
    before returning to Main Menu.
    
    
    C.   OUTPUT
    
         To screen:  
         Normal output is a screen plot of a Plot Variable, initially membrane 
    potential (for each compartment), and modifiable by Selection 12 
    (=CHANGE_DISPLAY in the netlist .BATCH block) of the Main Menu.  Colors 
    can be used with screens supporting graphics mode 9 by setting GMODE=9 in 
    the .MASTER block of the netlist (see MASTER BLOCK below).  In the absence 
    of color or screen specification, SYNETSIM defaults to CGA (graphics mode 
    2) format.  Note that the model may run a lot (e.g. 2x) slower in these 
    alternate screen modes!
    
         To printer:
         If the "PRINT" option is active, parameters of the run will be listed 
    on the printer operated by BASIC's LPRINT statement.   Activation is via 
    menu item 13, or setting PRINT=ON in the .BATCH block, or setting PRINT=-1 
    in the .MASTER block.
    
         To .PRN and .SPK files:
         If output to disk is selected using main menu item 9 (=OUTPUT_PRN in 
    and the extensions ".PRN" and ".SPK".  The .PRN file will contain Lotus 1-
    2-3 compatible data columns.  The first column is model time.  The 
    subsequent columns are the display-parameter variables from selection 12 
    (if not left as membrane voltage).  The file can be read directly into a 
    Lotus worksheet (using the "Import/Numbers" operations) and plotted using 
    the usual Lotus facilities.
         The .SPK file contains two columns, Time a spike fired and Unit # 
    firing.
    
    
    D.   END-OF-SWEEP DISPLAY
    
         At the end of the run (if not in batch mode), a "SWEEP COMPLETE:   
     TO MAIN MENU" message appears.  At this point, the cursor keys (and 
    the Word-Star cursor control cluster of ^E, ^S, ^F, ^X, ^A, ^F) are 
    active, and permit positioning a cursor on any point of any trace.  Use 
    the up-down arrows to switch between traces.  Hold  key down with 
    right or left arrow to make larger jumps.  The  key (or ^V) toggles 
    between the first cursor and a second one.  Y and T values for both 
    cursors are displayed at the upper left of the screen; differences between 
    the two cursor values in Y and T are shown at the right.  The cursors are 
    useful for making small numbers of quantitative measurements on model 
    output without having to write large files to disk.  Type  to return 
    to main menu.
    
    
    III.                         MODEL DESCRIPTION
    
         SYNETSIM models a set of "Compartments" each composed of "Branches" 
    and "Pools".  Branches correspond to physiologically identifiable 
    contributions to the conductance and to the ionic current of a compartment 
    (i.e. its electrical properties).  Pools deal with biochemical and 
    modulatory properties.  The various types of branches, pools, and certain 
    interactions are given "Branch Codes" Except for the "Principal Branch" 
    (Code "CMPT" [1], specifying basic parameters for a given compartment: 
    capacitance, leak battery and leak conductance), there is no limit to the 
    number of branches of a particular type that can be associated with a 
    given compartment.  The following describes the characteristics of each of 
    the branches, pools, or interactions, then describes how to specify 
    necessary parameters in the netlist file 
    A.  NETLIST STRUCTURES
    
         The first step in creating a network is producing a netlist file 
    (.NET extension) which describes the network desired.  This file is then 
    compiled using the compiler NET2PRM and run as described in the STARTUP 
    section above.  The netlist contains several sections: a parameter block 
    and a DEFINE block, consisting of component declaration lines which 
    generate a parameter file (.PRM extension); a MASTER block and a BLOCK 
    block, which generate a master file (.MST extension); and a  BATCH block, 
    which generates a batch file (.SBT extension).  Only the parameter and 
    master blocks are mandatory.  These are described briefly in this section, 
    and the remaining block types are discussed later under SPECIAL NETLIST 
    FEATURES.  Details of the netlist are given in Appendix IV and of each of 
    the input files in Appendix V.
    
    PARAMETER BLOCK
           The first line of the netlist file is a text identifier (enclosed 
    in quotes).  What it contains is arbitrary, but it might be used to 
    identify the run characteristics.  Following are lines laying out the 
    network structure, cell by cell, with properties belonging to a given cell 
    grouped with that cell. 
         The following netlist (plus a MASTER block described later) specifies 
    two single-compartment cells ("Drivr" and Follower"), each with a spike-
    generating trigger zone.  The Drivr cell bursts endogenously through a 
    repetitive driver potential property, and it inhibits the follower with a 
    spike-mediated chemical synapse.  There is also a non-rectifying 
    electrotonic connection between Drivr and Follower (this netlist has been 
    written with several lines for each parameter set to keep them on the 
    page; in practice, only one line for each property is permitted; a less 
    cumbersome method for assigning property parameters is described in the 
    
    "Demo netlist"
    'Code Name                Parameters                        Connections
    CELL Drivr
     CMPT One     (C=.005 RP=-50 GL=.2) 
      TRIGR       (E0=0 TAUM0=0.04 PMTHR=0 KPM=2 TAUPM=.25 
    +              KA1=0.3 TAUA1=0.5 TAUA2=5.8 THRINF=4 
    +              TAUTHR=.004 DV0=-4 MAXV=-4 DTHR0=5 
    +              MAXTHR=5)
      DRIVER      (VNA=40 GBARNA=.5 V0NA=-40 MUNA=5 VK=-90 
    +              GBARK=.5 V0K=-40 MUK=5 GBARK1=.36 TAUK1=.4)
    
    
    
    '          
    CELL Follower
     CMPT One     (C=.005 RP=-50 GL=.2) 
      TRIGR       (E0=0 TAUM0=0.04 PMTHR=0 KPM=2 TAUPM=.25 
    +              KA1=0.3 TAUA1=0.5 TAUA2=5.8 THRINF=4 
    +              TAUTHR=.004 DV0=-4 MAXV=-4 DTHR0=5 
    +              MAXTHR=5)
      HHFXD       (VEQ=-90 GBAR=100 QM=1 V0M=-35 MUM=4
    +              TAUMA=.005 QH=1 V0H=-70 MUH=-5 TAUH=.04)
      ELECTN      (GC=.1)                                     Drivr/One
      SYNAPSE     (VREVS=-75 GAMMA=0.06 KDS=1 PSPSHP%=1       
    +              DLY=.003 A0S=.1 TAUF=0)                    Drivr/One/TRIGR
    
         As can be seen from this example, each cell is declared with a CELL 
    reserved word, followed by a name.  All components following pertain to 
    that cell until the next CELL declaration, or until a terminating code 
    (e.g. .MASTER) is encountered.  A series of property declaration lines 
    follows (continuation lines must start with a "+"; total number of 
    characters in a declaration is 256).  Each has three fields: the code 
    field, the parameter field, and the connection field.  
         Code field:  contains one of the standard (reserved word) names of 
    branch types, as presented in the next section (e.g. CMPT, TRIGR, DRIVER).  
    In the cases of CMPT (as for CELL) there is an additional mandatory name 
    field after the code field (in other cases, the name, if needed, is 
    appended to the code field with a "/").
         Parameter field:  contains parameter asssignments.  Parameter 
    assignments are indicated with "=" and those for different parameters are 
    separated with spaces (not commas).  The assignment segment is enclosed in 
    ().  This format is intended to follow the SPICE simulation conventions.  
    The order in which parameters are given does not matter, but any parameter 
    not assigned will be given a value of 0.
         Connection field:  contains sources of input from or output to other 
    compartments or branches.  If the connection deals with a compartment, 
    only the full compartment name (including cell name) need be given (e.g. 
    the ELECTN electrotonic connection above).  If it deals with a specific 
    property (such as the trigger zone in the SYNAPSE above), it must include 
    the name of the cell AND the property (if there are more than one copies 
    of a property-type in one compartment, they must be given unique names in 
    their declaration lines [e.g. TRIGR/One and TRIGR/Two] and the appropriate 
    one referenced by this name in the connection field).
    
    MASTER BLOCK
         The following aspects of the model are determined by assignments made 
    in a master block within the netlist, and reflected in entries made in the 
    master file (.MST extension):
    
    PRMFILE   =    Name of Parameter File (less .PRM extension)
    PSPFILE   =    Name of PSP File (less ".PSP") [defaults to "NONE"]
    BATFILE   =    Name of batch file (less ".SBT") [defaults to "NONE"]
    XSCALE    =    Full-scale X-axis value for screen plot (sec)
    VSCALE    =    Full-scale Y-axis value for voltage plot (mV)
    ISCALE    =    Full-scale Y-axis value for current plot (nA)
    GSCALE    =    Full-scale Y-axis value for conductance plot (umho)
    KSCALE    =    Full-scale Y-axis value for rate & binding constant plots
    PSCALE    =    Full-scale Y-axis value for pool level plot.
    Y0        =    Vertical offset for plotted horizontal axis line
    TINC      =    Integration time increment (in sec) [typical: .001]
    SKIP      =    Plot skip index (point-plotting interval: 1=none skipped)
    PSPDM     =    PSP duration multiplier (normally=1): scales time course
    PSPL      =    Length of PSP table (PSPTB) [typical: 500]
    SUMTBL    =    Length of PSP summation table (SUMTB) [typical: 500]
    SPKHT     =    Spike height (vertical line drawn when spike fired, in mV)
    ADPFLG         Set = -1 to elect y=KA(E-sum A) tz option (else yinf=KA*E)
    PF             Set = -1 to print run protocol on printer, otherwise 0
    ZPF            Set = -1 to plot zero line (axis), otherwise set = 0
    SPF            Set = -1 to plot spikes, otherwise set = 0
    
    The master block is indicated by a .MASTER code followed by a "(", and it 
    need not be contained on a single line.  Continuation lines must start 
    with a "+".  The block ends with a ")".  Except for file names, parameters 
    omitted from the master block default to 0.  PRMFILE defaults to the same 
    name as the netlist file.  PSPFILE and BATFILE default to "NONE".   An 
    example follows which if added to the end of the parameter block above 
    will allow a net to be compiled by NET2PRM and run by SYNETSIM which 
    serves to illustrate various points covered so far:
    
    '
     .MASTER (PSPFILE=syntest XSCALE=1 VSCALE=200 ISCALE=2000 GSCALE=10
    +        KSCALE=1000 PSCALE=5 Y0=50 TINC=0.001 SKIP=5 PSPDM=1 PSPL=500
    +        SUMTBL=500 SPKHT=40 ADPFLG=1 ZPF=-1 SPF=-1)
     .END
    
    
    B.   REPRESENTATION OF BRANCHING NEURONS
    
         Several reserved-word codes in a NET2PRM netlist generate parameter 
    lines in the .PRM file appropriate for the compartmental representation of 
    branching neurons:
    
    CMPT - Basic electrical compartment
         The basic electrical unit in the model is a compartment, consisting 
    of a capacitance, a resting potential, and leak conductance.  The 
    parameters are set in the netlist using the following designations:
    
    C    -    Capacitance of compartment (in uf)
    VLK  -    Leak battery (mV absolute, e.g. -65)
    GL   -    Leak conductance (e.g. umho; units of C/GL = sec)
    
    The netlist line:
    
    CELL A
     CMPT Name (C=.002 RP=-50 GL=.2)
    
    Will generate a compartment with a capacitance of 2 nf (.002 uf; see 
    section MODEL UNITS for discussion of units used by SYNETSIM), a leak 
    battery of -50 mV, and a leak conductance of 0.2 umho.  Alternatively, the 
    same compartment could be generated with the line:
    
    CELL A
     CMPT Name (C=.002 RP=-50 GAMMA=.1)
    
    where GAMMA is the leak conductance density in mmho/uf.  In general, any 
    trans-membrane conductance can be given either as a straight conductance 
    (in umho) or as a density (in mmho/uf).  In the latter case, the density 
    is multiplied by the capacitance (in uf) to obtain the actual value for 
    that conductance.
    
    SPHERE - Spherical compartment
         Instead of calculating compartment parameters for certain common cell 
    geometries, NET2PRM will make the calculations and produce appropriate 
    compartment parameters.  For a spherical structure, such as a soma, the 
    code SPHERE, followed by the following parameter assignments will effect 
    this:
    
    DIAM -    Soma (e.g.) diameter (in microns)
    RHOM -    Specific membrane resistance (ohm-cm2)
    FOLD -    Infolding ratio (ratio of capacitance to that of equivalent 
    sphere)
    RP   -    Resting potential (as in CMPT)
    
    The lines:
    
    CELL A
     SPHERE SOMA (DIAM=100 RHOM=50000 FOLD=2 RP=-50)
    
    is compiled into compartment parameters equivalent to a sherical soma with 
    diameter 100u, a membrane resistivity of 50kohms-cm2, an infolding ratio 
    of 2.0 and a resting potential of -50mV.  The compartment is named 
    "A/SOMA".
    
    CYL - Cylindrical segment
         As for a sphere, a compartment with parameters representing a 
    cylindrical segment of membrane can be generated with the code CYL and the 
    parameter assignments:
    
    L    -    Length of cylinder (e.g. axon or dendrite; in microns)
    DIAM -    Cylinder diameter (in microns)
    RHOM -    Specific resistance of membrane (ohm-cm2; as in SPHERE)
    RHOI -    Specific resistance of cytoplasm (ohm-cm)
    FOLD -    Infolding ratio (as in SPHERE)
    RP   -    Resting potential (as in CMPT)
    
         Compartments may be strung together using electrical connections to 
    produce branching cables or electrotonically-connected cells.  Regular 
    compartments must use the ELECTN code (see below), but cylinders may 
    (though they need not) be connected to other compartments using the 
    connection field.  Thus the lines:
    
    CELL A
     SPHERE SOMA (DIAM=100 RHOM=50000 FOLD=2 RP=-50)
     CYL    X    (L=100 DIAM=10  RHOM=50000 RHOI=70 FOLD=2 RP=-50)   A/SOMA
    
    specify a cylindrical segment (named "X") connected to a sphere ("A/SOMA" 
    in the connection field gives the name of the compartment to which the 
    connection is made), and the lines:
    
    CELL A
     SPHERE SOMA (DIAM=100 RHOM=50000 FOLD=2 RP=-50)
     CYL    X    (L=100 DIAM=10  RHOM=50000 RHOI=70 FOLD=2 RP=-50)   A/SOMA
     CYL    Y    (L=100 DIAM=5   RHOM=50000 RHOI=70 FOLD=2 RP=-50)   A/X
     CYL    Z    (L=100 DIAM=5   RHOM=50000 RHOI=70 FOLD=2 RP=-50)   A/X
    
    specify the same configuration with the addition of two cylindrical 
    segments, Y and Z, branching off of segment X.  
         CYLinders are constructed so that half of their longitudinal 
    resistance is on the the proximal side of the compartment, and half on the 
    distal side (i.e. compartment parameters are associated with the midpoint 
    of the cylinder).  Two important restrictions result:
    
         1. Only one explicitly-specified connection is permitted per 
    cylinder.  This means that connections in branching trees are specified at 
    the proximal ends of cylindrical segments only.  For connections at the 
    distal ends, the connection fields of other cylinders are used.
    
         2.  No more than three cylinders may join at a branch point.  This 
    means, for example, that in the last case above, no more cylinders could 
    be attached to cylinder X.  This is because a "Y-to-Delta" transform is 
    necessary to properly link cylindrical compartments, and NET2PRM can only 
    handle the simplest case.  If multiple branches are needed from a single 
    point, short cylindrical pieces can be inserted between three-way 
    junctions, or appropriate values for standard CMPT compartments can be 
    calculated for the particular configuration needed.
    
    INFCYL - Infinite-cylinder cable termination
         A CYLinder with no entries in the connection field will have an 
    infinite termination resistance.  The COND code (see below), used as one 
    of the components of the compartment, can provide other termination 
    conductances.  Alternatively, the INFCYL code generates a COND code 
    appropriate to an infinite cylinder of specified characteristics.  Thus in 
    the previous example, the final lines:
    
     CYL    Z    (L=100 DIAM=10  RHOM=50000 RHOI=70 FOLD=2 RP=-50)   A/X
      INFCYL           (DIAM=10  RHOM=50000 RHOI=70 FOLD=2 RP=-50)
    
    provides a termination conductance appropriate to an infinitely extended 
    cable of the same diameter as the compartment.  Note that there is no 
    connection field for INFCYL, since it is only a branch circuit on 
    compartment Z defined in the previous declaration line.
    
    
    B.   ACTIVE ELECTRICAL PROPERTIES
    
         Special electrical branches provide characteristic electrical 
    properties for neurons.  Among the cellular properties so represented are 
    various types of active conductances and simplified repetitive firing 
    characteristics (trigger zone kinetics).  Among various types of 
    interactions between cells or compartments are resistive coupling 
    ("electrotonic"), spike-mediated chemical synaptic coupling, and non-spike 
    chemical ("chemotonic") coupling.
    
    CODE "COND"  - Fixed conductance  (Numerical code 7)
         This branch type gives a fixed conductance in series with a fixed 
    EMF.  Its intended purpose is to serve as a terminating conductance for 
    cables and as a target of modulation by the pools, as in simulating 
    second-messenger-mediated PSPs.
    
         Parameter-field names are:
    VCOND          EMF
    GCOND          Conductance
    GAMMA          Capacitance-normalized conductance
    
    As described under the CMPT code, any transmembrane conductance can be 
    given either as an absolute conductance (G) or as a capacitance-normalized 
    conductance (GAMMA).  Only one of the two should be assigned in the 
    netlist.  Example:
    
    CELL A
      SPHERE SOMA   (DIAM=100 RHOM=50000 FOLD=2 RP=-50)
      COND   TARGET (VCOND=-75 GCOND=0)
    
    could be a target conductance used to produce a 2nd-messenger-dependent 
    IPSP with a reversal potential of -75 mV (GCOND would be modulated by a 
    second messenger represented by a pool, as described below).
    
    
    CODE "DRIVER" - Driver-potential kinetics (Numerical code 8) 
         This code generates active plateau-potential kinetics based on a 
    time-independent mixed "Na-K" conductance with sigmoidal voltage-
    dependence for activation, and two slowly changing voltage-dependent K 
    ("restoring") conductances.  The voltage-dependence has the form:
    
              ginf = gbar / (exp(-(V-Vo)/mu) + 1)      (8.1)
    
    where ginf is the steady-state conductance, gbar is the maximum 
    conductance, Vo is the half-activation voltage for the sigmoid and mu is 
    the "characteristic" voltage, defining 1/(1+e) = .27 of the full value.  
    The time-dependence has the form:
    
            dg/dt = (ginf - g)/tau                         (8.2)
    
    where tau is a first-order time-constant.
    
            Parameter field:
    VNA      Sodium (or other inward current) reversal level
    GBARNA       Maximum sodium conductance
    GAMMA        Normalized sodium conductance
    V0NA         Sodium half-activation voltage
    MUNA         Sodium activation characteristic voltage
    VK           Potassium (or other outward current) reversal level
    GBARK        Maximum potassium conductance
    GAMMAK       Normalized potassium conductance
    V0K          Potassium half-activation voltage
    MUK          Potassium activation characteristic voltage
    GBARK1       Restoring conductance-1 maximum conductance
    GAMMAK1      Normalized maximum conductance-1
    TAUK1        Restoring conductance-1 time constant
    GBARK2       Restoring conductance-2 maximum conductance
    GAMMAK2      Normalized maximum conductance-2
    TAUK2        Restoring conductance-2 time constant
    
    
    CODE  "HHFXD" - HH fixed-tau kinetics    (Numerical code 9)
         Hodgkin-Huxley conductances with voltage-independent time constants.  
    For this, the activation gating variable, m, and the inactivation 
    variable, h, (instead of conductance) obey Eq. 8.1 and 8.2.  The 
    conductance is then related to the gating variables in the usual way:
    
              g = gbar * m^Qm * h^Qh                       (9.1)
    
    
         Parameter field:
    VEQ       Active current reversal level
    GBAR      Active current maximum conductance
    GAMMA     Normalized maximum conductance
    QM        Active current activation exponent
    V0M       Active current half-activation voltage
    MUM       Active current activation characteristic voltage
    TAUMA     Active current activation time constant
    QH        Active current inactivation exponent
    V0H       Active current half-inactivation voltage
    MUH       Active current inactivation characteristic voltage
    TAUH      Active current inactivation time constant
    
    
    CODE "HH"  - Full HH kinetics (Numerical code 10)     Hodgkin-Huxley type 
    conductances with all features, based on the differential equation for the 
    gating particle, x: 
    
              dx/dt = alpha (1 - x) - beta x               (10.1)
    
    in which the voltage-dependence of both alpha and beta can be described by 
    an equation of the form: 
    
              alpha= (a +b(V+c))/(exp(-(V+c)/d) + e)       (10.2)
    
    where a,b,c,d, and e are constants.  Rate constants calculated by 10.2 are 
    multiplied by a scale-factor, KTEMP, to adjust for temperature.
    
         Parameter field:
    VEQHH        Reversal potential (Na=55mV; K=-72; Lk=-49.387)
    GBARHH       Maximum conductance 
    GAMMA        Normalized maximum g (Na=120 mmho/uf; K=36; Lk=.3)
    KTEMP        Rate-constant scale factor for temperature
    QMHH         Exponent for activation gate (Na = 3; K = 4)
    QHHH         Exponent for inactivation gate (Na = 1; K = 0)
    AAM, BAM, CAM, DAM, EAM         Constants a,b,c,d,e for alpha-m
    ABM, BBM, CBM, DBM, EBM         Constants a,b,c,d,e for beta-m
    AAH, BAH, CAH, DAH, EAH         Constants a,b,c,d,e for alpha-h
    ABH, BBH, CBH, DBH, EBH         Constants a,b,c,d,e for beta-h
    
    For the Hodgkin-Huxley (1952) squid axon (6.3 degrees C, resting potential 
    = -60), these constants are (for rates in 1/sec):
       a       b       c       d      e     for Sodium
       0    -100      35      10     -1     alpha-m
    4000       0      60     -18      0     beta-m
      70       0      60     -20      0     alpha-h
    1000       0      30      10      1     beta-h
    
                                            for Potassium
       0     -10      50      10     -1     alpha-n
     125       0      60     -80      0     beta-n
    
         The netlist realization of a 1 nf compartment of squid membrane would 
    be:
    
    CMPT SQUID     (C=.001 RP=-49.387 GAMMA=0.3) 
      HH  SODIUM    (VEQHH=55 GAMMA=120 KTEMP=1 QMHH=3 QHHH=1 
    +                   AAM=0 BAM=-100 CAM=35 DAM=10 EAM=-1
    +                   ABM=4000 BBM=0 CBM=60 DBM=-18 EBM=0 
    +                   AAH=70 BAH=0 CAH=60 DAH=-20 EAH=0
    +                   ABH=1000 BBH=0 CBH=30 DBH=10 EBH=1)
      HH  POTASSIUM (VEQHH=-72 GAMMA=36 KTEMP=1 QMHH=4 QHHH=0 
    +                   AAM=0 BAM=-10 CAM=50 DAM=10  EAM=-1 
    +                   ABM=125 BBM=0 CBM=60 DBM=-80 EBM=0) 
    
    Note that parameters with 0 value would not have to have been explicitly 
    specified, this being the default value.  In fact, those for potassium 
    inactivation have been omitted to achieve this end.
    
    
    Code CONNOR - Special A-current kinetics (Numerical code 13)
         Connor, Walter, and McKown (1977: Biophys. J. 18: p102) give somewhat 
    different empirical equations for A-current activation and inactivation 
    kinetics:
    
    For steady-state gating particle concentrations (x):
    
         xinf = (a exp [(V+b)/c]/{1+exp[(V-Vo)/mu]})q   (13.1)
    
    For gating particle time-constants:
    
         tau = tauo + a'/{1+exp[(V-Vo)/mu']              (13.2)
    
    Time constants are divided by a temperature coefficient.  The forms of the 
    equations are the same for both activation and inactivation except that 
    the numerator of 13.1 = 1 for inactivation.  The exponent, q, has the 
    values:
    
         qm = 1/3 = 1/QMC for activation and
    
         qh =  4  = QHC for inactivation.
    
    Conductance is given by:
    
         g = gbar mQMCh                                     (13.3)
    
    
         Parameter field:
    VEQCON                             A reversal level
    GBARCON                            A maximum conductance
    GAMMA                              Normalized maximum conductance
    KTEMPC                             Temperature factor
    QMC                            A-activation exponent
    MCA, MCB, MCC, V0MC, MUMC          Constants for minf3
    TMC0, TMCA, V0TM, MUTM             Constants for taum
    QHC                                A-inactivation exponent
    V0HC, MUHC                         Constants for hinf
    THC0,THCA,V0TH,MUTH                Constants for tauh
    
         The values given in Connor et al (1977) for crab axon at 18oC 
    translated into netlist format are:
    
    CONNOR (VEQC=-75 GAMMA=47.7 KTEMPC=1 QMC=3 
    +          MCA=76.1 MCB=94.22 MCC=31.84 V0MC=-1.17 MUMC=28.93
    +          TMC0=.0003632 TMCA=.001158 V0TM=-55.96 MUTM=20.12 
    +          QHC=4 V0HC=-53.3 MUHC=14.54 
    +          THC0=.00124 THCA=.002678 V0TH=-50 MUTH=16.027)
    
    
    D.   GRADED INTERACTIONS
    
         These are interactions between cells or between parts of the same 
    cell in which the strength of the effect felt is smoothly graded as a 
    function of the force (membrane potential) driving the interaction.
    
    CODE "ELECTN" - Electrotonic interactions  (Numerical code 3)
         This code type specifies two compartments which are resistively 
    coupled by a bi-directional coupling conductance.  These use the current-
    based equations:
    
              I(i,j) = gc(i,j)[V(j)-V(i)]                  (3.1)
    
    where I(i,j) is the current into compartment i from compartment j, V(i) is 
    the membrane potential of compartment i, and gc(i,j) is the coupling 
    conductance.  These are summed with other sources of current to charge the 
    membrane capacitance.  The parameter field has only one parameter, GC, the 
    coupling conductance (in umho).  To specify a coupling between two 
    compartments (code CMPT) in a netlist, one is arbitrarily chosen as the 
    "postjunctional" compartment, and the code line placed within the domain 
    of that compartment.  The "prejunctional" compartment name should then 
    appear in the connection field.  Thus the lines:
    
    CELL A
     CMPT X  (C=.002 VLK=-50 GL=.2)
    CELL B
     CMPT Y  (C=.001 VLK=-60 GL=.1)
      ELECTN (GC=.2)                    A/X
    
    couples the two compartments X and Y with a conductance of .2 umho.
    
    
    CODE "DIODE" - Rectifying electrical connection (Numerical code 4)
         This code functions much the way the previous one does, but the 
    coupling is unidirectional.  Current flows from prejunctional to 
    postjunctional compartment only if the membrane potential in the 
    prejunctional compartment is more positive (depolarized) than that in the 
    postjunctional one.  Its method of specification is the same as for 
    bidirectional electrotonic connections.
    
    
    CODE "CHEMOX" - Chemotonic inputs (steady state)  (Numerical code 12) 
         In SYNETSIM 3 synapses, chemical synapses simulate the release and 
    binding of transmitter on the postsynaptic cell.  In non-spiking chemical 
    transmission, transmitter release is an exponential function of 
    presynaptic voltage.  This can occur in two ways:  the steady-state value 
    can bear this exponential relationship (a non kinetic situation), or the 
    release rate can.  Thus:
    
              Xmtr= Xmtro exp(Vpre/Muc)                  (12.1)
    
              dXmtr/dt= Xmtr'o exp(Vpre/Muc)             (12.2)
    
    where Xmtro and Xmtr'o are respectively the transmitter concentration or 
    release rate at Vpre=0, Vpre is the presynaptic voltage, and Muc is the 
    characteristic voltage for the release curve. Released transmitter affects 
    synaptic conductance according to:
    
              g(t)= gbarc * Xmtr(t)/(Kdc + Xmtr(t))      (12.3)
    
    where gbarc is the maximum possible conductance (saturation: all channels 
    open), Xmtr(t) is transmitter concentration at time t, and Kdc is the 
    effective dissociation constant for transmitter binding to the 
    postsynaptic receptor.  Synaptic current (I) is then calculated as for all 
    other ionic currents:
    
              I(t)=g(t)(V-Vrevc)                           (12.4)
    
    where Vrevc is the reversal potential for this particular synapse.
    
            Parameter field:
    VREVC     Chemotonic reversal potential
    GBARC     Maximum chemotonic conductance
    GAMMA     Normalized maximum conductance
    KDC       Dissociation constant for transmitter binding
    S0C       Transmitter release at 0 mV presynaptic voltage
    MUC       Presynaptic voltage giving release of S0C * e
    KS        Decay time-constant of transmitter
    
         If KS=0, then a steady state situation is simulated.
         Presynaptic compartments are specified in the connection field of the 
    netlist.  Thus the lines:
    
    CELL A
     CMPT X  (C=.002 VLK=-50 GL=.2)
    
    CELL B
     CMPT Y  (C=.001 VLK=-60 GL=.1)
      CHEMOX (VREVC=-75 GBARC=.2 KDC=1 S0S=.1 MUC=15 KS=.01)    A/X
    
    would use the voltage in cell A compartment X to release transmitter onto 
    cell B compartment Y.  
         Note that the transmitter pools pertaining to spikes and those 
    pertaining to chemotonic interactions are separate.  This may be 
    physiologically inaccurate since a given synapse could well operate in 
    both modes, and this would produce errors in calculation of receptor-
    saturation proportions.  
    
    
    E.   SPIKE-FLAG-RELATED PROPERTIES
    
         Spike flags allow for simulations in which the crossing of threshold 
    by membrane potential generates a spike, which in turn can activate a 
    synapse, releasing transmitter onto a postsynaptic cell.  The same 
    processes can be simulated using the HH properties to simulate spike 
    generation and the CHEMOX properties to generate synaptic potentials, but 
    the simulations, while physiologically more correct, require much more 
    computer time.
    
    CODE "TRIGR"  - Trigger-zone kinetics (Numerical code 2)
         This property provides repetitive firing kinetics using the "active 
    pacemaker model" of Hartline 1976a.  It operates by setting a "spike flag" 
    when threshold conditions have been met, and this spike flag can be used 
    to drive other spike-flag-sensitive properties (i.e. SYNAPSE-type 
    synapses) It gives a nearly linear pacemaker response relation (f-I 
    curve), with up to three components of adaptation.  The present 
    implementation approximates the trigger zone of SYNETSIM 2.4.  [WARNING: 
    There is a known flaw in this module which renders the simulation 
    quantitatively inaccurate, though qualitatively acceptable; further, 
    various programming relics of version 2.4 have not yet been removed, and 
    not all features of the SNAX version 2.4 are included in SYNETSIM-3].  The 
    trigger zone is driven by the voltage of the parent compartment, and 
    providing they are given uniques names, there may be more than one trigger 
    zone in each compartment.  The SYNETSIM 3 versions to date have no 
    feedback to the parent compartment (e.g. simulating spike-
    invasion/shunting or loading phenomena).  Use Code HHFXD type branches for 
    this.  Loading may be added in future versions.  
         The kintics of SYNETSIM trigger zones are discussed in Hartline 
    (1989) and the reader is referred to this source for details.  Parameter 
    names are as follows:
    
         Parameter field:
    E0      Base excitation
    TAUM0   Base level membrane time constant
    PMTHR   Threshold for active pacemaker response
    KPM     Pacemaker sensitivity factor
    TAUPM   Pacemaker response increase time constant
    KCOND   Spike conductance sensitivity factor
    TAUCOND Spike conductance time constant
    KAR     Resting-potential adaptation sensitivity factor
    TAUAR   Resting-potential adaptation time constant
    KA1     Adaptation component 1 sensitivity factor
    TAUA1   Adaptation component 1 time constant
    KA2     Adaptation component 2 sensitivity factor
    TAUA2   Adaptation component 2 time constant
    THRINF  Asymptotic spike threshold value
    KTHR    Spike threshold sensitivity factor
    TAUTHR  Spike threshold time constant
    DV0     Base increment in membrane voltage
    MAXV    Maximum membrane voltage reset level
    DG0     Base increment in spike conductance
    MAXG    Maximum spike conductance
    DAR0    Base resting-potential adaptation increment
    MAXAR   Maximum resting-potential adaptation level
    DA10    Base adaptation 1 increment
    MAXA1   Maximum adaptation 1 level
    DA20    Base adaptation 2 increment
    MAXA2   Maximum adaptation 2 level
    DTHR0   Base threshold increment
    MAXTHR  Maximum threshold
    
    (Note that not all TRIGR parameters have been implemented as modulation 
    targets yet)
    
    
    CODE "SPIKE"  - Spike flag (Numerical code 5)
         This branch type generates a "Schmidt trigger" type of spike when the 
    voltage in its compartment exceeds an "on" threshold; it is "refractory" 
    until voltage goes below an "off" threshold.  The intended use is to allow 
    Hodgkin-Huxley spikes to set spike flags.
    
         Parameter field:
    ONTHR          On-threshold (mV absolute)
    OFFTHR         Off threshold (mV absolute)
    
    Synapses are linked to both of these spike generators (TRIGR and SPIKE) 
    through their connection field in the netlist (see below).
    
    CODE "SYNAPSE"  - Spike-mediated PSP inputs  (Numerical code 11)
         In SYNETSIM 3, spikeflag-produced PSP time-courses are computed by 
    tabular interpolation to obtain the time-course of transmitter 
    concentration.  Transmitter is accumulated separately at each synapse.  
    Concentration is assumed to be additive (not a valid assumption under some 
    conditions).  The amplitude function, representing intrinsic synaptic 
    strength and facilitation effects, is computed as described in Hartline 
    (1989) and yields a transmitter release coefficient.  Conductance and 
    current are calculated as they are for chemotonic inputs.  
    
            Parameter field:
    VREVS       PSP reversal potential
    GBARS       Maximum synaptic conductance
    GAMMA       Normalized maximum conductance
    KDS     Dissociation constant for transmitter binding
    PSPSHP          PSP shape # (sequence number during .PSP file read-in)
    DLY     Synaptic delay
    A0S     Base amount of transmitter release
    ------------------[ repeating unit] ------------
    TAUF        Facilitation time-constant
    NF              Facilitation exponent
    C2F             Base facilitation increment
    C1F             Facilitation increment factor
    ------------------------------------------------
    
    The repeating facilitation unit permits several facilitation "pools" to be 
    associated with a single synapse.  SYNETSIM continues to read in 
    facilitation blocks until it encounters a TAUF=0.
         Presynaptic "units" in the model refer to the spike flag name in the 
    netlist.  Thus the lines:
    
    CELL A
     CMPT X  (C=.002 VLK=-50 GL=.2)
      SPIKE/1
    CELL B
     CMPT Y  (C=.001 VLK=-60 GL=.1)
      SYNAPSE/i (VREVS=-75 GBARS=.2 KDS=1 PSPSHP%=1 A0S=.1)  A/X/SPIKE/1
    
    would use spikes generated by the Schmidt-trigger generator in cell A 
    compartment X to generate PSPs in cell B compartment Y.  Note that the 
    full name of the spike source must be given, including the name of the 
    property (SPIKE) generating it.  The synapse in this example has been 
    given an optional name ("i") by which can be referenced (see Pool Type 1 
    example, below)
    
    STIM reserved word
         This word used in a connection field specifies the need for a spike 
    flag that has not been attached to either a TRIGR branch or a SPIKE 
    branch.  It would then be available for use in the "PSP_train" option of 
    the main menu (option 3).  If it is given a name (e.g. STIM/electrode1), 
    then several different synapses could be acitvated by the same stimulator.
    The flag number will be printed out on the screen by NET2PRM when the 
    netlist is compiled.  This number must be used when specifying the 
    spikeflag in menu option 3.
    
    F.   POOLS, SECOND MESSENGERS, AND BIOCHEMISTRY
    
         Non-electrical neuronal properties (e.g. biochemically derived) are 
    simulated through a set of POOLS.  Each pool has an amount of material 
    (Xpool) contained in a specific volume (XVOL parameter in netlist).  In 
    addition, each pool potentially has an additive base level (XPOOL0 in the 
    netlist) which is not subject to "diffusion" and "degradation".  This can 
    be used to bias the level of modulation produced in target parameters, if 
    desired.  (Note: in Hartline 1989, different symbols were used: S=Xmtr, 
    P=Xpool, Po=Xpool0, R=Xtarg, and Ro=Xtarg0.)
         For the netlist, the pool type is specified by a TYPE=__ assignment, 
    assignments for XVOL and XPOOL0, and several type-specific assignments as 
    delineated below.  The pool specifications (as for other compartmental 
    components) must be grouped under the compartment definition line.
    
    CODE "POOL" - Pool definition (Numerical code 20)
         Pool types are defined using this code.  Four types of pools can be 
    specified according to the rules for their filling and emptying:
    
         TYPE 1:  Bound transmitter pool.  Pool level is proportional to the 
    concentration of bound transmitter at a synapse:
    
              Xpool= C * Xmtr/(Kd + Xmtr)                (20.1)
    
    where C is a constant of proportionality and Kd is the dissociation 
    constant for transmitter binding.  The synapse must be one of the Code 
    "SYNAPSE" (=11) synapses, but this can be made to have no PSP (if desired) 
    by setting GBARS=0.  Note that the dissociation constant controlling the 
    pool can in general be different from that for the Code SYNAPSE synapse 
         The netlist line is of the form:
    
      POOL[/Name] (TYPE=1 XVOL=xx XPOOL0=xx KD=xx C=xx)      SynapseName
    
    The connection field contains the full name of the synapse associated with 
    the pool.  An example:
    
      POOL/cAMP (TYPE=1 XVOL=1 XPOOL0=0 KD=1 C=.005)      B/Y/SYNAPSE/i
    
    where the synapse is the one given above for SYNAPSE.
    
    
         TYPE 2:  Filling rate proportional to bound transmitter.
    
              dXpool/dt = C1 * Xmtr/(Kd + Xmtr) - C2 * Xpool (20.2)
    
    where terms are analogous to type 1.  This can be used to simulate 
    activation of an enzyme producing second messenger at a rate proportional 
    to bound transmitter.
         The netlist line is similar to that for Type 1:
    
    CELL A
     CMPT X
      POOL[/Name] (TYPE=2 XVOL=xx XPOOL0=xx KD=xx C1=xx C2=xx)  
    CELL/CPT/SYNAPSE/ID
    
         TYPE 3: Filling rate proportional to ionic current, with first order 
    decay.
    
              dXpool/dt = C1 * I(k,j) - C2 * Xpool        (20.3)
    
    where I(k,j) is the current flowing in the kth branch of type code j.  
    This can be used to simulate entry of ions through channels, e.g. Ca.
         The netlist line is of the form:
    
      POOL[/Name] (TYPE=3 XVOL=xx XPOOL0=xx K=xx J=xx C1=xx C2=xx)
    
    Note that the K and J specified must correspond to values assigned in the 
    parameter file.  To find those values, the netlist must be compiled twice, 
    the first time with dummy K,J's (e.g. 1,1).  [THIS NEEDS TO BE CHANGED TO 
    PERMIT NAMED SOURCES IN THE CONNECTION FIELD]
    
         TYPE 4: Constant filling rate with first-order decay.
    
              dXpool/dt = F - K * Xpool                  (20.4)
    
    where F is the filling rate and K the rate constant for decay.  This can 
    be used to simulate a substance which is synthesized and degraded, rates 
    of which can then be modulated by other pools, e.g. enzymatic regulation 
    of synthesis and degradation.
         The netlist form is:
    
      POOL[/Name] (TYPE=4 XVOL=xx XPOOL0=xx F=xx K=xx)
    
         Additional pool types can be added as needed.  Pool-defining 
    ("spring") subroutines must be added starting at line 11340.  Follow the 
    format for existing types.
    
         TYPE 5:  Bound transmitter from CHEMOX branch.  Essentially a Type 1 
    pool for CHEMOX. 
              Xpool= C * Xmtr/(Kd + Xmtr)                (20.5)
    
      POOL[/Name] (TYPE=5 XVOL=xx XPOOL0=xx KD=xx C=xx)      ChemoxName
    
    
    CODE "POOLK" - Inter-pool diffusion (Numerical code 21)
         All pools are potentially interconnected by first-order "diffusional" 
    rate constants:
    
            dXpool(k)/dt = SUM{K(k,j) Xpool(j)/Xvol(j)}        (21.1)
                    - SUM{K(j,k)} Xpool(k)/Xvol(k)
    
    where K(k,j) is the first-order rate constant into pool k from pool j.  
    Note that the rate constants in the two directions need not be equal.  
    This can be used to simulate not only diffusion within and between 
    compartments and cells (in which intrinsic rate constants in the two 
    directions would be equal), but also first-order chemical reactions.
         Netlist format is:
    
       POOLK[/Name] (K=xx)       SourcePoolName
    
    The pool k of eq. 21.1 is the pool under which the definition line 
    appears.  The connection field gives the full name of pool j.  For 
    example, a situation for a modulator-activated cAMP pool diffusing away 
    from the site of origin into the interior of the cell might be represented 
    by the following netlist:
    
      POOL/cAMP1 (TYPE=2 XVOL=1 XPOOL0=0 KD=1 C1=5)      A/X/SYNAPSE/e
       POOLK     (K=.1)                                  POOL/cAMP2
      POOL/cAMP2 (TYPE=4 XVOL=1)
       POOLK     (K=.1)                                  POOL/cAMP1
    
    
    
    CODE "POOLX" - Pool interactions (Numerical code 22)
         Pool levels can affect various "targets": other pools and compartment 
    parameters of the model.  Seven types of interaction have been programmed 
    (in the following, Xpool refers to the sum of the calculated pool level 
    plus a base level, Xpool0, which can be specified with the Code POOL 
    parameters).  A base level of interaction in the presence of 0 control-
    pool levels (Xtarg0) is set automatically for any non-zero value in the 
    input (.PRN) file.
         Netlist interaction entries must follow after the pool-definition 
    line for the pool controlling (driving) the interaction.  The name of the 
    target (a pool or a parameter) is specified in the interaction fields.  
    The name structure for a pool target is:
    
         [Cell-name/Compartment-name/]POOL/Pool-name
    
    and for a parameter:
    
         [Cell-name/Compartment-name/]CODE/Branch-name/Parameter-name
    
    Note the "/"s are required between cell and compartment names in this 
    structure.  The cell and compartment names may be omitted (indicated by 
    []) if they are the same as for the compartment generating the 
    interaction.  As an example, the target name for the maximum synaptic 
    conductance (GBARS) in Cell B of the SYNAPSE example given below would be:
    
         B/Y/SYNAPSE/i/GBARS
    
    
         TYPE 1: Direct proportionality.  The value of the target is a 
    constant multiple of the pool value plus a base level:
    
                    Xtarg = C Xpool + Xtarg0                   (22.1)
    
    where Xtarg is the value of the target, C is a constant, and Xtarg0 is the 
    value of Xtarg if Xpool = 0.
         Netlist declaration line:
    
    POOLX (TYPE=1 C=1)      Target
    
    where Target is the name of either a pool or of a parameter to be 
    modulated.
    
    Example:
    CELL A
     CMPT X     (C=.002 VLK=-50 GL=.2)
      SPIKE/1   (ONTHR=-30 OFFTHR=-40)
    
    CELL B
     CMPT Y
      SYNAPSE/i (VREVS=-75 GBARS=.2 KDS=1 PSPSHP%=1 A0S=.1)  A/X/SPIKE/1
       POOL/cAMP1 (TYPE=2 XVOL=1 XPOOL0=0 KD=1 C1=5)         SYNAPSE/i
        POOLX (TYPE=1 C=1)                                   A/X/GL
    
    In this case, the target was a model parameter instead of a pool.
    
         TYPE 2: Equilibrium receptor binding.  The value of the target above 
    base is proportional to the binding of the control pool to a receptor:
    
            Xtarg = C Xpool/(Kd + Xpool) + Xtarg0              (22.2)
    
         Netlist declaration line:
    
    POOLX (TYPE=2 C=1 KD=1)      Target
    
    
         TYPE 3: Bimolecular reaction with pseudo first-order kinetics.  The 
    rate of change in target value is proportional to the difference in rates 
    of forward and backward reaction of the form:
    
                           A + Xpool <---> Xtarg
    
            dXtarg/dt = alpha * Xpool(A0-Xtarg) - beta * Xtarg (22.3)
    
    where alpha and beta are the two rate constants and A0 is the total amount 
    of the limiting reactant (Xpool is assumed not to change as a result).  
    This can be used, for example, to simulate the kinetics of receptor 
    binding, or enzymatic phosphorylation of a channel.  Note that for the 
    steady state:
    
                    Xtarg = A0/(1 + beta/alpha/Xpool)          (22.4)
    
         Netlist declaration line:
    
    POOLX (TYPE=3 ALPHA=xx BETA=xx A0=xx)      Target
    
         TYPE 4: Ionic battery interaction.  The target value is related to 
    the pool level by the Nernst equation:
    
                    Xtarg = 26 * ln (Xpool/Conc)               (22.5)
    
    where Conc is the concentration of ion on the other side of the membrane.  
    In conjunction with a Type 3 pool, trapping of ions in extracellular 
    spaces can be simulated.  
         Netlist declaration line:
    
    POOLX (TYPE=4 CONC=xx)      Target
    
         TYPE 5: Modulation of target synthesis.  The rate of change of the 
    target is proportional to pool value:
    
                    dXtarg/dt = C * Xpool                      (22.6)
    
    This can be used to simulate the enzymatically-limited synthesis of a 
    compound from a large substrate pool.  It can also be used as an 
    alternative to Type 3 to simulate the production of a second messenger at 
    a rate proportional to bound transmitter.
    
         Netlist declaration line:
    
    POOLX (TYPE=5 C=xx)      Target
    
    
         TYPE 6: Modulation of coupling conductance.  The target conductance 
    is proportional to the controlling pool:
    
                    GC(Post, Pre) = C * Xpool + Xtarg0     (22.7)
    
         Netlist declaration line:
    
    POOLX (TYPE=6 C=xx)      PostTargetCmpt    PreTargetCmpt
    
    Since electrotonic interactions involve two compartments, specifying one 
    for modulation requires two names in the interaction field, one for the 
    post- and one for the prejunctional compartment.
    
         TYPE 7: Modulation of diffusion rate constant between pools.  The 
    target constant is proportional to the controlling pool:
    
                    K(Post, Pre) = C * Xpool + Xtarg0      (22.8)
    
    This can be used to simulate the effect of changing enzyme concentrations 
    on the rates of first-order reactions.
         Netlist declaration line:
    
    POOLX (TYPE=7 C=xx)      PostTargetPool    PreTargetPool
    
    As with type 6, this interaction requires two connection-field entries.
    
         Other interaction types can be added.  Appropriate subroutines should 
    be inserted beginning at line 12800.
    
    
    G.  SPECIAL NETLIST FEATURES
    
    ".DEFINE" BLOCKS
    
         A standard parameter set for any type of branch can be defined in a 
    DEFINE line and assigned a unique name, by which it can be invoked.  This 
    name is then placed just prior to the parameter-assignment segment.  This 
    has the effect of setting default template values for all branch 
    parameters.  Only those parameters that differ from this template then 
    need be assigned in the assignment segment.
         For example, a neuron represented as a spherical soma with a 5-
    segment 5 micron diameter two-times infolded uniform axon which could be 
    represented by the netlist:
    
    CELL X
     SPHERE SOMA (DIAM=60 RHOM=50000 FOLD=5 RP=-50)
     CYL    AXON1 (L=100 DIAM=5.0 RHOM=50000 RHOI=50 FOLD=2 RP=-50)  X/SOMA
     CYL    AXON2 (L=200 DIAM=5.0 RHOM=50000 RHOI=50 FOLD=2 RP=-50)  X/AXON1
     CYL    AXON3 (L=300 DIAM=5.0 RHOM=50000 RHOI=50 FOLD=2 RP=-50)  X/AXON2
     CYL    AXON4 (L=400 DIAM=5.0 RHOM=50000 RHOI=50 FOLD=2 RP=-50)  X/AXON3
     CYL    AXON5 (L=500 DIAM=5.0 RHOM=50000 RHOI=50 FOLD=2 RP=-50)  X/AXON4
    
    could be more clearly and efficiently represented by:
    
    CELL X
     SPHERE SOMA (DIAM=60 RHOM=50000 FOLD=5 RP=-50)
     CYL    AXON1  AXON (L=100)                       X/SOMA
     CYL    AXON2  AXON (L=200)                       X/AXON1
     CYL    AXON3  AXON (L=300)                       X/AXON2
     CYL    AXON4  AXON (L=400)                       X/AXON3
     CYL    AXON5  AXON (L=500)                       X/AXON4
     .DEFINE CYL AXON (DIAM=5.0 RHOM=50000 RHOI=50 FOLD=2 RP=-50)
    
    
    ".BLOCK" BLOCKS
         Physiological properties can be blocked with a set of toxin flags, 
    one for each property type (=branch code).  These flags may be set during 
    run time using main menu option 6 (or an equivalent .BATCH block call).  
    Initial values are also set by the master file, which in turn is 
    automatically written by NET2PRM so that any branch codes found in the 
    declaration lines will be unblocked, and those missing will be blocked.  
    However, this latter default can be overridden by including the branch 
    code in the parameter field of a .BLOCK statement, e.g.:
    
     .BLOCK (ELECTN HHFXD POOLK)
    
    in SYNTEST.NET blocks these three properties.
    
    
    BATCH BLOCKS and BATCH OPERATIONS
         If a .BATCH block is present in the netlist, and a "/B" switch is 
    used in invoking SYNETSIM (e.g. "SYNETSIM SYNTEST /B "), normal menu-
    driven input from the keyboard will be suspended and command sequences and 
    parameters will be taken from the batch file (in the example just given, 
    this would default to the file SYNTEST.SBT, which is also the default name 
    of the file generated by NET2PRM for SYNTEST.NET; the third file given in 
    the command lines for both NET2PRM and SYNETSIM is assigned to the batch 
    file, if this is to be different from the default name).  The batch file 
    consists of lines of numbers or strings which would be normally the 
    responses to INPUT prompts.
    
    The batch file is generated from a .BATCH block in the netlist which might 
    contain something like:
    
     .BATCH HOLD    (CMPT=1/1 HOLD_V=-100 NSWEEPS=20 SAVFILE=FILE.SAV)
           IV      (CMPT=1/1 COND_V0=-100 NCOND=1 TEST_V0=-60 SAMPLE_T=.006
                     TEST_STEP=10 NTEST=13 SAVFILE=FILE.SAV IVFILE=FILE.IV)
     .ENDBATCH
    
    This would generate a file with the lines:
    
    SYNETSIM 3.3.2
    4,1,1,-100,20,FILE.SAV,0
    4,3,1,-100,0,0,1,-60,.006,10,13,FILE.SAV,FILE.IV,0
    7
    
    The first line is a format check line; the next two are the numbers that 
    must be entered to guide the SYNETSIM menu system through a hold-potential 
    voltage clamp run followed by an I(V) curve run.  The last line ("7") 
    terminates the batch mode, and is generated by the mandatory ".ENDBATCH" 
    directive in the netlist.
         It will be seen that the batch mode allows using names for the 
    various parameters that must be given to SYNETSIM to set up a given run 
    (the same names appear in the screen prompts of the menu mode).  Any 
    numerical parameters not assigned will be set (effectively) to zero.  If 
    file names are to be omitted, the assignment (file)NAME = NONE must be 
    made.
         Batch mode also allows using netlist names for compartments 
    (parameter name "CMPT"), spikeflags ("SPKFLG"), pools ("POOL"), pool 
    targets ("TARGET"), and toxin and display-variable names ("CODENAME").  In 
    addition, the parameter "FLAG" can be set equal to "ON" (=-1 or true) or 
    "OFF" (=0 or false).  See NET2SBT.CNF discussion in the Appendix.
         Batch block parameter names are listed in the description of the main 
    menu above.  
    
    H.  DATA FILES
    
    SYNAPTIC TRANSMITTER FILE (PSPFILE$.PSP)
         This file contains time-course data for all PSPs.  It must be 
    constructed with an editor,  word processor, or user-generated program.  
    Two formats for specifying the data are possible.  In one, the PSP is 
    given as transmitter-level and time pairs.  In the other, the PSP 
    transmitter level is calculated as an analytic function.  The choice is 
    specified by the entries in the file.  The first three entries are:
    
    STITLE$   Title of PSP file
    SFIDD$    SYNETSIM 3.0.1 (12/25/87 file format code)    
    NPSP%     Number of PSP's in file (any number of PSPs can be 
                       contained in a file, but only the first NPSP% of 
                       those will be read in)
    
    Subsequent entries are specific to the two formats.  Formats can be 
    intermixed:
    
    Format 1:
         In the first format, entries consist of of alternating time (T3) and 
    value (V3) (transmitter level) entries in sequential order but no 
    specified interval.  The latter should be normalized to a peak 
    concentration of 1.0.  Each PSP must begin with the pair 0,0, which also 
    serves as the termination code for the preceding PSP.  Each PSP must 
    extend beyond the end of the PSP storage array (PSPTB), this being 
    accomplished, for example, by having a final T,V pair = 1000,0.  The final 
    PSP must have a 0,0 termination pair at its end.  
    
    4:        0
    5:        0
    6,8,...   T1, T2 ... Tm-1, 1000  Time of points on 1st PSP.
    7,9,...   V1, V2 ... Vm-1,    0  Value of points on 1st PSP.
    
    
    n-1:      0     End code
    n:        0
    
    Format 2:
         For PSPs calculated from an equation, the first entry must be a 
    negative number, the magnitude of which specifies which of various 
    analytic functions is to be used for the calculation.  In SYNETSIM 3.3, 
    only an instantaneously rising, exponentially decaying function is 
    implemented, but other formats are readily programmed (see line 685 ff).  
    For this "Type -1" PSP, the second entry is the decay time constant of 
    transmitter (sec).  Example:
         -1,0.07
    specifies a sharp-rise transmitter release with a decay of 70 msec.
    
    SAVE FILE (*.SAV; set as File#1)
         When option 10 of the Main Menu is selected to save the model state, 
    it writes a file having the following format [.SAV is a suggested, though 
    not mandatory, extension]:
    
    PFILE$  -       Parameter file format code
    U       -       Model time
    SUMTB0% -       Pointer to current place in psp summation array
    V(i)s   -       Membrane potentials for all compartments (1 to N%)
    {j%, k%, s.v} - Indices and state-variable for branch (j%,k%)s
                    [j%=1 to 12 (excl 3); k%=1 to N%(j%)]
    XPOOL(k%)s      Pool values for all pools (1 to N%(POOL%))
    0,0             Block termination
    SUMTB(j%,t%)s   Synaptic transmitter concentrations for all synapses
    "END"           End-code
    
    
    SAMPLE NETWORKS
    
    SYNTEST 2-CELL NET
         The SYNTEST network consists of a circuit of two cells ("Drivr and 
    "Follower": see wiring diagram in Appendix IV).  This network features an 
    endogenously bursting network-driver neuron which inhibits and is 
    inhibited by the follower.  Drivr is electrotonically coupled to Follower 
    by a rectifying connection.  In addition to the spike-mediated synapses, 
    there is a blocked reciprocal chemotonic inhibition between Drivr and 
    Follower that can be unblocked (set toxin flag CHEMOX = "U" with menu 
    option 6) as a demonstration of the chemotonic feature of the model.  In 
    addition, transmitter released by Drivr activates the synthesis of a 
    "second messenger" pool in Follower which induces a voltage-dependent 
    inward current in the cell, causing it to produce plateau potentials.  For 
    purposes of demonstration a second pool is "diffusionally connected" to 
    the second messenger one if the "diffusion" property is enabled (set toxin 
    flag POOLK to "U" using menu option 6).  This could represent "buffering" 
    of the second messenger, or its reversible inactivation through a chemical 
    reaction.  In the SYNTEST net, only codes TRIGR, ELECTN, DRIVER, SYNAPSE, 
    POOL, and POOLX (=2,3,8,11,20,22) are unblocked (spikes, electrotonic 
    connections, plateaus, spike-mediated synapses, pools and pool targets).  
    The resulting output is plotted using LOTUS in the figure accompanying 
    Appendix IV.
            See APPENDIX VI for an annotated listing of the SYNTEST parameter 
    file, and output plots.
    
    SQUID AXON
         A 1-compartment cell with parameters appropriate for a .001 cm2 patch 
    of space-clamped Hodgkin-Huxley squid axon is also provided.  The 
    parameters are for an axon at 6.3oC as specified in J. Physiol. 117: 500-
    544 (1952), using a resting potential of -60 mV.  To utilize this, run 
    NET2PRM and then SYNETSIM using HH in the command line.  Choose menu 
    selection 1 for several sweeps to let the state variables settle, then use 
    selection 2 with Compartment=1, Bias=0, Cond_I=0, Test_I=900, 150, 70, and 
    60 (nA/nf=uA/cm2) in sequence, Cond_durn=0.001, and Test_durn=0.0001 to 
    generate Fig. 12 of HH '52 (be sure to allow several recovery sweeps 
    between stimuli).
    
    
    DEMONSTRATION MODULES
         A set of demonstration modules is included which is suitable for 
    training students in the application and properties of various SYNETSIM 
    branch types and the physiological phenomena they represent.  See the 
    separate description SYNETDEM.TXT.
    
    MISCELLANEOUS
    
    PROGRAM COMPATIBILITY
         The current version of SYNETSIM is completely compatible (to the best 
    of my belief) with QuickBASIC 3.0.  The source code provided in 
    SYNETSIM.3xx is intended to be mostly GWBASIC compatible as well.  In 
    recompiling it with QuickBASIC, comment out line 50 (GWB%=-1).  Small 
    networks (<=3 branches per compartment) can be run under GWBASIC.  In 
    transporting it to a foreign version of BASIC a problem may be encountered 
    owing to the frequent use of the same name for an array and for a standard 
    variable.  Thus N% is the number of compartments in the model, whereas 
    N%(i) is the number of branches having code i.  Also, T is a scratch time 
    variable whereas T% is a time index for an array.  GWBASIC permits these, 
    but other BASICs (e.g. BetterBASIC) may not. 
    
    MODEL UNITS
         The basic unit of time in SYNETSIM is the second.  Thus time 
    increments (TINC), display X-axis length (XSCALE) and stimulus durations 
    (from Main Menu) must be given in this unit.
         The basic unit of voltage is the millivolt.  This is the unit for 
    activation voltages, reversal potentials, etc.  There is no absolute 
    voltage reference built into the model.  The demonstration models (e.g. 
    SYNTEST) use the external bath potential as the zero reference, but one 
    could as well use resting potential.
         Other units in the model (current, conductance, capacitance, 
    concentrations, binding constants) are arbitrary, but must be kept 
    consistent with the time and voltage units.  In SYNTEST and most 
    demonstration modules, current has been given in nA, making resistance 
    units = Mohms, conductance units = umho, and capacitance units = uf.  To 
    bring specific conductances into line with current usage, these (i.e. 
    GAMMAs) are given in mmho/uf.  One can use other units, but keep in mind 
    that membrane conductances in the model are calculated from densities with 
    the equation G = GAMMA/(1000*C).
    
    PROGRAM BUGS
         TRIGR inaccuracies:  The present version still has the known 
    inaccuracy in the spike calculation routine of 3.0, which renders it 
    inaccurate, though usable.  
         Type 3 pool interaction:  There is a known minor inaccuracy in this 
    interaction in line 12310.
         SYNAPSE facilitation: reported not to work (S. Lin, personal comm.)
         Untested options:  Not all options have been tested.  The following 
    sections, in particular, have NOT been tested in the current version and 
    may be particularly prone to errors:
         Code TRIGR details, including RP adaptation; spike resets; threshold-
              crossing corrections;  handling of excitatory drive.
         Code POOL pools of types 2 and 3
         Code POOLK (inter-pool diffusion)
         Code POOLX pool interactions of types 4,6,7, and 8
    
         DIMension limitations:  The model as it stands does not DIMension 
    many arrays, giving them default dimensions of 10.  If more than 10 
    branches are required, DIM statements will have to be added after line 63, 
    and MAXBR% in line 60 must be changed to the new maximum number of 
    branches.
           Despite every attempt to minimize them, errors are inevitable.  
    Your help in drawing attention to such will be greatly appreciated.
    
    
    
    OTHER NOTES
         Interpreted-mode:  If need be, a truncated version of the source 
    program (SYNETSIM.3xx, where xx=version and revision #) can be run in 
    interpreted mode with GWBASIC (or BASICA), although much more slowly (see 
    Speed tests, Appendix V).  The "comment" mark (') must be removed from 
    line 50 before attempting this.  The program itself must also be 
    shortened, and unnumbered lines must be deleted.  It is suggested that 
    lines 13000 to the end be deleted and that pool interactions be blocked.
    
    UPDATES IN 3.0 AND 3.2
    
         This release of SYNETIM has several changes from the two previous 
    releases (3.0D and 3.2C), primarily in the implementation of Greg 
    Wolodkin's net-list compiler, NET2PRM.  This is reflected in the rewritten 
    descriptions of network properties above, and in separate sections on 
    NET2PRM (see also the NET2PRM manual in Appendix V).  
    
    A.  Modifications of the Parameter File (.PRM)
         The parameter file is now created from the netlist file.  Old 
    parameter files must be translated into the new form.  As an aid, empty 
    templates for each v3.0 and 3.2 SYNETSIM property are given below as   
    which must be inserted: see NET2PRM documentation):
    
    "Netlist title (1 line of text enclosed in quotes)"
    'Code Name      Parameters (changes)     Connections
    '-------------------------------------------------------------------------
    ----
     .DEFINE CMPT    x  (C=       RP=       GL=       ) 
    
     .DEFINE TRIGR   x  (E0=      TAUM0=    PMTHR=    KPM=      TAUPM=
    +         KCOND=    TAUCOND=  KAR=      TAUAR=    KA1=      TAUA1= 
    +         KA2=      TAUA2=    THRINF=   KTHR=     TAUTHR=   DV0=
    +         MAXV=     DG0=      MAXG=     DAR0=     MAXAR=    DA10=
    +         MAXA1=    DA20=     MAXA2=    DTHR0=    MAXTHR=   )
    
     .DEFINE ELECTN  x  (GC=      )
    
     .DEFINE SPIKE   x  (ONTHR=   OFFTHR=   )
    
     .DEFINE COND    x  (VCOND=   GCOND=    )
    
     .DEFINE DRIVER  x  (VNA=     GBARNA=   V0NA=     MUNA=     VK= 
    +         GBARK=    V0K=      MUK=      GBARK1=   TAUK1=    GBARK2=   
    +         TAUK2=    )
    
     .DEFINE HHFXD   x  (VEQ=     GBAR=     QM=       V0M=      MUM=
    +         TAUMA=    QH=       V0H=      MUH=      TAUH=    )
    
     .DEFINE HH      x (VEQHH=    GBARHH=   KTEMP=1   QMHH=     QHHH=
    +                   AAM=      BAM=      CAM=      DAM=      EAM=
    +                   ABM=      BBM=      CBM=      DBM=      EBM=
    +                   AAH=      BAH=      CAH=      DAH=      EAH=
    +                   ABH=      BBH=      CBH=      DBH=      EBH=     )
    [NOTE that this property contains the additional parameter KTEMP, for
    temperature scaling, which cannot be defaulted to 0 and hence atleast
    a value of 1 must be inserted in any v3.3 netlist]
    
     .DEFINE SYNAPSE x  (VREVS=   GBARS=    KDS=      PSPSHP%=  DLY=
    +         A0S=      TAUF=     )
    
     .DEFINE CHEMOX  x  (VREVC=   GBARC=    KDC=      S0=       MUC=     )
    [NOTE: "S0" replaces "XMTR0C"]
    
     .DEFINE POOL    x  (TYPE=1   XVOL=     XPOOL0=   KD=    C=    )
     .DEFINE POOL    x  (TYPE=2   XVOL=     XPOOL0=   KD=    C1=   C2=   )
     .DEFINE POOL    x  (TYPE=3   XVOL=     XPOOL0=   C1=    C2=   )
     .DEFINE POOL    x  (TYPE=4   XVOL=     XPOOL0=   F=     K=    )
    
     .DEFINE POOLK   x  (K=       )
    
     .DEFINE POOLX   x  (TYPE=1   XVOL=     XPOOL0=   C=   )
     .DEFINE POOLX   x  (TYPE=2   XVOL=     XPOOL0=   C=      KD=    )
     .DEFINE POOLX   x  (TYPE=3   XVOL=     XPOOL0=   ALPHA=  BETA=  A0= )
     .DEFINE POOLX   x  (TYPE=4   XVOL=     XPOOL0=   CONC=   XBRN%= XPRM%= )
     .DEFINE POOLX   x  (TYPE=5   XVOL=     XPOOL0=   C=      XBRN%= XPRM%= )
     .DEFINE POOLX   x  (TYPE=6   XVOL=     XPOOL0=   C=      )     
     .DEFINE POOLX   x  (TYPE=7   XVOL=     XPOOL0=   C=      )     
    
    Specific changes which have been made in parameter file structure are:
         1. HH parameter lines add KTEMP after GBAR (normally = 1), the 
    temperature-dependent rate-constant scale factor (added to 3.2.4, v3.2D).
         2.  Omitted parameters are no longer allowed in parameter lines (e.g. 
    omitting the exponent in HH lines to abort the further read-in of non-
    utilized activation or inactivation properties).  This is to maintain 
    compatibility with NET2PRM, which, except for certain special exceptions, 
    expects a fixed parameter line format.
         3.  DIODE branch replaces "ELECTN" for unidirectional connections; 
    ELECTN is reserved only for bidirectional ones.  Branch Code for DIODE is 
    4; SPIKE has been reassigned code 5.
         4.  Conductance densities.  Version 3.3 adds the option of 
    conductance densities (per uf of capacitance) to be specified in place of 
    conductances, wherever they appear in the old parameter set.  If only a 
    single conductance is present for a particular property, the density is 
    simply called "GAMMA" in the netlist.  Where several conductances appear, 
    the density for the first is GAMMA, and in the remainder, "GBAR" is 
    replaced by "GAMMA" in the name (e.g. the density for GBARK1 is GAMMAK1 in 
    DRIVER).
    
    B.  Master File (.MST) is replaced by .MASTER block:
    
         The master file is now created from a .MASTER block in the netlist 
    file.  Old master files must be translated into the new form.  As an aid, 
    the .MASTER block-equivalents for SYNTEST.MST is given for version 3.0 and 
    3.2C:
    
    Version 3.0D:
     .MASTER (PRMFILE=SYNTEST PSPFILE=SYNTEST
    +  XSCALE=1 VSCALE=50 TINC=.002 SKIP=1 PSPDM=1 PSPL=500 SUMTBL= 500
    +  SPKHT=15 ADPFLG=-1
    +  ZPF=-1 SPF=-1) 
     .BLOCK (ELECTN HHFXD CHEMOX POOLK)
    
    Note that the plot switches (PLTSW%) of v3.0D have been eliminated except 
    for the zero-line plot (ZPF) and the spike-tic plot (SPF) [the original 
    plot switches have been replaced by plot variables: see main menu 
    selection 12; note that this replaces main menu option 6].  All switches 
    and flags have been converted to a Boolean form (i.e. using -1 instead of 
    1).  The header information for the master file is generated automatically 
    by NET2PRM.
    
    Version 3.2D:
     .MASTER (PRMFILE=SYNTEST PSPFILE=SYNTEST
    +  XSCALE=1 VSCALE=100 ISCALE=2000 GSCALE=10 KSCALE=1000 PSCALE=5 Y0=50
    +  TINC=.002 SKIP=1 PSPDM=1 PSPL=500 SUMTBL=500
    +  SPKHT=20 ADPFLG=-1
    +  ZPF=-1 SPF=-1)
     .BLOCK (ELECTN HHFXD CHEMOX POOLK)
    
    The master file for v3.3B also includes the parameter BATFILE (for batch 
    file operation) and the flag PF (for protocol printout), which default to 
    NONE and 0, respectively, if they are left unassigned.
    
    C.  Additional features of 3.2 and 3.3:
    
         1.  Voltage-clamp conditions can be applied to a single compartment 
    at a time (Main Menu option 4; options 4 & 5 renumbered).  see Main Menu 
    section (3.2).
    
         2.  A cursor-supplied screen display, useful for making measurements 
    on simulation runs, has been added.  It automatically comes up at the end 
    of each run (3.2).  See End-of-Run Display section.
    
         3.  Three new branch types have been added.  "SPIKE" (code 4) 
    branches generate spikes from membrane potential via a "Schmidt trigger", 
    so that Hodgkin-Huxley branches can be linked to synapses (3.2).  "COND" 
    (code 7) branches give fixed conductances which can be modulated by second 
    messengers to simulate slow PSPs (3.2).  "CONNOR" (code 13) branches 
    specify HH-type rate constants for A-current as developed by Connor et al 
    (3.3).
    
    D.  Bugs corrected
         HH Branch line 5020 incorrectly read IF EAM(K%)=-1 ..."  It has been 
    corrected to read "IF EBM(K%)=-1 ...".  The only situation in which this 
    gave much of a problem was in voltage clamp with a hold potential of -60 
    (which is when V=-CBM) (corrected in 3.3).
    
    E.  Demonstration package for 3.2 and 3.3
         Several modules which illustrate model features are included in this 
    release (see DEMO subdirectory and SYNETDEM documentation).  Some modules 
    require SYNTEST.PSP.
    =============================================================================
                               APPENDIX I
    
    ERROR MESSAGES
    
    
    230: BAD MASTER FILE Need: x Have y
         Discrepancy in .MST file format code.  Program expects format 
         code x but found code y.
    
    360: BAD PARAMETER FILE: Need: x Have: y
         Discrepancy in .PRM file format code.
    
    465: .PRM FILE FRAMING ERROR
         Program failed to find termination sequence "0,0,END" at the
         end point in the .PRM file.  One likely cause is an
         incorrect number of parameters for one of the branch types.
    
    530: BAD PSP FILE: Need: x Have: y
            Discrepancy in .PSP file format code.
    
    680: ILLEGAL PSP TYPE
            Invalid type-code (<-1) encountered in PSP file.
    
    1520: WRONG SAVE FILE
         .PRM format code on the model-state file being loaded does not 
    correspond to the 
         current .PRM file in use.
    
    1585: SAVE FILE END ERROR
         Expected "END" not found at end of .SAV file
    
    5300: ILLEGAL BRANCH CODE CALL IN KINETICS
         An illegal branch-type code was encountered in doing update kinetics.  
    INDICATES 
         PROBABLE MODEL BUG.
    
    6190: INPUT CODE x NOT IMPLEMENTED
         An illegal branch-type code was encountered in the .PRM file.
    
    14950: TARGET-FETCH CALLED ILLEGAL BRANCH CODE x
         An illegal branch-type code was encountered while retrieving a pool-
    target parameter.
    
    14960: TARGET-FETCH INVALID TARGET PARAMETER prm OF BRANCH i INTERACTION k
         In a type k pool interaction, a legal branch type, i, was found with 
    a parameter-
         number (prm) outside the valid range for that branch.  Some 
    parameters for some of 
         the branches have not been implemented yet, but can readily be by 
    following the 
         format laid down in this section of the program.  
    
    16950: TARGET-SAVE CALLED ILLEGAL BRANCH CODE x
            See 14950
    
    16960: TARGET-SAVE ILLEGAL TARGET PARAMETER prm OF BRANCH i INTERACTION k
            See 14960
    
    =============================================================================
                                                     APPENDIX II
    
    IMPLEMENTATION NOTES
    
    A.  PROGRAM LOGIC, IN BRIEF
         The Initializations and Parameter Input Calls section does the usual 
    set-up of special constants, reading of parameter files, checking formats, 
    and printing out diagnostic information.  Branch codes, identified in the 
    program by the index J% and decoded/encoded from their ASCII form via the 
    surboutine array following location 100, direct the calling of appropriate 
    subroutines for reading in parameters and making model calculations.  The 
    Branch-data Input Loop uses a simple ON {Branch Type} GOSUB to read 
    appropriate parameters from the parameter file, keeping track of the 
    maximum index number of each branch type with the array N%(j%).  When a 
    branch-type of 0 is encountered, it should be the end of the list, in 
    which case another 0 and a string "END" is expected, or a framing error 
    has occurred.  A minor loop at 475 sets to 1 those pool volumes not set by 
    input data, to prevent later division by 0.  The PSP Shape Table Input 
    Loop tests data for PSP format.  For a tabulated PSP, (time,value) pairs 
    are read in and intermediate values at equal time increments are 
    calculated by interpolation, to be stored in the PSP table, VPSP(K%,T%).  
    For calculated PSPs, a mathematical computation of the functional form of 
    the PSP replaces the interpolation, but either way, the PSPs end up as 
    functions tabulated at intervals of the integration time step.  Voltage 
    values are initialized to resting potential, and base levels (XTARG0) for 
    targets of modulation by pools are set to the initial levels taken from 
    the parameter file.
         NETST Section: Model Run Options operates the main menu.  This is a 
    straight forward ON {Menu Selection} GOTO switch which executes the 
    selection, then returns to line 815 or 820 to clear the screen and 
    redisplay the menu.  Programming for most is uncomplicated.  For selection 
    2 (current pulse), the start and end times are requested, and the model-
    call loop includes testing of current time so that a current is applied 
    through the variable IM0(UNIT%) to compartment UNIT% during the interval.  
    Saving and restoring the model state (selections 10 and 11) involves a ON 
    {Branch Type} GOSUB switch to subroutines at 7000+NAME%*10 and 
    7500+NAME%*10 to write/read corresponding state variables to/from disk, 
    followed by a write/read of the SUMTB(J%,T%) array.  Additional conditions 
    for the model can be programmed by following the pattern set by menu 
    selections 2 and 3.  The key line to insert is:
    
                    GOSUB 1800: IF X=0 THEN GOTO 815
    
    This executes one time-increment of the model, plots results, and clears 
    any spike flags that have been set.  If you need the spike flag 
    information, use GOSUB 3000 to run the model and GOSUB 2000 to plot, deal 
    with the flags yourself, and test for X=0 to see if the sweep is finished.  
    The return to 815 clears previous disk-write modes.  Return to 820 to 
    avoid this.
         NETWRK Subroutine (at line 3000) is the heart of the model.  The 
    first part, PATCH, calculates the sum of all ionic currents (II(I%)) and 
    conductances (GI(I%)) from each branch for each compartment.  It adds the 
    currents to those from other compartments using the coupling conductances 
    GC(I%,J%) or GC(J%,I%).  Which is used is determined by the sign of the 
    voltage difference between the two compartments, hence allowing for 
    rectifying connections (line 3160).  Total currents are used to calculate 
    the change in compartment voltage, DV(k%), due to the charging of the 
    compartment's capacitance.  The second part,  Branch 2 Updates, applies 
    the membrane voltage minus the leak battery (VA(I%)) to the trigger zone 
    subroutine at 4070 and updates its state variables.  If a spike is fired, 
    the SPIKE subroutine at 4600 is called to reset trigger zone variables 
    appropriately.  The third section, PATCHI, does the updates on all of the 
    other electrical branch codes (7-13), using the ON {Code} GOSUB switch in 
    line 3400.  These call subroutines at 4000+NAME%*100 which contain 
    appropriate kinetics for each branch type.  Most of these are straight 
    forward, but special notes on some are given below.  This results in new 
    values for the conductance G(K%,J%) and the ionic current I(K%,J%) for 
    each branch K% of each code J%.  The fourth part involves producing pool 
    interactions (subroutine at 12000).  Targets are located, a minus flag 
    being used to tag a compartmental parameter as a target, and the lack of 
    the flag being used to specify a pool as a target.  The variable K is used 
    as temporary storage for the value of this target parameter.  The type of 
    operation performed is determined by the type-specifier XINTYP%, which 
    controls the GOSUB switch in line 12080.  The new value for the target 
    parameter is returned to the target variable via K.  Following this, pools 
    are updated by the Inter-pool Diffusion subroutine at location 11000, 
    which includes a type-specific pool "spring" to fill them.  Fluxes are 
    computed to and from other pools, based on the first-order rate constants 
    K(L%,K%), as well as pool "degradation" (specified by the rate constant 
    K(0,K%)), and net pool changes (DPOOL(K%)) are calculated.  Upon return, 
    compartmental voltages are incremented by DV (line 3600), pools are 
    incremented (line 3700), and pool values are printed at the top of the 
    screen.  Finally, the the current location in the transmitter summation 
    table is zeroed and the location pointer, SUMTB0%, is incremented.
         PLOTS:  Returning from the NETWRK subroutine, the PLOTS subroutine is 
    called.  First, a skip-count (SKPCNT%) is tested.  This allows skipping 
    the plotting and writing of time points to make output files more 
    manageable.  If the count is 0, a subroutine at 2200 is called which 
    writes the time on the .PRN file, then tests switch options, and plots and 
    writes appropriate variables.  Next, if any of the spike flags are set, 
    spike tics are generated, spikes are sent to the .SPK file, if 
    appropriate, and spike perturbations (vertical lines of height SPKHT) are 
    generated on the voltage plots and .PRN file. 
         Cursor-accessed display:  The final test is whether the sweep limit 
    on the screen has been exceeded, in which case the run is done, and a 
    "SWEEP COMPLETE" message is generated (line 2125).  If batch file 
    operations or multiple-run conditions pertain, the program returns for the 
    next sweep.  Otherwise, it enters the display mode loop at 2130 which 
    tests for keyboard input and interprets the ASCII codes in terms of curor 
    manipulations on the screen.  An  key returns control to the main 
    menu.
    
    B.  HODGKIN-HUXLEY BRANCHES
         The equations given by Hodgkin and Huxley (1952) for the gating 
    particles have been placed in a uniform format, specified by 5 constants, 
    a,b,c,d,e (see Code 10 description).  This form reduces to 0/0 when a=0, 
    e=-1 (i.e. for alpha-m; alpha-n) and V+c=0.  By applying l'Hospital's 
    rule, alpha = b*d at this point.  The program tests for the condition and 
    uses this alternate calculation if needed.  It should also be noted that 
    the voltage variable, V, given in the H&H paper is with respect to rest, 
    and represents outside minus inside, instead of the currently used inside 
    minus outside.  Thus for their "V", -(V+60) must be substituted, where the 
    new V is absolute membrane potential (-60 is the average squid axon 
    resting potential).
    
    C.  SYNAPTIC POTENTIALS
         Version 3 reads in each synaptic potential from the .PSP file and 
    converts it to a sequence of values at equal time increments corresponding 
    to the integration increment (TINC) in the array VPSP(K%,T%).  At run 
    time, the index K% is used to retrieve a particular shape when needed.  
    Each synapse (indexed by K%) has a PSP summation array, SUMTB(K%,L%), 
    which accumulates the transmitter released.  The array is "circular" for 
    loading or read-out, meaning that it "wraps around" and the point 
    following L%=SUMTBL% (the upper limit) is L%=0.  During a simulation, the 
    pointer variable SUMTB0% gives the starting L% index for all SUMTBs.  This 
    index is incremented by 1 each integration cycle, picking off synaptic 
    input values at progressively later times as model time increases.  When a 
    spike fires in a presynaptic unit, points from the corresponding 
    VPSP(K%,T%), scaled according to amplitude calculations, are added to 
    SUMTB, commencing at index SUMTB0%, wrapping around, and ending at 
    L%=SUMTB0-1.
    
    D.  FACILITATION
         Each spike-mediated synaptic input branch (Numerical code 11) can 
    have several facilitation pools associated with it, the number being held 
    in the variable NF%(K%) for the K%th branch.  These NF% pools are 
    represented by consecutive indices, L%, of the various facilitation 
    parameters (TAUF(L%), NF(L%), C2F(L%), C1F(L%)) and the pool variable, 
    XF(L%).  For the K%th branch, the index L% starts at FLOC%(K%).  To 
    calculate transmitter release, the facilitation pools are first calculated 
    by exponentially decaying their value after the previous spike in the 
    presynaptic unit.  These numbers are raised to the appropriate power (see 
    Hartline 1988) and all summed to give the net facilitation factor, which 
    (as 1+F) multiplies transmitter released.  Increments to each facilitation 
    pool are then calculated and the storage variable for the previous spike 
    on this input branch, TPREV(K%) is updated to the current model time (U).
    
    E.  TARGETS OF MODULATION
         Targets are specified by an integer (XTARG%()) in the parameter 
    block.  If the integer is positive, it is taken as the number of the pool 
    which is the target.  If the integer is negative, its absolute value 
    specifies a branch type code.  The particular branch number and the 
    particular parameter of that branch which will be the target are specified 
    by the additional line entries XBRN%() and XPRM%() respec- tively.  NOTE 
    THAT NOT ALL PARAMETERS ARE LEGAL TARGETS.  In particular, indices and 
    other integers are usually not.  These are recognized (by a non-standard 
    name, such as one ending if "%") and skipped over by NET2PRM in 
    calculating XPRM%.  THE APPROPRIATE TARGET PARAMETER SPECIFIER for XPRM% 
    is given following the parameter name in the Parameter File Block lists.  
    "*" targets (coupling and diffusion) are handled by special interactions 
    (Types 6 and 7).  The POOL which controls the interaction is specified by 
    XSRC%() [generated by NET2PRM from the preceding pool-definition line], 
    and the interaction type by XINTYP%() [taken from the TYPE= assignment].
    =============================================================================
                                  APPENDIX III
    
    USER-GENERATED ADDITIONS
    
    A.  ADDITION OF MAIN MENU OPTIONS
         1.  Changes in source file (SYNETSIM.3xx).  Additions to the main 
    menu can be made readily by adding selections to the NETST section 
    starting at line 1750.  Follow the format of existing selections.
         2.  Changes in NET2SBT.CNF.  To add changes made in the main menu 
    (and any sub-menus added) to the batch capability, additional lines 
    corresponding to the menu selction(s) and input parameters needed must be 
    added to this file.  Follow the examples given in the listing of the file 
    (Appendix __).
    
    B.  ADDITION OF PHYSIOLOGICAL PROPERTIES (branch codes)
         1.  Changes to source file (SYNETSIM.3xx). Intentional gaps have been 
    left in the branch coding for later additions.  Codes 17 - 19 are reserved 
    for user-generated functions.  Each new branch code must have a parameter 
    input section (lines 6160- 6589 reserved).  The input section commences 
    with the third parameter (usually the compartment assignment), since the 
    calling code reads the branch code and index.  The new code must also be 
    provided with a branch update section commencing at line 5700, 5800, or 
    5900 for codes 17, 18, and 19, respectively (accessed through the switch 
    in line 3400).  HIBR% will need to be set to the highest code number used 
    under 20 in line 53.  If the parameters of the new branch type are to be 
    modulated by pools, appropriate subroutines for accessing branch 
    parameters must be added to the FETCH BRANCH PARAMETER VIA K (line 13000 
    ff) and SET BRANCH PARAMETER FROM K (line 16000 ff) sections (follow the 
    examples already there).  If preloading and saving of state variables from 
    the new branch type are required, appropriate subroutines must be written 
    to read and write them on sequential files, starting at lines 8700, 8800, 
    and 8900 for codes 17, 18, and 19 respectively, again following the 
    existing form.  
    
         2.  Changes to NET2PRM.CNF:  For each new property added, a new 
    parameter-configuration line must be added to this file specifying the new 
    code, the names of its parameters, and their order in the parameter file.  
    Read the description of the file in Appendix V (NET2PRM Manual) and follow 
    the examples for other codes.
    
         3.  CHECKLIST for addition of branch codes to SYNETSIM:
         a.  Add NAME% to line 52
         b.  Add IF J$=NAME$ THEN J%=NAME% to line 100+NAME%.
         c.  Add ON J% GOTO .... XXX ....  to line 150
         d.  Change LOWBR% or HIBR% in line 54
         e.  Add kinetic calculations in lines 4000 + 100*NAME%
         f.  Add INPUT #1, CP%(K%, NAME%, prm1(K%), .:RETURN in 6000+NAME%*10
         g.  Add PRINT #1, vrbl1(K%), vrbl2(K%),.... :RETURN in 7000+NAME%*10
         h.  Add INPUT #1, vrbl1(K%), vrbl2(K%),.... :RETURN in 7500+NAME%*10
    
         For addition of parameters to an existing branch code, as well as 
    adding new branch codes:
    
         i.  Add a line NAME%, NAME, name-prm1, name-prm2, ...,END to 
    NET2PRM.CNF
         j.  Add ON XPRM% GOTO beginning at line 13000+NAME%*100
         k.  Add K=prm(XBRN%) line blocks in the appropriate space following
         l.  Add ON XPRM% GOTO 16x05 at line 16000+NAME%*100
              Add prm(K%) = K line blocks in the appropriate space following
    
    
                                                           APPENDIX IV
    
    NETLIST MANUAL
    
    by Greg Wolodkin
         Dept. of Electrical Engineering
         University of Maryland
         College Park, MD
    
    A.  STRUCTURE OF THE NETLIST
    Net2prm reads in a netlist containing information about a compartmental 
    structure which represents some physiological system.  The basic structure 
    consists of compartments (which make up cells) and cells (which make up 
    the network).  While an essay on compartmental modeling is certainly 
    beyond the scope of this manual, some introduction is necessary to make 
    sense of the format of the netlist.  With that in mind, the basic 
    structure is this:
    
    CELL    is the largest 'object' or structure within the netlist.
            A cell can be composed of one compartment, or many.  All        
            compartments which are listed underneath of a CELL belong 
            to that CELL.  The beginning of a cell is marked by a 
            CELL declaration line, consisting of the reserved word CELL
            as the first word on the line, followed by a cell name.  The
            cell name must be unique.  The end of a cell is marked by the
            beginning of a new cell, or the end of the netlist, whichever
            occurs first.  An example of a proper cell declaration is this:
    
            CELL PD
             .
             .
    
            which defines a cell named 'PD' and assigns any items under
            it to belong to 'PD'.
    
            The CELL structure is not used by SYNETSIM, but is rather a 
            human concern.  As we observe networks in the form of cells,
            we would like our model to also represent the various cells
            observed.
    
    CMPT    is the real building block of the compartmental model.  As
            mentioned above, cells can be constructed of one CMPT, or 
            of many.  CMPT declarations work identically to cell declarations,
            in that the beginning of a CMPT is marked by the reserved word
            "CMPT" as the first word on a line, followed by a compartment
            name.  Compartment names must be unique only within the cell.
            (Two cells could have compartments in them with matching names,
            as long as the cells had unique names themselves.)  The CMPT
            declaration must also include a parameter set, which follows
            the compartment name.  For now, we will represent the parameter
            set by the label '[parameter set]'.  Its form in the netlist will
            be discussed later.  A legal CMPT declaration would be:
    
            CMPT Soma [parameter set]
             .
             .
    
            Furthermore, to define a cell with one compartment, we could
            combine the two examples to form:
    
            CELL PD
             CMPT Soma [parameter set]
              .
              .
          
            The indentation here helps to show that the CELL is made up of
            any number of CMPTs, and the CMPT Soma as shown belongs to the 
            CELL PD.  
    
            These two structures (CELL and CMPT) allow us to build the 
            skeleton of a compartmental model.  To reference this skeleton,
            we need a naming convention.  Electrical circuits are typically
            referenced by node number, as in the circuit simulator SPICE.  
            
            In the compartmental model, each compartment is connected at
            two nodes.  One connection represents ground, and all
            compartments share a common ground.  The other connection 
            or node represents the membrane voltage, inside the membrane.
            Since the compartmental model involves dividing a length of 
            membrane into compartments, each compartment has associated 
            with it the membrane voltage for a particular segment of the
            membrane.  Thus each compartment represents a node in the 
            circuit.
    
            We have chosen to reference these nodes by name, and this name
            is formed by the combination cell/compartment.  Notice that
            each cell has a unique name, and each compartment has a unique
            name within the cell.  With this in mind, then, each node has
            a unique name.  For the example above, the node would be named
                    
                    PD/Soma
    
            Each compartment MUST have a name, and all compartments must
            belong to a cell.  Each cell MUST have a name.
    
    ELECTN  The electrical coupling of compartments is accomplished via the 
    DIODE   codes ELECTN and DIODE.  These can be pictured as resistances
            which passively connect one node to another.  This adds another
            field to our netlist form, that being the connection field. 
            A proper ELECTN declaration involves two nodes or compartments, 
            one which the ELECTN belongs to, and the other which is
            specified in the connection field.  The example below shows 
            two compartments which are connected electrotonically.
    
            CELL PD
             CMPT Soma [parameter set]
              ELECTN   [parameter set]  Axon
             
             CMPT Axon [parameter set]
              .
              .
    
            where again the [parameter set] will contain information 
            regarding the specifics of each declaration.
    
            Notice that the connection field for ELECTN above contains
            'Axon', the name of the node to which it connects.  It could
            just as well have contained 'PD/Axon', as that is the FULL
            name of the node.  Since compartment names are unique within
            a cell, however, we can omit the cellname and call it by 'Axon'.
    
            The following example has an identical effect.  
    
            CELL PD
             CMPT Soma [parameter set]
             
             CMPT Axon [parameter set]
              ELECTN   [parameter set]  Soma
              .
              .
    
            For a DIODE, which represents a rectifying connection, the 
            direction of current flow (positive ions) is always INTO the
            parent compartment, FROM the connection field.  For the ELECTN 
            or bi-directional connection, the specification is not
            important.
    
            These four structures (CELL CMPT ELECTN DIODE) are enough
            to build a passive membrane, consisting of resistances, 
            capacitances, and DC voltage sources.  Other properties 
            can be added quite easily, as described below.
    
    B. COMPONENTS WITHIN THE STRUCTURE   [to be continued]
    
    C.  CONFIGURATION FILES
    
    The .CNF files used by NET2PRM specify the names and orders for parameters 
    appearing in various input files for synetsim.  
    
    1. NET2PRM.CNF --->  contains information concerning the codes available
                         in the current version of synetsim.  
    
       - Lines which begin with a single quote ( ' ) are comments.
       - Blank lines (along with comment lines) are ignored.
    
       - The first line of the file represents the synetsim file format.
         It is of the form:
    
             SYNETSIM 3.3.2  
         
         and must match with the current version of synetsim.  The compiler
         passes this string on to any .PRM file which it creates.  Upon
         execution of synetsim, a fatal error will result if this string
         doesn't match with synetsim's internal format.  This is necessary, 
         as the .CNF file contains the order in which to pass parameters to
         the .PRM file.
    
       - All information following the first line must be of the form:
    
            CODENUMBER, CODENAME, [parameter list], END
    
          where CODENUMBER represents the number which synetsim uses to
          index codes, CODENAME represents the name of the code, 
          [parameter list] represents a series of strings, separated by
          commas, which correspond to synetsim parameters and compiler
          reserved-words.  END is used to mark the end of a parameter list,
          and the beginning of a new code definition.
    
          CODENUMBERS must go in sequence, starting with one.  
    
          Valid items in the parameter list include:
    
            PNAME   - a alphabetic string represents a parameter which is
                      to be input from the netlist.  It will be found in
                      the netlist in the form   (PNAME=34),   and the 
                      value 34 will be passed to synetsim.
    
            PNAME%  - a string ending with % indicates a value that will
                      be dependent on the structure of the netlist.  The
                      compiler keeps track of these (cmpt number, branch
                      number, etc...) and passes them to the model quietly.
                      no effort is needed on the part of the user to set
                      these "structural" parameters.