.. currentmodule:: brian2

.. simple_case:

Example: simple_case
====================


        .. only:: html

            .. |launchbinder| image:: file:///usr/share/doc/python-brian-doc/docs/badge.svg
            .. _launchbinder: https://mybinder.org/v2/gh/brian-team/brian2-binder/master?filepath=examples/standalone/simple_case.ipynb

            .. note::
               You can launch an interactive, editable version of this
               example without installing any local files
               using the Binder service (although note that at some times this
               may be slow or fail to open): |launchbinder|_

        

The most simple case how to use standalone mode.

::

    from brian2 import *
    set_device('cpp_standalone')  # ← only difference to "normal" simulation
    
    tau = 10*ms
    eqs = '''
    dv/dt = (1-v)/tau : 1
    '''
    G = NeuronGroup(10, eqs, method='exact')
    G.v = 'rand()'
    mon = StateMonitor(G, 'v', record=True)
    run(100*ms)
    
    plt.plot(mon.t/ms, mon.v.T)
    plt.gca().set(xlabel='t (ms)', ylabel='v')
    plt.show()
    

