DEQATN
Bulk Data Entry Specifies one or more equations for use in optimization.
Format
(1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) |
---|---|---|---|---|---|---|---|---|---|
DEQATN | EQUID | EQN1; | EQN2; | EQN3; | |||||
…; … ; EQNn-1; EQNn |
Example 1
DEQATN | 3 | y(x1, x2) = x1 + x2**-3.0*(2-1)+5.0; | |
z = -y*1.3E-2 |
Example 2
DEQATN | 104 | z(x1, x2) = min(sin(x1), x2); | |
y = max(0.3, -2.0, z) + 4.0 |
Definitions
Field | Contents | SI Unit Example |
---|---|---|
EQUID | Unique equation
identification number. (Integer > 0) |
|
EQNi | i-th
equation. (Character string) |
Restrictions
- Variable names longer than 8 characters are truncated, which may create an error in equation if two names are identical after such truncation.
- All trigonometric arguments are in radians.
- Only alphanumeric characters may be used in variable names (that is do not use underscores, monetary symbols, punctuation symbols, mathematical operators, letters from non-English alphabet, and so on).
- Mathematical function names (such as those listed in Comment 6) should not be used as variable names.
- The following functions are not accepted:
DB() DBA() INVDB() INVDBA()
Possible Errors
- Error 1690
- This equation could not be parsed. See the DEQATN entry in the OptiStruct manual.
- The length of the equation exceeds the 72 character per line limitation
- The last character of the equation is an operator
- There are two adjacent operators in the equation
- There are non-alphanumeric characters (besides operators) in the equation
Comments
- Each equation card is specified in a fixed format, without the limitation of data field boundaries. Equations are located in columns 17-72 on the first card, and in columns 9-72 on each continuation card. There is no limit on the total length of any equation.
- Large field format is not allowed.
- Free field format is allowed, but only the same number of characters as in the fixed format (56 on the first line and 64 on the continuation lines) and will be accepted. Characters after the 72nd column will not be accepted. Excess characters are silently disregarded, which may result in DEQATN error or in a valid expression different from that intended. On the continuation card in free format, the comma must be present within the first 8 columns; otherwise, the card will be interpreted in a fixed field format.
- Blank characters in the equation have no effect, even within a constant, variable or function name. Lower and upper case letters are equivalent.
- There must be only one variable at the
left-hand side of each equation in any equation card. The variable of the first
equation must be followed by an argument list in the following format:
v1(x1,x2,…,xn) = expression(x1,x2,…,xn); v2 = expression(x1,x2,…,xn,v1); … vi = expression(x1,x2,…,xn,v1,v2,…,vi-1); … vn = expression(x1,x2,…,xn,v1,v2,…,vn-1);
Where,
vi
is the variable of equation i. (x1
,x2
, …,xn
) is the argument list for variablev1
. (v1
,v2
,…,vi-1
) is the variable list which corresponds to the result of equation 1 through equation i-1.Only the value of the last expression is returned to the bulk data card referencing EQUID (DRESP2).
- Constants can be specified in a format of
either integer or floating point. A floating point number can be in a format of
either normal decimal-point format (3.90) or scientific notation (-2.0E-3),
which means -2×10-3.The list of supported mathematical functions is:
- One-argument functions
- abs(x)
- absolute value
- acos(x)
- arccosine
- acosh(x)
- hyperbolic arccosine
- asin(x)
- arcsine
- asinh(x)
- hyperbolic arcsine
- atan(x)
- arctangent
- atanh(x)
- hyperbolic arctangent
- cos(x)
- cosine
- cosh(x)
- hyperbolic cosine
- exp(x)
- exponential
- log(x)
- natural logarithm
- log10(x)
- common logarithm
- pi(x)
- multiples of π
- sin(x)
- sine
- sinh(x)
- hyperbolic sine
- int (x)
- real to integer conversion
- sqrt(x)
- square root
- Two-argument functions
- atan2(x,y)
- actangent of quotient
- atanh2(x,y)
- hyperbolic actangent of quotient
- dim(x,y)
- positive difference
- logx(x,y)
- base y logarithm
- mod(x,y)
- remainder
- Multi-argument functions
- The supported operators are:
Symbol Meaning Example + binary + x + y - binary - x - y * multiplication, x * y / division x / y ** power x**y + unary + +1.0 - unary - -1.0 - The precedence of mathematical calculations
follows the rules of Fortran language. Parenthesis has a
higher priority in the order of precedence than the operators listed above. Two
consecutive operators are acceptable only if the second one is unary, plus or
minus.Examples of operator precedence:
- Expression
- Result
- 2**-3
- 0.128
- 1 / 2 + 3
- 3.5
- 2*3-4
- 2.0
- -2**3**2
- -512.0
- 2 + -5
- -3.0
- 2 * -5
- -10.0
- 2 - -5
- 7.0
- 2/3/4
- 0.16666666…
- 2/(3/4)
- 2.6666666…
- Functions can be defined in a layered format, for example, min(sin(x1), x2), with no limit on the number of layers.
- The DEQATN entry is
referenced by DRESP2 and/or
DVPREL2 Bulk Data
cards.
DRESP2 card, the variable identified by DVIDi, LABj, NRk, Gr and DPIP correspond to variable arguments listed in the left-hand side of the first equation of a DEQATN card identified by EQUID. The variable arguments x1 through xN (where N = n + m + p + q + s) are assigned in the order DVID1, DVID2, …, DVIDn, LAB1, LAB2, …, LABm, NR1,NR2, …, NRp, G1, …, Gq, DPIP1,…,DPIPS. In a DVPREL2 card, the variables identified by DVIDi and LABj correspond to variable arguments listed in the left-hand side of the first equation of a DEQATN card identified by EQUID. The variable arguments x1 through xN (where N = n + m) are assigned in the order DVID1, DVID2, …, DVIDn, LAB1, LAB2, …, LABm.
Only the computed value of the last expression (vn) is used by DRESP2 and/or DVPREL2 entry.
- This card is represented as an optimization function in HyperMesh.