"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gkpglq$qff$1@fred.mathworks.com>...
> "Dhritiman " <dhritimanbhattacharya@uiowa.edu> wrote in message <gkpekf$699$1@fred.mathworks.com>...
> > the following integration takes atleast 7 to 10 minutes in my pc. Is there are faster method to do this.......i need to run this integration many times with diffferent upper and lower bounds new_z1,new_z2
> >
> > syms z w
> > y=int(138.2528*84.626456371135150*z*(10.99*z)*((1/w)^3.680000000000001)*((1/((2)*.06^3))*(z^(31))*(2.718281828459046^(z/.06))),z,new_z1,new_z2)
>
> Factor out all the stuff that doesn't depend on z and you can reduce the integral to:
>
> y=int(z^3*(10.99*z)*exp(z/.06),z,new_z1,new_z2)
>
> That ought to integrate a lot faster. Then multiply the removed factors back in.
>
> Roger Stafford
Second thought. Instead of forcing 'int' to solve the same definite integral over and over again for differing bounds, do an indefinite integral of the above simplified function of z just once. Then you can find its definite integral for various lower and upper bounds by simple substitution according to the rules of calculus.
It looks as if the indefinite integral should be fairly easy for the symbolic toolbox to find. (You could even solve it yourself by consulting a good table of integrals.)
Roger Stafford
