next up previous contents
Next: Setup of Experiments Up: A Practical Example 2: Previous: A Practical Example 2:   Contents


Chronology of Commands

First we give a short guideline how to setup hsolve:

  1. First create all compartments with their channels.
  2. Do a reset and check the simulation schedule with the showsched command. You will see that all compartments and channels are scheduled for simulation.
  3. Then create hsolve, configure hsolve by setting the appropriate fields (chanmode 4) and method of integration, call SETUP, then do a 'reset'.
  4. Again check the simulation schedule with the showsched command. The compartments and channels are removed from the simulation schedule. Instead, hsolve has been scheduled.
  5. Messages for compartmental voltage can be created in two ways: before the SETUP messages can be created coming from the compartments (the modeling elements), after SETUP, messages that come from the hsolve element must be created with use of the findsolvefield command. We will shortly show why the latter approach is not always possible.

We indicate points of interest with a marker of the form '// point <n>' such that we can refer to it later on. Here is the complete script:

    genesis > include ht_compartments.g
    genesis > make_compartments
    genesis > setclock 0 0.000010
    genesis > readcell main.p /main -hsolve
    genesis > setmethod main 11
    genesis > setfield main chanmode 4
    genesis > // point 1
    genesis > call main SETUP
    genesis > create xform /cell [200,350,300,300]
    genesis > create xdraw /cell/draw [0,0,100%,100%]
    genesis > setfield /cell/draw xmin -0.00005 xmax 0.00005 \
    genesis >         ymin -1e-5 ymax 4e-5 \
    genesis >         zmin -1e-5 zmax 1e-5
    genesis > create xcell /cell/draw/xcell
    genesis > setfield /cell/draw/xcell colmin -0.1 colmax 0.05 \
    genesis >     path /main/##[TYPE=compartment]
    genesis > str element
    genesis > foreach element ( { el /main/##[TYPE=compartment] } )
    genesis >         addmsg /main /cell/draw/xcell \
    genesis >                 COLOR {findsolvefield /main {element} Vm}
    genesis > end
    genesis > setfield /cell/draw/xcell \
    genesis >         nfield {countelementlist /main/##[TYPE=compartment]}
    genesis > xshow /cell
    genesis > reset
    genesis > // point 2





NOTE: The xcell element assumes that you have it setup the right messages with the path field of the element. If you setup the messages manually as we do here, you must set the nfield field with the number of messages going to the xcell element, otherwise it will not display anything. The nfield field of xcell is not documented.






next up previous contents
Next: Setup of Experiments Up: A Practical Example 2: Previous: A Practical Example 2:   Contents
2002-11-15