Giter Club home page Giter Club logo

Comments (5)

mschmidt87 avatar mschmidt87 commented on June 19, 2024

What I found out:
If I put the state variable in the state block instead of the initial_values block, NESTML complains that

The variable has to be defined in the 'initial_values' block for being unsed on the left side of an ODE

Putting the variable in both blocks (initial_values and state) leads to the error:

The variable is defined multiple times

So, how to make sure that a state variable that is governed by an ODE enters the state dictionary?
By the way: The initial_values is not documented in doc/syntax.md .

from nestml.

mschmidt87 avatar mschmidt87 commented on June 19, 2024

Another finding: Looking into the generated C++-Files, we found that the get_v and set_v Function exists, but it does not appear in the set_status Function.

from nestml.

kperun avatar kperun commented on June 19, 2024

@mschmidt87
To put it simply: It's a missing feature which I will include in one of the next updates of PyNestML.
Explanation: The initial_values is something new which has been added not that long ago, thus several features for code generation has not yet been updated to support the generation of these properties. NestML error messages are correct: by declaring the variable in both, it leads to a redeclaration. Otherwise, if you put it only in the state block, the ODEs are not provided with any starting values. So it is correct to simply state those variables in the init values block.
I will fix the problem of missing get/set in the get_status/set_status and update this ticket here to inform you.

from nestml.

kperun avatar kperun commented on June 19, 2024

@mschmidt87
I have updated PyNestML and included this feature. Until it is merged into the official branch, feel free to use this one:
https://github.com/kperun/nestml/tree/stable_PyNestML

set_status and get_status now also include everything to access the variables of the initial values block. So you can use SetStatus(neuron, {'v': -60., 'g_k': 0.}) where v is an initial values variable. If there are any bugs, please report them.
Best regards
Konstantin

from nestml.

kperun avatar kperun commented on June 19, 2024

Issue closed, since set_status for initial values has been integrated into the master branch.

from nestml.

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.