Giter Site home page Giter Site logo

MOOSE script does not work about moose-core HOT 2 CLOSED

dilawar avatar dilawar commented on June 15, 2024
MOOSE script does not work

from moose-core.

Comments (2)

dilawar avatar dilawar commented on June 15, 2024

This is due to several changes made to MOOSE. The name of fields are standardized and changed; see the official documentation page (http://moose.ncbs.res.in/pymoose/index.html).

The working version of script having one passive soma and a current injection is following. The output should be like charging and discharging of RC circuit. Here I've changed the default values of RM and CM.

The moose.connect statements are changed to reflect the new naming scheme.

#!/usr/bin/env python

"""excercise.py: This is a simple excercise in moose. We just simulate a soma as
described by Subha on tutorial.

Last modified: Tue Feb 18, 2014  06:20PM

"""

__author__           = "Dilawar Singh"
__copyright__        = "Copyright 2013, NCBS Bangalore"
__credits__          = ["NCBS Bangalore", "Bhalla Lab"]
__license__          = "GPL"
__version__          = "1.0.0"
__maintainer__       = "Dilawar Singh"
__email__            = "[email protected]"
__status__           = "Development"


import moose

model = None
soma = None 
vmtab = None

def buildModel():
    global model 
    global soma
    model = moose.Neutral('/model')
    soma = moose.Compartment('/model/soma')
    soma.Em = -60e-3
    soma.Rm = 1e10
    soma.Cm = 1e-10
    return model

def stimulus():
    global soma
    global vmtab
    pulse = moose.PulseGen('/model/pulse')
    pulse.delay[0] = 50e-3
    pulse.width[0] = 100e-3
    pulse.level[0] = 1e-9
    pulse.delay[1] = 1e9
    vmtab = moose.Table('/soma_Vm')
    moose.connect(pulse, 'output', soma, 'injectMsg')
    moose.connect(vmtab, 'requestOut', soma , 'getVm')

def main():
    global vmtab
    buildModel()
    stimulus()
    moose.reinit()
    t = 500e-2
    moose.start(t)
    import pylab
    t = pylab.linspace(0, t, len(vmtab.vector))
    pylab.plot(t, vmtab.vector)
    pylab.savefig('soma_passive.png')

if __name__ == '__main__':
    main()

The output should be

soma

from moose-core.

dilawar avatar dilawar commented on June 15, 2024

The working script can be found here https://raw.githubusercontent.com/BhallaLab/moose-examples/master/passive/passive_soma.py

from moose-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.