R
e
p
o
r
t
T
V
S
M
-
9
0
0
1
C
A
L
F
E
M
-
I
I
A
F
N
T
E
E
L
E
M
E
N
T
T
O
O
L
B
O
X
T
O
M
A
T
L
A
B
V
e
r
s
i
o
n
3
.
3
Department
of
Mechanics
and
Materials
C A L F E M
A finite element toolbox to MATLAB
Version 3.3
Structural Mechanics & Solid Mechanics
Department of Mechanics and Materials
Structural Mechanics
ISRN LUTVDG/TVSM--99/9001--SE (1-265)
ISSN 0281-6679
C A L F E M
A finite element toolbox to MATLAB
Version 3.3
Copyright © 1999 by Structural Mechanics, LTH, Sweden.
Printed by JABE Offset, Lund, Sweden.
The software described in this document is furnished under a license agreement. The
software may be used or copied only under terms in the license agreement.
No part of this manual may be photocopied or reproduced in any form without the prior
written consent by the Division of Structural Mechanics.
CALFEM
February 1999
c Copyright 1992–99 by the Division of Structural Mechanics and the Department of Solid
Mechanics at Lund University. All rights reserved.
CALFEM is the trademark of the Division of Structural Mechanics, Lund University.
Matlab is the trademark of The MathWorks, Inc.
The Division of Structural Mechanics
Lund University
PO Box 118
S–221 00 Lund
SWEDEN
Phone: +46 46 222 0000
Fax: +46 46 222 4420
The Department of Solid Mechanics
Lund University
PO Box 118
S–221 00 Lund
SWEDEN
Phone: +46 46 222 0000
Fax: +46 46 222 4620
E-mail addresses:
calfem@byggmek.lth.se
strucmech@byggmek.lth.se general questions to the departments
CALFEM questions and comments
Homepage:
http://www.byggmek.lth.se/Calfem
Preface
CALFEMR is an interactive computer program for teaching the finite element method
(FEM). The name CALFEM is an abbreviation of ”Computer Aided Learning of the Finite
Element Method”. The program can be used for different types of structural mechanics
problems and field problems.
CALFEM, the program and its built-in philosophy have been developed at the Division of
Structural Mechanics starting in the late 70’s. Many coworkers, former and present, have
been engaged in the development at different stages, of whom we might mention
Per-Erik Austrell
Jonas Lindemann
Kent Persson
Matti Ristinmaa
H˚akan Carlsson
Anders Olsson
Anders Peterson
G¨oran Sandberg
Ola Dahlblom
Karl-Gunnar Olsson
Hans Petersson
The present release of CALFEM, as a toolbox to MATLAB, represents the latest develop-
ment of CALFEM. The functions for finite element applications are all MATLAB functions
(M-files) as described in the MATLAB manual. We believe that this environment increases
the versatility and handling of the program and, above all, the ease of teaching the finite
element method.
Lund, November 22, 2000
Division of Structural Mechanics and Division of Solid Mechanics
Contents
1 Introduction
2 General purpose functions
3 Matrix functions
4 Material functions
5 Element functions
1 – 1
2 – 1
3 – 1
4 – 1
5.1 – 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 – 1
5.1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 – 1
5.2 Spring element
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 – 1
5.3 Bar elements
5.4 Heat flow elements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 – 1
5.5 Solid elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 – 1
5.6 Beam elements
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6 – 1
5.7 Plate element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7 – 1
6 System functions
6.1 – 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 – 1
6.1
6.2 Static system functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 – 1
6.3 Dynamic system functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3 – 1
7 Statements and macros
8 Graphics functions
9 User’s Manual, examples
7 – 1
8 – 1
9.1 – 1
9.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 – 1
9.2 MATLAB introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 – 1
9.3 Static analysis
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.3 – 1
9.4 Dynamic analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.4 – 1
9.5 Nonlinear analysis
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5 – 1
1 Introduction
The computer program 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 are 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 consists typically 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 + B0
where two matrices A and B’ are added together and the result is stored in matrix C .
The matrix B’ is the transpose of B. An example of a call to the element library is
Ke = bar1e(k)
where the two-by-two element stiffness matrix Ke is computed for a spring element with
spring stiffness k, and is stored in the variable Ke. The input argument is given within
parentheses ( ) after the name of the function. Some functions have multiple input argu-
ments and/or multiple output arguments. For example
[lambda, X] = eigen(K, M)
computes the eigenvalues and eigenvectors to a pair of matrices K and M. The output
variables - the eigenvalues stored in the vector lambda 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 purpose and syntax for the specified function.
1 – 1
INTRODUCTION