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.



4345 Rate this article:
No rating

Using Double Integration in IDL

Calling the QROMB, QROMO, and QSIMP routines within the user-supplied function of these same routines allows the user to calculate double and triple integrals. This Help Article contains an example demonstrating double 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 double integration to calculate the area of a surface over a specified region.

Integrating Over a Surface (Double Integration): this example calculates the area of the surface defined by

area_equation1.jpg

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

area_equation.jpg

Note that the correct solution to this integral is 3.

This example program is made up of four routines: the main routine, the integration in the y direction, the second integration of the x term, and the second integration of 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 (integratingOverASurface.pro).

Code Example:

FUNCTION xSquaredTerm, x

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

END

FUNCTION xTerm, x

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

END

FUNCTION yDirection, y

; Re-write equation to consider both x terms.
firstIntegration = QROMB('xSquaredTerm', 0., 1.)*y^2 $
+ 4.*(QROMB('xTerm', 0., 1.))*y + 1.
RETURN, firstIntegration

END

PRO integratingOverASurface

; Determine the area of the surface represented
; by 9x^2y^2 + 4xy + 1.
area = QROMB('yDirection', 0., 1. )

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

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 »