- #1
Hepth
Gold Member
- 464
- 40
I have a LARGE function that I must integrate over 2 variables, {x,y} both from 0 to 1.
The Function looks like :
F[x_,y_] = A[q] G[x,y] + B[q] G2[x,y] + (...)
Where (...) MAY be 100's of terms long, if not thousands. But the fact is each term is separable, in SOME way to a function of x and y (and no other units or unknown variables).
Each G function is quite complicated as well, and so far takes over 3 minutes each to integrate algebraically, though can be numerically integrated in under a second or two. They're all well behaved in the integration region.
Is there a way, other than expand F, and dividing out A[q] etc for each, doing the NIntegrate, then multiplying it again, to numerically integrate this equation so it ends up being:
result = (0.14325) A[q] + (-4.5602134) B[q] + (...)
Can I tell NIntegrate to integrate around variables?
I know something like NIntegrate[ a x^2,{x,0,1}] will throw an error due to an undefined "a" inserted.
The Function looks like :
F[x_,y_] = A[q] G[x,y] + B[q] G2[x,y] + (...)
Where (...) MAY be 100's of terms long, if not thousands. But the fact is each term is separable, in SOME way to a function of x and y (and no other units or unknown variables).
Each G function is quite complicated as well, and so far takes over 3 minutes each to integrate algebraically, though can be numerically integrated in under a second or two. They're all well behaved in the integration region.
Is there a way, other than expand F, and dividing out A[q] etc for each, doing the NIntegrate, then multiplying it again, to numerically integrate this equation so it ends up being:
result = (0.14325) A[q] + (-4.5602134) B[q] + (...)
Can I tell NIntegrate to integrate around variables?
I know something like NIntegrate[ a x^2,{x,0,1}] will throw an error due to an undefined "a" inserted.