pyrates-neuroscience / PyRates

Open-source, graph-based Python code generator and analysis toolbox for dynamical systems (pre-implemented and custom models). Most pre-implemented models belong to the family of neural population models.
https://pyrates.readthedocs.io/en/latest/
GNU General Public License v3.0
74 stars 8 forks source link

Allow variable initialization #12

Closed jajcayn closed 5 years ago

jajcayn commented 5 years ago

Right now I couldn't find a way how to initialize variables. By default, all variables (input, output, variable) are initialized at 0. When using a variable in equations as e.g.

tau_h = ...
h = (1/tau_h) ...

the compile method (I must add correctly) throws

ValueError: Result of operation (numpy_multiply) contains NaNs or infinite values.

It would be nice to give the users an option to initialize integration variables with some non-zero values.

jajcayn commented 5 years ago

I found a way, not sure if this was intended but when you do:

  V:
    default: input -70.

it initializes V at -70.0.

Closing this.