Results Postprocessing > Create Results > 11.3 Derived Results
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
11.3 Derived Results
Deriving results is a powerful tool and gives a fair amount of flexibility. In this respect, Derived Results differs from Combined Results significantly. If only a simple global scaling of a Result Case is desired or the scaling and/or addition of one or more like Result Cases (subcases) is desired, then it is advisable to use Combined Results as explained in Combined Results, 4. When more complex derivations are needed such as extracting the maximum or minimum values from multiple layers and Result Cases or creating a new results quantity, then the derive capability must be used. Derive Results can be as simple as extracting max/min values or as complex as creating PCL expressions to derive new results. There are therefore, five Methods available to derive results: Maximum, Minimum, Sum, Average, and PCL Function.
Derived results can only be created. There is no Modify function for derived results.
Toggles the form to select results for derivations when the Method is set to Maximum, Minimum, Average, Sum, or PCL Function.
To derive results, these basic operations must be followed:
1. Set the Action to Create, the Object to Results and the Method to the function you wish to perform. Is it the extraction of max/min values, averaging or summing, or a more complicated expression that will have to be define with a PCL function? Set this with the Method pulldown at the top of the form.
 
2. Select a Result Case or Cases from the Select Result Case(s) listbox. See Selecting Results, 15 for a detailed explanation of this process as well as Filtering Results, 20.
3. Define a new name for the derived result. Default names can be accepted and no action is required.
 
4. Select a Result from the second listbox. It is important to understand that whatever result type is selected, the same result type will be created. That is if the result type is scalar, vector or tensor, then the newly derived result will be either a scalar, vector or tensor, respectively.
 
5. For Average, Sum, and PCL Function derivations skip to step 6. Otherwise select the Quantity for comparison purposes, such as von Mises, from the Quantity option pulldown menu. The following quantities are available from vector and tensor data.
Vector to Scalar. Magnitude, X Component, Y Component, Z Component.
Tensor to Scalar. von Mises, XX, YY, ZZ, XY, YZ, XZ, Minor, Intermediate, Major, Hydrostatic, 1st Invariant, 2nd Invariant, 3rd Invariant, Tresca, Max Shear, Octahedral. See Derivations, 8.
For vector or tensor result types a resolution to the selected scalar quantity is made for comparison purposes only. The resulting result remains a vector or tensor.
 
6. If more than one layer is associated with the selected result, select the layer(s) from which you wish to derive results using the Position button.
 
7. Skip this step unless a PCL Function derivation is requested. If the function is the derivation of results based on a PCL function, then determine what the type of the new derived result will be. That is, will it be a scalar value, a vector, or a tensor? Then define the PCL expression. This is explained below in PCL Expressions, 9.
 
8. Optionally you can select target entities from which to derive results if you wish to limit where the new results are calculated. By default all entities associated with the selected Result Cases will be targeted. However you may limit it to only particular selected entities as explained in Target Entities, 13. Target entities are specified by pressing the second button toggle on the top of the form.
9. Optionally you can set comparison criteria (Algebraic or Absolute) and other optional result manipulations such as scaling and coordinate transformations. This is explained in Result Options, 14.
10. Press the Apply button when ready to create the derived result.
Max/Min
Once the Apply button is pressed, the following internal operations occur:
1. Any operations under Plot Options are performed. This includes coordinate transformations, scale factors, etc.
2. The scalar Quantity is derived from vector or tensor data. For scalar results, this step is not necessary.
3. The maximum or minimum comparison is done for each target entity based on the derived scalar result Quantity for vector/tensor data or the scalar result itself for scalar data.
4. What is kept from the comparison is not the Quantity itself, but the scalar, vector, or tensor values based on the Quantity comparison for each entity. The new results are stored in the database in the same form as the originally selected results. That is, nodal data remains nodal, element centroidal data remains as element centroidal, and element nodal or element gauss data remain as is. A single new Result Case of maximum or minimum data is created from this operation.
Average/Sum
Once the Apply button is pressed, the following internal operations occur:
1. Any operations under Plot Options are performed. This includes coordinate transformations, scale factors, etc.
2. The individual components of the selected result type are summed separately for all selected Result Cases and layers. For vector data, the X, Y, and Z components are summed separately. For tensor data, the XX, YY, ZZ, XY, YZ, and ZX components are summed separately.
3. For the Average method, the sum of each component is then divided by the number of occurrences. For example, if at a particular node six Result Cases contain results, the average will be computed by adding the six together and dividing by six. It is possible to have a different number of results existing at different target entities.
4. The new results are stored in the database in the same form as the originally selected results. That is, nodal data remains nodal, element centroidal data remains as element centroidal, and element nodal or element gauss data remain as is. A single new Result Case of averaged or summed data is created by this operation.
PCL Expressions
Once a PCL expression has been defined and the Apply button is pressed, the following internal operations occur:
1. Any operations under Plot Options are performed. This includes coordinate transformations, scale factors, etc.
2. The PCL expression is applied to all results in the selected Result Cases and/or layers.
3. The new results are stored in the database in the form as indicated by the New Result Type setting. Note that nodal data remains nodal, element centroidal data remains as element centroidal, and element nodal or element gauss data remain as is. A new Result Case is created for every selected Result Case and a new layer for every selected layer.
The PCL Expression builder form is shown below. You may type in your own PCL equation but for most operations, the PCL expression can be built simply by pressing the arithmetic operator buttons and selecting intrinsic functions and/or independent variables from the listboxes. No typing is required unless you need to reference user defined PCL functions. For detailed information on how to write your own PCL functions see Chapter 1: Introduction to Customization (p. 1) in the .
The variables used in the PCL expression must begin with the $ sign, (i.e., $SCALAR). The variable simply signifies that when the expression is evaluated for a particular entity (say at a node), the results value for that entity will be used in the variable to derive the new result and this will be the case for every entity selected for the derivation.
Vectors require three function definitions. Tensors require six. These function definitions are separated by semi-colons (example: $XX; $YY; $ZZ/2).
The Independent Variables available for use in the PCL equation are dependent on what results type you have asked to derive. For derivations from scalar values, the only variable available is $SCALAR. However when vector results have been selected you have the choice of these variables:
Vector to Scalar: $MAG (magnitude), $XX (X component), $YY (Y-component.), $ZZ (Z-component.). See Derivations, 8.
For tensor results you have the choices of these variables:
Tensor to Scalar: $VONM (von Mises), $XX, $YY, $ZZ, $XY, $YZ, $ZX, $MINOR, $INTER, $MAJOR, $HYDRO, $INV1, $INV2, $INV3, $TRESCA, $MAXSHR, $OCT. See Derivations, 8.
The intrinsic functions available for scalar derived results are:
Function
Description
ABS(value)
Returns the absolute value of the result argument.
ACOSD(value)
Returns the angle in degrees which corresponds to the trigonometric cosine of the result contained in the argument.
ACOSR(value)
Returns the angle in radians which corresponds to the trigonometric cosine of the result contained in the argument.
ASIND(value)
Returns the angle in degrees which corresponds to the trigonometric sine of the result contained in the argument.
ASINR(value)
Returns the angle in radians which corresponds to the trigonometric sine of the result contained in the argument.
ATAND(value)
Returns the angle in degrees which corresponds to the trigonometric tangent of the result contained in the argument.
ATANR(value)
Returns the angle in radians which corresponds to the trigonometric tangent of the result contained in the argument.
ATAN2D(x, y)
Returns the angle in degrees to the trigonometric tangent represented by the specified x and y components in the argument.
ATAN2R(x, y)
Returns the angle in radians which corresponds to the trigonometric cosine of the result contained in the argument.
COSD(angle)
Returns the trigonometric cosine value of the result argument specified in degrees.
COSR(angle)
Returns the trigonometric cosine value of the result argument specified in radians.
EXP(value)
Returns the power function of natural logarithm base, e to the x, where x is the result value argument.
LN(value)
Returns the natural logarithm of the result argument.
LOG(value)
Returns the common logarithm (base 10) of the result argument.
SIND(angle)
Returns the trigonometric sine value of the result argument specified in degrees.
SINR(angle)
Returns the trigonometric sine value of the result argument specified in radians.
SQRT(value)
Returns the square root of the result argument.
TAND(angle)
Returns the trigonometric tangent value of the result argument specified in degrees.
TANR(angle)
Returns the trigonometric tangent value of the result argument specified in radians.
User Defined
Any user defined function that can accept a scalar, vector, or tensor array may be used. For example you might have function defined in Patran called my_result_function. You would then type it in manually and enter one, or more of the independent variables separated by commas, i.e., my_result_function($XX, $YY, $ZZ). Inside your function $XX, $YY, and $ZZ are defined as REAL variables. For vector and tensors, the function parameters must be defined as REAL 3x1 and 3x3 dimensioned variables respectively. The return value must be the same as the type of new result being created: scalar, vector, or tensor. See User Defined PCL, 12.
All intrinsic function accept a single scalar quantities as input, e.g., SIND($XX) except ATAN2D and ATAN2R. Also note that PCL derived results from as-is coordinate systems results in a new result in an undefined coordinate system. The new result can there for not be transformed into any other coordinate system. To avoid this it is suggested to derive the new results in a know, consistent coordinate system such as the Global system.
Examples:
Function
Description
LN($SCALAR)
Would generate the natural log of the variable $SCALAR when deriving a new scalar result.
$XX;$YY;$ZZ
Would generate a vector replicating the input result.
$XX+$YY;$YY+$ZZ;0.0
Would generate some sort of user modified result with the Z component of the vector set to 0.0.
$ZX;$YZ;$XY;$ZZ;$YY;$XX
Would swap the order of the components in a tensor.
User Defined PCL
You may enter your own user defined PCL functions also that have been compiled into Patran. A user defined PCL function must be set up to accept scalar values as the parameters and return a single scalar value. Any number of scalar parameter inputs may be defined. For example you may enter a function:
myFunction( $XX, $YY, $ZZ )
The contents of your PCL functions might look something like:
FUNCTION myFunction( x, y, z )
	REAL x, y, z		/* these are real scalars */
	RETURN x+y+z		/* must return a scalar value */
END FUNCTION
To use this function, enter it as you would a variable (no $ sign however). Examples:
Function
Description
LN(myFunction($XX, $YY, $ZZ))
Would generate the natural log of the returning value form myFunction when deriving a new scalar result.
myFunction($XX, $YY, $ZZ);2.0;2.0
Would generate a vector with the returning value of myFunction as the first component and the second and third set to 2.0.
For more information on how to create and compile PCL functions see The PATRAN Command Language (PCL) Introduction (Ch. 2) in the PCL and Customization.
Target Entities
Similar to the other graphical plot tools in the Results application, derived results can be limited to various entities via the Target Entities options.
Toggles the form to select target entities for creating derived results.
You may wish to derive results for only a few elements or nodes or those entities associated with a group or group of groups.
The following table describes in detail to which entities derived results can be targeted:
Entity
Description
Entire Model
This is the default option where derivations will be performed for all entities (nodes or elements) associated with the selected results. No consideration or selection of any graphical entities is necessary.
Current Viewport
The derived results can be limited to only the entities (nodes or elements) associated with everything in the currently active viewport.
Nodes
Individual nodes may be selected from which to create a graph. Nodes are selected graphically from the screen and fill the databox. However, you may type in any node numbers manually. Be sure to include the word Node in front of the IDs you type in manually, (i.e., Node 1 5 55 100 etc.). Elemental based results are extrapolated to the nodes and averaged.
Elements
Individual elements may be selected for which to derive results. Elements are selected graphically from the screen and fill the databox. However, you may type in any element numbers manually or by selecting them graphically from the screen. Be sure to include the word Elem in front of the IDs you type in manually, (i.e., Elem 1 5 55 100 etc.). With elemental data, values will be extrapolated or averaged to the element centroid for reporting purposes.
Groups
Derived results can be limited to only selected groups. A selected group or groups must have nodes or elements in them otherwise the derivation will not work. A listbox allows selection of the group(s) for which the derived results will be calculated.
Materials
Derived results can be targeted at only those finite elements which have certain material properties assigned to them. A listbox appears allowing selection of the materials for whose elements will be targeted.
Properties
Derived results can be targeted at only those finite elements which have certain element properties assigned to them. A listbox appears allowing selection of the properties for whose elements will be targeted for a fringe display.
Element Types
Derived results can be limited to only certain element types also.
Important:  
Once a target entity has been selected, it will remain the target entity for derived results until the user physically changes it.
Result Options
Derived results have various options that are available for specifying how and what operations are to be performed.
Result Options selection button. Toggles the form to select Results options for derived results.
The following table describes in detail the Derived results options which can be modified:
Option
Description
Coordinate Transformations
Vector and tensor results can be transformed into any of the following coordinate systems: any user defined local system (CID), the projection of any CID, the Patran global system, a material coordinate system, element IJK coordinate system or the nodal (analysis) coordinate system depending on the type of result (vector, or tensor). See Coordinate Systems, 27 for a definition of each of these coordinate systems. The default is no transformation, which will derive data in the coordinate frame as stored in the database. Typically the solver code will calculate results at nodes in the analysis coordinate system specified by the user. These can vary from node to node. Element data can be stored from the analysis code in any coordinate system.
Scale Factor
This scale factor has the effect of simply scaling the results up or down by the specified amount before derivation.
Comparison Criteria
When doing maximum or minumum comparisons this toggle indicates the type of comparison to be made. Algebraic will consider the sign, negative numbers being less than positive numbers. Absolute will ingnore the sign and compare only the relative magnitude. Example: Comparing -6 to 5 algebraically will render 5 larger than -6, yet absolutely, -6 is larger than 5.
Save Derived Results
If this toggle is OFF, then no new Result Case and/or subcase will be created. The new result will simply be stored in a results register. This is not too terribly useful unless you are doing PCL programming and understand the use of registers.
 
Important:  
Once plot options have been selected, they will remain in effect for the derivation until the user physically changes them.