DIFF returns the derivative in a location in a two- or more dimensional space
Syntax
- DIFF(Pno%, Ndim%, "ColLab$_1,.., "ColLab$_Ndim%", Xint_1, ..., Xint_Ndim%-1, [DirivNo%])
- DIFF(0, Npoints%, x_1, y_1, x_2, y_2,…, x_n, y_n, Xint, [DirivNo%=1]) (only in 2D)
- DIFF(@ObjFn(..), Ndim%, @ObjColPar_1,.., @ObjColPar_Ndim%, Xint_1, ..., Xint_Ndim%-1, [DirivNo%])
- DIFF(Telitab$, Ndim%, "ColLab$_1",.., "ColLab$_Ndim%", Xint_1, ..., Xint_Ndim%-1, [DirivNo%])
Arguments
- Pno% is the number that refers to the TeLiTab sets in the Data slot. Pno% should be an integer value or a parameter which is assigned an integer value and is the number of the TeLiTab set in the expressions' data slot.
- Npoints% is the number of points (x,y) that are given in direct definition.
- @ObjFn() refers to the Object from which data will be used.
- TeLiTab$ refers to the string parameter that contains the TeLiTab.
- Ndim% is the number of dimensions (or columns in the table...).
- "ColLab$_1" and @ObjColPar_1 refer to the column that will be used as the first parameter in the differentiation.
- "ColLab$_2" and @ObjColPar_2 refer to the column that will be used as the second parameter in the differentiation.
- Xint are the coordinates on which to compute the derivative dx/dy.
- DirivNo% is an optional argument by which can be indicated for which index of x_i the differential dx_i has to be computed. In y=f(x) DirivNo% should either be one (1) or omitted. If omitted or larger than Ndim%-1, the x_Ndim%-1 is assumed as differential
- See also Telitab access for a generic description on the use of TeLiTab data
- Similar to other Data analysis functions, the DIFF is a convenient way to evaluate data. Please also look at these functions for syntax examples
- Please realise the dataset provided to DIFF should be a function. Every x-value should have one y-value. Furthermore, in case of a multi-dimensional dataset you should provide a matrix of coordinates.
- Extrapolation outside the x-range is performed parabolically.
Examples
Syntax 1: TeLiTab in Dataslot
In this example, the TeLiTab is addressed in the Dataslot. The function y is defined as y = DIFF(1, 2, "XC", "YC", x, 1) With the following Telitab set in the Data slot:
For x = 2.5, the function returns
y=5 NOTE: In case you apply the symbolic addressing of the columns for the description of the point on the curve or surface to compute the differential for, e.g. "Par_x" and "Par_y", please make sure that your Telitab set contains these names. If not, an error message is generated and the calculation is stopped.
Syntax 2: Direct definition
In direct definition, the points of the curve are stated in the Relation itself. This method can only be used for 2D derivatives, the syntax is: DIFF(Pno%, Ndim%, "ColLab$_1,.., "ColLab$_Ndim%", Xint, [DirivNo%]) If Pno%=0 then all x_i and y_i values should be numeric expressions. The minimum number of x,y data points Ndim% in the list is 2 in which case the interpolation (and differentiation) is performed linear. Let the function y be defined as
y = DIFF(0, 4, 1, 1, 2, 4, 3, 9, 4, 16, x, 1) For x=2.5, this function returns
y=5
Syntax 3: TeLiTab in string
We have a relation:
DataSet2# = TEXTITEM$(1)
With in its dataslot:
And use the following relation to determine the derivative:
Calculated_Value=DIFF(DataSet2#,3,"X","Y","Z", Input_Value_x, Input_Value_y, OptionalDirivNo)
With Input_Value_x = 1, Input_Value_y = 2 and OptionalDirivNo = 2 this gives Calculated_Value=2
Quick links: Function overview | Attribute overview | Constants overview | Dimensions overview