-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solving ODEEdges with algebraic variables without mass matrix #45
Comments
Hello Antomek, you could define two types of edges and pass them as an edge list to the Since we are always excited when our package find a new use case, I would be very curious to learn in which domain your system arises. Could you point me to any references? |
Hello Lindnemi, Thank you for the reply. If we model the synapses as the edges, this means that a neuron (or vertex) has the same electric effect on the downstream vertices with which it is connected. The upshot is that ideally I would like to mix an function edgeA!(de, e, v_s, v_d, p, t)
de[1] = f(v_s, e[1]) # ODE describing synaptic conductance depending on presynaptic voltage
e[2] = g(e[1], v_d) # Electric current which gets added to downstream neuron's voltage derivative
end and then be able to do something in the vertex along the lines of for e in e_d
dv[1] += e[2]
end I'm sure a workaround is possible but I cannot see it for the moment. |
Hi Antomek, Great application! I work with @lindnemi on the package. We've discussed this exact sort of situation before and are aware that it is useful for models in many different domains. You're correct to observe that at the moment there isn't a clean way to make it work with the package. It's in our planned features. In fact, we do have a prototype in place that implements what you describe. The example similar to yours is here from a working branch on my fork. Ignore the comment about DAE, that results from an earlier discussion. Take note that this branch isn't stable or complete, but the dynamics you describe are possible. We are still discussing how to finish up the interface to this feature. Are you interested in taking the proof-of-concept to a polished pull request for this feature, or should we let you know when we have completed it? It will move up the feature queue for me now that you've opened this issue. @lindnemi , I think we should rename or merge this issue to represent the "plasticity" issue, because the heterogeneous modeling in the original question you answered nicely. |
Hey Lima-Lima, Thank you, that example does look promising! |
There is already another way implemented to make the above version of
However this has two drawbacks:
With these issues in mind these types of mixed edges work fine, especially for smaller systems where optimized performance is not an issue. However the prototype by @Lima-Lima will eventually sidestep these issues altogether and any help getting this to a pull request is greatly appreciated :) |
Is there any update on doing this? This suggestion:
unfortunately doesn't work if you, e.g. have different values stored in the edges. for e in edges
if class(e) == :classA
dv[1] += e[1]
elseif class(e) == :classB
dv[2] += e[2]
end
end Are there ways of solving this that I am overlooking? |
Unfortunately no update on this. Next year we will have more funding to advance NetworkDynamics, at the moment the package is mostly in maintenance mode. If you want to open a PR on this problem, that would be very welcome. Anyways I thought of the following workaround: Basically you want to try to unify the addition, i.e., use
There are several ways to achieve that. If you do not need to keep the edge variables, you can overwrite those which are not used in the addition, e.g., function classB(e, v_s, v_d, K, t)
e[1] = f(...)
e[2] = g(...)
e[1] = 0.
end If you do indeed need them, you can increase the edge dimension
in combination with
Does this help with your problem? |
Hello all,
First I would like to thank you for the work being done on NetworkDynamics.jl. It looks very promising and potentially very useful!
I had a question on how to model heterogeneous networks. I hope this is the right place to ask it.
Specifically, suppose I have two types of vertices: type A and type B.
A vertex can be connected to either a vertex of the same type of the other type.
The network is described by a directed graph, and the connection is specified by the vertex from which it originates.
So essentially we have two types of edges: ones originating from type A vertices, and those originating from type B vertices.
Ideally I would like to do something of the lines of (in the ODE describing a vertex):
but at the moment I have no idea how to achieve something like this.
Any help is appreciated!
The text was updated successfully, but these errors were encountered: