"Simple Formula"
"Simple Formula"

This method calculates results from a "simple" mathematical formula using built-in data components and standard maths operations.
All calculations are performed using floating point arithmetic and produce a single result, thus:
- Scalar components are evaluated from a single formula
- Vector components use three (independent) formulae: one for each of [x,y,z]
- Tensor components use six formulae, one for each of[xx,yy,zz,xy,yz,zx]
Syntax rules for Simple Formulae
Formulae follow typical "computer programming" syntax, using
commonly understood operators.
| Operators supported: | ||
| *, /, +, - | Multiply, divide, plus and minus | * and / take precedence over + and - |
| ** and ^ | To the power of. Thus "x**2" is "x squared" | Note that "^" is Fortran syntax, not the C "exclusive OR" operator. |
| % | Modulus operator (x % y is remainder of x / y) | There is also a "mod" maths function. |
| ( ... ) | Brackets may be nested to any (reasonable) level | (...) take precedence over all other operators |
| Note: all arithmetic is floating point, thus both "5.0 / 2.0" and "5 / 2" will both deliver the answer 2.5 | ||
A formula must be a single line, up to 256 characters long.
Standard D3PLOT "built in" data components supported
| Category | Acronym | Description | Acronym | Description |
| Nodal data |
bx
cx
dx
vx
ax
|
Basic X coordinate
Current X coordinate
X displacement
X velocity
X acceleration
|
rdx
rvx
rax
temp
tfx
dtdt |
X rotation displacement
X rotation velocity
X rotation acceleration
Temperature
X temperature flux
dTemp / dTime |
|
Solid and
shell data |
Stress and strain tensor-derived data is extracted in the global frame of reference unless the " l " (for "local") suffix is added to the component acronym, in which case it is extracted in the element local system. See below for how the Frame of Reference transformation applies to Simple Formula components. | |||
| Global tensor components |
sxx
syy szz sxy or syx syz or szy szx or sxz |
XX stress
YY stress ZZ stress XY stress ( symmetric ) YZ stress ( ditto ) ZX stress ( ditto) |
exx
eyy ezz exy or eyx eyz or ezy ezx or exz |
XX strain
YY strain ZZ strain XY strain ( symmetric ) YZ strain ( ditto ) ZX strain ( ditto ) |
| Element Local tensor components |
sxxl
syyl szzl sxyl or syxl syzl or szyl szxl or sxzl |
XX stress
YY stress ZZ stress XY stress ( symmetric ) YZ stress ( ditto ) ZX stress ( ditto) |
exxl
eyyl ezzl exyl or eyxl eyzl or ezyl ezxl or exzl |
XX strain
YY strain ZZ strain XY strain ( symmetric ) YZ strain ( ditto ) ZX strain ( ditto ) |
| Non-directional components derived from tensor data |
svon
evon
|
von Mises stress
Max principal stress Mid principal stress Min principal stress Average stress (pressure) Max shear stress von Mises strain Max principal strain Mid principal strain Min principal strain Average strain (pressure) Max shear strain |
epl
erate
|
Effective plastic strain
Strain rate
Engineering Minor strain Engineering Thickness strain |
| Non-directional components from Nastran OP2 file |
sen
ken
|
Strain energy
Kinetic energy
|
enl
|
Energy loss
|
| Shell only data |
rfx
rfy rfxy rqx rqy rmx rmy rmxy s2max s2min e2max e2min eratio
|
Fx resultant force
Fy resultant force Fxy resultant force Qx resultant force Qy resultant force Mx resultant moment My resultant moment Mxy resultant moment
2D (in plane) max princ stress
2D (in plane) max princ strain
|
thk
eden
|
Shell Thickness
Internal energy density
|
| Solid only data | erate | Strain rate |
vol
rvol |
Element Volume
Element Relative volume |
| Beam only data |
bfx
bmxx
bsxx
bsax
|
Axial force
XX torsional moment
XX axial stress
Total axial strain
|
bbed
bsen
bken
benl
|
Bending energy density
Strain energy
Kinetic energy
Energy loss
|
|
"Extra" and
ALE data |
sox
n
shx n |
Solid Extra component #n
Shell Extra component #n |
ammg
n
adens
|
Ale Multi-Matl group #n
Ale density
|
|
Contact data
|
csn
cst csx csy carea |
Contact Normal Stress
These are contact segment
|
cfgx
cfgy cfgz cflx cfly cflz cfm |
Contact global X force
|
|
LSDA (binout) data
(Only available if both
|
sw_f
sp_f
xsec_f_x
|
Spotweld
axial force
Spring axial force
Database X-sect X force
|
sb_f
sr_p
rt_f
spc_f_x
|
Seatbelt axial force
Slipring pull-through
Retractor force
SPC X force (at node)
|
|
User-defined
components |
unos
n
usss n ubms n |
Nodal scalar component #n
So/Sh scalar component #n Beam scalar component #n |
Simple formulae may reference other user-defined components as well as the standard components above. | |
|
Material properties
valid for Parts and
|
dens
|
Material density
Young's modulus Poisson's ratio Yield stress Failure strain |
These are calculated by PRIMER and written to the .ZTF file, so they will only be available if a ZTF file has been read. (A binout file is not required.) Not all properties are calculable for all material types, and -1.0 will be returned where values cannot be computed. |
|
Applicability of the "Standard" data components in the table above
The data components above are all implicitly available for nodes.
-
Where the data is nodally-derived (eg current X coordinate
cx
)
then the value is used directly.
- Where the data is element-derived (for example beam axial force bfx , or contact stress csn ) then the nodal value will be the average of all elements of the relevant type meeting at that node.
Elements may only use components of their "native" type, or nodally-derived data.
-
Where an element data component matches the element type (eg X stress
sxx
for shells, or YY bending moment
bmyy
for beams) then it is used directly.
-
Where an element references a nodally-derived data component (eg
X displacement
dx
) the value used will
be the average of all nodes on that element.
- Where an element references an element-derived data component of a different type (eg a shell element refers to beam axial force bfx ) then the result will be zero.
Applicability of programme settings: Integration point, frame of reference, etc.
-
Data is extracted "per integration point" for user-defined
components, and it is not currently possible to specify data from some
explicit integration point within a Simple Formula, meaning that you
cannot use this method to assemble data from multiple integration points
in an element.
-
The current global / local / cylindrical "frame of reference" (see
REF_FRAME... Choosing the frame of reference
)
does
not apply
when a Simple Formula value is calculated from
raw tensor components (eg Sxx) for solids and shells. The unqualified
acronym (Sxx, Syz, ...) always extracts global data, and the acronym
with an "l" suffix (eg Sxxl, Sxzl) always extracts element
local data.
However if you build a tensor Simple Formula (6 formulae) for solids or shells then the current "Frame of reference" is applied when it is used . In other words tensor Simple Formulae are created as "raw data", exactly like analysis data read from disk, and are subject to the same transformations when used. It is necessary to work this way in order to prevent "double transformations". (Scalar and vector user-defined components are not transformed.)
Maths functions supported
ALL calculations in simple formulae are processed using double precision floating point arithmetic. This includes constants, and means that the "integer arithmetic" conventions of languages such as Fortran or C, and their associated truncation, do not apply.
Also the "integer" functions above ( int, nint, ceil , floor ) return integer values, but expressed as floating results.
|
|||||||||||||
|
Examples of simple formulae
Note that the "built in" data components described above can be referred to as simple acronyms, whereas maths functions require their arguments to be placed inside brackets.
|
|||||||||||||
Defining a scalar formulaIn the case of a scalar component only a single formula is used. In the example here the user is calculating pressure at nodes from stress components. |
|
||||||||||||
Defining a vector formulaIn the case of a vector component three formulae are used, one for each of the [x,y,z] components. These are three wholly separate formulae which are evaluated independently. In the example here the user is applying factors to displacements at nodes. Note that each row must have a formula defined for the component to be valid. |
|
||||||||||||
Defining a tensor formulaIn the case of a tensor component six formulae are used, one for each of the [xx,yy,zz,xy,yz,zx] components. These are six wholly separate formulae which are evaluated independently. In the example here the user is extracting only the in-plane (2D) components of strain for an element. As with vectors each row must have a formula defined for the component to be valid even if, as here, some row values are set explicitly to zero. |
|
||||||||||||
|
Further notes on Simple FormulaeHandling errors and missing dataIf the expression being evaluated is grammatically legal, but not valid in a given context, then zero is returned. Typical examples are:
Evaluation of element quantities at nodesIf an expression refers to an element data component, for example sxx , but is being evaluated for a node, then the relevant value is averaged from all legal elements at that node subject to the current averaging rules in force. This can result in elements of more than one type being used: in this example component sxx , X stress, can be present in solids, shells and thick shells, so if multiple element types use the node then the value will contain contributions from all of them. In general you should avoid contouring element quanties evaluated at nodes, since the effect is to smear out results and hence miss peak values at element centres. The result is identical to "low resolution" contouring of element data for scalar components.
Evaluation of nodal quantities at elementsIf an expression refers to a nodal quantity, for example cx current X coordinate, but is being evaluated for an element, then the average value from all the nodes on that element is used.
Limitations of simple formulaeSimple formulae are powerful and very easy to use, but they do have limitations:
|
|||||||||||||