【发布时间】:2016-08-05 08:11:50
【问题描述】:
调试 NEURON 模拟器 .MOD 文件有哪些有用的方法?在其他语言中,通常可以使用 print() 语句来查看变量值。 .MOD 文件中是否有类似 print() 语句的内容?
【问题讨论】:
标签: debugging neural-network neuroscience biological-neural-network neuron-simulator
调试 NEURON 模拟器 .MOD 文件有哪些有用的方法?在其他语言中,通常可以使用 print() 语句来查看变量值。 .MOD 文件中是否有类似 print() 语句的内容?
【问题讨论】:
标签: debugging neural-network neuroscience biological-neural-network neuron-simulator
使用printf()声明
例如,在 .MOD 文件的任何部分中,添加下面的 printf() 语句将在模拟期间每次评估该部分时打印变量 t, i, and v 值:
BREAKPOINT {
SOLVE state METHOD cnexp
g = (B - A)*gmax
i = g*(v - e)
printf("time: %g, current: %g, voltage: %g \n", t, i, v)
}
将导致如下所示:
time: 231.062, current: 0.000609815, voltage: -67.2939
time: 231.188, current: 0.000609059, voltage: -67.2938
time: 231.312, current: 0.000608304, voltage: -67.2937
time: 231.438, current: 0.00060755, voltage: -67.2936
time: 231.562, current: 0.000606844, voltage: -67.2924
注意事项:
【讨论】: