

We will establish the limits by solving the equation We will do this using ezplot:Īlthough this looks like an ellipse, it is actually a quartic curve. To determine the limits for x and y, it may be helpful to plot the curve along which the upper and lower limits for z coincide. This determines the lower and upper limits for z. Consequently, we will solve the equation of the ellipsoid for positive z and use ezmesh to plot both surfaces.Įzmesh(sqrt(20-3*x^2-2*y^2),) įrom the viewpoint we have chosen, using MATLAB's view comand, we can see that there is a region inside the ellipsoid that is bounded below by the paraboloid and above by the ellipsoid. Since z is never negative on or above the paraboloid, we are interested only in positive values of z. We might begin by plotting the two surfaces simultaneously.

Let us consider the region above the paraboloid Integration can always be performed by one of the methods illustrated above. The remaining issue in the evaluation of triple integrals is the determination of limits. (For the numerical integration, first do the integral over z, then use newnumint2 on this intermediate result.) The accuracy is: double(firstans-fourthans)īoth symbolically and numerically. To the cube of this parameter, so be extra careful about increasing it.įourthans=numint3(x*y*z,z,0,3-x-y,y,0,3-x,x,0,3) Is 8.) The higher this parameter, the more accurate the results however, the running time of the algorithm is proportional Again there is an optional final parameter, which is the number of subdivision points to use in each direction. The analogue of newnumint2 for triple integrals is called numint3. Which is pretty good!! Now we try a totally numerical integration. Note that this answer looks the same as the first two to four decimal places, but that we are spared all the annoying warning

To the square of this parameter, so be careful about increasing it. Is 20.) The higher this parameter, the more accurate the results however, the running time of the algorithm is proportional The syntax is the same as for numint2, but there is an optional final parameter, which is the number of subdivision points to use in each direction. To see how it works, we first try out an alternative version of numint2, based on nit, called newnumint2.

To use this package, first add the package with the command: Copy this package from into a subdirectory of your working directory called nit. This toolbox is much faster and more adaptable (though admittedly sometimes harder to use) than dblquad. We have looked for an alternative, based on a freeware package of M-files called the numerical integration toolbox. Thirdans = triplequad(h, 0, 3, 0, 1, 0, 1)īut because dblquad is sometimes slow (and the same algorithm extrapolated to three dimensions would be even slower) or doesn't work very well, So in the new coordinates, the integral is over the box 0
