X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



4163 Rate this article:
5.0

Using Triple Integration in IDL

Calling the QROMB, QROMO, or QSIMP routine within a user-supplied function of one of these same routines allows the user to calculate double and triple integrals. This Help Article contains an example demonstrating triple integration.

Each term of an integrand (the equation within the integral) can contain another integration method. The double and triple integrations are performed over each term of the integrand. The following example uses triple integration to determine the volume of a three-dimensional equation over a specified region.

Integrating Over a Solid (Triple Integration): this example calculates the volume of the solid defined by

volume_equation.jpg

over the region defined by 0 <= x <= 1, 0 <= y <= 1, and 0 <= z <= 1. The solution can be found by evaluating the triple integral

volume_equation1.jpg

Note that the correct solution to this integral is 3.

This example program is made up of six routines: the main routine, the integration in the z-direction, the second integration of the xy term, the second integration of the second x^2*y^2 term, the third integration in the x term, and the third integration in the x^2 term. The main routine is the last routine in the program. The file containing this program should be named the same as the main routine (integratingOverAVolume.pro).

Code example:

FUNCTION xSquaredTerm, x

; Integration of the x squared term.
thirdIntegration = 9.*x^2
RETURN, thirdIntegration

END

FUNCTION xTerm, x

; Integration of the linear x term.
thirdIntegration = x
RETURN, thirdIntegration

END

FUNCTION xSquaredySquaredTerm, y

; Integration of the y squared term.
secondIntegration = QROMB('xSquaredTerm', 0., 1.)*y^2
RETURN, secondIntegration

END

FUNCTION xyTerm, y

; Integration of the linear y term.
secondIntegration = QROMB('xTerm', 0., 1.)*y
RETURN, secondIntegration

END

FUNCTION zDirection, z

; Re-write equation to consider both x terms.
firstIntegration = QROMB('xSquaredySquaredTerm', 0., 1.) + $
8.*(QROMB('xyTerm', 0., 1.))*z + 1.
RETURN, firstIntegration

END

PRO integratingOverAVolume

; Determine the area of the surface represented
; by 9x^2y^2 + 8xyz + 1.
volume = QROMB('zDirection', 0., 1. )

; Output results.
PRINT, 'Resulting volume: ', volume

END
_________________________________________
Reviewed by BC on 09/05/2014
Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »