Manual Cal Sap
Manual Cal Sap
Manual Cal Sap
BY
EDWARD L. WILSON
TABLE OF CONTENTS
1.1 Purpose of Program
1.3 Required User Background
1.4 Program Installation
1.5 The CAL Command Language
1.6 Data Preparation
1.7 Execution of the CAL Program
CHAPTER 1
At the present time, a large number of computer programs exist which evaluate the
displacements and member forces within complex three-dimensional structures. After
the computer model and input data is prepared, the analysis process is completely
automated. Therefore, it is now possible for students, professional engineers, and
professors to perform structural analysis and design using computer programs
without a complete knowledge of the approximations which have been incorporated
in the computer program. In addition, many individuals do not assume the
responsibility or have the ability to independently verify the results produced by a
structural analysis program.
The major reasons for the misuse of computer programs for structural analysis and
design is the lack of understanding of the engineering fundamentals of
equilibrium, force-deformation requirements, and displacement compatibility
equations. Another reason, which contributes to the inappropriate use of computer
programs, is that the traditional hand calculation methods of structural analysis are
not used within modern computer programs. Therefore, many engineers use
structural analysis programs as "black boxes" in which the approximations used
within the program are not appreciated. This is particularly true if a program is used
for three-dimensional dynamic response analysis.
One possible educational solution to this problem is to require students to write their
own programs for structural analysis which are based on the direct stiffness method
and on modern three-dimensional numerical methods of dynamic analysis. This
would result in an improvement in the students' programming ability; however, this
2 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
The basic purpose of the CAL-SAP language is to bridge the gap between traditional
methods of teaching structural analysis and the use of automated structural analysis
programs. As a result of using CAL-SAP, it is hoped that engineers will understand
the theory and approximations which are used in modern structural analysis
programs.
Since the program can be easily modified, we use the program as an effective
research tool. New numerical algorithms for the static or dynamic analysis of
structures can be programmed and tested within a few hours. All floating point
calculations are carried out in double-precision 64 bit accuracy.
The program has been used to verify other programs for structural analysis. Simple
static and dynamic problems can easily be solved with the CAL-SAP program and
their results compared with programs which are being used for the first time.
Since the program performs basic matrix operations it can be used in upper division
courses on structural analysis that uses matrix notation. However, it will not
teach non-structural engineers to prepare computer input for large or small
structural systems. In my opinion, the most qualified individual to create a computer
model for a large, real structure is an experienced engineer that knows structural
analysis theory and has a clear understanding of the behavior of structures. This
knowledge cannot be automated into any computer program. Unfortunately,
many firms delegate the responsibility of the preparation and definition of the
computer model to junior engineers or non-engineering personel. The responsibility
of a CAL-SAP user is to be able to independently verify that the basic three
fundamental equations of mechanics are satisfied.
The CALSAP.EXE executable program is the only file which is required in order to
execute all CAL-SAP commands. Copy the CALSAP.Exe program in a folder
named CALSAP. In the same folder define or copy the file FileList and the example
problems. The Filelist ASCII file contains the name are the example problems and
any new problem that the user wants to define.
This version of the program performs matrix analysis, direct stiffness structural
analysis and dynamic response analysis. Several other commands exist; however,
they have not been documented at this time. Also, I plan to add additional
4 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
Data on a "command line" must be separated by commas, or, one or more blanks. A
typical CAL command line has the following form:
The notation "M+" indicates that a new array will be created by the operation. If the
array name for new data has previously been used the old array will be eliminated
before the operation is executed. The notation "M-" indicates that the array will be
modified by the CAL operation.
Typical data, "ai", to be used by the operation can be in either integer or floating point
form. In the case of a floating point number, it can have the form of arithmetic
statements. For example, 2.5+4*2-6/2 will be interpreted as ((2.5+4)*2-6)/2.
A "!" in column one of a command or data line indicates that the line will be a
comment line which is used to make the CAL input file more readable. In addition, a
! (after the essential data entered on any line) will allow additional comments to be
entered.
After the CAL-SAP Windows program is opened, the program asks the user for the
CAL-SAP project "name" of the input data file which contains the batch command.
The results of every CAL-SAP solution are saved on the output file name
"name.OUT".
After the CAL program is terminated the output file, name.OUT, can be printed or
edited by the WORDPAD editor.
5
CHAPTER 2
BASIC COMMANDS
The group of CAL commands presented in this section controls the flow of execution
of the CAL commands. Also, it allows for input, output, duplication or generation
of arrays within the computer's memory, RAM, or the transfer of arrays between
RAM and low speed disk storage. Note that the "+" sign after an array name
indicates that the array is created by the CAL command and the "-" sign after an
array name indicates that the CAL command modifies or deletes the data within the
array.
RETURN
The RETURN command will terminate the execution of the batch input mode and
return the CAL program to the interactive mode. This command can only be given
in the batch input file mode.
LIST or L
If the interactive LIST command is executed a list of the name and size of all arrays
which are contained in the computer storage is displayed.
PRINT or P M1
The PRINT command will cause the matrix "M1" to be displayed on the terminal and
written to the "????.OUT" print file, which can be printed by the DOS PRINT
command.
DELETE or D M1-
The array named M1 will be deleted and the storage within the computer will be
compacted.
DUP M1 M2+
The DUP command forms a new matrix named M2 in which all terms are equal to the
terms in matrix M1.
CHAPTER 3
ADD M1- M2
This operation replaces the matrix M1 with M1 + M2
SUB M1- M2
The SUB operation replaces the matrix M1 with M1 - M2
MULT M1 M2 M3+
The MULT command creates the matrix M3 which is the product of the matrices M1
and M2. ( The number of numerical operations required for matrix multiplication is
NxMxL; where, M1 is a N by M matrix and M2 is a M by L matrix.)
TMULT M1 M2 M3
Same as the MULT command except that M1 is stored in transposed form.
TRAN M1 M2+
The TRAN command forms the matrix M2 which is the transpose of the matrix M1.
SCALE M1+ M2
The SCALE command multiplies each term in matrix M1 by M2(1,1).
Any nonsingular set of equations can be made symmetric if both sides of the equation
are multiplied by the transpose of A.
INVERT A-
The symmetric matrix A is replaced by its inverse.
(The number of numerical operations required to invert a symmetric matrix is N3/2)
DUPDG M1 M2+
The command DUPDG creates a row matrix M2 from the diagonal terms of matrix
M1.
STODG M1- M2
The command STODG stores the row matrix M2 on the diagonal of the matrix M1.
The set of equations shown below must be solved. Since the SOLVE command
only solves symmetrical systems we must use additional operations to make the
system symmetrical.
If the above data file is called "CALEX" it can be executed by giving the DOS
command CAL91. The CAL program will then ask the user for the "name" of the
input file and the user will respond by entering CALEX and a carriage return. The
above data is then executed by the user entering the CAL RUN command. The
results will be on the output file "CALEX.OUT"
The CAL program disk contains the file CALEX; therefore, the user can check the
program by executing the above data file.
10 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
CHAPTER 4
The direct stiffness operations allow for the automatic formulation of element
stiffness matrices, the direct addition of element stiffness to form the global stiffness
matrix and the calculation of member forces in a local member coordinate system.
The first step in the use of these commands is for the user to identify all displacement
degrees of freedom at the joints of the structural system. These displacements
should be numbered U1, U2, - - - -UN. The corresponding external joint loads will be
R1, R2 - - - - RN. One equilibrium equation must be written in the direction of each
unknown displacement. The structural members should also be numbered from 1 to
M.
The classical slope-deflection method, for horizontal beams and vertical columns, is
a well-known approach for structural analysis. However, it is identical to the direct
stiffness method in which axial deformations are assumed to be zero. Therefore, it
will be used to illustrate the basic steps involved in the direct stiffness method.
11
For the sign convention shown in Figure 4.1 the classical slope-deflection
equations can be written as
EI 6 ( v3 - v4 )
F1 = [ 4 v1 + 2 v 2 + ]
L L
EI 6 ( v3 - v4 )
F = [ 2 v1 + 4 v 2 + ]
2 L L
( F 1+ F 2 )
F3 = - F4 =
L
The relative displacement between the ends of the member, v3 - v4, has been written
in terms of the absolute global displacements. Now, these equations can be written,
for a typical member "M", as the following symmetric matrix equation:
4 2 6 6
-
F1 L L v1
2 4 6
-
6
F 2 L L v2
= 4EI 4.1
L 6
F 3 6 12 12
- 2 v3
L L
2
L L
F 4 M
6 6 12 12
- - - v4 M
L L L
2
L M
2
=
FM
K
vM
K
M
In order to illustrate the direct stiffness method we will consider the rigid frame
example structure shown in Figure 4.2. The first step required, in the analysis of a
structure by the slope defection method, is to select the independent displacement
13
degrees of freedom
u3
u1 5 u1
u4
u4
100 in 1 2
6 u2 7 u2
u8 u9
u3
120 in 3 4
u6
180 in
The next step, after the degrees of freedom are identified, is to write one equilibrium
equation for each degree of freedom. For this structure, the nine equilibrium
equations can be written in the following matrix form:
R1 F 3 F 3 0 - 0 - 0- 0- 0 -
R2 F 4 F 4 F 4 F 3 0 - 0 - 0-
R3 0- 0- 0- 0- F 4 F 4 F 3
R4 F 1 0 - 0 - 0 - F 1 0 - 0 -
R5 = 0- + F 1 + 0- + 0- + F 2 + 0 - + 0-
R6 0- 0- 0- F 2 0 - 0 - 0-
R7 F 2 0- F 1 0- 0 - F 1 0-
R8 0- F 2 0- 0- 0- F 2 F 1
4.2
R9
0- 1 0- 2 0- 3 F 14 0- 5 0- 6 F 2 7
14 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
From matrix Equation (4.2), we can also create a table indicating what member
forces contribute to each of the nine global equilibrium equations.
Member 1 2 3 4 5 6 7
Force
F1 4 5 7 9 4 7 8
F2 7 8 - 6 5 8 9
F3 1 1 2 2 - - 3
F4 2 2 - - 3 3 -
Equation (4.2) is nothing more than a simple statement, in matrix form, that the
external applied loads equal the sum of the forces acting at the ends of the seven
elements. It clearly represents the summary of nine different free body diagrams. It
is suggested that the student draw each of these diagrams in order to understand this
simple, but extremely important, force equilibrium statement.
The final step involves the use of the joint displacement compatibility condition. The
displacements at the ends of all members connected to a joint must have the same
global displacements. For this example, Table 4.2 defines the relationship between
the four member displacements for each member and the nine global joint
displacement numbers.
15
Member 1 2 3 4 5 6 7
Displaceme
nt
v1 4 5 7 9 4 7 8
v2 7 8 - 6 5 8 9
v3 1 1 2 2 - - 3
v4 2 2 - - 3 3 -
It is apparent that the integer arrays, given in Tables 4.1 and 4.2, are identical. The
blank positions are reaction points and have zero displacements. The equilibrium
equations can be written in the following form:
R
=[
+
-
-
-
-
+
]
u
=
u
=
u
K
KT
*1
*2
* 7
M
∑ (4.3)
Each element stiffness can be expanded to a 7 x 7 matrix and the total stiffness
KT
matrix, , can be formed by direct matrix addition. Or, the total stiffness matrix can
be formed directly. This would involve the addition of each term in the 4 x 4 element
K
* M
stiffness matrix, , into the correct location in the 7 x 7 total stiffness matrix. The
procedure is time-consuming, repetitive, and prone to error if done by hand
calculations. For this reason special commands have been added to the CAL
program to perform these direct additions of stiffness operations.
loaded with this CAL command. The array loaded by the LOADI command can
be checked by the CAL PRINT command.
ADDK K KM ID N=?
The element stiffness matrix named "KM" is added to the total stiffness matrix
named "K". The row and column numbers where the terms are to be added are
obtained from the "N" column of the integer array loaded by the LOADI command.
The ADDK command is used for each member to add the element stiffness matrices
to the total (global) stiffness matrix.
After the joint loads are defined, the joint equilibrium equations are solved for joint
displacements by the SOLVE command. The use of the MEMFRC command for
each member allows member forces to be calculated.
MEMFRC T U ID F+ N=?
The member forces are evaluated by the multiplication of the matrix named "T" by
the joint displacement matrix named "U" and the results are stored in a matrix named
"F". The joint displacements which are to be used in multiplication are obtained
from the "N" column of the integer array named "ID". If "T" is the element stiffness
matrix the member forces are given according to the global sign convention. If "T"
is a special member force-displacement transformation matrix the member forces
will be given in a local member coordinate system.
A complete analysis of the structure shown in Figure 4.1 will now be given. In order
to illustrate that the properties of the stiffness matrix are not a function of the loading
on the structure let us use the following two different lateral load conditions in the
same analysis:
10
T
20 0 0 0 0 0 0 0
R = 4.2
20 -10 0 0 0 0 0 0 0
The CAL input data file is shown in Table 4.3 and is on the CAL program disk under
the name SLOPEX. It is suggested that the student run this example problem and
PRINT the output file named "SLOPEX.OUT". Shear and bending moment
17
diagrams should be plotted and the overall static of both load conditions should be
checked.
Since this problem could have been solved by the traditional slope-deflection method
it is extremely important that each step of the direct stiffness method, using matrix
notation and the CAL program, be completely understood before other types of
elements are used.
Some important points to remember when using the direct stiffness method are:
1. The positive direction of forces and displacements for both members and joints
must be the same.
2. The basic equations which are written and solved are simple equilibrium
equations in which the external loads are set equal to the sum of the forces
acting ot the ends of the elements.
4. Matrix notation and the CAL ADDK and MEMFRC commands are simple
operations which minimize bookkeeping functions.
18 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
The FRAME command forms the 6 x 6 element stiffness matrix named "KM" and a
4 x 6 force-displacement matrix named "TM" for a general two-dimensional
bending member with axial deformations included in the formulation. The
properties of the member are given as:
The coordinates of the "i" and "j" ends of the member are defined by Xi,Yi and Xj,Yj
respectively. Note that the user is responsible for the definition of the "i" and "j"
ends of the member. If P is specified the 6 x 6 geometric stiffness matrix KG is
formed.
The element stiffness matrix, "KM", is formed with respect to the positive definition
of global forces and displacements as shown below.
2
Figure 4.3 POSITIVE DEFINITION OF FORCES AND DISPLACEMENTS
The member forces, with respect to the member's local coordinate system, can be
evaluated by the use of the MEMFRC operation which multiplies the matrix "TM"
20 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
by the joint displacements. The positive definition of the member forces in the
local coordinate system is shown below. The MEMFRC command will evaluate the
local member forces in the order P1 - - P4.
The TRUSS command forms the 6 x 6 element stiffness matrix named "KM" and a
1 x 6 force-displacement matrix named "TM" for a general three-dimensional
21
member with axial deformations only included in the formulation. The Axial
Area of the member is "A". The Modulus of Elasticity of the member is "E".
Node numbers I and J refer to the row numbers in the "XYZ" array. The element
stiffness matrix, "KM", is formed with respect to the positive definition of global
forces and displacements as shown below.
The member axial force can be evaluated by the use of the MEMFRC operation
which multiplies the matrix "TM" by the joint displacements. A positive axial force
indicates tension.
The FRAME3 command forms the 12 x 12 element stiffness matrix named "KM"
and an 8 x 12 force-displacement matrix named "TM" for a general
three-dimensional member with axial, bending and torsional deformations included
in the formulation. The properties of the member are given as
The coordinates of joint number I, J, P1 and P2 must have been previously loaded in
an array named "XYZ".
The element stiffness matrix, "KM", is formed with respect to the positive definition
of global forces and displacements as shown below.
23
The member forces, with respect to the member's local coordinate system, can be
evaluated by the use of the MEMFRC operation which multiplies the matrix "TM"
by the joint displacements. The positive definition of the member forces in the local
coordinate system is shown below. The MEMFRC command will evaluate the local
member forces in the order P1 - - P8.
The section properties I22 and I33 of a three-dimensional frame member must be
24 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
The positive 1-axis, V1 vector, is defined by a line along the axis of the member
from node point "I" to node point "J".
The 2 and 3-axes can be specified, with the P=P1,P2 option, by any one of the
following three methods:
V2 = Vp x V1 and V3 = V1 x V2
Node points P1 and P2 may be "dummy nodes" which are not connected to members.
V3 = V1 x VK and V2 = V3 x V1
25
CHAPTER 4.
COMMANDS FOR DYNAMIC ANALYSIS
In this section several commands are presented which allow CAL-SAP to perform
linear dynamic analysis of small structural systems. With the aid of other commands
it is possible to solve the following types of dynamic problems:
All commands assume that the mass and stiffness matrices have been calculated by
other CAL commands. The PLOT interactive command can be used to produce
time history response plots of results.
EIGEN K- V+ M-
This command solves the following eigenvalue problem for the mode shapes and
frequencies:
KV = MVe
Where "K" is the name of the N x N stiffness matrix K. The command is restricted
to a diagonal mass matrix; therefore, the array named "M" must be given as a row or
column array of the diagonal terms of the N x N mass matrix M.
The N x N matrix V, which contains all the eigenvectors (mode shapes) stored
column wise, is named "V" and is normalized in order that VT M V = I.
26 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
The program uses the standard Jacobi method; therefore, both K and M must be
symmetric and positive definite matrices.
JACOBI K- V+ M- E+
This command solves the following eigenvalue problem for the mode shapes and
frequencies:
KV = MVe
Where "K" is the name of the N x N stiffness matrix K and "M" is the name of the
N x N mass matrix. The N x N matrix V, which contains all eigenvectors (mode
shapes) stored column-wise, is named "V" and is normalized in order that VT M V =
I.
SQREL M1
The SQREL command replaces each term in matrix M1 with the square root of the
term.
INVEL M1
The INVEL command replaces each term in matrix M1 with the inverse of the term.
Given a N x N stiffness matrix named "K", a N x 1 mass matrix named "M" and
a N x 1 force vector named "F", a N x NV matrix of orthogonal vectors, V, named
"V" is generated using a LOAD DEPENDENT algorithm. The matrix V is
27
The generated vectors V are not orthogonal with respect to the stiffness matrix K.
If "S" is a nonzero number the static vector response is not included in the response.
A row matrix M2 is formed in which each column contains the sum of the
corresponding column of the matrix M1. If "T" is not equal to zero the square root of
the sum of the square is calculated.
PROD M1 D
This command forms a 1 x 2 array named "D" which contains the product of all
terms in the array named "M1". The product is stored as two numbers of the form
D(1) 10D(2). This command is used to evaluate the determinate of a matrix.
This command evaluates a set of "I" uncoupled second order differential equations
which are generated in the mode superposition analysis of a structural system. The
typical equation is of the following form:
Xi + 2 ci wi Xi + w2 Xi = fi g(t) ; i = 1,---I
Where
G is the name of a 2 x M array which can be used to define the time function g(t).
X(t) is the name of the I x N array where the results are stored.
28 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
The array G defines a time function in terms of straight line segments where G(1,J)
defined the time tj and G(2,J) is the value g(tj). The time function must be defined
in the range T = 0 to Tmax, where Tmax = N x DT. Therefore, the maximum value
of G(1,M) must be greater than Tmax.
The accuracy of the solution is not a function of the output time increment "DT"
since the command produces the exact solution for straight line segments.
The MAX command locates the maximum absolute value in each row of the array
named X(t) and stores the results in a column matrix Xmax. The maximum value
and its column number are also printed or displayed.
The FUNCT command forms a 1 x N array named F(t). The terms are extracted at
"DT" intervals from the time function defined in the array named G. The array G
defines a time function in terms of straight line segments where G(1,J) defines the
time tj and G(2,J) is the value g(tj). The time function must be defined in the range
T = 0 to Tmax, where Tmax = N x DT. Therefore, the maximum value of G(1,M)
must be greater than Tmax.
29
Where a(t), v(t) and u(t) are the time-dependent acceleration, velocity and
displacement vectors respectively. K, M and C are the names of the N x N stiffness
matrix, {K}, mass matrix, M, and damping matrix, C respectively.
The loads are specified as the product of a N x 1 matrix P and a 1 x J array {F(t)}
named F(t). The loads F(i) are given at equal time steps as specified by "DT".
U is the name of the displacements which are stored as an N x Lmax array. The
step-by-step integration is conducted with a time increment "DT"; however, the
displacements are stored at Li time steps (or at "Li x DT" time intervals). Therefore,
the number of loads specified "J" must be greater than " Li x Lmax ".
If the P parameters are not specified the linear acceleration method is used.
30 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
The CAL operations DFT, IDFT and FSOLVE are provided in order to solve linear
dynamic analysis problems in the frequency domain. This approach can be very
effective for problems in which the loading is periodic over a very large time span
such as machine vibrations or wind and wave loading on structures. It can be used
for other types of loading, (i.e. earthquake ground motions), if the period of the
loading is selected to be sufficiently long to assure that the response of the structure
at the end of each loading period is essentially zero. If the damping of the system is
small a very large period may be required if accurate results are to be obtained for
loading which is not basically periodic. Following is a summary of these basic CAL
operations:
F (t )
−t t
Tp = N ∆t Tp = N ∆t
The term F(m,1) represents the value of the function "m" at the beginning and end of
the basic time period N x DT. The DFT operation expands the time functions in a
series of the following form:
where k=1,2,----- (N-1)/2 (for N odd), or, (N-2)/2 (for N even), and dw = 2π/(N DT).
The calculated constants for time function "m" are stored in the mth row in the order
F0, Fc1, Fs1, Fc1 - - and replace the original terms in the F(m,t) array. For N even the
Nth column will be zero.
IDFT F(m,w)-
This operation transforms the frequency domain functions back to the time domain.
The M x N array named F(m,w), which is in the form generated by the DFT or
FSOLVE operations, is replaced by time function values at equal time intervals.
This operation evaluates the solution of a set of uncoupled second order differential
equations which are generated in the mode superposition analysis of a structural
system for which the loading has been transformed to the frequency domain. W, C,
and F are M x 1 arrays and have the same definition as given by the DYNAM
operation. The 1 x N array named P(w) is in the same form as produced by the DFT
operation and DT is the time step which was used to transform the time domain to the
frequency domain.
The mth row in the M x N array named Y(m,w) contains the terms Y0, Yc1, Ys1, yc2
32 C O M P U TE R A S S I S TE D L E A R N I N G o f S T R U C TU R A L A N A L Y S I S P R O C E D U R E S
----- which is the solution of the mth mode written in the following form:
The frequency domain solution Y(m,w) can be transformed to the modal time
domain by the IDFT operation - IDFT Y(m,t).