JuliaDynamics / NetworkDynamics.jl

Julia package for simulating Dynamics on Networks
https://juliadynamics.github.io/NetworkDynamics.jl/dev/
MIT License
128 stars 13 forks source link

order of arguments in accessing_edge_values.jl #121

Closed kafu16 closed 1 year ago

kafu16 commented 1 year ago

In examples/accessing_edge_values.jl the order of arguments might be not correct. It is

gd_nd = nd(sol(1.0), 1.0, nothing, GetGD) # exposes underlying graph data struct

whereas in the documentation it says

gd_nd = nd(x, p, t, GetGD) # exposes underlying graph data struct

So the order of p and t differs in accessing_edge_values.jl and the documentation.

Interestingly, independently of the order of the arguments, e_values = gd_nd.gdb.e_array leads to the same results.

Also

gd_nd = nd(sol(1.0), nothing, 2.0, GetGD)
e_values = gd_nd.gdb.e_array

seems to invoke the function at time t=1.0 and gives the same results.

hexaeder commented 1 year ago

I think you're right. The example code does not show any difference because there is neither a parameter dependency nor an explicit time dependency in the rhs of the system. So in the example you can pass whatever you want in both slots, won't make a difference.