Modigliani  2.0
A stochastic simulator for axons, neurons, and networks
Public Member Functions | List of all members
modigliani_core::Membrane_compartment Class Reference

Membrane_compartment class acts as a "container + glue" for the various Membrane_current classes that can be attached to it. More...

+ Inheritance diagram for modigliani_core::Membrane_compartment:

Public Member Functions

 Membrane_compartment (const modigliani_base::Real newArea, const modigliani_base::Real newTemperature, const modigliani_base::Real newCm, const modigliani_base::Real newRa)
 Constructor. More...
 
virtual modigliani_base::ReturnEnum AttachCurrent (Membrane_current *currentPtr, CurrentType type=IONIC)
 Adds a new current to the compartment. More...
 
virtual modigliani_base::ReturnEnum Step (const modigliani_base::Real newVM)
 Sets the membrane potential to the specified value and runs of step of simulation. More...
 
virtual modigliani_base::ReturnEnum Step ()
 Sets the membrane potential according to membrane current and runs of step of simulation. More...
 
modigliani_base::ReturnEnum InjectCurrent (modigliani_base::Real current)
 Injects current into the compartment. More...
 
modigliani_base::Real AttachedConductance (modigliani_base::Size currentIndex)
 Returns the current conductance of the attached conductance source. More...
 
modigliani_base::Real AttachedReversalPotential (modigliani_base::Size currentIndex)
 Returns the reversal potential of the attached conductance source. More...
 
virtual modigliani_base::ReturnEnum SetupOutput (std::string output_file_name)
 Opens an output file and writes the header. More...
 
virtual modigliani_base::ReturnEnum WriteOutput () const
 Writes the current flwoing through all attached Membrane_current instances to a binary file. More...
 
modigliani_base::Real TimeConstant () const
 Membrane time constant at instaneous membrane conductivity. More...
 
const Membrane_currentCurrent (modigliani_base::Size currentIndex) const
 Returns the current object at the given index. More...
 
modigliani_base::Real area () const
 Returns the membrane surface area. More...
 
modigliani_base::Real vm () const
 Returns the membrane potential. More...
 
void set_vm (modigliani_base::Real newVoltage)
 Sets the membrane potential. More...
 
modigliani_base::Real cm () const
 Sets the membrane capacitance per surface area. More...
 
modigliani_base::Real ra () const
 Sets the axial resistance. More...
 
virtual modigliani_base::ReturnEnum set_temperature (modigliani_base::Real newTemp)
 Set temperature in compartment and for all currents within the compartments. More...
 
modigliani_base::Real temperature () const
 Returns temperature in compartment. More...
 
modigliani_base::Real CompartmentMembraneCapacitance () const
 Returns total compartment capacitance. More...
 
modigliani_base::Real CompartmentMembraneNetCurrent () const
 Returns net membrane current. More...
 
modigliani_base::Real CompartmentChannelStateTimeConstant () const
 Sum of escape rates from current state. More...
 
bool GillespieStep ()
 Perform one step of the Gillespie algorithm. More...
 
modigliani_base::Size NumberCurrents () const
 Returns the number of currents attached to the compartment. More...
 
modigliani_base::Real WeightedConductance () const
 Returns the sum of attached conductance weighted by the difference between the membrane potential and the reversal potential. More...
 
const std::vector
< Membrane_current * > 
current_vec () const
 Returns the vector of attached currents. More...
 
- Public Member Functions inherited from modigliani_core::Object
modigliani_base::Real timestep () const
 Returns simulation timestep. More...
 
void set_timestep (modigliani_base::Real newTimeStep)
 Sets simulation timestep. More...
 

Detailed Description

Membrane_compartment class acts as a "container + glue" for the various Membrane_current classes that can be attached to it.

Constructor & Destructor Documentation

modigliani_core::Membrane_compartment::Membrane_compartment ( const modigliani_base::Real  newArea,
const modigliani_base::Real  newTemperature,
const modigliani_base::Real  newCm,
const modigliani_base::Real  newRa 
)

Constructor.

Parameters
newAreaMembrane surface area in [ $\si{\micro\meter\squared}$]
newTemperatureTemperature in [C]
newCmMembrane capacitance in [ $\si{\micro\farad\per\centi\meter\squared}$]
newRaAxoplasmic resistance in [ $\si{ohm,\centi\meter}$]

Member Function Documentation

modigliani_base::Real modigliani_core::Membrane_compartment::area ( ) const
inline

Returns the membrane surface area.

Returns
Membrane area in [ $\si{\micro\meter\squared}$]
modigliani_base::ReturnEnum modigliani_core::Membrane_compartment::AttachCurrent ( Membrane_current currentPtr,
CurrentType  type = IONIC 
)
virtual

Adds a new current to the compartment.

Parameters
currentPtrPointer to the Membrane_current object
typeCurrent type

Reimplemented in modigliani_core::Custom_cylindrical_compartment.

modigliani_base:: Real modigliani_core::Membrane_compartment::AttachedConductance ( modigliani_base::Size  currentIndex)
inline

Returns the current conductance of the attached conductance source.

You can think of this as returning $G*m(t)^3*h(t)$ for a Hodgkin-Huxley sodium channel.

Parameters
currentIndexThe current source we are interested in.
Returns
Conductance in [mS]
Warning
Currents are index as in Matlab : [1..m]
modigliani_base:: Real modigliani_core::Membrane_compartment::AttachedReversalPotential ( modigliani_base::Size  currentIndex)
inline

Returns the reversal potential of the attached conductance source.

Parameters
currentIndexThe current source we are interested in.
Returns
Reversal potential in [mV]
Warning
Currents are index as in Matlab : [1..m]
modigliani_base::Real modigliani_core::Membrane_compartment::cm ( ) const
inline

Sets the membrane capacitance per surface area.

Returns
capacitance in [ $\si{\micro\farad\per\centi\meter\squared}$]
modigliani_base::Real modigliani_core::Membrane_compartment::CompartmentChannelStateTimeConstant ( ) const

Sum of escape rates from current state.

This is useful for the Gillespie algorithm.

Returns
Escape rate in $[\si{\kilo\hertz}$]
modigliani_base::Real modigliani_core::Membrane_compartment::CompartmentMembraneCapacitance ( ) const

Returns total compartment capacitance.

Returns
Capacitance in [ $\si{\micro\farad}$]
modigliani_base::Real modigliani_core::Membrane_compartment::CompartmentMembraneNetCurrent ( ) const

Returns net membrane current.

Returns
Current in [ $\si{\nano\ampere}$]
const Membrane_current* modigliani_core::Membrane_compartment::Current ( modigliani_base::Size  currentIndex) const
inline

Returns the current object at the given index.

Returns
Pointer to the Membrane_current object
Warning
Currents are index as in Matlab : [1..m]
const std::vector< Membrane_current * > modigliani_core::Membrane_compartment::current_vec ( ) const
inline

Returns the vector of attached currents.

Returns
Vector of Membrane_current pointers
bool modigliani_core::Membrane_compartment::GillespieStep ( )

Perform one step of the Gillespie algorithm.

Warning
This is not as well tested as the binomial algorithm.
modigliani_base::ReturnEnum modigliani_core::Membrane_compartment::InjectCurrent ( modigliani_base::Real  current)

Injects current into the compartment.

This funcion is used to mimic the effects of a current injection in to cell.

Parameters
currentCurrent to inject in [nA]
Returns
Success or failure
modigliani_base::Size modigliani_core::Membrane_compartment::NumberCurrents ( ) const

Returns the number of currents attached to the compartment.

This includes both ion channels and leak currents.

Returns
Number of currents
modigliani_base::Real modigliani_core::Membrane_compartment::ra ( ) const
inline

Sets the axial resistance.

Returns
axial resistance in [ $\si{\ohm\centi\meter}$]
virtual modigliani_base::ReturnEnum modigliani_core::Membrane_compartment::set_temperature ( modigliani_base::Real  newTemp)
inlinevirtual

Set temperature in compartment and for all currents within the compartments.

This also affects future attached currents.

Parameters
newTempNew temperature in [ $\si{\celsius}$]

Reimplemented in modigliani_core::Custom_cylindrical_compartment.

void modigliani_core::Membrane_compartment::set_vm ( modigliani_base::Real  newVoltage)
inline

Sets the membrane potential.

Parameters
newVoltageMembrane potential in [ $\si{milli\volt}$]
modigliani_base::ReturnEnum modigliani_core::Membrane_compartment::SetupOutput ( std::string  output_file_name)
virtual

Opens an output file and writes the header.

This function is used to create a file in which to dump data during the simulation. For performance reasons (mainly when loading output files into Matlab) we use a binary file format. Data is dumped sequentially into the file, and the header is a simple float32 stating the number of columns that should be used to reshape the data.

See Also
WriteOutput()
Parameters
output_file_nameOutput file name
Returns
Success status
Warning
Call after having attached all currents.

Reimplemented in modigliani_core::Custom_cylindrical_compartment.

modigliani_base::ReturnEnum modigliani_core::Membrane_compartment::Step ( const modigliani_base::Real  newVM)
virtual

Sets the membrane potential to the specified value and runs of step of simulation.

The membrane compartment has one mode of operation. If the voltage is specified externally at each time step, the compartment acts as a container for the occuring current objects, integration has to be provided externally. e.g. :

* FLOAT voltage;
* LOOP
* voltage = IntegrateDifferentialEquation( c.vm() );
* c.Step( voltage );
* END LOOP;
*

Additionally single compartment HodgkinHuxley simulation is possible using this where the voltage is updated at each step, if the old voltage is specified as input. e.g. :

* LOOP
* c.Step( c.vm() );
* vM += deltaVM * _timeStep();
* END LOOP;
*
Parameters
newVMThe membrane potential in [mV]
Returns
Success or failure

Reimplemented in modigliani_core::Custom_cylindrical_compartment.

modigliani_base::ReturnEnum modigliani_core::Membrane_compartment::Step ( )
virtual

Sets the membrane potential according to membrane current and runs of step of simulation.

See Also
Step()
Returns
Success or failure

Reimplemented in modigliani_core::Membrane_patch.

modigliani_base::Real modigliani_core::Membrane_compartment::temperature ( ) const
inline

Returns temperature in compartment.

Returns
Temperature in [ $\si{\celsius}$]
modigliani_base::Real modigliani_core::Membrane_compartment::TimeConstant ( ) const
inline

Membrane time constant at instaneous membrane conductivity.

Warning
Uses weighted conductance
Returns
Time constant in [ms]
modigliani_base::Real modigliani_core::Membrane_compartment::vm ( ) const
inline

Returns the membrane potential.

Returns
Membrane potential in [ $\si{\milli\volt}$]
modigliani_base::Real modigliani_core::Membrane_compartment::WeightedConductance ( ) const

Returns the sum of attached conductance weighted by the difference between the membrane potential and the reversal potential.

Returns
Current in [ $\si{\micro\ampere}$]
modigliani_base::ReturnEnum modigliani_core::Membrane_compartment::WriteOutput ( ) const
virtual

Writes the current flwoing through all attached Membrane_current instances to a binary file.

The values are written sequentially as float32. There are no delimiters. They can be reshaped into a matrix using the number of columns written into the header by SetupOutput().

See Also
SetupOutput()
Returns
Success or Failure

Reimplemented in modigliani_core::Custom_cylindrical_compartment.


The documentation for this class was generated from the following files: