- #1
rsc42
- 6
- 0
I have a symbolic function of three variables which I'm trying to numerically integrate wrt a single variable. Consider (syms x y a) and the function f(x,y,z). Here are some things I've tried, without success:
1. >>int(f(x,y,z),x,a,b)
which analytically integrates f wrt x from a to b but, with 3+ hours runtime, Matlab hasn't been able to solve it.
2. >>double(int(f(x,y,z),x,a,b))
but this requires that Matlab first try to solve it analytically before solving it numerically. And Matlab thinks it can solve it analytically so it never gets around to a numerical solution.
3. Variations on >>quad(inline(f),a,b)
but quad only accepts single variable functions. quad2d, dblquad and higher order quads can handle multivariable functions but only if you're integrating over all variables.
4. I've also tried expanding individual within my integral so as to soften it up for int(f(x,y,z)...) but with no luck since this requires I limit the region within which the resulting expression is valid.
I'd appreciate any help you could give me. Thanks!
Rebekah
1. >>int(f(x,y,z),x,a,b)
which analytically integrates f wrt x from a to b but, with 3+ hours runtime, Matlab hasn't been able to solve it.
2. >>double(int(f(x,y,z),x,a,b))
but this requires that Matlab first try to solve it analytically before solving it numerically. And Matlab thinks it can solve it analytically so it never gets around to a numerical solution.
3. Variations on >>quad(inline(f),a,b)
but quad only accepts single variable functions. quad2d, dblquad and higher order quads can handle multivariable functions but only if you're integrating over all variables.
4. I've also tried expanding individual within my integral so as to soften it up for int(f(x,y,z)...) but with no luck since this requires I limit the region within which the resulting expression is valid.
I'd appreciate any help you could give me. Thanks!
Rebekah