Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
565 views

Using Parameters in ANSYS

This document provides an overview of using parameters in ANSYS. It discusses defining scalar and array parameters through commands like *SET and *GET. Parameters can be numeric, character, or table types. Guidelines are provided for naming parameters and assigning values during execution or at startup. The document also covers retrieving ANSYS-supplied values and storing them in parameters using *GET or inline get functions.

Uploaded by

Nam Vo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
565 views

Using Parameters in ANSYS

This document provides an overview of using parameters in ANSYS. It discusses defining scalar and array parameters through commands like *SET and *GET. Parameters can be numeric, character, or table types. Guidelines are provided for naming parameters and assigning values during execution or at startup. The document also covers retrieving ANSYS-supplied values and storing them in parameters using *GET or inline get functions.

Uploaded by

Nam Vo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Chapter 3: Using Parameters


Go to the Next Chapter
Go to the Previous Chapter
Go to the Table of Contents for This Manual.

Chapter 1 * Chapter 2 * Chapter 3 * Chapter 4 * Chapter 5 * Chapter 6

3.1 Parameters
Parameters are APDL variables (they are more similar to Fortran variables than to Fortran parameters). You
don't need to explicitly declare the parameter type. All numeric values (whether integer or real) are stored as
double-precision values. Parameters that are used but not defined are assigned a near-zero, or "tiny," value of
approximately 2-100. For example, if parameter A is defined as A=B, and B is not defined, then A is assigned
the tiny value.

ANSYS uses two types of parameters: scalar and array. The first part of this chapter discusses information
that is applicable to both types. Starting with section 3.11, the information is specific to array type
parameters.

Character strings (up to eight characters long) can be assigned to parameters by simply enclosing the string
in single quotes. APDL also provides several types of array parameters: numeric, character, and table (a
special numeric type that automatically interpolates values).

You can use a parameter (instead of a literal number or character string) as an argument to any ANSYS
command; the parameter is evaluated and its current value is used for that argument. For example, if you
assign the value 2.7 to a parameter named AA and then issue the command
N,12,AA,4

the ANSYS program will interpret the command as

N,12,2.7,4

(which defines node 12 at X=2.7 and Y=4).

3.2 Guidelines for Parameter Names


Parameter names must

Begin with a letter.


Contain only letters, numbers, and underscore characters.
Contain no more than eight characters.

Examples of valid and invalid parameter names are

Valid:

ABC

PI

X_OR_Y

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 1/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Invalid:

NEW_VALUE (more than 8 characters)

2CF3 (begins with a number)

M&E (invalid character "&")

When naming parameters

Avoid parameter names that match commonly used ANSYS labels, such as:
Degree of freedom (DOF) labels (TEMP, UX, PRES, etc.)
Convenience labels (ALL, PICK, STAT, etc.)
User-defined labels (such as those defined with the ETABLE command)
Array type field labels (such as CHAR, ARRAY, TABLE, etc.)
Be aware that parameter names ARG1 through ARG9 and AR10 through AR99 are reserved for local
parameters. Generally, local parameters are used in macros (see Section 4.4). Use of these names as
"regular" parameters is not recommended.
Make sure that parameter names don't match abbreviations defined with the *ABBR command. For
more information about abbreviations, see Section 2.1.
Don't begin parameter names with an underscore (_). This is the convention reserved for parameters
used by the GUI and ANSYS-supplied macros.

3.3.2 Hiding Parameters from *STATUS


Section 3.3.4 discusses listing parameters through the *STATUS comand. You can use a parameter naming
convention to "hide" parameters from the *STATUS comand. Any parameter whose name ends in an
underscore (_) will not be listed by *STATUS.

This capability was added specifically for those who are developing APDL macros for large audiences. You
can use this to build macros that your ANSYS users and other macro programmers cannot list.

3.3 Defining Parameters


Unless otherwise specified, the information in the next several sections applies to both scalar and array type
parameters. Beginning with Section 3.11, the information is specific to array type parameters.

You can either assign values to parameters or retrieve values supplied by ANSYS and store these values in
parameters. For retrieving values from ANSYS, you can use either the *GET command or the various inline
get functions. The following sections cover these subjects in detail.

3.3.1 Assigning Parameter Values During Execution


You can use the *SET command to define parameters. The following examples illustrate a set of example
parameters defined using *SET:
*SET,ABC,-24
*SET,QR,2.07E11
*SET,XORY,ABC
*SET,CPARM,'CASE1'

You can use an "=" as a shorthand way of calling the *SET command (this is the most convenient method).
The format of the shortcut is Name=Value, where Name is the name assigned to the parameter and Value is
the numeric or character value stored in that parameter. For character parameters, the assigned value must be
enclosed in single quotes and cannot exceed eight alphanumeric characters. The following are examples of
"=" in use:

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 2/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

ABC=-24
QR=2.07E11
XORY=ABC
CPARM='CASE1'

In the GUI, you can either type the "=" directly in the ANSYS input window or in the "Selection" field of the
Scalar Parameter dialog box (accessed by the Utility Menu>Parameters>Scalar Parameters menu item).

3.3.2 Assigning Parameter Values At Startup


You can define parameters as arguments when launching ANSYS from the operating system command line.
Simply type parameter definitions after the ANSYS execution command (which is system dependent) using
the format -Name Value. For example, the following defines two parameters (parm1 and parm2) having the
values 89.3 and -0.1:
ansys55 -parm1 89.3 -parm2 -0.1

It's a good practice to avoid assigning one or two character parameter names at startup to avoid conflicts with
ANSYS command line options.

Note-Remember that UNIX shells treat single quotes and many other non- alphanumeric characters as
special symbols. When defining character parameters, you must tell UNIX not to interpret the quotes by
inserting a back slash (\) before the single quotes. For example, the following defines two character
parameters having the values `filename' and `200.'
ansys55 -cparm1 \'filename\' -cparm2 \'200\'

If you use the ANSYS Launcher to start ANSYS, you can define parameters through the Interactive or
Batch menu items (using the -Name Value format described above).

If you are defining a large number of parameters at startup, you'll find it much more convenient to define
these in the start5x.ans file or through a separate file that you can load through the /INPUT command
instead of the command line.

3.3.3 Assigning ANSYS-Supplied Values to Parameters


ANSYS provides two powerful methods for retrieving values:

The *GET command, which retrieves a value from a specified item and stores it in a specified
parameter.
The inline get functions, which can be used in operations. Each get function returns a specific value
from a specific item.

3.3.3.1 Using the *GET Command

The *GET command (Utility Menu>Parameters>Get Scalar Data) retrieves an ANSYS-supplied value
for an item (a node, an element, an area, etc.) and stores it as a user-named parameter. Various keyword,
label, and number combinations identify the retrieved item. For example, *GET,A,ELEM,5,CENT,X returns
the centroid x-location of element 5 and stores the result as parameter A.

The format for the *GET command is:


*GET,Par,Entity,ENTNUM,Item1,IT1NUM,Item2,IT2NUM

where

Par is the name of the parameter to store the retrieved item.


Entity is a keyword for the item to be stored. Valid keywords are NODE, ELEM, KP, LINE, AREA,
VOLU, etc. For a complete list of valid keywords, see the *GET description in the ANSYS Commands
mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 3/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Reference.
ENTNUM is the number of the entity (or zero for all entities).
Item1 is the name of an item for a particular entity. For example, if Entity is ELEM, Item1 will be
either NUM (the highest or lowest element number in the selected set) or COUNT (the number of
elements in the set). (For a complete list of Item1 values for each entity type, see the *GET description
in the ANSYS Commands Reference.)

You can think of the *GET command as a path down a tree structure, from general to specific information.

The following examples show the *GET command in use. The first command below gets the material
attribute (the MAT reference number) of element 97 and assigns it to parameter BCD:

*GET,BCD,ELEM,97,ATTR,MAT ! BCD = Material number of element 97


*GET,V37,ELEM,37,VOLU ! V37 = volume of element 37
*GET,EL52,ELEM,52,HGEN ! EL52 = value of heat generation in element 52
*GET,OPER,ELEM,102,HCOE,2 ! OPER = heat coefficient of element 102,face2
*GET,TMP,ELEM,16,TBULK,3 ! TMP = bulk temperature of element 16,face3
*GET,NMAX,NODE,,NUM,MAX ! NMAX = maximum active node number
*GET,HNOD,NODE,12,HGEN ! HNOD = value of heat generation at node 12
*GET,COORD,ACTIVE,,CSYS ! COORD = active coordinate system number

3.3.3.2 Using Inline Get Functions


For some items, you can use inline "get functions" in place of the *GET command. A get function returns a
value for an item and uses it directly in the current operation. This allows you to bypass the dual steps of
storing the value with a parameter name and then entering the parameter name in an operation. For example,
suppose that you want to calculate the average x-location of two nodes. You could do the following using the
*GET function:

1. Issue the following command to assign the x-location of Node 1 to parameter L1.
*GET,L1,NODE,1,LOC,X

2. Issue a second *GET command to assign the x-location of Node 2 to parameter L2.

3. Compute the middle location from MID=(L1+L2)/2.

A shorter method is to use the node location "get function" NX(N), which returns the x-location of node N.
You can use it to calculate the MID location without setting intermediate parameters L1 and L2, as is shown
in the following example:
MID=(NX(1)+NX(2))/2

Get function arguments can themselves be parameters or other get functions. For instance, get function
NELEM(ENUM,NPOS) returns the node number in position NPOS for element ENUM. Combining
functions, NX(NELEM(ENUM,NPOS)) returns the x-location of that node.

The following table summarizes the available get functions:

Get Function Retrieved Value

Entity Status:

NSEL(N) Status of node N (-1=unselected, 0=undefined, 1=selected)

ESEL(E) Status of element E (-1=unselected, 0=undefined, 1=selected)

KSEL(K) Status of keypoint K (-1=unselected, 0=undefined, 1=selected)

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 4/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

LSEL(L) Status of line L (-1=unselected, 0=undefined, 1=selected)

ASEL(A) Status of area A (-1=unselected, 0=undefined, 1=selected)

VSEL(V) Status of volume V (-1=unselected, 0=undefined, 1=selected)

Next Selected Entity:

NDNEXT(N) Next selected node having a node number greater than N

ELNEXT(E) Next selected element having an element number greater than E

KPNEXT(K) Next selected keypoint having a keypoint number greater than K

LSNEXT(L) Next selected line having a line number greater than L

ARNEXT(A) Next selected area having an area number greater than A

VLNEXT(V) Next selected volume having a volume number greater than V

Locations:

CENTRX(E) Centroid x-coordinate of element E in global Cartesian coordinate system

CENTRY(E) Centroid y-coordinate of element E in global Cartesian coordinate system

CENTRZ(E) Centroid z-coordinate of element E in global Cartesian coordinate system

NX(N) X-coordinate of node N in the active coordinate system

NY(N) Y-coordinate of node N in the active coordinate system

NZ(N) Z-coordinate of node N in the active coordinate system

KX(K) X-coordinate of keypoint K in the active coordinate system

KY(K) Y-coordinate of keypoint K in the active coordinate system

KZ(K) Z-coordinate of keypoint K in the active coordinate system

LX(L,LFRAC) X-coordinate of line L at length fraction LFRAC (0.0 to 1.0)

LY(L,LFRAC) Y-coordinate of line L at length fraction LFRAC (0.0 to 1.0)

LZ(L,LFRAC) Z-coordinate of line L at length fraction LFRAC (0.0 to 1.0)

Nearest to Location:

Number of the selected node nearest the X,Y,Z point (in the active coordinate system; lowest
NODE(X,Y,Z)
number for coincident nodes)

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 5/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

KP(X,Y,Z) Number of the selected keypoint nearest the X,Y,Z point (in the active coordinate system;
lowest number for coincident keypoints)

Distance:

DISTND(N1,N2) Distance between nodes N1 and N2

DISTKP(K1,K2) Distance between keypoints K1 and K2

Distance between the centroid of element E and node N. Centroid is determined from the
DISTEN(E,N)
selected nodes on the element.

Angles:

Subtended angle between two lines (defined by three nodes where N1 is the vertex
ANGLEN(N1,N2,N3)
node). Default is in radians (see the *AFUN command to select degrees).

Subtended angle between two lines (defined by three keypoints where K1 is the
ANGLEK(K1,K2,K3)
vertex keypoint). Default is in radians (see the *AFUN command to select degrees).

Nearest to Entity:

NNEAR(N) Selected node nearest node N

KNEAR(K) Selected keypoint nearest keypoint K

ENEARN(N) Selected element nearest node N. The element position is calculated from the selected nodes.

Areas:

AREAND(N1,N2,N3) Area of the triangle with vertices at nodes N1, N2, and N3

AREAKP(K1,K2,K3) Area of the triangle with vertices at keypoints K1, K2, and K3

Area at node N apportioned from selected elements attached to node N. For 2-D
planar solids, returns edge area associated with the node. For axisymmetric solids,
ARNODE(N)
returns edge surface area associated with the node. For 3-D volumetric solids,
returns face area associated with the node.

Normals:

NORMNX(N1,N2,N3) X-direction cosine of the normal to the plane containing nodes N1, N2, and N3

NORMNY(N1,N2,N3) Y-direction cosine of the normal to the plane containing nodes N1, N2, and N3

NORMNZ(N1,N2,N3) Z-direction cosine of the normal to the plane containing nodes N1, N2, and N3

NORMKX(K1,K2,K3) X-direction cosine of the normal to the plane containing keypoints K1, K2, and K3

NORMKY(K1,K2,K3) Y-direction cosine of the normal to the plane containing keypoints K1, K2, and K3

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 6/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

NORMKZ(K1,K2,K3) Z-direction cosine of the normal to the plane containing keypoints K1, K2, and K3

Connectivity:

Element connected to node N. LOC is the position in the resulting list when many
ENEXTN(N,LOC)
elements share the node. A zero is returned at the end of the list.

NELEM(E,NPOS) Node number in position NPOS (1-20) of element E

Faces:

Element adjacent to a face (FACE) of element E. The face number is the same as
the surface load key number. Only elements of the same dimensionality and
ELADJ(E,FACE)
shape are considered. A -1 is returned if more than one element is adjacent; A 0
is returned if there are no adjacent elements.

Node in position LOC of a face number FACE of element E. The face number is
NDFACE(E,FACE,LOC) the same as the surface load key number. LOC is the nodal position on the face
(for an IJLK face, LOC=1 is at node I, 2 is at node J, etc.).

Face number of element E containing the selected nodes. The face number output
NMFACE(E) is the surface load key. If multiple load keys occur on a face (such as for line and
area elements), the lowest load key for that face is output.

For 2-D planar solids and 3-D volumetric solids, returns the area of the face of
ARFACE(E) element E containing the selected nodes. For axisymmetric elements, the area is
the full (360°) area.

Degree of Freedom Results:

UX(N) UX structural displacement at node N

UY(N) UY structural displacement at node N

UZ(N) UZ structural displacement at node N

ROTX(N) ROTX structural rotation at node N

ROTY(N) ROTY structural rotation at node N

ROTZ(N) ROTZ structural rotation at node N

TEMP(N) Temperature at node N

PRES(N) Pressure at node N

VX(N) VX fluid velocity at node N

VY(N) VY fluid velocity at node N

VZ(N) VZ fluid velocity at node N

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 7/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

ENKE(N) Turbulent kinetic energy (FLOTRAN) at node N

ENDS(N) Turbulent energy dissipation (FLOTRAN) at node N

VOLT(N) Electric potential at node N

MAG(N) Magnetic scalar potential at node N

AX(N) AX magnetic vector potential at node N

AY(N) AY magnetic vector potential at node N

AZ(N) AZ magnetic vector potential at node N

3.3.4 Listing Parameters


Once you have defined parameters, you can list them using the *STATUS command. If the *STATUS
command is issued without arguments, it provides a list of all of the currently defined parameters. The
following example shows the command and a typical listing.
*STATUS

PARAMETER STATUS- ( 5 PARAMETERS DEFINED)

NAME VALUE TYPE DIMENSIONS


ABC -24.0000000 SCALAR
HEIGHT 57.0000000 SCALAR
QR 2.070000000E+11 SCALAR
X_OR_Y -24.0000000 SCALAR
CPARM CASE1 CHARACTER

You can also access this information through either the Utility Menu>List>Other>Parameters or Utility
Menu>List>Status>Parameters>All Parameters menu items.

Note-Any parameters beginning or ending in an underscore (_) are not shown by the *STATUS command.

You can check the status of individual parameters by providing these as arguments to the *STATUS
command. The following example shows the status of the ABC parameter.
*STATUS,ABC

PARAMETER STATUS- abc ( 5 PARAMETERS DEFINED)

NAME VALUE TYPE DIMENSIONS


ABC -24.0000000 SCALAR

You can also check the status of specific parameters through the Utility Menu>List>Other>Named
Parameter or Utility Menu>List>Status> Parameters>Named Parameters menu items.

Note-Although ANSYS allows a maximum of 1000 parameters, fewer than 1000 are available to the user due
to GUI and ANSYS macro requirements. The number of parameters defined by the user interface (internal
parameters) is listed by the *STATUS command. The command *GET,par,PARM,,MAX returns the total
number of parameters defined.

3.4 Deleting Parameters


You can delete specific parameters in two ways:
mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 8/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Issue the "=" command, leaving the right-hand side of the command blank. For example, to delete the
QR parameter issue this command:

QR=

Issue the *SET command (Utility Menu>Parameters>Scalar Parameters), but don't specify a value
for the parameter. For example, to delete the QR parameter via the *SET command issue the
command as follows:
*SET,QR,

Setting a numeric parameter equal to zero doesn't delete it. Similarly, setting a character parameter equal to
empty single quotes (` `) or placing blanks within single quotes doesn't delete the parameter.

3.5 Using Character Parameters


Typically, character parameters are used to provide file names and extensions. The desired file name can be
assigned to a character parameter, and that parameter can be used anywhere a file name is required.
Similarly, a file extension can be assigned to a character parameter and used where appropriate (typically the
Ext command argument). In batch mode, this allows you to easily change file names for multiple runs by
simply changing the initial alphanumeric "value" of the character parameter in your input file.

Note-Remember that character parameters are limited to a total of eight characters.

The following is a list of general uses for character parameters.

As arguments to any applicable command field (that is, where alphanumeric input is expected)
As macro name arguments for the *USE command (Utility Menu>Macro>Execute Data Block)
NAME='MACRO' ! MACRO is the name of a macro file
*USE,NAME ! Calls MACRO

As arguments to macro calls for *USE and for the "unknown command" macro. Any of the following
macro calls are allowed:

ABC='SX'
*USE,NAME,ABC

or
*USE,NAME,'SX'

DEF='SY'
NEWMACRO,DEF ! Calls existing macro file NEWMACRO.MAC

or

NEWMACRO,'SY'

3.6 Substitution of Numeric Parametric Values


Whenever you use a parameter name in a numeric command field, its value is automatically substituted. If no
value has been assigned to the parameter (that is, if the parameter has not been defined), a near-zero value (2-
100) will be substituted, usually without warning.

Note-Defining the parameter after it is used in a command does not "update" the command in most cases.
(Exceptions are the commands /TITLE, /STITLE, *ABBR, and /TLABEL. See Section 3.6.2.1 for more
mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 9/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

information.) For example:

Y=0
X=2.7
N,1,X,Y ! Node 1 at (2.7,0)
Y=3.5 ! Redefining parameter Y now does not update node 1

3.6.1 Preventing Substitution


You can prevent parameter substitution by enclosing the parameter name with single quotes ('), for example,
'XYZ'. The literal string is then used; therefore, this feature is valid only in non-numerical fields.

Conversely, you can force parameter substitution in titles, subtitles, and filenames by enclosing the parameter
name with percent signs (%). For example,

/TITLE, TEMPERATURE CONTOURS AT TIME=%TM%

specifies a title in which the numerical value of parameter TM is substituted. Note that the parameter is
substituted at the time the title is used.

3.6.2 Substitution of Character Parametric Values


Use of a character parameter in an alphanumeric command field generally results in automatic substitution of
its value. Forced substitution and character parameter restrictions are explained below.

3.6.2.1 Forced Substitution

As with numerical parameters, you can force the substitution of a character parameter value in certain cases
where substitution would not occur otherwise. This is done by enclosing the character parameter name with
percent signs (%). Forced substitution of character parameters is valid for the following commands:

/TITLE command (Title field). Specifies titles for various printed output.
/STITLE command (Title field). Specifies subtitles, similar to /TITLE. (You cannot access the
/STITLE command directly in the GUI.)
/TLABEL command (Text field). Specifies text string for annotation.
/SYP command (ARG1 - ARG8 fields). Passes a command string (plus arguments) to the operating
system. (You cannot access the /SYP command directly in the GUI.)
*ABBR command (Abbr field). Defines an abbreviation.

Forced substitution is also valid in the following types of fields:

Any filename or extension command argument. These arguments apply to commands such as
/FILENAME, RESUME, /INPUT, /OUTPUT, and FILE. (Direct parameter substitution is also
valid in these fields.)
Any 32 character field: A typical example is the directory path field that is available for many
commands. (Direct substitution is not valid for these fields.)
As a command name in any command name field. Also as an "unknown command" macro name in
field 1. For example:
R='RESUME'
%R%,MODEL,DB

The following example of the command input method shows forced substitution for a subtitle definition and
for a directory name.
A='TEST'
B='.RST'
C='/ANSYS'

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 10/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

D='/MODELS/'
/STITLE,,RESULTS FROM FILE %C%%D%%A%%B%

SUBTITLE 1 =
RESULTS FROM FILE /ANSYS/MODELS/TEST.RST

/POST1
FILE,A,RST,%C%%D% ! Read results from /ANSYS/MODELS/TEST.RST

3.6.2.2 Other Places Where Character Parameters Are Valid


In addition to the more general applications already discussed, there are some specific instances where
character parameters are allowed for added convenience. The commands which are affected and details of
usage are outlined below.

*ASK

This command may prompt the user for an alphanumeric string (up to eight characters enclosed in
single quotes) which is assigned to a character scalar parameter. (You cannot access the *ASK
command directly in the GUI.)

*CFWRITE

This command writes ANSYS commands to the file opened by *CFOPEN. It can be used to write a
character parameter assignment to that file. For example, *CFWRITE,B='FILE' is valid. (You
cannot access the *CFWRITE and *CFOPEN commands directly in the GUI.)

*IF and *ELSEIF

Character parameters may be used for the VAL1 and VAL2 arguments of these commands. For the Oper
argument, only labels EQ (equal) and NE (not equal) are valid when using character parameters. (You
cannot access the *IF and *ELSEIF commands directly in the GUI.) Example:

CPARM='NO'
*IF,CPARM,NE,'YES',THEN

*MSG

Character parameters are allowed as input for the VAL1 through VAL8 arguments. The data descriptor
%C is used to indicate alphanumeric character data on the format line (which must follow the *MSG
command). The %C corresponds to the FORTRAN descriptor A8. (You cannot access the *MSG
command directly in the GUI.)

PARSAV and PARRES

These commands will save character parameters to a file (PARSAV command or menu path Utility
Menu>Parameters> Save Parameters) and resume character parameters from a file (PARRES or
Utility Menu>Parameters> Restore Parameters).

*VREAD

This command (Utility Menu>Parameters>Array Parameters>Read from File) can be used to read
alphanumeric character data from a file and produce a character array parameter. The FORTRAN
character descriptor (A) may be used in the format line which must follow the *VREAD command.

*VWRITE

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 11/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

This command (menu path Utility Menu>Parameters>Array Parameters>Write to File) can be


used to write character parameter data to a file in a formatted sequence. The FORTRAN character
descriptor (A) may be used in the format line which must follow the *VWRITE command.

3.6.2.3 Character Parameter Restrictions


Although character parameters have much of the same functionality as numerical parameters, there are
several instances where character parameters are not valid.

Character parameter substitution is not allowed for the Par argument of the *SET, *GET, *DIM, and
*STATUS commands.
Interactive editing of array parameters (*VEDIT command) is not available for character array
parameters.
Vector operation commands, such as *VOPER, *VSCFUN, *VFUN, *VFILL, *VGET, and
*VITRP, do not work with character array parameters.
When operating on character parameters, the specification commands *VMASK and *VLEN are
applicable only to the *VWRITE and *VREAD commands.
Character parameters are not valid in parametric expressions which use addition, subtraction,
multiplication, etc.

3.7 Dynamic Substitution of Numeric or Character


Parameters
Dynamic substitution of parameters will occur for the following commands: /TITLE, /STITLE, *ABBR,
and /TLABEL. Dynamic substitution allows the revised value of a parameter to be used, even if the
command which uses the parameter value has not been reissued.

Example:
XYZ='CASE 1'
/TITLE,This is %XYZ%
APLOT

The title "This is CASE 1" will appear on the area plot.

You can then change the value of XYZ and the new title will appear on subsequent plots, even though you
did not reissue /TITLE.
XYZ='CASE 2'

The title "This is CASE 2" will appear on subsequent plots.

3.8 Parametric Expressions


Parametric expressions involve operations among parameters and numbers such as addition, subtraction,
multiplication, and division. For example:

X=A+B
P=(R2+R1)/2
D=-B+(E**2)-(4*A*C) ! Evaluates to D = -B + E2 - 4AC
XYZ=(A<B)+Y**2 ! Evaluates to XYZ = A + Y2 if A is less than B;
! otherwise to XYZ = B + Y2
INC=A1+(31.4/9)
M=((X2-X1)**2-(Y2-Y1)**2)/2

The following is a complete list of APDL operators:


mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 12/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Operator Operation

+ Addition

_ Subtraction

* Multiplication

/ Division

** Exponentiation

< Less-Than Comparison

> Greater-Than Comparison

You can also use parentheses for clarity and for "nesting" of operations, as shown above. The order in which
the ANSYS program evaluates an expression is as follows:

1. Operations in parentheses (innermost first)

2. Exponentiation (in order, from right to left)

3. Multiplication and division (in order, from left to right)

4. Unary association (such as +A or -A)

5. Addition and subtraction (in order, from left to right)

6. Logical evaluation (in order, from left to right)

Thus an expression such as Y2=A+B**C/D*E will be evaluated in this order: B**C first, /D second, *E
third, and +A last. For clarity, you should use parentheses in expressions such as these. Parentheses can be
nested up to four levels deep, and up to nine operations can be performed within each set of parentheses. As
a general rule, avoid using blank spaces between operators in expressions. In particular, never include a
blank space before the * character because the rest of the input line (beginning with the *) will be interpreted
as a comment and therefore will be ignored. (Don't use this convention as a comment; use an exclamation
point (!) for this purpose.)

3.9 Parametric Functions


A parametric function is a programmed sequence of mathematical operations which returns a single value,
such as SIN(X), SQRT(B), and LOG(13.2). The following tables provide a complete list of functions
currently available in ANSYS.

Standard FORTRAN 77 Functions

ABS(x) Absolute value of x.

SIGN(x,y) Absolute value of x with sign of y. y=0 results in positive sign.

EXP(x) Exponential of x (ex).

LOG(x) Natural log of x (ln (x)).


mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 13/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

LOG10(x) Common log of x (log10(x)).

SQRT(x) Square root of x.

NINT(x) Nearest integer to x.

MOD(x,y) Remainder of x/y. y=0 returns zero (0).

Random number (uniform distribution) in the range x to y (x = lower bound, y = upper


RAND(x,y)
bound).

GDIS(x,y) Random sample of a Gaussian (normal) distribution with mean x and standard deviation y.

SIN(x),
Sine, Cosine, and Tangent of x. x is in radians by default, but can be changed to degrees with
COS(x),
*AFUN.
TAN(x)

SINH(x),
COSH(x), Hyperbolic sine, Hyperbolic cosine, and Hyperbolic tangent of x.
TANH(x)

ASIN(x), Arcsine, Arccosine, and Arctangent of x. x must be between -1.0 and +1.0 for ASIN and
ACOS(x), ACOS. Output is in radians by default, but can be changed to degrees with *AFUN. Range of
ATAN(x) output is -pi/2 to +pi/2 for ASIN and ATAN, and 0 to pi for ACOS.

Arctangent of y/x with the sign of each component considered. Output is in radians by default,
ATAN2(y,x)
but can be changed to degrees with *AFUN. Range of output is -pi to +pi.

VALCHR
Numerical value of CPARM (if CPARM is anumeric, returns 0.0).
(CPARM)

CHRVAL Character value of numerical parameter PARM. Number of decimal places depends on
(PARM) magnitude.

UPCASE
Upper case equivalent of CPARM.
(CPARM)

LWCASE
Lower case equivalent of CPARM.
(CPARM)

The following are examples of parametric functions:


PI=ACOS(-1) ! PI = arc cosine of -1, PI calculated to machine accuracy
Z3=COS(2*THETA)-Z1**2
R2=SQRT(ABS(R1-3))
X=RAND(-24,R2) ! X = random number between -24 and R2

*AFUN,DEG ! Units for angular functions are degrees


THETA=ATAN(SQRT(3)) ! THETA evaluates to 60 degrees
PHI=ATAN2(-SQRT(3),-1) ! PHI evaluates to -120 degrees
*AFUN,RAD ! Units for angular functions reset to radians

X249=NX(249) ! X-coordinate of node 249


SLOPE=(KY(2)-KY(1))/(KX(2)-KX(1))
! Slope of line joining keypoints 1 and 2

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 14/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

CHNUM=CHRVAL(X) ! CHNUM = character value of X


UPPER=UPCASE(LABEL) ! UPPER = uppercase character value of parameter LABEL

3.10 Saving, Resuming, and Writing Parameters


If you must use currently defined parameters in another ANSYS session, you can write them to a file and
then read (resume) that file. When you read the file, you can either completely replace currently defined
parameters or simply add to them (replacing those that already exist).

To write parameters to a file, use the PARSAV command (Utility Menu>Parameters>Save Parameters).

The parameters file is simply an ASCII file consisting largely of APDL *SET commands used to define the
various parameters. The following example shows the format of this file.

/NOPR
*SET,A , 10.00000000000
*SET,B , 254.3948750000
*SET,C ,'string '
*SET,_RETURN , 0.0000000000000E+00
*SET,_STATUS , 1.000000000000
*SET,_ZX ,' '
/GO

To read parameters from a file use the PARRES command (Utility Menu>Parameters>Restore
Parameters)

If you wish, you can write up to ten parameters or array parameters using FORTRAN real formats to a file.
You can use this feature to write your own output file for use in other programs, reports, etc. To do this, use
the *VWRITE command (Utility Menu>Parameters>Array Parameters>Write to File). The *VWRITE
command command is discussed in Section 3.11.7.

3.11 Array Parameters


In addition to scalar (single valued) parameters, you can define array (multiple valued) parameters. ANSYS
arrays can be

One-dimensional (a single column)


Two-dimensional (rows and columns)
Three-dimensional (rows, columns, and planes)

ANSYS provides three types of arrays

ARRAY

This type is similar to FORTRAN 77 arrays and is the default array type when dimensioning arrays.
As with FORTRAN arrays, the indices for rows, columns, and planes are sequential integer numbers
beginning with one. Array elements can be either integers or real numbers. This type can have up to
10242-1 rows, up to 255 columns, and up to 7 planes.

CHAR

This is a character array, with each element consisting of an alphanumeric value not exceeding eight
characters. The indices for rows, columns, and planes are sequential integer numbers beginning with
one. This type can have up to 10242-1 rows, up to 255 columns, and up to 7 planes.

TABLE

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 15/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

This is a special type of numeric array which allows ANSYS to calculate (through linear interpolation)
values between these array elements explicitly defined in the array. Moreover, you can define the array
indices for each row, column, and plane and these indices are real (not integer) numbers. Array
elements can be either integers or real numbers. As we'll see in the later discussion on TABLE arrays,
this capability provides a powerful method for describing mathematical functions. This type can have
up to 65,535 rows, up to 255 columns, and up to 7 planes.

3.11.1 Array Parameter Basics


Consider a two-dimensional array (either ARRAY or CHAR) as shown below. It is m rows long and n
columns wide; that is, its dimensions are m times n. Each row is identified by a row index number i, which
varies from 1 to m, and each column is identified by a column index number j, which varies from 1 to n. The
quantities that make up the array are array elements. Each array element is identified as (i,j), where i is its
row index number and j is its column index number.

Figure 3-1 A Graphical Representation of a Two-Dimensional Array.

We can extend these definitions to a three-dimensional array parameter, which may be m rows long, n
columns wide, and p planes deep. The plane index number is k, which varies from 1 to p. Each array element
is identified as (i,j,k). The following figure shows a three-dimensional array.

Figure 3-2 A Graphical Representation of a Three-Dimensional Array.

3.11.2 Array Parameter Examples


Type ARRAY parameters consist of discrete numbers that are simply arranged in a tabular fashion for
convenience. Consider the following examples.

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 16/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

The parameter NTEMP could be an array of temperatures at selected nodes; NTEMP(1)=-47.6 could be the
temperature at node 27, NTEMP(2)=-5.2 could be the temperature at node 43, and so on. Similarly,
EVOLUM could be an array of element volumes, and COMPSTRS could be an array of nodal component
stresses, with each column representing a particular direction (X, Y, Z, XY, YZ, XZ, for example).

A type CHAR array parameter is structured similarly to an ARRAY parameter, with the tabular values being
alphanumeric character strings (up to eight characters). Two examples of character array parameters are:

3.11.3 TABLE Type Array Parameters


A type TABLE array parameter consists of numbers (alphanumeric values are not valid) arranged in a tabular
fashion, much like the ARRAY type. However, there are three important differences

ANSYS can calculate (through linear interpolation) any values that fall in-between the explicitly
declared array element values.
A table array contains a 0 row and 0 column used for data-access index values, and unlike standard
arrays, these index values can be real numbers. The only restriction is that the index values must be
numerically increasing (never decreasing) numbers. You must explicitly declare a data access index
value for each row and column; otherwise the default value assigned is the "tiny number"
(7.888609052E-31).
A plane index value resides in the 0,0 location for each plane.

The following figure shows a TABLE array with data-access index values. Note that the indexes are
specified as the "0" row and column values.

Figure 3-3 A Graphical Representation of a Table Array

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 17/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

As shown in the above example, when configuring a table array you must set

The plane index value as the 0,0 element value for each plane.
The data-access column index values in the elements in the 0 row in plane 1. These values are used
only when accessing data from the array. When setting the array element values, you use the traditional
row and column index numbers.
The data-access row index values in the elements in the 0 column in plane 1. Again, these values are
used only when accessing data from the array. When setting the array element values, you use the
traditional row and column index numbers.

Row and column index values may be set or changed in any plane, and those values will be applied to all
planes.

3.11.4 Defining and Listing Array Parameters


To define an array parameter, you must first declare its type and dimensions using the *DIM command
(Utility Menu>Parameters>Array Parameters>Define/Edit).

This following examples illustrate the *DIM command used to dimension various types of arrays:

*DIM,AA,,4 ! Type ARRAY is default, dimension 4[x1x1]


*DIM,XYZ,ARRAY,12 ! Type ARRAY array, dimension 12[x1x1]
*DIM,FORCE,TABLE,5 ! Type TABLE array, dimension 5[x1x1]
*DIM,T2,,4,3 ! Dimensions are 4x3[x1]
*DIM,CPARR1,CHAR,5 ! Type CHAR array, dimension 5[x1x1]

Note-Array elements for ARRAY and TABLE are initialized to 0 (except for the 0 row and column for
TABLE, which is initialized to the tiny value). Array elements for CHAR are initialized to a blank value.

3.11.5 Specifying Array Element Values


You can specify array element values by
mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 18/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Setting individual array element values through the *SET command or "=" shortcut.
Filling individual vectors (columns) in the array with either specified or calculated values (the
*VFILL command, for example).
Interactively specifying values for the elements through the *VEDIT dialog box.
Reading the values from an ASCII file (*VREAD or *TREAD commands).

3.11.5.1 Specifying Individual Array Values


You can use either the *SET command or the "=" shortcut. Usage is the same as for scalar parameters,
except that you now define a column of data (up to ten array element values per "=" command). For
example, to define the parameter XYZ dimensioned above as a 12x1 array you will need two "=" commands.
In the following example the first command defines the first eight array elements and the second command
defines the next four array elements:
XYZ(1)=59.5,42.494,-9.01,-8.98,-8.98,9.01,-30.6,51
XYZ(9)=-51.9,14.88,10.8,-10.8

The following example shows how to define the element values for the 4x3 array parameter T2, dimensioned
earlier in the *DIM examples:

T2(1,1)=.6,2,-1.8,4 ! defines (1,1),(2,1),(3,1),(4,1)


T2(1,2)=7,5,9.1,62.5 ! defines (1,2),(2,2),(3,2),(4,2)
T2(1,3)=2E-4,-3.5,22,.01 ! defines (1,3),(2,3),(3,3),(4,3)

The following example defines element values for the TABLE array parameter FORCE discussed earlier.

FORCE(1)=0,560,560,238.5,0
FORCE(1,0)=1E-6,.8,7.2,8.5,9.3

Character array parameters can also be defined using the "=" command. Assigned values can be up to eight
characters each and must be enclosed in single quotes. For example:
*DIM,RESULT,CHAR,3 !Character array parameter with
! dimensions (3,1,1)

RESULT(1)='SX','SY','SZ' !Assigns values to parameter RESULT

Notice that, as when defining a numerical array parameter, the starting location of the array element must be
specified (in this case, the row index number 1 is indicated).

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 19/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Note-CHAR cannot be used as a character parameter name because it will create a conflict with the CHAR
label on the *DIM command. ANSYS will substitute the character string value assigned to parameter CHAR
when CHAR is input on the third field of the *DIM command (Type field).

3.11.5.2 Filling Array Vectors


You can use the *VFILL commands (Utility Menu>Parameters>Array Parameters> Fill) to "fill" an
ARRAY or TABLE vector (column).

See the *VFILL command reference information in the ANSYS Commands Reference for more detail about
the command syntax. The following example illustrates the capabilities of the *VFILL command.
*DIM,DTAB,ARRAY,4,3 ! dimension 4 x 3 numeric array
*VFILL,DTAB(1,1),DATA,-3,8,-12,57 ! four data values loaded into vector 1
*VFILL,DTAB(1,2),RAMP,2.54,2.54 ! fill vector 2 with values starting at
! 2.54 and incrementing by 2.54
*VFILL,DTAB(1,3),RAND,1.5,10 ! fill vector 3 with random numbers between
! 1.5 and 10. Results will vary due to
! random number generation.

3.11.5.3 Interactively Editing Arrays

The *VEDIT command (Utility Menu>Parameters>Array Parameters>Define/Edit), which is available


only in interactive mode, launches a data entry dialog box you can use to edit an ARRAY or TABLE (not
CHAR) array. The dialog box provides a number of convenient features:

A spreadsheet-style editor for array element values.


Navigational controls for scrolling through large arrays.
An initialize function to set any row or column to a specified value (ARRAY type only).
Delete, copy, and insert functions for moving rows or columns of data (ARRAY type only).

Complete instructions for using the dialog box are available from the box's Help button.

Figure 3-5 An example of the *VEDIT dialog box for an ARRAY type array.

Figure 3-5 An example of the *VEDIT dialog box for a TABLE array.

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 20/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

3.11.5.4 Filling an Array From a Data File Using *VREAD


You can fill an array from a data file using the *VREAD command (Utility Menu>Parameters>Array
Parameters>Read from File). The command reads information from an ASCII data file and begins writing
it into the array, starting with the index location that you specify. You can control the format of the
information read from the file through data descriptors. The data descriptors must be enclosed in parenthesis
and placed on the line following the *VREAD command. See Section 3.11.7.1 for more information about
data descriptors. The data descriptors control the number of fields to be read from each record, the width of
the data fields, and the position of the decimal point in the field.

For example, given the following data file:


1.5 7.8 12.3
15.6 -45.6 42.5

and an array called EXAMPLE that has been dimensioned as 3 x 2, the following commands (provided as
either a part or a macro or input listing)

*VREAD,EXAMPLE(1,1),,,2
(3F6.1)

result in

Note that the *VREAD command cannot be issued directly from the command input window. However, the
Utility Menu>Parameters>Array Parameters>Read from File dialog box offers a way to specify the data
descriptors and issue the command in interactive mode.

3.11.5.5 Filling a TABLE Array From a Data File Using *TREAD

Once configured, you have two options for specifying values for the TABLE array elements: you can add
values as you would for any other type of array, or you can read in a table of data from an external file.

To read in a table of data from an external file, you still define the TABLE array first, specifying the number
of rows, columns, and planes, and the labels for each. You can then read an ASCII file containing the table of
data using the *TREAD command (Utility Menu>Parameters>Array Parameters>Read from File). At
this time, you also specify the number of lines to skip (NSKIP) between the top of the file and the first line of
the table.

When reading data from an external file, remember:

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 21/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

The file containing the table of data can be created in a text editor or an external application (such as
Microsoft Excel), but it must be in ASCII form, tab-delimited, to be read into ANSYS.
You must first define the array in ANSYS, remembering to allow for the index values (0,0).
The values are read straight across the rows until all columns on each row of the array are filled;
ANSYS then wraps from one row to the next and begins to fill those columns, and so on. Be sure that
the dimensions of the array you defined are correct. If you mistakenly define fewer columns in the
ANSYS array than required, ANSYS will start filling in the next row of the array using the values
remaining in the first row of the data table being read. Similarly, if you define more columns in the
ANSYS array than required, ANSYS will fill all columns of the array using values from the next row
of the data table being read, and only then wrap and begin filling the next row.

You can create 1-D, 2-D, and 3-D tables by reading data from an external file. Examples of how you create
each of these follows.

Example 1: 1-D Table

First, create the 1-D table using the application of your choice (such as a spreadsheet application, a text
editor, etc.) and then save the file as a text file in tab-delimited format. In this example, the table is named
"Tdata" and contains data for time vs. temperature. In its ASCII form, the table would look like this:

Time Temperature Table

Time Temp

0 20

1 30

2 70

4 75

In ANSYS, you define a TABLE parameter "Tt" using the *DIM command (Utility
Menu>Parameters>Array Parameters>Define/Edit). Specify 4 rows and 1 column, row label of Time,
and column label of Temp. Note that the data table you created has four rows and one column of data, plus
the row and column index values (the first column -- TIME - is the row index values) Then read in the file as
described earlier, specifying 2 skipped lines. The TABLE array in ANSYS would look like this:

This same example, done via command input, would look like the following:
*DIM,Tt,table,4,1,1,TIME,TEMP
*TREAD,Tt,tdata,txt,,2

Example 2: 2-D Table


mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 22/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

For this example, create (in a spreadsheet application, a text editor, etc.) a 2-D table named "T2data"
containing temperature data as a function of time and x-coordinate and read it into a TABLE array parameter
called "Ttx." The table, in its ASCII form, would look like this:

Temp (time-X-coord) Table

Time X-Coordinate

0 0 .3 .5 .7 .9

0 10 15 20 25 30

1 15 20 25 35 40

2 20 25 35 55 60

4 30 40 70 90 100

In ANSYS, you define a TABLE parameter "Ttx" using the *DIM command (Utility
Menu>Parameters>Array Parameters>Define/Edit). Specify 4 rows, 5 columns, 1 plane, row label of
TIME, and column label of X-COORD. Note that the data table you created has four rows and five columns
of data, plus the row and column index values. Then read in the file as described earlier, specifying 2 skipped
lines. The TABLE array in ANSYS would look like this:

This same example, done via command input, would look like the following:
*DIM,Ttx,table,4,5,,time,X-COORD
*TREAD,Ttx,t2data,txt,,2

Example 3: 3-D Table

For this example, create a 3-D table named "T3data" containing temperature data as a function of time, x-
coordinate, and y-coordinate and read it into a TABLE array parameter called "Ttxy." The table, in its ASCII
form, would look like this:

Temp (time-X-coord) Table

Time X-Coordinate

0 0 .3 .5 .7 .9

0 10 15 20 25 30
mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 23/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

1 15 20 25 35 40

2 20 25 35 55 60

4 30 40 70 90 100

1.5 0 .3 .5 .7 .9

0 20 25 30 35 40

1 25 30 35 45 50

2 30 35 45 65 70

4 40 50 80 100 120

In the example above, the bold values (in the (0,0,Z) positions) indicate the separate planes. Each plane of
data, along with the row and column index values, is repeated for the separate planes. Only the plane index
value and the actual data values are different. The shaded area above shows the values that change from
plane to plane.

In ANSYS, you define a TABLE parameter "Ttxy" using the *DIM command (Utility
Menu>Parameters>Array Parameters>Define/Edit). In the case of a 3-D table, the table is dimensioned
according to the number of rows, columns, and planes of data. The first column (TIME) is the row index
values and the first row is the column index values. Specify 4 rows, 5 columns, 2 planes, row label of TIME,
column label of X-COORD, and plane label of Y-COORD. Note that the data table you created has four rows
and five columns of data in two planes, plus the row and column index values. Then read in the file as
described earlier, specifying 2 skipped lines. The TABLE array in ANSYS would look like this for the
second plane of data (Y=1.5):

This same example, done via command input, would look like the following:
*DIM,Ttxy,table,4,5,2,TIME,X-COORD,Y-COORD
*TREAD,Ttxy,t3data,txt,,2

3.11.6 Interpolating Values


When accessing information from the array, ANSYS will interpolate values between those explicitly set.

As examples of how ANSYS interpolates values in TABLE arrays, consider the following:

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 24/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Given that A is a TABLE array parameter, the ANSYS program can calculate any value between A(1) and
A(2), for example

A(1.5) evaluates to 20.0 (halfway between 12.0 and 28.0)


A(1.75) evaluates to 24.0
A(1.9) evaluates to 26.4

Similarly, if PQ is a TABLE array parameter

PQ(1.5,1) evaluates to -3.4 (halfway between 2.8 and -9.6)


PQ(1,1.5) evaluates to 3.5 (halfway between 2.8 and 4.2)
PQ(3.5,1.3) evaluates to 14.88

This feature allows you to describe a function, such as y=f(x), using a TABLE array parameter. You would
use the j=0 column for values of the independent variable x and the "regular" j=1 column for values of y.
Consider, for example, a time-history forcing function described by five points as shown below.

Figure 3-4 Time-History Forcing Function

You can specify this function as a TABLE array parameter whose array elements are the force values, and
whose row index numbers 1 through 5 are time values 0.0 through 9.3. Schematically, the parameter will
then look like this:

ANSYS can calculate (through linear interpolation) force values at times not specified in the FORCE
parameter. For the above example, ANSYS will calculate a value of 89.4375 for FORCE(9). If a parameter
location beyond the dimensions of the array is used, no extrapolation is done and the end value is used. For
example, ANSYS will provide a value of 560.0 for FORCE(5,2) or 0.0 for FORCE(12)

You can see from these examples that TABLE array parameters can be very powerful tools in your analysis.
Typical applications are time-history loading functions, response spectrum curves, stress-strain curves,
material-versus- temperature curves, B-H curves for magnetic materials, and so forth. Be aware that TABLE
array parameters require more computer time to process than the ARRAY type.

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 25/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

3.11.6.1 Retrieving Values into or Restoring Array Parameter Values

You can use the *VGET command (Utility Menu>Parameters>Get Array Data), which is similar to
*GET, to retrieve ANSYS supplied values and store them in an array.

You must define a starting array location number for the array parameter the *VGET command creates.
Looping continues over successive entity numbers for the KLOOP default. For example,
*VGET,A(1),ELEM,5,CENT,X returns the centroid x-location of element 5 and stores the result in the first
location of A. Retrieving continues with elements 6, 7, and so on until successive array locations are filled.
In this example, if KLOOP is 4, then the centroid of x, y, and z are returned.

To restore array parameter values, use the *VPUT command (Utility Menu>Parameters>Array
Operations>Put Array Data).

The *VPUT command uses the same arguments as the *VGET command (described above), but does the
opposite of the *VGET operation. For a list of valid labels for *VPUT items, see the command's description
in the ANSYS Commands Reference.

The ANSYS program "puts" vector items directly, without any coordinate system transformation. *VPUT
can replace existing array items, but can't create new items. Degree of freedom results that are changed in the
database are available for all subsequent operations. Other results change temporarily, and are available
mainly for immediately following print and display operations.

Note-Use this command with extreme caution, as it can alter entire sections of the database. The *VPUT
command doesn't support all items on the *VGET item list because putting values into some locations could
make the ANSYS database inconsistent.

3.11.5.2 Listing Array Parameters

As with scalar parameters, you can use the *STATUS command to list array parameters. The following
examples illustrate the *STATUS command in use:

*STATUS
ABBREVIATION STATUS-

ABBREV STRING
SAVE_DB SAVE
RESUM_DB RESUME
QUIT Fnc_/EXIT
POWRGRPH Fnc_/GRAPHICS
ANSYSWEB Fnc_HomePage

PARAMETER STATUS- ( 5 PARAMETERS DEFINED)


(INCLUDING 2 INTERNAL PARAMETERS)

NAME VALUE TYPE DIMENSIONS


MYCHAR hi CHARACTER
MYPAR ARRAY 4 6 1
MYPAR1 .987350000 SCALAR

*STATUS,XYZ(1),5,9 ! Lists rows 5 through 9 of XYZ


PARAMETER STATUS- XYZ ( 4 PARAMETERS DEFINED)

LOCATION VALUE
5 1 1 -8.98000000
6 1 1 9.01000000
7 1 1 -30.6000000
8 1 1 51.0000000
9 1 1 -51.9000000

*STATUS,FORCE(1),,,0 ! Lists parameter FORCE, includes j=0 column

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 26/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

PARAMETER STATUS- FORCE ( 4 PARAMETERS DEFINED)

LOCATION VALUE
1 0 1 0.000000000E+00
2 0 1 0.800000000
3 0 1 7.20000000
4 0 1 8.50000000
5 0 1 9.30000000
1 1 1 0.000000000E+00
2 1 1 560.000000
3 1 1 560.000000
4 1 1 238.500000
5 1 1 0.000000000E+00

*STATUS,T2(1,1) ! Lists parameter T2

PARAMETER STATUS- T2 ( 4 PARAMETERS DEFINED)

LOCATION VALUE
1 1 1 0.600000000
2 1 1 2.00000000
3 1 1 -1.80000000
4 1 1 4.00000000
1 2 1 7.00000000
2 2 1 5.00000000
3 2 1 9.10000000
4 2 1 62.5000000
1 3 1 2.000000000E-04
2 3 1 -3.50000000
3 3 1 22.0000000
4 3 1 1.000000000E-02

*STATUS,RESULT(1) !Lists parameter RESULT

PARAMETER STATUS- RESULT ( 4 PARAMETERS DEFINED)

LOCATION VALUE
1 1 1 SX (CHAR)
2 1 1 SY (CHAR)
3 1 1 SZ (CHAR)

3.11.7 Writing Data Files


You can write formatted data files (tabular formatting) from data held in arrays through the *VWRITE
command. The command takes up to 10 array vectors as arguments and writes the data contained in those
vectors to the currently open file (*CFOPEN command). The format for each vector is specified with
FORTRAN 77 data descriptors on the line following the *VWRITE command (therefore you can't issue the
*VWRITE command from the ANSYS input window.)

An array vector, specified with a starting element location (such as MYARRAY(1,2,1)). You can also use an
expression, which is evaluated as a constant value for that field in each row of the data file. The keyword
SEQU evaluates to a sequential column of integers, starting from one.

The format of each row in the data file is determined by the data descriptor line. You must include one
descriptor for each argument to the command. Do not include the word FORMAT in the descriptor line. You
can use any real format or character format descriptor; however, you may not use either integer or list
directed descriptors.

3.11.7.1 Format Data Descriptors


If you aren't familiar with FORTRAN data descriptors, this section will get you started with formatting your
data file. For more information, consult the documentation for the FORTRAN 77 compiler for your
particular platform.

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 27/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

You must provide a data descriptor for each data item you specify as an argument to the *VWRITE
command. In general, you can use the F descriptor (floating point) for any numeric values. The F descriptor
takes the syntax

Fw.d

where

Is the width of the data field in characters.

Is the number of digits to the right of the decimal point.

Thus, for a field that is 10 characters wide and has eight characters after the decimal point, you would use the
following data descriptor:
F10.8

For character fields, you can use the A descriptor. The A descriptor has the syntax

Aw

where

Is the width of the data field in characters.

Thus, for a character field that is eight characters wide, the descriptor is
A8

The following examples illustrate the *VWRITE command and data descriptors in use.

Given that the MYDATA array has been dimensioned and filled with the following values:

The following short macro first defines the scalar parameter X as having a value of 25 and then opens the file
vector (*CFOPEN command). The *VWRITE command then defines the data to be written to the file. In
this case, the first vector written uses the SEQU keyword to provide row numbers. Note that in some cases
that constants, scalar parameters, and operations that include array element values are written to the file.
Note the data file contents for these items.
x=25
*cfopen,vector
*vwrite,SEQU,mydata(1,1,1),mydata(1,2,1),mydata(1,3,1),10.2,x,mydata(1,1,1)+3
(F3.0,' ',F8.4,' ',F8.1,' 'F8.6,' ',F4.1,' 'F4.0,' 'F8.1)
*cfclos

The macro creates the following data file:


1. 2.1522 3.9 5.286370 10.2 25. 5.2
2. 2.3049 4.0 5.409196 10.2 25. 5.2

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 28/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

3. 2.0105 3.4 5.936638 10.2 25. 5.2


4. 2.3683 3.3 5.632203 10.2 25. 5.2
5. 2.8491 4.8 5.978024 10.2 25. 5.2
6. 2.2280 3.5 5.546851 10.2 25. 5.2

The second example uses the following previously dimensioned and filled array:

Note the use of descriptors in the following example *VWRITE command:


*vwrite,SEQU,mydata(1,1),mydata(1,2),(mydata1(1,1)+mydata1(1,2))
(' Row',F3.0,' contains ',2F7.3,'. Is their sum ',F7.3,' ?')

The resulting data file is


Row 1. contains 10.000 50.000. Is their sum 60.000 ?
Row 2. contains 20.000 60.000. Is their sum 60.000 ?
Row 3. contains 30.000 70.000. Is their sum 60.000 ?

3.11.8 Operations Among Array Parameters


Just as parametric expressions and functions allow operations among scalar parameters, a series of
commands is available to perform operations among array parameters. There are classes of operations:
operations on columns (vectors), known as vector operations and operations on entire matrices (arrays),
known as matrix operations. All operations are affected by a set of specification commands, which are
discussed in Section 3.11.8.3.

3.11.8.1 Vector Operations


Vector operations are simply a set of operations-addition, subtraction, sine, cosine, dot product, cross
product, etc.-repeated over a sequence of array elements. Do-loops (discussed in Section 4.5.5) can be
employed for this purpose, but a more convenient and much faster way is to use the vector operation
commands-*VOPER, *VFUN, *VSCFUN, *VITRP, *VFILL, *VREAD, and *VGET. Of these listed
vector operation commands, only *VREAD and *VWRITE are valid for character array parameters. Other
vector operation commands apply only to array parameters dimensioned (*DIM) as ARRAY type or TABLE
type.

The *VFILL, *VREAD, *VGET, *VWRITE, and *DIM commands were introduced earlier in this
chapter. Other commands that are discussed in this section include

*VOPER or Utility Menu>Parameters>Array Operations>Vector Operations

Performs an operation on two input array vectors and produces a single output array vector.

*VFUN or Utility Menu>Parameters>Array Operations>Vector Functions

Performs a function on a single input array vector and produces a single output array vector.

*VSCFUN or Utility Menu>Parameters>Array Operations>Vector-Scalar Func

Determines the properties of a single input array vector and places the result in a specified scalar
parameter.

*VITRP or Utility Menu>Parameters>Array Operations>Vector Interpolate

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 29/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Forms an array parameter (type ARRAY) by interpolating an array parameter (type TABLE) at
specified table index locations.

The examples below illustrate the use of some of these commands. Refer to the ANSYS Commands Reference
for syntactical information about these commands. For all of the following examples, the array parameters
(of type ARRAY) X, Y, and THETA have been dimensioned and defined.

In the following example, the result array is first dimensioned (Z1). The *VOPER command then adds
column 2 of X to column 1 of Y, both starting at row 1, and then places the result into Z1. Notice that the
starting location (the row and column index numbers) must be specified for all array parameters. The
operation then progresses sequentially down the specified vector.
*DIM,Z1,ARRAY,4
*VOPER,Z1(1),X(1,2),ADD,Y(1,1)

In the following example, again the result array (Z2) is dimensioned first. The *VOPER command then
multiplies the first column of X (starting at row 2) with the fourth column of Y (starting at row 1) and writes
the results to Z2 (starting at row 1).
*DIM,Z2,ARRAY,3
*VOPER,Z2(1),X(2,1),MULT,Y(1,4)

In this example, again the results array (Z4) is dimensioned first. The *VOPER command then performs the
cross product of four pairs of vectors, one pair for each row of X and Y. The i, j, and k components of these
vectors are columns 1, 2, and 3 respectively of X and columns 2, 3, and 4 of Y. The results are written to Z4,
whose i, j, and k components are vectors 1, 2, and 3 respectively.
*DIM,Z4,ARRAY,4,3
*VOPER,Z4(1,1),X(1,1),CROSS,Y(1,2)

In the following example, the results array (A3) is dimensioned first. The *VFUN command then raises each
element in vector 2 of X to the power of 2 and writes the results to A3.

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 30/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

*DIM,A3,ARRAY,4
*VFUN,A3(1),PWR,X(1,2),2

In this example, the results array (A4) is dimensioned. The two *VFUN commands then calculate the cosine
and sine of array elements in THETA and place the results in the first and second columns, respectively, of
A4. Notice that A4 now represents a circular arc spanning 90°, described by seven points (whose x, y, and z
global Cartesian coordinates are the three vectors). The arc has a radius of 1.0 and lies parallel to the x-y
plane at z = 2.0.
*DIM,A4,ARRAY,7,3
*AFUN,DEG
*VFUN,A4(1,1),COS,THETA(1)
*VFUN,A4(1,2),SIN,THETA(1)
A4(1,3)=2,2,2,2,2,2,2

In this example, the results array (A5) is first dimensioned. Then, the *VFUN command calculates the
tangent vector at each point on the curve represented by A4, normalizes it to 1.0, and places the results in
A5.
*DIM,A5,ARRAY,7,3
*VFUN,A5(1,1),TANG,A4(1,1)

Two additional *VOPER operations, gather (GATH) and scatter (SCAT), are used to copy values from one
vector to another based on numbers contained in a "position" vector. The following example demonstrates
the gather operation. Note that, as always, the results array must be dimensioned first. In the example, the
gather operation copies the value of B1 to B3 (using the index positions specified in B2). Note that the last
element in B3 is 0 as this is its initialized value.
*DIM,B1,,4
*DIM,B2,,3
*DIM,B3,,4
B1(1)=10,20,30,40
B2(1)=2,4,1
*VOPER,B3(1),B1(1),GATH,B2(1)

3.11.8.2 Matrix Operations

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 31/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

Matrix operations are mathematical operations between numerical array parameter matrices, such as matrix
multiplication, calculating the transpose, and solving simultaneous equations.

Commands discussed in this section include

*MOPER or Utility Menu>Parameters>Array Operations>Matrix Operations

Performs matrix operations on two input array parameter matrices and produces one output array
parameter matrix. Matrix operations include

Matrix multiplication
Solution of simultaneous equations
Sorting (in ascending order) on a specified vector in a matrix
Covariance between two vectors
Correlation between two vectors

*MFUN or Utility Menu>Parameters>Array Operations>Matrix Functions

Copies or transposes an array parameter matrix (accepts one input matrix and produces one output
matrix).

*MFOURI or Utility Menu>Parameters>Array Operations>Matrix Fourier

Calculates the coefficients for or evaluates a Fourier series.

The examples below illustrate the use of some of these commands. Refer to the ANSYS Commands Reference
for syntactical information about these commands.

This example shows the sorting capabilities of the *MOPER command. For this example, assume that the
array (SORTDATA) has been dimensioned and its element values have been defined as follows:

First, the OLDORDER array is dimensioned. The *MOPER command will place the original order of the
rows into OLDORDER. The *MOPER command then sorts the rows in SORTDATA so that the 1,1 vector
is now in ascending order.
*dim,oldorder,,5
*moper,oldorder(1),sortdata(1,1),sort,sortdata(1,1)

The following array values result from the *MOPER command:

To put the SORTDATA array back into its original order, you could then issue the following command:
*moper,oldorder(1),sortdata(1,1),sort,oldorder(1,1)

In the following example, the *MOPER command solves a set of simultaneous equations. The following
two arrays have been dimensioned and their values assigned:

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 32/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

The *MOPER command can solve a set of simultaneous equations for a square matrix. The equations take
the form

In the case of the above arrays, the *MOPER command will solve the following set of simultaneous
equations:

To solve the equations, first the results array (C) is dimensioned. Then the *MOPER command solves the
equations, using A as the matrix of a coefficients and B as a vector of b values.

*DIM,C,,4
*MOPER,C(1),A(1,1),SOLV,B(1)

The C array now contains the following solutions.

The following example shows the *MFUN command used to transpose data in an array. For this example,
assume that the array (DATA) was dimensioned and filled with the following values.

As always, the results array (DATATRAN) is dimensioned first, then the *MFUN command transposes the
values and writes them to DATATRAN.

*DIM,DATATRAN,,2,3
*MFUN,DATATRAN(1,1),TRAN,DATA(1,1)

The following shows the results in the DATATRAN array:

3.11.8.3 Specification Commands for Vector and Matrix Operations


All the vector and matrix operation commands are affected by the setting of the following specification
commands: *VCUM, *VABS, *VFACT, *VLEN, *VCOL, and *VMASK. (Of all specification commands,
only *VLEN and *VMASK, in conjunction with *VREAD or *VWRITE, are valid for character array
parameters.) You can check the status of these commands with the *VSTAT command. Most of these
commands (and their corresponding GUI paths) were introduced earlier in this chapter. The others are
explained in the following.

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 33/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

With the exception of the *VSTAT command, which you cannot access directly in the GUI, all of the
specification commands described below are available via menu path Utility Menu>Parameters>Array
Operations>Operation Settings.

Important: All specification commands are reset to their default settings after each vector or matrix
operation.

The following lists the available array specification commands:

*VCUM

Specifies whether results will be cumulative or non-cumulative (overwriting previous results). ParR,
the result of a vector operation, is either added to an existing parameter of the same name or
overwritten. The default is non-cumulative results, that is, ParR overwrites an existing parameter of
the same name.

*VABS

Applies an absolute value to any or all of the parameters involved in a vector operation. The default is
to use the real (algebraic) value.

*VFACT

Applies a scale factor to any or all of the parameters involved in a vector operation. The default scale
factor is 1.0 (full value).

*VCOL

Specifies the number of columns in matrix operations. The default is to fill all locations of the result
array from the specified starting location.

*VSTAT

Lists the current specifications for the array parameters.

*VLEN or Utility Menu>Parameters>Array Operations>Operation Settings

Specifies the number of rows to be used in array parameter operations.

*VMASK or Utility Menu>Parameters>Array Operations>Operation Settings

Specifies an array parameter as a masking vector.

The following table lists the various specification commands and the vector and matrix array commands that
they affect.

*VLEN
*VABS *VFACT *VCUM *VCOL *VMASK
NROW,NINC
*MFOURI No No No N/A No No No

*MFUN Yes Yes Yes No Yes No Yes

*MOPER Yes Yes Yes No Yes No Yes

*VFILL Yes Yes Yes N/A Yes Yes Yes

*VFUN Yes Yes Yes N/A Yes Yes Yes


mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 34/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

*VGET Yes Yes Yes N/A Yes Yes Yes

*VITRP Yes Yes Yes N/A Yes Yes Yes

*VOPER Yes Yes Yes N/A Yes Yes Yes

*VPLOT No No N/A N/A Yes Yes Yes

*VPUT Yes Yes No N/A Yes Yes Yes

*VREAD Yes Yes Yes N/A Yes Yes Yes

*VSCFUN Yes Yes Yes N/A Yes Yes Yes

*VWRITE No No N/A N/A Yes Yes Yes

The examples below illustrate the use of some of the specification commands. Refer to the ANSYS
Commands Reference for syntactical information about these commands.

In the following, the results array (CMPR) is dimensioned. The two *VFUN commands, in conjunction with
the preceding *VMASK and *VLEN commands, then compress selected data and write them to specified
locations in CMPR. The complement to the COMP operation is the EXPA operation on the *VFUN
command.
*DIM,CMPR,ARRAY,4,4
*VLEN,4,2 ! Do next *V---- operation on four rows,
! skipping every second row
*VFUN,CMPR(1,2),COMP,Y(1,1)
*VMASK,X(1,3) !Use column 3 of X as a mask for next *V----
! operation
*VFUN,CMPR(1,3),COMP,Y(1,2)

This example uses the *VFACT command to round the values in an array vector to the number of decimal
places specified by the NUMDP scalar parameter (set to 2 in the example). The NUMDATA array has been
dimensioned and filled with the following values:

numdp=2
*vfact,10**numdp
*vfun,numdata(1),copy,numdata(1)
*vfun,numdata(1),nint,numdata(1)
*vfact,10**(-numdp)
*vfun,numdata(1),copy,numdata(1)

or, you can use a slightly shorter version


numdp=2
*vfact,10**numdp
*vfun,numdata(1),copy,numdata(1)
*vfact,10**(-numdp)
*vfun,numdata(1),nint,numdata(1)

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 35/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

The resultant NUMDATA array is then

This example uses the *VLEN and *VMASK commands to find the set of prime numbers less than 100. An
array, MASKVECT, is created using 1.0 to indicate that the row value is a prime number and 0.0 to indicate
that the value isn't prime. The algorithm used to create the mask vector is to initialize all rows whose value is
greater than 1 to 1.0 and then loop thorugh the range of possible factors, eliminating all multiples of the
factor. The *VLEN command sets the row increment for performing operations to FACTOR. When the
*VFILL command is processed, the row number is incremented by this value. Because the starting row is
FACTOR x 2, the rows are processed by each loop in the following manner: FACTOR x 2, FACTOR x 3,
FACTOR x 4, etc.

*dim,maskvect,,100
*vfill,maskvect(2),ramp,1
*do,factor,2,10,1
*vlen,,factor
*vfill,maskvect(factor*2),ramp,0
*enddo
*vmask,maskvect(1)
*dim,numbers,,100
*vfill,numbers(1),ramp,1,1
*status,numbers(1),1,10

The resultant output from the *STATUS command, showing the first 10 elements in NUMBERS is
PARAMETER STATUS- NUMBERS ( 5 PARAMETERS DEFINED)
(INCLUDING 2 INTERNAL PARAMETERS)

LOCATION VALUE
1 1 1 0.000000000E+00
2 1 1 2.00000000
3 1 1 3.00000000
4 1 1 0.000000000E+00
5 1 1 5.00000000
6 1 1 0.000000000E+00
7 1 1 7.00000000
8 1 1 0.000000000E+00
9 1 1 0.000000000E+00
10 1 1 0.000000000E+00

3.11.9 Plotting Array Parameter Vectors


You can graphically display array vector values using the *VPLOT command.

The following demonstrates some of the capabilities of the *VPLOT command. For this example, two
TABLE arrays (TABLEVAL and TABLE) and one numeric array have been dimensioned and filled with the
following values:

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 36/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

The following are example *VPLOT commands and their resulting plots. Note that since ARRAY data is
unordered it is plotted as a histogram; TABLE data is ordered and is therefore plotted as a curve.

The plot (below) resulted from the following command.

*vplot,,arrayval(1,1),2

Figure 3-6 Example Plot

The plot (below) resulted from the following command.


*vplot,,tableval(1,1),2

Figure 3-7 Example Plot

The plot (below) resulted from the following command.


*vplot,table2(1),tableval(1,1),2

Figure 3-8 Example Plot

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 37/38
29/10/2019 APDL: Chapter 3: Using Parameters (UP19980820)

The plot (below) resulted from the following command.


*vplot,tableval(1,0),tableval(1,1),2

Figure 3-9 Example Plot

Go to the beginning of this chapter

mechanika2.fs.cvut.cz/old/pme//examples/ansys55/html/prog_55/g-apdl/AS3.htm 38/38

You might also like