Skip to content
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

passing heterogenious edge parameters in presense of a stochastic layer #99

Open
sho7014 opened this issue Sep 8, 2021 · 2 comments
Open

Comments

@sho7014
Copy link

sho7014 commented Sep 8, 2021

Hello,

When the size of an array of heterogeneous edge parameters does not match the number of edges of a stochastic layer (e.g. in case of a static layer without any edges), an error arises.

ERROR: Error: The size of the parameter array does not match the number of edges. Make sure the correct number of parameters is given when using the tuple syntax.

The error is getting trapped at L88 of:
https://github.com/PIK-ICoNe/NetworkDynamics.jl/blob/57635388611caddabc47f7bfd64899b3aaf1f1c8/src/nd_ODE_Static.jl

If they match, then everything is fine. This might be unintended behavior for some cases because vertex-independent noise is widely used for sde modeling. Some remarks regarding the behavior in the tutorial might be helpful.

@lindnemi
Copy link
Collaborator

Hello,

thank you for raising this issue, it's indeed unintended behaviour. As an immediate fix i suggest a closure:

sde_prob = SDEProblem(nd, (dx,x,p,t) -> nd_noise(dx,x,nothing,t), u0, (0., 500.), p)

@sho7014
Copy link
Author

sho7014 commented Sep 22, 2021

Thank you for the concise and smart fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants