Arrays as RANGE variables
Posted: Mon Nov 10, 2008 4:13 pm
I'm using a bit of code from the examples that are around implementing radial diffusion with a variable number of concentric shells. The diffusible ion concentration is stored in a STATE variable that is initialized as an array and then used in a KINETIC block. I'd like to be able to see these concentrations from hoc during the a simulation so I think I need to make it a RANGE variable only it doesn't seem possible for a RANGE variable to be an array. My work around has been to make a whole bunch of RANGE variables, one for each shell and this makes it work fine.
It would be nice to be able to change the number of shells easily without having to add more variables each time (the KINETIC block works so nicely if you can loop over the array of concentrations...). Also I'd like to be accessing the concentration of several different diffusible molecules so I'd really rather not confuse things by having to make a RANGE variable for every molecule and every shell.
What is the best way to be able to see STATE variables that are arrays, in hoc (or python which is what I'm using....though if I get it into hoc i bet it'll be visible in python too!)?
Thanks,
-Andrew
It would be nice to be able to change the number of shells easily without having to add more variables each time (the KINETIC block works so nicely if you can loop over the array of concentrations...). Also I'd like to be accessing the concentration of several different diffusible molecules so I'd really rather not confuse things by having to make a RANGE variable for every molecule and every shell.
What is the best way to be able to see STATE variables that are arrays, in hoc (or python which is what I'm using....though if I get it into hoc i bet it'll be visible in python too!)?
Thanks,
-Andrew