Comments (5)
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.
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.
@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.
@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.
Issue closed, since set_status for initial values has been integrated into the master branch.
from nestml.
Related Issues (20)
- [Feature Request] Continuous input conductance in compartmental models HOT 1
- Error indexing a vector with a local variable
- [feature request] Integrate and Fire mechanism for compartmental models HOT 2
- Forbid assigning to inline expression
- Add coco to check post_ports code generation option
- Allow physical units to appear in expressions without a numeric literal?
- Enhance runtime performance for plastic synapses
- Improve nomenclature for tests
- Fix scaling for delta pulses
- Menu not accessible in mobile version of documentation HOT 1
- Symbol resolution bug for locally defined variables
- Error with `random_normal()` function HOT 1
- New way of handling convolutions HOT 1
- Sender_id information available in the update block HOT 5
- ``get_parent()`` is excruciatingly slow
- Address review comments on #879
- Improve handling of NEST synaptic delay parameter
- Issue in generate_code_for() HOT 2
- Documentation issue on hh_cond_exp_traub neuron model HOT 1
- Implement continuous input in NESTML compartmental
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nestml.