-`NeuronalBilayerSonophore` defines the **full electromechanical model for any given neuron type**. To do so, it inherits from `BilayerSonophore` and receives a specific `PointNeuron`objectatinitialization.
Allthreeclassescontaina`simulate` method to simulate the underlying model's behavior for a given set of stimulation and physiological parameters. The `NeuronalBilayerSonophore.simulate` method contains an additional `method` argument defining whether to perform a detailed (`full`), coarse-grained (`sonic`) or hybrid (`hybrid`)integrationofthedifferentialsystem.
```$ python run_astim.py -n RS -a 32 -f 500 -A 100 --tstim 150 --method sonic -p Qm```
Thesimulationresultsaresavedin`.pkl` files. To view these results directly upon simulation completion, you can use the `-p [xxx]` option, where `[xxx]` can be `all` or a given variable name (e.g. `Z` for membrane deflection, `Vm` for membrane potential, `Qm`formembranechargedensity).
Youcanalsoeasilyrunbatchesofsimulationsbyspecifyingmorethanonevalueforanygivenstimulationparameter(e.g.`-A 100 200` for sonication with 100 and 200 kPa respectively). These batches can be parallelized using multiprocessing to optimize performance, with the extra argument `--mpi`.
1.Createanewfile,andsaveitinthe`neurons` sub-folder, with an explicit name (e.g. `my_neuron.py`)
2.Copy-pastethecontentofthe`template.py` file (also located in the `neurons`sub-folder)intoyourfile
3.Inyourfile,changetheclassnamefrom`TemplateNeuron` to something more explicit (e.g. `MyNeuron`), and change the neuron name (used to refer to the neuron from outside the class) accordingly (e.g. `myneuron`)
6.Modifytheexisting`alphax` and `betax` methods (and add new ones if needed) to define the voltage-dependent activation and inactivation rates of the different ion channnels gates of your model. Those methods take the membrane potential `Vm` as input and return a rate in `s-1`. **You also need to modify the docstring accordingly, as this information is used by the package**. Alternatively, your can use `xinf` and `taux`methods,butyouwillneedtomodifytheotherclassmethodsaccordingly.
7.Modifythe`derX` methods to define the derivatives of your different gating states. Those methods must return a derivative in `prob/s` (or `s-1`).**Youalsoneedtomodifythedocstringaccordingly,asthisinformationisusedbythepackage**
8.Modifythe`iXX` methods to define the different membrane currents of your model. Those methods take relevant gating states and the membrane potential `Vm` as inputs, and must return a current density in `mA/m2`.**Youalsoneedtomodifythedocstringaccordingly,asthisinformationisusedbythepackage**
9.Modifytheotherrequiredmethodsoftheclass:
-The`currents` method that takes a membrane potential value `Vm`andavectorofgatingstatesasinputs,andreturnsadictionaryofmembranecurrents
-The`steadyStates` method that takes a membrane potential value `Vm`asinput,andreturnsadictionaryofgatingsteady-states
-The`derStates` method the membrane potential `Vm`andavectorofgatingstatesasinputs,andreturnsadictionaryofgatingstatesderivatives
-The`computeEffRates` method that takes a membrane potential array `Vm` as input, and returns a dictionary of effective (i.e. averaged over the `Vm`array)gatingsteady-states
-The`derEffStates` method that takes a membrane charge density value `Qm`,avectorofgatingstates,andalookupdictionaryasinputs,andreturnsadictionaryofeffectivegatingstatesderivatives
10.Addtheneuronclasstothepackage,byimportingitinthe`__init__.py` file of the `neurons`sub-folder:
12.Pre-computelookuptablesrequiredtoruncoarse-grainedsimulationsoftheneuronmodeluponultrasonicstimulation.Todoso,gotothe`scripts` directory and run the `run_lookups.py`scriptwiththeneuron'snameascommandlineargument,e.g.: