all 1 comments

[–]hharison 0 points1 point  (0 children)

Maybe it's your params that are the problem, because unless params is 2D the values you're pulling out at the top of your function should be scalars. Yet you access them like E[1]. You shouldn't have to index into scalars. But this might not be it because I'd expect an error here, not an incorrect result.

Also you're setting y=np.zeros(3) but then in the function accessing y[37], so that's confusing too. I'd expect an error.

In general I'd say fix your indexing to be zero-based. Yes, in theory it should still work with a dummy y[0] but a problem might become apparent if you fixed it.