# NEURON and NeuroML#

NEURON is a widely used simulation environment and is one of the main target platforms for a standard facilitating exchange of neuronal models.

## Simulating NeuroML models in NEURON#

jNeuroML or pyNeuroML can be used to convert NeuroML2/LEMS models to NEURON. This involves pointing at a LEMS Simulation file describing what to simulate, and using the -neuron option:

# Simulate the model using NEURON with python/hoc/mod files generated by jNeuroML
jnml <LEMS simulation file> -neuron -run

# Simulate the model using NEURON with python/hoc/mod files generated by pyNeuroML
pynml <LEMS simulation file> -neuron -run


These commands generate a PyNeuron script and run it (a file ending in _nrn.py). So you must have NEURON installed on your system, with its Python bindings (PyNeuron). Skipping the -run flag will generate the Python script but will not run it: you can run it manually later. Adding -nogui will suppress the NEURON graphical elements/menu opening and just run the model in NEURON in the background

You can also run LEMS simulations using the NEURON simulator using the pyNeuroML API:

from pyneuroml.pynml import run_lems_with_jneuroml_neuron

...

run_lems_with_jneuroml_neuron(lems_file_name)


## Using neuroConstruct#

NEURON simulations can also be generated from NeuroML model components by neuroConstruct, but most of this functionality is related to NeuroML v1.