Sorry about my delayed response--somehow I didn't see a "new comment" notice until today.
nianwosuh wrote:I am working through Model Control : Simulation Families on the on-line course, please I need some help to understand ;" SWITCHING TO PRODUCTION MODE" of that section. and to completethe code
Does the "automation of exploration " imply that the manual use of Gather values- Graph will be eliminated
Yes. Through just a little bit of programming, you make the computer do the repetitive task of placing the synapse at new locations, running new simulations, collecting results, and finally plotting the results.
Does it mean that as one moves the synapse using the "putsyn()", the graph of vm Vs x (synapse location)will be automatically plotted if the "myprofile.hoc" is called using the xopen("myprofile.hoc")?
Yes.
No period or x on this line, please.
Code: Select all
/* use Vector class .record() to "attach" vm to soma.v(0.5) */
This comment means you need to add, at this point in the code, a hoc statement that uses the Vector class's .record() method. See the Programmer's Reference for documentation of this.
The skeleton code contains the statement
and dend for (x) is what it should be in order to iterate over all the nodes in dend--see the documentation of "for" in the Programmer's Reference, then try this toy example for yourself:
1. start NEURON without a hoc file
2. at the oc> prompt enter this command
and at the next oc> prompt enter this command
Code: Select all
dend { print nseg for (x) print x }
hoc will print
1
0
0.5
1
The first number is the value of nseg. The other three are the locations of dend's nodes (every section has a node at 0 and 1, and a node at the center of each segment).
3. now enter the command
then repeat the command
Code: Select all
dend { print nseg for (x) print x }
(hint: to save some typing, use the keyboard's "up" arrow to recall the command, then press the Enter key). hoc will print
3
0
0.16666667
0.5
0.83333333
1
Back to your hoc code--
Code: Select all
vm = vec.max() /* find maximum element in vm */
If soma.v(0.5) was recorded to Vector vm, then you want vm.max(). And you want to save the result to a temporary variable--might as well call it vtemp.
Code: Select all
vdest.record(vm, x) // save the vm max and corresponding x values
This statement will generate an error message (there is no Vector called vdest), and unnecessary--a Vector record() statement should already have been executed before entering the for loop.
Code: Select all
vm.append(amplitude)/* append this to amplitude vector */
The Vector to which the peak amplitudes are to be appended is called amplitude. Following my hint from a few lines above, the variable whose value is to be appended would be called vtemp.
Code: Select all
x.append(location) /* append x to location vector */
Please see the Programmer's Reference for documentation of the syntax for the append() method.
Code: Select all
g = vec.plot(location, amplitude) /* plot amplitude vs. location */
I would suggest using the Vector class's plot() method. The syntax would be
amplitude.plot(g, location)
No need for these statements.