From 9:00 AM - 12:00 PM CDT on Saturday, June 6th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

# divergence (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info

Owning Class: vector

Requires: MathScript RT Module

## Syntax

d = divergence(Fx, Fy)

d = divergence(dx, dy, Fx, Fy)

## Description

Computes the divergence of a two-dimensional vector field.

Details

Examples

## Inputs

Name Description
dx Specifies the spacing between points along the x-axis or between values of the second dimension in a 2D array. dx is an array of double-precision, floating-point numbers. The default is 1.
dy Specifies the spacing between points along the y-axis or between values of the first dimension in a 2D array. dy is an array of double-precision, floating-point numbers. The default is 1.
Fx Specifies the x-components of a two-dimensional vector field. Fx is a 2D array of double-precision, floating-point numbers.
Fy Specifies the y-components of a two-dimensional vector field. Fy is a 2D array of double-precision, floating-point numbers. size(Fy) must equal size(Fx).

## Outputs

Name Description
d Returns the z-components of the divergence of the vector field. d is of the same dimensions and data type as Fx.

## Details

You can specify the spacing between the points of the curl in two ways. If either dx or dy contains only one element, the spacing between two consecutive points in the corresponding axis is constant. If either dx or dy contains more than one element, the values of the elements specify the coordinates of the points in the corresponding axis. In this case, the length of dx or dy must conform to the corresponding dimension of the vector field.

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

## Examples

FX = rand(3, 4);
FY = rand(3, 4);
D = divergence(1:4, 1:3, FX, FY)