This file gives a short introduction to the neurite growth simulator
written in python, with work name iGrow.
This is the solver used by the simulator to advance time and to keep
track of all the different states. It uses the clock object to track
The program prints more information about what is going on when this
is set to true.
Specify how large the solver matrix is pre-allocated. If the
simulation growths beyond this size the matrix is automatically
Specifies the method used by the solver, can be impEuler, RK4, euler,
RK2. The implicit euler method is recommended.
The solver automatically splits compartments that get too big, and
merges compartment if they are smaller than a predefined size.
quantity, transport, reaction, production
The quantity matrix keeps track of how many molecules each compartment
contain (in mol). Transport, reaction and production each describe the
flux, reactions and production of molecules. They are updated by the
step function each time step.
Replaces the old clock with a new clock object specified by the user.
Lets the user specify a function that is called every step, good for
customizing your simulations.
Adds a compartment to be tracted by the solver in the simulation.
Internal function that keeps track of which compartments needs to have
their elements in the reaction, transport and production matrixes
Growth cones are special compartments which can elongate and retract
depending on their states. Strictly speaking it is not the compartment
itself that changes size, instead it moves, and the second compartment
will elongate or retract to compensate. This helps reduce the
fluctuations in the concentration due to volume changes.
Specifies which file to save the simulation output to. The first in
argument is the name, the second one is an optional flag to specify
whether only the concentrations in the compartments, or also the
fluxes should be saved.
Initialises the solver. It verifies that every compartment has a
positive length, and also merges and splits compartment when needed
based on maxCompartmentLength and minCompartmentLength.
Optionally this can also try and remove transients by calling the
function removeTransients. It also calls _stepAction.init() if there
is a _stepAction function defined.
First calls the user supplied _stepAction, if any exists. Then it
steps the simulation forward one time step using the selected solver
method, the time step is defined in the clock object. The reaction,
transport and productions are calculated. Then the growth cones are
updated and moved. After that the spatial discretisation is updated,
and the transport and reaction matrixes are updated
accordingly. Lastly the output from this time step is written to file.
This function checks if any of the stop conditions specified by the
user where met, and if so takes appropriate action then removes the
stop condition. For example one action could be to save the current
state, change a parameter, continue the simulation, the restart it
from the save point and change another parameter. This gives plenty of
flexibility, and also saves time as the entire simulation need not be
Specifies a stop condition that is checked each simulation step, the
stop condition also includes an optional action to be taken after
stopping the simulation.
Finishing up the simulation, closing the output file.
Tries to remove any transients by first estimating how long it would
take for diffusion to propagate from the soma to growth cone furthest
away. It clamps the soma and the growth cone concentrations during the
transient removal process.
Performs similar function to removeTransient. Why did I write two functions?!
Runs the simulation from current time to end of simulation.
stepEuler, stepRK2, stepRK4, implicitEuler
Helper function to step the simulation one time step forward using a
Increases the number of substances tracked by the solver. When the old
limit is hit this function is automatically called.
Modifies the transport and reaction matrixes.
Goes through all substances and sets their production rate specified
by the substane objects.
Merges and splits compartments when needed. Called by step, uses the
helper functions _splitCompartment and _mergeCompartment.
Prints all compartments to stdout.
Saves and loads the state of the simulation.
This file contains the default parameters for the simulation.
neuriteGrowthPoly - polymerisation rate
neuriteGrowthDepoly - depolymerisation rate
This function loads an experiment from a text file previously written
by matlab, or by hand. It takes the solver, a file to load and an
optional overwrite flag, whether an existing output file will be
overwritten or prevent this parameter set for being recalculated. The
latter is useful if multiple workers are using the same list of files