Next: Intrinsics and Technicalities Up: Some Useful Tricks with Previous: Other Fields Contents

# Exercises

1. In the Purkinje cell tutorial, plot the overall contribution of one of the channels in a `graph`. Add code that allows to inspect the overall influx in the cell (the currents are modeled with two separate channels).
2. To randomize the properties of a population before a simulation, I once encountered code a bit like the following (I summarized it to the pieces of interest):

         echo "Randomizing granule cells"
         for (i = {number_granule_cells}; i > 0; i = i - 1)
           pushe /granule_cell_layer/Granule[{i-1}]/soma
           initvm = {rand {Vm_init_lb} {Vm_init_ub}}
           setfield . initVm {initvm}
           setfield . Vm     {initvm}
           setfield . Em     {rand {Granule_E_leak_lb} {Granule_E_leak_ub}}
           call /granule_cell_layer/Granule[{i-1}]/solve \
             HPUT /granule_cell_layer/Granule[{i-1}]/soma
           pope
           pushe /granule_cell_layer/Granule[{i-1}]/soma/mf_AMPA
           setfield . \
                   gmax {{getfield . gmax}
                         * (1 + {weight_distribution} * {rand -1 1})}
           call /granule_cell_layer/Granule[{i-1}]/solve HPUT .
           pope
         end

   The man that sent me the code complained that `hsolve` is indeed very fast, but the setup of `hsolve` takes ages. What is redundant in the code above? Why? Is this causing a bottleneck during the simulation?