Introduction¶
CALFEM is a MATLAB toolbox for finite element applications. This manual concerns mainly the finite element functions, but it also contains descriptions of some often-used MATLAB functions.
The finite element analysis can be carried out either interactively or in a batch-oriented fashion. In the interactive mode, the functions are evaluated one by one in the MATLAB command window. In the batch-oriented mode, a sequence of functions is written in a file named .m file and evaluated by writing the file name in the command window. The batch-oriented mode is a more flexible way of performing finite element analysis because the .m file can be written in an ordinary editor. This way of using CALFEM is recommended because it gives a structured organization of the functions. Changes and reruns are also easily executed in the batch-oriented mode.
A command line typically consists of functions for vector and matrix operations, calls to functions in the CALFEM finite element library, or commands for workspace operations. An example of a command line for a matrix operation is:
C = A + B'
where the two-by-two matrices A and B are added together, and the result is stored in matrix C. The matrix B' is the transpose of B. In MATLAB, the transpose operator is denoted by a single quote '.
An example of a call to the element library is:
Ke = spring1e(ep)
where the two-by-two element stiffness matrix \({\mathbf{K}}^e\) for a spring element is computed and stored in the variable Ke. The input argument is given within parentheses ( ) after the name of the function and is in this case ep, containing the spring stiffness \(k\). Some functions have multiple input arguments and/or multiple output arguments. For example:
[L, X] = eigen(K, M)
computes the eigenvalues and eigenvectors of a pair of matrices
K and M. The output variables, the eigenvalues \(\lambda\), stored in the vector L and the corresponding eigenvectors stored in the matrix X are surrounded by brackets [ ] and separated by commas. The input arguments are given inside the parentheses ( ) and also separated by commas.
The statement:
help function
provides information about the purpose and syntax for the specified function.
The available functions are organized in groups as follows. Each group is described in a separate chapter.
General purpose commands |
For managing variables, workspace, output etc. |
Matrix functions |
For matrix handling |
Material functions |
For computing material matrices |
Element functions |
For computing element matrices and element forces |
System functions |
For setting up and solving systems of equations |
Statement functions |
For algorithm definitions |
Graphics functions |
For plotting |