0% found this document useful (0 votes)
31 views5 pages

CADINP - Input Language: Sofistik

The document outlines the CADINP input language used in SOFiSTiK, detailing variable types, arithmetic expressions, and debugging commands. It describes how to define functions, use loops, and implement conditional statements, providing examples for clarity. Additionally, it covers interpolation techniques and the handling of text variables within the programming structure.

Uploaded by

Benjamin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views5 pages

CADINP - Input Language: Sofistik

The document outlines the CADINP input language used in SOFiSTiK, detailing variable types, arithmetic expressions, and debugging commands. It describes how to define functions, use loops, and implement conditional statements, providing examples for clarity. Additionally, it covers interpolation techniques and the handling of text variables within the programming structure.

Uploaded by

Benjamin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SOFiSTiK | CADINP - Input Language

the masses (MASS) and reinforcements (REIN) of all groups (GRP_) and section numbers
(SCT_) or Materials (MAT_), where the index 0 contains the total sum.

All other variables start with the first three characters of the program creating them followed by
an underline:

• ASE uses the array ASE_ITER as follows


ASE_ITER(0) = first load case number
ASE_ITER(1) = last load case number
ASE_ITER(2) = last achieved load factor
• Variables of Array AQB_USAGE will be set by AQB with the usage factors of the design
tasks of the last input block.
• All Variables starting with OPT_ are reserved for OPTIMA.

To trace the assignment of values, there is a command DBG#. This will toggle test prints
and an interactive debug mode. DBG# uses the variable #0, which can not be used for other
purpose therefore

DBG#0 No output of intermediate values


DBG#1 Output of the generated input records
DBG#2 Additional output of all value
assignments
DBG#3 Additional output of selected
structures (CDB access)
DBG#4 Printout to console stream/window
DBG#8 Input from console stream/window
(interactive mode)
DBG# Switch between option 15 and option 0
(=break and continue)
and
DBG# -2 Immediate STOP of total program run,
although all outstanding
TXE-Lines will be printed after the
error message

2.2.15 Arithmetic Expressions


In place of a numerical value any desired arithmetic expression may be used. The expression
may contain parentheses, but no separation characters.

The allowable operators are:

+ - Addition, Subtraction
* / Multiplication, Division
** or ^ Exponentiation

== <> Condition of equality/inequality


>= <= Relational condition
> < Relational condition
result: true (1.) or false (0.)

2-10 SOFiSTiK 2025


CADINP - Input Language | SOFiSTiK

& | Bitwise logical operation on the


integer part with AND or OR

If no operator is given, a multiplication will be performed. The bindings of the operators are
according to the mathematical rules. The logical operators have the same weight, thus it is
strongly recommended to use parentheses for combined expressions.

The following functions are allowed inside an expression:

SIN(x),COS(x),TAN(x) Trigonometric functions


ASIN(x),ACOS(x) Arc sine, arc cosine
ATN(x),ATN(y,x) Arc of tangent x or y/x
ARC(x) Convert angles to arcus
SQR(x) Square root
ABS(x) Absolute value
EXP(x) Exponents of e
LOG(x) Natural logarithm
LGT(x) Base 10 logarithm
DIV(x,y),xDIVy,DIV(x/y) Integer part of x/y
MOD(x,y),xMODy Division remainder of x/y
MOD(x) Division remainder of x/y
MIN(x,y,..),MAX(x,y,..) Minimum or Maximum numbers
RANDOM(x) random value between 0 and 1
(x=0 reinitialises the seed)
IIF(expr,val1,val2) returns val1 if expr is not
equal zero and val2 if expr
equals to zero.

Arithmetic expressions may also appear within a list of values or generation instructions. The
functions DEG, GON and RAD may be placed before any argument, but separated from it by
a comma. Their definition is kept if an assignement contains only one of those names (e.g.
LET#0 RAD).

Examples:

SIN(30.)+3*COS(45.) oder SIN30+3COS45


SIN(RAD,2.435)

100.+MOD(354,32) oder 100+354MOD32

120.+12.
3(5.0+4.0)

COS(#1) SIN(#1)
345*#11+##12

Interpolation and Tables:

A special feature is available when accessing arrays of variables. If the index is not integer, but
rational, an interpolation between the values of the array will take place:

SOFiSTiK 2025 2-11


SOFiSTiK | CADINP - Input Language

LET#A(0) 10.0
LET#A(1) 14.0
LET#A(2) 16.0
LET#A(3) 17.0

LET#B =A(1.3) => #B = 14.6

The same procedure is also available for higher interpolation schemes. Then we need two
arrays of the X and Y values with the same length. These variables are then connected by a
special assignement of a literal as a table definition:

LET#X 0.0,2.0,3.5
LET#Y 0.0,100.0,100.0
LET#SIG 'TAB(X,Y)'

The expression #SIG(1.73) interpolates for this X-value betwen the given Y-values linearly. If
higher functions are requested, a third array is needed, giving the derivatives of the function:

LET#DY -,0,-
LET#SIG 'TAB(X,Y,DY)'

For the example above only the derivative at the middle point has been specified. Thus we
have quadratic parabulas for the interpolation function. If derivatives are specified at both ends
of an interval we have cubic splines as interpolation functions.

Variables and Literals:

In case it is required to store text in a variable this may be done with the LET/STO command
in the same way (The use of apostrophes is manadatory):

LET#TEXT 'ABCDEFGHIJK'

The text will be saved in blocks with 8 characters each in the name of the variable, #TEXT(1)
would thus be equivalent to ”IJK ” in the above example and it is possible to change that item
only, but there is no storage of single characters. However when using a text variable it is
possible to use sub strings with the format #TEXT(3:7) selecting the third to seventh charac-
ter. (Instead of the numbers any arithmetic expresssionas are also valid of course). A text
variable may be read from the CDB and it is possible to convert with a LET/STO command a
text to numbers. The following example will save the two numbers in variables #VALT(0) and
#VALT(1):

LET#TEXT '1.23,1.48'
LET#VALT VAL(#TEXT)

2.2.16 FUN - Definition of functions


If an arithmetic expression is needed more often or the meaning of a variable should be
changed during the run, it is possible to define a function. Such definition is done as a lit-

2-12 SOFiSTiK 2025


CADINP - Input Language | SOFiSTiK

eral according to:

LET#F '=FUN(var,formulaexpression)'
! e.g.
LET#F '=FUN(x,3*#x**3-2*#x**2+5*#x)'
LET#1 #F(1.234)

The Literal has to start with the character sequence ”=FUN(” , followed by a formal param-
eter name, followed by an expression containing any variables defined so far. If the formal
parameter’s name has been defined already, it will not be changed by the call.

But this requires that this variable (LET#X) must be initialized before the first function call.
Recursive calls are allowed.

2.2.17 LOOP, ENDLOOP - Loops and Jumps


The most powerful form of generation is achieved through loops. This form corresponds to
the FORTRAN DO-Loops or to the FOR NEXT loops of BASIC. The loop is initiated by the
record LOOP and terminated by the record ENDLOOP. A loop is executed as many times as
determined by the number following LOOP (Default 9999). It may also be terminated if the
expression following ENDLOOP becomes zero or negative. If the name of a variable is given
instead of the number after the LOOP, then the number of elements contained in that variable
will be used.

Loops can be nested up to 32 levels, containing any number of input elements. If LOOP is not
followed by a number, it will be performed at most 9999 times.

Each loop construction must not exceed 255 lines. Multiple records, however, can be entered
at the same line (separated by ;). If you still need more than 256 lines you have to specify
before the first LOOP

LET#LOOPSIZE number_of_lines

It is possible to store the index of the loop in a variable, if the name is appended to the LOOP
keyword. The index starts counting at zero. The variable may be changed within the loop, but it
will be restored after evaluation of the terminating condition in each cycle. Generation of nodes
and springs on a semicircle at a distance of 30 degrees.

LET#1 1 , LET#2 0.
LOOP 7
NODE #1 COS(#2) SIN(#2)
SPRI #1 #1 DX COS(#2) DY SIN(#2) CP 1.E5
LET#1 #1+1
LET#2 #2+30.
ENDLOOP

Instead of LOOP 7 / ENDLOOP you could use LOOP / ENDLOOP #2 < =180. With an endloop
condition one can leave a loop prematurely.

Example for two-level generation:

SOFiSTiK 2025 2-13


SOFiSTiK | CADINP - Input Language

LOOP#1 3
TXB ADEF #1+1
LOOP 2
TXB BDIV 0.5 #1+1
TXB 0.2 1
ENDLOOP
ENDLOOP

creates:

ADEF 1
BDIV 0.5 1
0.2 1
0.5 1
0.2 1
ADEF 2
BDIV 0.5 2
0.2 1
0.5 2
0.2 1
ADEF 3
BDIV 0.5 3
0.2 1
0.5 3
0.2 1

If you want to run a loop over all elements of an array, this may be done by giving only the
name of the array (without the # ):

LET#A 10,22,34,55,76,83
LOOP#1 A ! Only the name, #A would be the value 10!
NODE #1+1 X #A(#1)
ENDLOOP

If not all elements have been defined, ist is possible to perform the loop only over the defined
elements, the loop index will then obtain the value of the defined elements only:

LET#ANZ 0
LOOP#1 DEF(A)
LET#ANZ #ANZ+1
ENDLOOP

2.2.18 IF - Logical Conditions


Conditional blocks are an important element of every programming language. The execution
of jumps (go to) is not possible within CADINP as it is proven to be able to solve any problem
without this feature. The conditional block is executed if the expression following the IF is
greater than zero. You might want to use the logical expressions for this. Texts may be only
compared with == and != operators, the comparison is case sensitive. As the complete string

2-14 SOFiSTiK 2025

You might also like