Repository navigation
Replies: 1 comment 13 replies
import numpy as np
import quadpy
def integrand(x):
return [np.sin(x), np.ones_like(x)]
res, err = quadpy.quad(integrand, 0, 1) |
13 replies
Answer selected by
piperfw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm looking to integrate a vector-valued function of a single variable. Following the example
I tried
Expecting the second element of
resto be1.0, but instead I get the ValueErrorValueError: Expected the function return value to be of shape (..., 21), but got shape (2,) instead.Where am I going wrong? Apologies for such a basic question. I noted that changing
1.0to1.0+x*0.0allowed the second integral to be performed.All reactions