Finite Element Method Course
Finite Element Method Course
Course
Finite Element Method
Abdelghani SEGHIR
Doctor of Science from A. Mira University, Béjaia, Algeria Doctor of
Civil Engineering from Paris-Est University, Marne-la-Vallée, France
2005-2014
Machine Translated by Google
Contents
chapter 1 Presentation of MATLAB .................................................. ............................. 5
3
Machine Translated by Google
4
Machine Translated by Google
chapter 1
MATLAB Overview
1.1 Introduction
MATLAB is an interactive software based on matrix calculation (MATrix LABoratory).
It is used in scientific calculations and engineering problems because it allows
complex numerical problems to be solved in less time required by common
programming languages, thanks to a multitude of built-in functions and several tool
programs. tested and grouped according to use in files called toolboxes.
The main MATLAB window contains two secondary windows that can be moved or
closed.
On the right, the commands window allows you to enter commands line by line and
display the results. The >> symbol indicates waiting for a command.
On the left, the Workspace, Current Directory and sometimes Command History windows are nested in
panes .
- Workspace allows you to display the variables used with their sizes.
Execution of the script (the commands one after one) is done using the Save and
Run button or with the debug/Save and Run menu or, simply, by pressing the F5
function key. The execution results are displayed in the execution window.
commands in the same manner as if commands are entered in this window.
Notes :
A command line can contain multiple statements separated by commas or
6
Machine Translated by Google
with semicolons. The result of a statement followed by a semicolon will not be displayed.
The columns of the matrix are separated by commas (,) or spaces and the rows by
semicolons (;) or line breaks (RETURN).
2- Generated by an internal function (built-in function)
>>A = eye(3) % identity matrix
A=
1 0 0
0 1 0
0 0 1
1 1 1
1 1 1
1 1 1
0 0 0
0 0 0
1 0 0
0 2 0
7
Machine Translated by Google
0 0 3
>> A = rand(2,3) % random matrix, a 2nd call of
rand
>>A = load('matrix.txt')
157
542
421
Substraction C=A-B
* C=A*B
Multiplication
^
Power C = A^2 or C = A * A
'
Transposed C = A' or C = transpose(A)
\ left division x = A\b
These matrix operations also apply to scalars. An error is caused in the case where
the ranks of the matrices are incompatible.
8
Machine Translated by Google
Note 1
Matrix division involves solving systems of linear equations. If A is an invertible
square matrix:
x = A\b is the solution of the system A*x = b, with x and b are column vectors
x = b/A is the solution to the system x*A = b, with x and b now being row vectors
>> A = [3 2; 4 7]
A=
3 2
4 7
>> b = [2;3]
b=
2
3
>> x = A\b
x=
0.6154
0.0769
>>A* x
years =
2
3
y = b'
y=
2 3
>> z = y/A
z=
0.1538 0.3846
>>z * HAS
years =
2 3
Note 2
If a point is added to the left of the operators * ^ \ and / they will be applied to the
elements of matrices with index matching:
>>A*A % equivalent to A ^2
years =
17 20
9
Machine Translated by Google
40 57
>>A.*A % equivalent to A.^2
years =
9 4
16 49
11
2 3 6
ÿ
>> y = x .^ 2 .* cos(x) % y = x cos(x) (note the points)
y=
10
Machine Translated by Google
debt determining
>> d = det(A)
inv reverse
>> B = inv(A) (I = B * A)
read LU decomposition
>> [L,U] = read(A) A = L *U
qr QR decomposition
>> [Q,R] = qr(A) A = Q *R
standard standard
Scalar functions such as cos, sin, exp, log…etc. apply to matrix elements
11
Machine Translated by Google
vectors =
0.7040 0.6349 0.3182
-0.6521 0.4005 0.6437
0.2812 -0.6607 0.6959
values =
3.5470 0 0
0 5.2209 0
0 0 11.2322
>> vects' * A * vects
years =
>> A(2,2:4)
years =
>> A(3,:)
years =
>> A(:,3)
years =
12
Machine Translated by Google
1.3000
2.3000
3.3000
4.3000
>> t = [1,4]
t=
1 4
years =
1.1000 1.4000
4.1000 4.4000
The structure of loops in MATLAB does not differ from that of other programming languages. There are two types of
initializations
while logical expression
statement 1
instructions 2
. . . . . . .
end
The for loop varies a variable from an initial value to a final value with a constant increment step which is taken equal
to one if omitted. The instructions inside the loop are executed at each value of the variable. The while loop
executes as long as a logical expression is true; it often requires initialization before being launched and can
run indefinitely if the controlling logical expression always remains true.
13
Machine Translated by Google
Both loops can be broken by the break command. We generally insert break with an if condition test .
i = 1; % initialization of i
while i <= 5 % loop as long as i is less than or equal to 5
w(i) = 2*i;
i = i+1; % the increment is important otherwise the
end; % loop is infinite
are:
< lower <= less than or equal
> greater == equal >= greater than or equal
~= not equal (different)
Example of if test
if a < b
m=a
else
m=b
end
14
Machine Translated by Google
instruction
the function keyword is essential. The input variables are var1, var2 ... and the results are res1, res2, ... As many variables and results as
necessary can be used. The file must be saved under the name functionname.m and may contain more than one function.
%R = rot3dz(theta)
% returns a 3d rotation matrix
001
];
return
0.8660 0.5000 0
-0.5000 0.8660 0
15
Machine Translated by Google
0 0 1.0000
1.10 Application 1
1) Open MATLAB
5) Calculate A + B and A – B.
9) Calculate the matrices X = A / B and X = A \ B, check A*X, X*A, B*X and X*B
10) Calculate the matrices X = A ./ B and X = A .\ B, check A*X, X*A, B*X and X*B
16) Create three functions for the three 3D rotations around the x, y and z axes.
Calculate a rotation matrix R composed of a rotation of 30° around x , 60°
around y and 45° around z. Then calculate Ar = R'*A*R.
18) Create a batch file using MATLAB editor and redo 2-10.
19) Create a text file containing the elements of a 3ÿ3 matrix and load the
matrix using a command line.
16
Machine Translated by Google
1.11 Exercise
Create matrix A using the diag function and a vector b with a fixed step
A=
1 1 0
1 2 2
0 2 3
b=
1
2
3
2) The LU decomposition,
3) QR decomposition.
1.12 Duty - TP
2) Calculate the stress tensor as a function of the strain tensor using the
relation ÿ ÿ 2 ÿ ÿ + ÿ e I .
5) Check that a rotation of 60° around y gives the main directions of the
stress tensor ÿ taken as an example below
17
Machine Translated by Google
8) Calculate the normal stress and the unit expansion along the normal n.
ÿ 7 0 ÿ
33 ÿ
ÿ ÿ
330 13 ÿ
ÿ ÿ
Reminder :
ÿ ÿ ÿ ÿ 2ÿ ÿ ÿ 0 0 0 ÿ
ÿ ÿ ÿ 2ÿ ÿ 0 0 0
ÿ
ÿ
ÿ ÿ ÿ2 0 0 0 ÿ
D ÿ
ÿ ÿ
;
2ÿ 0 0
ÿ ÿ
Sym 2ÿ 0 ÿ
ÿ ÿ
ÿ 2ÿ ÿ
ÿ 1 ÿÿÿÿ 0 0 0 ÿ
ÿ
1 0 0 0
ÿ
ÿÿ
ÿ ÿ
1 ÿ
1 0 0 0 ÿ
VS ÿ
ÿ ÿ
E 1ÿÿ 0 0
ÿ ÿ
Sym 1ÿÿ 0 ÿ
ÿ ÿ
1ÿÿ
ÿ ÿ
I3 ÿ det(ÿ) ÿ ÿIÿIIÿIII.
ÿ ÿ ÿE / (1ÿ2ÿ)(1ÿÿ) ; 2ÿ ÿ E/(1ÿÿ)
18
Machine Translated by Google
chapter 2
2.1 Introduction
To analyze a natural phenomenon in general or an engineering problem in particular,
we are often required to develop a mathematical model that can describe the problem
in question as reliably as possible.
The development of a mathematical model is generally based on a few basic
postulates and several simplifying hypotheses to arrive at governing equations which
are often differential equations to which boundary conditions are added. Example,
the theory of elasticity is based on the fundamental postula of the existence of the
stress vector and the general equations of isotropic linear elasticity are obtained with
the assumptions of small deformations, homogeneity and isotropy of materials as
well as the linearity of the relationships linking stresses and deformations.
have been thus developed and successfully applied to provide satisfactory solutions to a
wide variety of engineering problems.
The finite element method is one of the most powerful numerical techniques.
One of the major advantages of this method is the fact that it offers the possibility of
developing a program to solve, with few modifications, several types of problems. In
particular, any complex form of a geometric domain where a problem is well posed with all
boundary conditions, can be easily treated by the finite element method.
This method consists of dividing the physical domain to be treated into several subdomains
called finite elements with non-infinitesimal dimensions. The sought solution is replaced in
each element by an approximation with simple polynomials and the domain can then be
reconstituted with the assembly or summation of all the
elements.
Argyris (1955), Turner (1956), Glough (1956) and Martin (1956) made a direct analogy by
adopting a simplified behavior for small portions: they represent a two-dimensional elastic
continuous medium by an assembly of triangular panels, on which the displacements are
assumed to vary linearly as for each bar or beam of the discrete system: each panel is
described by a
2
Machine Translated by Google
rigidity matrix and the assembly gave the overall rigidity of the continuous medium. Hence
the birth of finite elements with “panels” as their name.
Argyris and Kelsy (1960) use the notion of energy in the analysis of structures and use
mathematical methods (weighted residues, variational principles, etc.).
The term "finite element" was used for the first time by Glough (1960), and from then on, it
there is rapid development of the method.
In the sixties; Zienkiwicz (1965), De Arante (1968), Oliviera (1968), Green
(1969), Tones (1969), Lay (1969), Storne (1969), and Finlayson (1975) reformulated the
method from energetic and variational considerations in the general form of weighted
residuals, hence the mathematical model of the MEF.
In 1969 FEM was recognized as a general tool for solving PDE, and used to solve nonlinear
and nonstationary problems in several domains.
In fluid mechanics, the solution of the incompressible Navier Stokes equations by finite
elements using the velocity–pressure formulation began in the 1970s.
Physical Problem
4
Machine Translated by Google
determine the system's eigenvalues and vectors which generally correspond to the
eigenfrequencies and modes of a physical system.
A propagation problem which concerns the transient (non-stationary) case in which it
is necessary to determine the variations over time of physical variables and the
propagation of an initial value. Step-by-step integration methods are the most common
such as central finite difference method, Newmark method, Wilson method.
These methods must be associated with iteration techniques to deal with the non-
linear case. The most famous is Newton Raphson's method.
Currently, the principle of virtual work is well known and very widespread. It is often
formulated in terms of the equality of work done by external and internal forces during
any virtual movement. This concept is essential for solving partial differential
equations. Indeed, the displacements are replaced by an arbitrary function continuous
on the domain and the equation is rewritten in integral form
where A(u) is the set of governing equations defined on the domain ÿ and B(u) is the
set of boundary conditions that the functions u must satisfy on the contour ÿ
(fig.3.2). The function u can be a scalar such as temperature, pressure, etc. or a
vector such as displacement, speed, etc.
ÿ
ÿ B(u) ÿ 0
A(u) ÿ 0
5
Machine Translated by Google
The variational problem associated with system (2.1) is written by taking the integral of the system of
governing equations weighted by weight functions, the statement becomes:
ÿ: w V ÿ ÿÿ w A ud
()ÿÿ0 (2.2)
This equation is called the strong integral form of the differential equation (or system of differential
equations). It is analogous to the expression of virtual works. In fact the solution of (2.2) has even more
scope, we can affirm that if it is satisfied for any weight function w, then the differential equation (2.1) is
satisfied at every point of the
domain ÿ.
(i) Example
We consider the following second order differential equation:
of2
Tou ( ) ÿ
ÿ 10ÿÿx ; 0ÿxÿ1 (2.3)
dx 2
In this case B(u) is the set of values imposed on the two edges of the domain. In one dimension, ÿ reduces
to two points. The integral form associated with the equation A(u)
is written:
2
of 1 of 2 1
w (1) xd
2 ÿÿÿÿ 0; ÿ w dx wÿ (x
ÿ 1) dx ÿ
(2.5)
ÿÿ 0 dx 2 0
dx
With the form of the terms to be integrated, we see that the search for approximate solutions for the
unknown function u requires the use of polynomials or interpolation functions differentiable at least twice.
In addition, the boundary conditions must be checked separately since they do not intervene in the integral
equation above, hence the introduction of the weak integral form.
6
Machine Translated by Google
ÿÿ w Bud
()ÿÿ0 (2.6)
The operators C, D, E and F contain derivatives of lower order, hence a wider choice of u
approximation functions.
This equation is the weak formulation of the differential equation, it forms the basis of the finite
element approximation.
Note: To obtain such integral formulations, we have two methods at our disposal: the first is the
method of weighted residues known as the Galerkin method, the second is the determination of
variational functionals which we seek to make stationary.
In practice, it is not always easy to find a functional one. The first process is more used; it
consists of choosing wÿÿÿÿu Dirac function (a disturbance of the desired function) and using the
nodal approximation for the discretization. w
is also called weight function hence the word: “weighted”.
(i) Example
To obtain the weak variational form of the previous example (equation 2.5) we integrate the first
term in parts.
1 dw of ÿ du ÿ 1 1
ÿ dx wÿ
ÿ ÿ 0 w (x 1) dx (2.8)
ÿ ÿ
0 dx dx ÿÿ
dx ÿÿ
0
We now see that the boundary conditions, particularly on the derivatives, are explicitly taken into
account in the equation. The values imposed on the function itself will be processed when
solving discrete systems.
7
Machine Translated by Google
Border
of the domain
Element
Border node
Internal node
20) A node of an element must not be interior to one side of another of the same
type. (Fig. 2.4a)
22) Two distinct elements can only have points in common located within their common
boundaries; recovery is excluded. (Fig. 2.4c)
(has)
(d)
(b)
(vs)
8
Figure 2.4: Discretization rules
Machine Translated by Google
The result of the discretization process must contain two essential data which are the
coordinates of the nodes and the connectivities of the elements. We must number all
nodes and elements in order to have global matrices with a small bandwidth, for this, the
numbering is done according to the smallest width of the domain.
not
i
u axi (2.9)
ÿÿ iÿ 0
ÿ has 0 ÿ
2 ÿ ÿ
u ÿÿ 1 xx ÿ
ÿ ÿ has 0 ÿ
ÿÿ P x( )ÿAÿÿ (2.10)
ÿ ÿ
ÿ
ÿ ÿ
ÿÿ )
u i P(x i
ÿ ÿÿ
HAS
ÿÿ Pij a j (2.11)
j
ÿ ÿ ÿP1ja { }j ÿ
ÿu ÿ .....
ÿ ÿ
ÿ
ÿÿ {..} ÿ
ÿ Un = Pn an (2.12)
ÿ
ÿÿ F nja { }j ÿ
ÿ ÿ
9
Machine Translated by Google
The disadvantage of this interpolation lies in the use of the parameters ai as a base variable,
additional calculations are necessary to calculate the desired function u. In order to avoid these
calculations, we can put the values of the function u at the nodes as base variables by proceeding
as follows:
From equation (3.12), we can draw the ans as a function of ones and replace them in equation
(3.10). Which give :
ÿ
1
u ÿÿ P (x)ÿ PU ÿ ÿ N x ÿ
not not
() A (2.13)
This is the form most used because its variables are the values of the function at the nodes, the
resolution directly gives these values.
This type of approximation is called nodal interpolation, the Ni functions are called shape
functions, they depend on the type of element used for the geometric discretization.
10
Machine Translated by Google
chapter 3
of
ÿ 2x(u ÿ1) ÿ 0 with u(0) ÿ 0
dx
points: 0 and 2.
2
The exact solution to this equation is: u 1 e x
ÿ
ÿÿ
e
Machine Translated by Google
The division of the domain ÿ into several elements is called meshing. We use two tables to describe
the mesh: element connectivity table and node coordinate table. For an example of three elements
we obtain the two tables as follows:
The MATLAB command lines which allow you to obtain the two tables are:
n = 4; x = % number of elements
t([1:n],:) = [[1:n]',[2:n+1]']
Noticed
12
Machine Translated by Google
For a higher number of elements, simply increase the value of nx(i) gives the coordinate of node i ; .
x(2) displays: 0.5
u ÿ aÿ ÿ aÿ x (3.)
u ÿ aÿ ÿ aÿ x u ÿ uÿ
u ÿ uÿ
Node 1 Node 2
x ÿ xÿ x ÿ xÿ
or in vector form:
ÿ has 0 ÿ
_ ÿÿu 1 x ÿ ÿ ÿ ÿ u ÿ p an
has
ÿ 1ÿ
not
13
Machine Translated by Google
ÿ u1 ÿ ÿ 1 x1 ÿ ÿ ÿ has 0 ÿ
ÿ ÿ
ÿ
ÿ ÿ
ÿ one ÿ Pn year
u2 x2
_ ÿÿ
has
1
ÿ ÿ ÿÿ1 ÿ
ÿ has 0 ÿ 1 ÿ xxu 1 ÿ
ÿ
ÿÿ 2 1ÿ ÿ ÿ
an ÿ Pn Aÿ ÿ ÿ
ÿ
ÿ ÿ
has
1
xx 2 1 ÿ ÿ
1 1 u2
ÿ ÿ ÿÿ ÿÿ ÿ
1 ÿ x2 _
ÿ
xu 1ÿ ÿ1ÿ ÿ xx 2 ÿ
xx 1
ÿ
ÿ u1 ÿ
u 1 ÿÿ ÿx _ ÿ ÿ
ÿÿ ÿ ÿ ÿ
xx 2 1
ÿ ÿ
1 1 u2 xx 2 1 ÿ
xx 2 1 ÿ
u2
ÿÿ ÿÿ ÿ ÿ ÿ
u ÿ N One
This interpolation is called nodal interpolation since it depends on the values at the nodes of the
unknown function u.
xx 2 ÿ
1 xx 1ÿ xx 1ÿ
1 xx 2ÿ
Nx()
1
ÿ ÿ
; Nx()
2
ÿ ÿ
xx 2 1 ÿ
xx 2ÿ xx 2 1 ÿ
xx 1ÿ
ÿÿÿ0 ÿÿÿ0
N 1(x) ÿ N (x)
2 ÿ1 ÿxÿ x ; x
ÿ
1 2
ÿ
1) They take the unity value at nodes with the same index and the zero value at
other nodes.
2) Their sum is equal to unity over the entire interval of the element:
1
N1
N2
x1 x2
14
Machine Translated by Google
Noticed
The two shape functions can be written as Jacobi polynomials:
xx ÿ
N i (x) ÿ
ÿ xx ÿ
j
ji ÿ ij
For example the shape functions of the element with three nodes are:
( xxxx
ÿ
2 )( ÿ
3 )
Nx()
1
ÿ
;
( xxxx 2 )(
ÿ ÿ
1 13 )
( xxxx
ÿ
1 )( ÿ
3)
Nx ()
2
ÿ
;
( xxxx 1 )(
ÿ ÿ
2 23 )
( xxxx )
ÿ ÿ
1 2 )
Nx () ÿ
3
( xxxx ( )( 3 2
ÿ ÿ
2 1 )
We can easily check in the figure below the properties at the nodes of the three
functions as well as their sum over the element.
15
Machine Translated by Google
N x 1( ) ÿ
ÿ
0 xx ÿ2 ; N x 2( ) ÿ
ÿ
1 xx ÿ2 ; N x 3( ) ÿ
ÿ
0 xx ÿ2
xx ÿ3 xx ÿ3 xx ÿ3
ÿÿ0 ÿÿ0 ÿÿ1
The MATLAB script which allows you to calculate and plot these three functions is as follows:
x1 = 2;
x2 = 5;
x3 = 8;
x = x1:0.1:x3;
N1 = (x-x2).*(x-x3)/(x1-x2)/(x1-x3); N2 = (x-x1).*(x-x3)/(x2-
x1)/(x2-x3); N3 = (x-x1).*(x-x2)/(x3-x1)/(x3-x2);
S = N1+N2+N3;
plot(x,N1,x,N2,x,N3,x,S)
ÿ of
ÿÿ ÿ u ÿ 2 xu
(
ÿ
1)ÿÿdÿ 0
ÿÿ
dx ÿÿ
The domain ÿ includes the interval 0 to 2, dÿ ÿ dx and with nodal interpolation we have:
of dN
ÿ
One ; and ÿu ÿ N ÿUn
dx dx
Since only the functions N depend on x and the disturbances only affect the values of u.
16
Machine Translated by Google
2 xi ÿ 1 x2
ÿÿ ÿ ÿÿ ÿ
elements e
ÿ
ÿ ÿÿ ÿ ÿ
0
ÿ
in 1,
ÿ
xi
ÿ
elements
x1
The integral form of the differential equation then becomes for each element:
x2 of ÿ x2 x2
ÿ
ÿ ÿu dx ÿ ÿ ÿ
ÿ uxu
2 dx ÿ ÿ
ÿ ÿ ÿ
ÿ u dx ÿ
0
x1
ÿÿ
dx ÿÿ
x1 x1
x2
ÿ TT dN ÿ x2
TT
x2
TT
ÿ ÿA not
U dx ÿ not
ÿ ÿ ÿ
2 dx
ÿ UN x NUnot not
ÿ ÿ
ÿ ÿ
A
ÿ2 xdx
not
ÿ ÿ
0
x1
ÿÿ
dx ÿ x1 x1
This discretized writing is valid for all types of elements. In the particular case of a linear element with
two nodes, it is written as follows:
x2 ÿ NOT ÿ ÿu ÿ
1 1
ÿÿ u1 ÿ ÿu
2 ÿ ÿ ÿ
ÿ ÿ dN dN dx
1 2 ÿ ÿ ÿ
x1
ÿ
NOT u
2ÿ ÿ 2ÿ
x2 ÿ NOT1 ÿ ÿu1 ÿ
ÿÿ u1 ÿ ÿu 2 ÿ ÿ ÿ
2 x NN
ÿ dx
1 2 ÿ ÿ ÿ
ÿ
x1
ÿ
NOT
2ÿ ÿ
u2 ÿ
x2 ÿ NOT ÿ
1
ÿÿ u1 ÿ ÿu ÿ ÿ ÿ
2 xdx =0
2
x1 ÿ
NOT
2ÿ
T
We see that it is possible to simplify (ÿa) since it is not zero and returns every time
term. By the way, it's the other terms that must be zero! we see it clearly with this example:
ÿv1 ÿ ÿw1ÿ
ÿ ÿ uu1 2 ÿÿ ÿ ÿ ÿ ÿ ÿ ÿ uu
ÿ1 2 ÿ ÿ
ÿ
0
ÿ
v2 ÿ ÿ
w2 ÿ
17
Machine Translated by Google
ÿ v1 ÿ ÿ w1 ÿ
And v2 ÿ w2 ÿ 0 ; Or : ÿ ÿ
ÿ ÿ ÿ
ÿ
0 .
v2 w2
ÿ ÿ ÿ ÿ
ÿ x2
_
ÿ #1 ÿ x2
_
ÿ #1 ÿ ÿÿ u1 ÿ
ÿ ÿ ÿ
ÿ d N d N dx ÿÿ ÿ ÿ ÿ ÿ 2 xÿ NN 1dx ÿ ÿ ÿ2 ÿ ÿ ÿ
ÿ
1 2
x1 NOT x1 NOT u2
ÿÿÿ ÿ 2 ÿ ÿ 2 ÿ ÿ
x 2 ÿ Nÿÿ
1
ÿ _ ÿ ÿ 2 x dx = 0 ÿ
x1 No. 2
ÿ x2 ÿ N d NN d N ÿ ÿ x2 ÿ 2N
N xN 2 xN 2 ÿ ÿ ÿ dx ÿÿÿ ÿ ÿ u1 ÿ ÿ2x 2 x N 1
_
1 1 1 2 ÿ dx
_
1 1 1
ÿ ÿÿÿ ÿ ÿÿ
ÿ = ÿ ÿ ÿ dx ÿ
N d NN d N 2 2 N xN2 N
2 xN 2 2 2 u2
ÿÿÿ
x1
2 1
x1
ÿÿ 1 ÿ
x1
ÿ ÿ2xN _ 2
Which is a system of linear equations Ke Ue ÿ Fe ; with Ke and Fe are called elementary matrix and vector of the
equation system. In the case of the present differential equation K is the sum of two matrices: Ke ÿ Keÿ ÿ Keÿ such
that:
x2
_
ÿ N 1dN N dN 1ÿ
1 2ÿ x2
_ N2 xN
ÿ2 N 1xN 1 ÿ1 ÿ 2ÿ
Ke 1 ÿ
ÿ dx ÿ ;
ÿ
Ke 2 ÿ
ÿ dx ÿ
x1 N 2dN N
1 dN 2ÿ 2
x1 N xN
2 2N 1xN 2 2 2
ÿ
By replacing the shape functions and their derivatives by their respective expressions we obtain:
xx 2 1 xx 2 1
ÿ ÿ
ÿÿ ÿ
x2
xxxx 2 1 2 xxxx 2 2 1
ÿ ÿ ÿ ÿ
_
1 1
Ke
1
ÿ
ÿ ÿ ÿ dx ; ÿ ÿ ÿ
xx 1 1 xx 2 1
ÿ ÿ
x1
xxxx 1 1 2 xxxx 1 2 1
ÿ ÿ ÿ ÿ
ÿÿ 2 2
xx 2 xx 2 xx 2 xx 1
ÿ ÿ ÿ ÿ
ÿÿ
ÿ
2 x 2 x
x2
_
xx 1 2 xx 1 2 xx 1 2 xx 2 1
ÿ ÿ ÿ ÿ
Ke 2
ÿ ÿ ÿ ÿ dx ÿ
x1 xx 1 xx 2 xx 1 xx 1
ÿ ÿ ÿ ÿ
2x _ 2x _
xx 2 1 xx 1 2 xx 2 1 xx 2 1
ÿ ÿ ÿ ÿ
ÿÿÿÿÿÿ
ÿÿ
1 ÿ
ÿ
11
ÿ
Ke1 ÿ ;
2 ÿ
ÿ
ÿÿ1
1ÿ
18
Machine Translated by Google
xxxxxx
2
ÿ
1
ÿ3 12
ÿ
2 1
ÿ ÿ
Ke 2 ÿ
6 ÿ xxxx 3
ÿ ÿ
ÿÿ
112 2 ÿ
x2 ÿ 2xxxx ÿ
)(
ÿ
)ÿ
Fe ÿ
ÿ (ÿ
212
ÿ dx
ÿ2
xxxx
( 1) ( )ÿ
x1
ÿ ÿ
21
either :
xxxx
2
ÿ
1 ÿ
2 12
ÿ ÿ
Fe ÿ
ÿ ÿ
3 ÿ
xx1 2 ÿ 2 ÿ
3.2.7 Note
It is possible to use MATLAB to analytically integrate elementary matrices. The script can
be as follows:
syms x x1 x2 real symbolic % declaration of variables
1 1 ÿ 1 1 1
ÿ 0 ÿ 3 ÿ0 2ÿ 0 ÿ ÿ
ÿ
2 2 2 2
Ke1
(1) ÿ
; Ke 2(1) ÿ
;
1 1 ÿ 21 1
6 ÿ 0 03
ÿ ÿ ÿ ÿ
ÿ
ÿÿ
ÿ 2 2ÿ 2ÿ
19
Machine Translated by Google
11 13 ÿÿ
ÿ ÿ
ÿÿ ÿÿ ÿ ;
24 ÿ
11 15 ÿ ÿ ÿ
0.6250 ÿ
12
ÿ
ÿ ÿ ÿÿ 2ÿ 0 0 12 ÿ 1 ÿ 1 ÿ ÿ ÿ 0.0833
(1) Fe ÿ
ÿ
ÿ
ÿÿ ÿÿ
ÿ
ÿ ÿ
3 0 2ÿ ÿ 12 2 0.1667 ÿ
12 ÿ ÿ
u1
ÿ
11 15 u2 12 2
ÿÿ ÿ
We denote by U the values of the function u at the five nodes, the values of the
elementary vector Ueÿÿÿ of element 1 correspond to the components uÿ and uÿ global
vector U, those of Ueÿÿÿ of the element 2 correspond to the second and third of the
global vector U, those of Ueÿÿÿ to the third and fourth and those of Ueÿ4ÿ to the fourth
and fifth.
Element 2 : x1 ÿ ½; x2 ÿ 1;
(2) 1
ÿ
15 ÿÿ ÿ ÿ ÿ 7
ÿ
9 19 ÿ
0.3750 0.7917 ÿ ÿ
7 15 u2 ÿ 1 4
ÿÿÿ
Ke Ue ÿ Fe ; ÿ ÿ
ÿ
ÿ 12 ÿ
ÿ 24 ÿ
ÿÿÿ9 u 5ÿ
ÿ 19 ÿ ÿ 3 ÿ
Element 3 : x1 ÿ 1; x2 ÿ ÿ /ÿ ;
1 ÿ
ÿ
3 17 ÿ ÿ ÿÿ
ÿ
ÿ7
; Fe (3) ÿ
ÿ ÿ ÿ 12
ÿ
0.6667 ÿ
ÿ 24 ÿ
23 ÿ ÿ ÿ
1 ÿ
ÿ
3 17 ÿÿ u3 ÿ 1 7
ÿÿÿ
(3) (3) (3)
Ke Ue ÿ Fe ; ÿ
ÿ
ÿ 12 ÿ
ÿ 24 ÿ
ÿ ÿ 7 23 u4 8ÿ
ÿ ÿÿ ÿ
ÿ
Element 4 : x1 ÿ /ÿ ; x2 ÿ 2 ;
ÿ5
; Fe (4) ÿ
12 ÿ 11 ÿ
ÿ
0.9167 ÿ
ÿ 24
ÿ
ÿ
27 ÿ ÿ ÿ
ÿ ÿ 0.2083 1.1250 ÿ
20
Machine Translated by Google
1 ÿ 1 19 ÿ ÿ ÿ ÿ u 4 ÿ 1 ÿ ÿ 10
(4) (4) (4)
Ke Ue ÿ Fe ; ÿÿ ÿÿ ÿ
ÿ
ÿÿ ÿ
24 ÿ
5 27 u5
ÿ
12 11 ÿ
ÿ
ÿ
11 13 0 0 0 0 ÿ ÿ 11 15 0 0 ÿ ÿ u 1 ÿÿ ÿÿÿÿ2
1
00 ÿÿÿÿÿ
ÿ
ÿÿÿÿÿÿ0000000ÿÿ u2 ÿ0
1 00 1 12 ÿ ÿ 0
ÿÿÿÿÿ
Element 1 : 000ÿÿÿÿ0000ÿÿÿÿ 0 u3 ÿÿ
ÿ
0ÿ
ÿÿÿÿ ÿÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ u4
24 ÿÿ
ÿÿÿÿ ÿ u5
ÿÿÿ ÿÿÿÿÿ
ÿ ÿÿ ÿÿ ÿ0ÿ0009019
0 ÿ0ÿ0ÿÿÿÿÿ ÿ u1 ÿÿ ÿ ÿ 0ÿ ÿÿ ÿÿ ÿ ÿ
ÿÿÿÿÿÿÿÿ00000ÿ 4
0 7 15 0 0
ÿÿÿÿÿÿÿ
ÿ
u2
1 ÿ 1 ÿ0ÿ
Element 2 : ÿ
u3 ÿÿ
ÿ
5
24 12
00000 u4 0
u5
ÿÿÿÿÿ
ÿ 0ÿ 0ÿ 0ÿ 0
ÿ ÿ0 ÿ ÿ 0 0 0 0 0 ÿ u2
ÿ1ÿÿ7ÿ
0
1 ÿ ÿÿÿÿÿÿ
0ÿ
Element 3 : ÿ
u3 ÿÿ
ÿ
24 12
0 0 7 23 0 ÿ
u4 8
u5
ÿÿÿÿÿ
ÿ ÿÿ ÿÿ ÿ0ÿ0ÿ000000ÿ0ÿ0ÿ ÿÿ ÿ u1 ÿÿ ÿ ÿ 0 ÿÿ 1ÿ ÿ ÿ ÿ
ÿ 0ÿ 00 00 00 01 19 ÿ ÿ ÿ ÿ ÿ u2 0
ÿ ÿ ÿ ÿ 10 ÿ ÿ
1 ÿ ÿ 0 0 0 5 27 ÿ ÿ ÿ ÿ ÿ 11 ÿ
Element 4 : u3 ÿÿ
ÿ
0
24 12
u4
u5
ÿÿÿÿÿ
Now taking the sum (ÿ sum of the integrals), the global system is finally written:
21
Machine Translated by Google
11 13 0 0 0 ÿ ÿu 1 ÿ 1
ÿ
ÿ ÿ ÿ
ÿ ÿ ÿ ÿ ÿ ÿ
ÿ
1115715 ÿ
0 0 u 2 4ÿ
2
1 1
ÿ ÿ ÿ
ÿ KU ÿ F
ÿ ÿÿ ÿÿ ÿÿ
0 9193 170 ÿ u 3 ÿ ÿ 5 7ÿ
ÿ ÿ
ÿ
ÿ ÿ
ÿ
24 12
ÿ ÿ
ÿ u 8 1ÿ0
ÿ ÿ ÿ ÿ
0 0 ÿ
723119
ÿ ÿ
4
ÿ ÿ ÿ ÿ
ÿ
0 0 0 ÿ
527 ÿ u 11
ÿ ÿ ÿ 5ÿ ÿ ÿ
ÿ ÿ ÿ ÿ
This operation is called assembly. In practice, we do not proceed in this way for reasons
of saving memory and calculation time but we assemble the elementary matrices using
the connectivities of the elements. The global matrix K is first initialized to the zero matrix,
then at each elementary matrix construction, we locate with a table where it must be
added to the global matrix. In the case of one degree of freedom per node (this case) the
location table corresponds to the connectivity table. Example ; for element 1 the location
table is t ÿ ÿ1 2ÿ we therefore add the matrix Keÿÿÿ to K(1,1) , K(1,2) , K(2,1) and K(2 ,2);
and for element 2 the location table is t ÿ ÿ2 3ÿ we add the matrix Keÿ2ÿ
each element
x1 = x(i); x2 = x(i+1); % coordinates of the two nodes
of the element
[Ke,Fe] = MatElt2Nd(x1,x2); % Function to calculate the
mast. and vectors. elementals
K(t,t) = K(t,t) + Ke; % Die assembly
global
F(t) = F(t) + Fe; % Assembly of the global vector
end; % end of loop
22
Machine Translated by Google
ÿ 15 7 15 ÿ 0 0 ÿ ÿu 2 ÿ 2 4ÿ
ÿ
ÿ ÿ
9 19 3 17 0 u3 5 7ÿ
ÿ ÿ ÿ ÿ ÿ
1 1
ÿ ÿ
ÿ ÿ ÿ ÿ
ÿ ÿ ÿ
ÿ ÿ ÿ ÿ
24 ÿ 0 ÿ
7 23 1 19 ÿ ÿ
u4 12 8 10
ÿ
ÿ ÿ ÿ ÿ
ÿ ÿ
0 0 ÿ
5 27 ÿ
u5 ÿ ÿ
11 ÿ
ÿ ÿ ÿ ÿ ÿ ÿ
The row and column with index 1 which correspond to the value u1 have been deleted from
the matrix K and the vector F. If u(0) ÿ a ÿ 0 (uÿ ÿ a) then we subtract from F the product of
the
time
1
column of K by a.
The MATLAB command which allows you to delete a row or column from a matrix consists of
assigning it a zero (empty) vector:
A(i, :) = [] % deletes line i from the
matrix A
A(:, i) = [] % deletes column i
V(i) =[] % removes component i from
vector V
23
Machine Translated by Google
24
Machine Translated by Google
% du/dx - 2*x*(1-u) = 0
% u(0) = 0
%
%------------------------------------------------- ---
K = zeros(n+1) ; % initializations
F = zeros(n+1,1);
j = i+1;
t = [ij];
x1 = x(i);
x2 = x(j);
[Ke, Fe] = MatElt2Nd(x1,x2);
K(t,t) = K(t,t) + Ke;
F(t) = F(t) + Fe;
end;
25
Machine Translated by Google
F(1,:) = [];
U = K\F; % resolution
return
%--------------------------------------------
%--------------------------------------------
-1 1 ] ;
The command: [U, Ue, Err, x] = ExampleEquaDiff(30) allows you to have both the
finite element solution U, the exact solution Ue, the relative error Err and the
coordinates x with 30 elements.
Note :
Note that this program practically allows you to solve all differential equations of
order 1 with the boundary condition u(0) ÿ 0. Only the function MatElt2Nd(x1,x2)
requires a change for elementary matrices.
26
Machine Translated by Google
1) Modify the program ExampleEquaDiff(n) to solve the same equation using quadratic form functions
(three-node element)
2) Write a MATLAB function which allows you to have the expressions of the functions
1D shape .
3) Write a MATLAB finite element program which allows you to solve in the
of u(0) ÿ1
domain [0, 3] the equation: dx ÿ (2x ÿ1) u ÿ 0 with . Compare with
2
xx
the exact solution:
ÿ
eue ÿ
and examine the convergence at the point x ÿ 0.5.
2
of of
ÿ uxx
69ÿÿÿ (1 ) with the boundary conditions: u(0) ÿ 0 And
2
dx dx
ÿdx ÿ
xÿ 1
ÿ
0.
3x 3
(8 ÿ ÿ xe 12)x
The exact solution is: u xx)(3 4) ÿ ÿ e 5 4 1
(1
ÿ
ÿ ÿ
e 127
The domain ÿ will be subdivided (mesh) into n linear elements with 2 nodes. The strong integral form of
this equation is written:
1 of 2 1 du 1 1
ÿ ÿu 2
dx 6 ÿ ÿÿ u dx 9ÿÿuuÿdx ÿ ÿ u x(1 x) dx
ÿ ÿ
0 dx 0 dx 0 0
When dealing with differential equations of second order and higher, we are faced with two difficulties.
Interpolation of derivatives and satisfaction of boundary conditions. In fact, the greater the order of the
derivatives, the higher the degrees of the polynomials or interpolation functions to use must be. A linear
element with two nodes cannot therefore be used for this type of equation. Moreover, the strong integral
form does not reveal the condition
ÿdx ÿ
xÿ 1
ÿ
0.
27
Machine Translated by Google
These two difficulties led to the use of the weak integral form which can be obtained, in this case
with integration by part of the first term:
1
1 of2 1 ÿ of of of ÿ ÿ
ÿ ÿu dx ÿÿ
ÿ dx ufrom ÿ ÿ
0 dx 2 0 dx dx dx ÿÿ ÿÿ
0
We immediately see the major advantage that this expression offers. It reduces the order of
the derivatives (hence the weak term) and allows the boundary condition to be taken into account
ÿdx ÿ
xÿ 1
ÿ
0.
Moreover since u (0) ÿ 0, the term ÿu also vanishes at x ÿ 0 (there cannot be any disturbances in
known or zero values).
Thus the integral form is written taking into account the boundary conditions as follows:
1 ÿ of of 1 1 1
ÿ
ÿ dx 6 uÿ ÿ ÿ from dxÿ9 ÿ ÿ x) dx
ÿ uu dx ÿ ÿ u x(1 ÿ
0 dx dx 0 dx 0 0
x2 T x2 x2 x2
dN dN T dN T T
ÿ
ÿ 6ÿ ÿ NOT ÿ ÿ dx N xxdx
(1 dx9 NN ÿ
ÿ ÿ
)
x1 dx dxdx x1 dx x1 x1
With this writing it is possible to use a linear element; the elementary matrix Ke
is the sum of three matrices: Ke ÿ Keÿ ÿ Ke2 ÿ Ke3 , with :
x2 ÿ1 xx
12
ÿ
)ÿ 1 ÿ
ÿ
1 1ÿ
Ke
1
ÿÿ
ÿ (ÿ ÿ
ÿ 1 ( xx 1 2 ÿ
) 1 ( xx dx 2 1 ÿ ÿ ) ; Ke 1
ÿ
x1
ÿ1 (
xx
21
ÿ
) ÿ
xx2 1 ÿ
ÿ
ÿ 1 ÿ
1ÿ
ÿ
x2 xxxx ÿ ÿ
ÿ
ÿ
33 ÿ
ÿ 2 )( 12 )ÿ
Ke 2 ÿ
6ÿ (ÿ ÿ
ÿ 1 ( xx 1 2 ÿ
) 1 ( xxdx 21
ÿÿ ) ; Ke2
ÿ
33
ÿ ÿ
x1
ÿ
xxxx ÿ ÿ
ÿ ÿ
ÿ( 1) ( 21 ) ÿ
x2 ÿ xxxx
ÿ
)(
ÿ
)ÿ
2
Ke 3 ÿ
9ÿ (ÿ
12
ÿ
ÿ ÿ (xxxx
12
2 )(
ÿ
) ( ) xxxxdx1 ) (
ÿ
2
ÿÿ
1 ;
x1 xxxx
1) ( )ÿ
ÿ ÿ
ÿ 21
xx2 1 ( ÿ ÿ 6 3 ÿ
Ke 3 ÿ
2 ÿ3 6 ÿ
ÿ ÿ
28
Machine Translated by Google
x2 ÿ xxxx ÿ
)(
ÿ
)ÿ
2 12
Fe ÿ
ÿ (ÿ ÿ xx(1)
dx
ÿ
;
x1
ÿ(
xxxx
1) ( )ÿ
ÿ ÿ
21
xx 2 1 ÿ
ÿ (4 3
ÿÿ
xxx 2 12)
1
ÿ ÿ (2 xx )
22 ÿ
Fe ÿ
ÿ ÿ
12 ÿ (4 3
ÿÿ
x2
_ 2)xxxx ÿÿ
1 2 1 1 (2 ) ÿ
integration
K = zeros(n+1) ;
F = zeros(n+1,1);
for i = 1:n
j = i+1;
t = [ij];
x1 = x(i);
x2 = x(j);
[Ke,Fe] = MatElt2Nd(x1,x2);
K(t,t) = K(t,t) + Ke;
F(t) = F(t) + Fe;
end;
K(1,:) = [];
K(:,1) = [];
F(1) = [];
U = K\F;
U = [0.0;U];
t = 0:0.01:1; Ue =
1/27*(1-t).*(3*t-4)+1/54*exp(-3*t).*(8+t*exp(3)-12*t);
29
Machine Translated by Google
plot(x,U,'-.',t,Ue)
return
%--------------------------------------------
touch
Ke2 = [ -3 3 % elementary
-3 3 ] ;
3/2 3];
Fe = (x2-x1)/12* [(4-3*x1-2*x2)*x1+(2-x2)*x2;
(4-3*x2-2*x1)*x2+(2-x1)*x1 ];
return
A call to this program with the EquaDiff2(15) command gives the figure
next :
30
Machine Translated by Google
of2
0ÿuÿxÿ
dx2
of
with the boundary conditions: u(0) ÿ 0 And
(4ÿ) ÿ 0 for the MEF
dx
and the initial conditions:
of of 2
u(0) ÿ 0 , (0) ÿ 0 And 2
ÿ
(0) 0 dx for step by step integration
dx
The exact solution being ue ÿ x ÿ sin x. The MATLAB command that provides this
solution is:
>> ue = simple(dsolve('D2u + u -t','u(0)=0','Du(4*pi)=0'))
% A. Seghir, 08/19/04
u(1) = 0.0;
v(1) = 0.0;
a(1) = - acc(1);
31
Machine Translated by Google
n = length(acc);
K = k + 6/dt^2 * m + 3/dt * vs;
for i = 1:n-1
A = 6/dt * v(i) + 3.0 * a(i);
B = 3.0 * v(i) + dt/2 * a(i);
P=m * ( acc(i) - acc(i+1) + A ) + B * vs;
du = P/K;
dv = 3/dt * du - 3.0 * v(i) - dt/2 * a(i);
u(i+1) = u(i) + du;
v(i+1) = v(i) + dv;
P = -c * v(i+1) - k * u(i+1) - m * acc(i+1);
a(i+1) = P/m;
end
return
The MATLAB commands that allow you to plot the two solutions are as follows:
clear
clc
n = 20 % number of integration steps
or finite elements
dt = 4*pi/n; t = % no integration time
0:dt:4*pi; % discretization of time
acc = -t; % inertia force Fi = - m *
acc
up = sdofth(1,0,1,acc,dt); step-by-step % function call
integration
Note : The EquadiffMEF(n) function has the same structure as EquaDiff2(n). The
difference lies only in the calculation of the elementary matrices and vectors.
Also note the output variables!
The plot of the three solutions with a number of integration steps equal to the number
of elements shows in the two figures below that the step-by-step integration is a little
closer to the exact solution when the number of elements is small and both
32
Machine Translated by Google
solutions coincide almost perfectly with the exact solution when the number of elements is
large.
The difference in the case of a small number of elements is due to the fact that the element
used is linear, therefore the interpolation polynomial is of the first order. On the other hand,
step-by-step integration uses an approximation with a cubic polynomial since the method is
linearly accelerated.
2) Introduce the SdofTH function into MATLAB and retrace the two figures
previous
3) Use the function FF1D(n) below to calculate the shape functions of a quadratic
element (element with three nodes) and calculate the expressions of
33
Machine Translated by Google
2
of
elementary matrices and vectors of the previous equation: 0ÿuÿxÿ with
dx2
the same CALs.
function [N,dN] = FF1D(n)
%------------------------------------------------- ------------------
-
% [N,dN] = FFDim1(n)
% A. Seghir, 12/09/04
%------------------------------------------------- ------------------
-
x = sym('x','real'); % character x
xn(i) = sym(['x',c],'real');
end;
N(i) = N(i)*(x-xn(j))/(xn(i)-xn(j));
end
end
end
34
Machine Translated by Google
order
The structure of the MATLAB programs produced so far does not allow all second-order differential
equations to be processed. More or less slight modifications are necessary for each case, they mainly
affect the elementary matrices
and boundary conditions.
It is possible to think about putting the function for calculating elementary matrices in another file and
creating another function for processing boundary conditions to keep the rest of the program in a function
which will not be modified. But, in addition to the fact that the type of element remains fixed, the expressions
of the elementary matrices themselves always pose a problem since they must be calculated by integration
over the element.
However, in certain cases, integration can be difficult or almost impossible; digital integration is a solution
that is perfectly suitable, particularly if it is associated with an element with fixed terminals called a parent
element or reference element.
Furthermore, the coefficients of the equation can also be functions of the variable x. To implement a
program that treats very diverse equations without modification, we must first characterize the variables
which are data of the problem.
A boundary value problem defined in a domain ÿ ÿ [x0, xÿÿ and governed by a 2nd order linear differential
equation is written as follows:
2
of of
2
ÿ cx ( ) ÿ dx kxufx
() ÿ
() , with u(x 0) ÿ u 0 And fromx(ÿ)ofÿ
ÿ
dx dx
If the second order term of the equation is multiplied by a function mÿxÿ then it is better to divide the whole
equation by this term otherwise the variational formulation
weak will involve one more integral term containing the derivative of m(x) with respect to
x.
The parameters of the equation are the functions k, c and f as well as the values u0 and duÿ, those of the
domain ÿ (of geometry) are x0 and xÿ and those specific to the method are the type of the element
characterized by the number of nodes it contains nne and the number
35
Machine Translated by Google
of net total elements . It is best to group all these parameters into a data structure
called Eq like Equation.
The finite element program that we want to obtain can be called with data preparation
in the following way:
function TstMefEqDiff;
%--------------------------------
% Test of the MefEquaDiff program
%
% A. Seghir, 14/10/04
%--------------------------------
return
We can clearly see that with this type of script, it is easy to process very diverse equations; it suffices to give the
expression of the coefficients in the functions coef_k, coef_c and func_f, the limits of the domain as well as the
36
Machine Translated by Google
changed using the values of Eq.xi, Eq.xf, Eq.u0 and Eq.Du. In addition we now have the choice of the type of elements
Eq.net.
Noticed
The exact solution of the differential equation treated as an example can be obtained
with these commands:
>>ue = dsolve('D2u + 4* u = cos(t)','u(0)=1','Du(pi)=1');
>>ue = simple(ue)
eu =
1/3*cos(t)+2/3*cos(2*t)+1/2*sin(2*t)
To achieve such flexibility, the program must be fairly comprehensive. Its general structure
is:
Start of the program
Geometry (coordinates and connectivity)
Initialization of matrices
Start of loop on elements
% p: node coordinates
% Eq: structure containing the parameters of the equation
37
Machine Translated by Google
% A. Seghir, 16/10/04
% ------------------------------------------------- -----------
U = [Eq.u0;U];
return
The first thing we notice in this version of the program is that the domain is meshed
with the mesh1d function which allows us to calculate both the coordinates of the
nodes and the connectivities of the elements. This way of doing things is particularly
useful for cases of two or three dimensions, in particular when we want to use a file of
38
Machine Translated by Google
mesh result of an automatic meshing program. For this simple case, we propose this
function as follows:
function [t,p] = mesh1d(net,nne,xi,xf)
%------------------------------------------------- ----
% t,p] = mesh1d(net,nne)
%t : table of connectivity of line elements
%p : table of node coordinates
% net: total number of elements
% nne: number of nodes per element
% xi,xf: limits of the integration domain
%
% A. Seghir, 14/10/04
%------------------------------------------------- ----
t(1,:) = 1:nne;
for i = 2:net
t(i,:) = t(i-1,:)+nne-1;
end;
n = (nne-1)*(net);
dx = (xf-xi)/n;
p = xi:dx:xf;
return
39
Machine Translated by Google
b not
ÿ fx(dx
) wfx i ( )i
has
ÿÿ ÿi 1
With f any function of x, n is the number of points xi in which the function is evaluated and
wi are weighting values. The coordinates xi as well as the weights wi
are calculated and the precision of this numerical integration depends on the number of
points n, the result is exact if the function f is a polynomial of order 2n. We give below the
points and weights for the integration on the interval ÿÿ1,ÿ1ÿ:
n=3
x -0.34641016151378 0 0.34641016151378
w 0.55555555555556 0.88888888888889 0.55555555555556
n=4
x -0.861136311594053 0.861136311594053 -0.339981043584856
0.339981043584856
w 0.347854845137454 0.347854845137454 0.652145154862546
0.652145154862546
n=6
x -0.932469514203152 0.932469514203152 -0.661209386466265
0.661209386466265
w 0.171324492379170 0.171324492379170 0.360761573048139
0.360761573048139
x -0.238619186083197 0.238619186083197
w 0.467913934572691 0.467913934572691
The MATLAB function implemented for the program is based on a number of points n ÿ 6,
which allows us to use elements with up to 11 nodes practically without loss of precision.
% [xsi,w] = wpgL6p
% xsi, w: points and Gaussian weights between -1 and +1 in line vectors
40
Machine Translated by Google
%------------------------------------------------- ------------------
---
With this integration method, the exact expressions of the elementary matrices are no longer necessary,
especially since we do not know, a priori, the functions to be integrated; the coefficients of the equation
can be arbitrary.
The last remaining point consists of making the transition between the integration terminals of
the real element and the terminals ÿ1 and ÿ1 of the reference element. The transformation
geometric :
xÿNÿ
with ÿ the coordinate in the reference element, offers the best solution because it uses the N shape
functions also defined in the reference element. We can easily verify that if ÿ ÿ ÿ 1, x ÿ x1, x2 for a linear
element and x ÿ x1, x3 for a quadratic element, … etc.
With this geometric transformation, the derivatives of the shape functions in the two elements are linked by
the relation:
dN dN dx
ÿ
;
dÿ dx d ÿ
dN ÿ J d dN
Or in more general form ÿ dx with J becomes a matrix (Jacobian) in the
1
Example of a linear element: NOT ÿ ÿ1ÿ
2
ÿ, 1ÿ ÿ ÿ ; 1dN ÿ_ ÿ2ÿ1 , 1ÿ ; And
Jÿxÿx1_( _ _ _
2 2 1)
41
Machine Translated by Google
x2 ÿ 1
ÿ ÿ
ÿ dx f NJ d
( ) ÿ ( ( )) fx ÿ
x1 ÿ
Finally, with these two major modifications which concern the geometric transformation and
numerical integration, the four functions of the elementary matrices and vectors will have
the following structure:
Start of function
[xsi, w] = wpgL4p;
npg = length(xsi);
nne = length(Xn);
Me = zeros(nne);
for i =1:npg
[N, dN] = FF1D(xsi(i), nne);
J = dN * Xn;
dN = dN * inv(J);
Me = Me + det(J) * w(i) * (dN' * dN);
end
return
42
Machine Translated by Google
function Ce = intNTcxdN(cx,Xn)
%--------------------------------------
[xsi, w] = wpgL4p;
npg = length(xsi);
nne = length(Xn);
This = zeros(nne);
for i =1:npg
[N, dN] = FF1D(xsi(i), nne);
x=N* Xn;
J = dN * Xn;
dN = dN * inv(J);
c = feval(cx,x);
Ce = Ce + det(J) * w(i) * vs * (N' * dN);
end
return
function Ke = intNTkxN(kx,Xn)
%----------------------------------
[xsi, w] = wpgL4p;
npg = length(xsi);
nne = length(Xn);
Ke = zeros(nne);
for i =1:npg
[N, dN] = FF1D(xsi(i), nne);
x=N* Xn;
J = dN * Xn;
k = feval(kx,x);
Ke = Ke + det(J) * w(i) * k * (N' * N);
end
return
function Fe = intNTfx(fx,Xn)
%------------------------------
[xsi, w] = wpgL4p;
npg = length(xsi);
43
Machine Translated by Google
nne = length(Xn);
Fe = zeros(nne,1);
for i =1:npg
[N, dN] = FF1D(xsi(i), nne);
x=N* Xn;
J = dN * Xn;
f = feval(fx,x);
Fe = Fe + det(J) * w(i) * f * N';
End
return
% [N,dN] = FF1D(x,n)
one = sym(1);
zero = sym(0);
else
one = 1.0;
zero = 0.0;
xn =-1:2/(n-1):1;
for i=1:n
p(i) = one;
q(i) = one;
s(i) = zero;
44
Machine Translated by Google
2 2
1) Repeat the equation from homework No. 3, question 3: du dx ÿ u ÿ x ÿ 0 with this
program. Modify the functions coef_k, coef_c and func_f, as well as the domain limits and boundary conditions.
2 2
of 1 of 1ÿ x
ÿ ÿ
2
dx x dx x
of
with the boundary conditions: u(0) ÿ1 And (4ÿ) ÿ ÿ2
dx
digital integration
function TstIntNum
clear
clc
xn =[-2 , 2];
[xsi,w, npg] = wpgL6p;
45
Machine Translated by Google
sn = 0;
for i=1:npg
[N,dN] = FF2Nd(xsi(i));
x = xn*N;
dx = xn*dN;
f = func(x);
sn = sn + dx* w(i) * f;
end;
x = sym('x','real'); se =
int(func(x),xn(1),xn(2))
int(func(x))
sn
se = double(se)
err = sn-se
function f = func(x)
f = x.*exp(-x);
return
46
Machine Translated by Google
chapter 4
Bar Element
ÿ
P0 PL P P+ Pdx
ÿx _
x
dx
ÿF ÿ mÿ
ÿ ÿ Pÿ ÿ 2u
P ÿ ÿ ÿ ÿ( 2dxÿ PA
ÿ t dx ) (2.1)
ÿÿ
x ÿÿ
Machine Translated by Google
In this expression u designates the longitudinal displacement, x is the coordinate and t is the time.
If we designate by E the modulus of elasticity of the material with which the bar is made, Hooke's law
gives the axial stress as a function of the longitudinal deformation:
P
ÿ ÿ ÿxÿ x E (2.2)
HAS
ÿu
ÿÿx (2.3)
ÿx
By substituting (2.3) into (2.2) we obtain the expression of the traction P as a function of the displacement
u:
ÿu
PEA ÿ ÿ
(2.4)
x
Hence the differential equation of the balance of the element dx which is obtained by replacing (2.4) in
(2.1):
ÿÿu( 2u
EA ÿ ÿ) ÿ A (2.5)
ÿx ÿx 2
ÿt
The boundary conditions of this equation depend on the embedding or displacements imposed for u,
and on the loading at the nodes for the derivatives of u (Equation 2.4).
Taking ÿu as a weighting function, the strong variational formulation of equation (2.5) is written:
L ÿ ÿu 2u
ÿ 0ÿ
u ( EA ÿ )] ÿ ÿu ÿA 2 ÿ t dx ÿ
0 (2.6)
[ ÿx ÿx
The weak formulation is written by taking the integration by parts of the first term:
48
Machine Translated by Google
L
L ÿu ÿu L 2u ÿ ÿ dx ÿ ÿ u u
EA ÿ dx ÿÿÿ ÿ u2Aÿ t AE ÿ ÿ 0 (2.7)
ÿ 0ÿ ÿx ÿx 0 ÿx ÿ ÿ ÿ ÿ
0
The last term is only the difference in the forces applied to the ends of the bar: ÿu|
xÿL PL ÿ ÿu|xÿ0 P0.
For the discretization of equation (2.7) take linear form functions with x1 ÿ 0 and x2 ÿ L.
The expressions of these functions and their derivatives are:
x L ÿÿ ÿ
x ÿ
01
N x( ) 0 ÿ0 L xx ÿÿ ÿ ÿ ; 1 dN
x ( ) ÿ ÿ ÿ1 1ÿ (2.8)
ÿ
L L ÿ
L L
ÿ ÿL (x)/W ÿ ÿ ÿ ÿ ÿÿ 1/ L ÿ
ÿ uÿÿ ÿ u0 ÿ uL ÿ ÿ
ÿ uu ÿÿ ÿ u0 ÿ uÿ Lÿ ÿ ÿ
(2.9a)
/xL ÿ
ÿx 1/ L ÿ
ÿÿ ÿ
ÿ uÿÿ ÿ u0 1 ÿÿ ÿ ÿ ÿ uL ÿ 0 ÿ u0 ÿ ÿÿ ÿ ÿ ÿ ÿ ÿ u0 uL ÿ ÿ (2.9b)
x 0ÿ x Lÿ
1
ÿÿ
ÿu ÿ u0 ÿ ÿ 2u 1 ÿ u0 ÿ
LL ÿÿ ÿ ÿ
1/ 1/ ÿ ÿ 2
tL L xx ÿ ÿ ÿ ÿ ÿ ÿ ÿÿ
ÿ (2.9c)
ÿx ÿ uL ÿ ÿ uL ÿ
Or :
ÿÿ
u represents the second derivative with respect to the travel time; that's to say
acceleration.
With these expressions the weak integral equation (2.7) becomes after simplification of
ÿ ÿu0 ÿuL ÿ :
L ÿÿ 1/ ÿ u0
ÿ ÿ
EA ÿ ÿ ÿ ÿÿ 1/LL
1/ dx ÿ ÿ
ÿ
0 1/ L
Lÿÿ _
u
ÿ L
ÿÿ (2.10)
L 1 ÿLÿxÿ ÿ 1 ÿLÿxÿ ÿ ÿ u0 ÿ ÿÿ P0ÿ
ÿ ÿ ÿA ÿ
dx ÿ ÿÿ
ÿ
ÿ
ÿ
0 L ÿ x ÿ
L ÿ x u P
ÿ ÿ L ÿ ÿÿ ÿ ÿ L ÿ
ÿÿ
49
Machine Translated by Google
L ÿÿ 1/ ÿ
K
e
ÿ
ÿ ÿ
EA ÿ ÿ ÿ 1/ 1/
LL dx
0
Lÿÿ _
1/ L ÿ
(2.12)
1 L ÿ 1 ÿ
1 EA ÿ
1 ÿ
1ÿ
ÿ
ÿ EA ÿ dx
ÿÿÿ
L2
ÿ
0
ÿÿ
ÿ
1 1 Lÿ ÿ
1 1ÿ ÿ
L 1 ÿLÿxÿ ÿ1ÿ
M ÿ
ÿ HAS L xxdx ÿ ÿ ÿ ÿ ÿ
e
0 L
ÿÿ
x L
(2.13)
Lx 21
2
ÿA L () Lxÿ
ÿ
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ( ) xA.L.
ÿ
ÿ
ÿ dx
L2 0
ÿ (Lxx )
ÿ
2x _ 6 ÿÿ12ÿ
ÿ ÿ 0ÿ ÿ ÿ ÿÿ1ÿÿÿÿ ÿÿ 0
ÿ
F ÿ
P ÿ
ÿÿ
P0 ÿ (2.14)
e L
1 0 Pÿÿ _
P
L ÿ
The elementary matrices Ke and Me are called respectively rigidity matrix and mass matrix. Fe is the
loading vector of the element. These expressions are valid if the section A, the density ÿ and the Young's
modulus E do not vary along the entire bar.
In the case where these quantities vary, it is possible to subdivide the bar into several elements and take
average values for each element.
The expression for the mass matrix as obtained in (2.13) is called coherent or distributed mass. It is
possible to concentrate the mass of the element at its ends.
Half of the total mass of the element is attributed to each of the two nodes, i.e.:
Me vs
ÿ
ÿ ÿ10
ÿAL
(2.15)
2 ÿÿÿ01ÿ
Young of the rod material are: ÿ ÿ7800 Kg/ mÿ and E ÿ 210,000 MPa.
250KN _
50
Machine Translated by Google
The mass and rigidity matrices as well as the loading vector are:
ÿ 1 ÿ
1ÿ ÿ1 0 ÿ ÿ 0 ÿ
M 29.25
ÿ N/ m ;
ÿ
K ÿÿ
175 106
ÿ
kg ; Fe ÿ
4 ÿ
NOT
ÿ
ÿ0 1
ÿ ÿ
25 10
1 1ÿ
ÿ
ÿ
ÿ
ÿ ÿ ÿ
Taking into account the condition u(0) ÿ 0. The resolution gives a displacement u(L) ÿ
1.4mm
F1 F2
The bars making up this system undergo two movements at their ends; a horizontal component and
another vertical. However, only the axial displacement of the bar gives rise to the axial force. Thus,
the elementary matrices of a bar
51
Machine Translated by Google
v1 v2
u1 EA u2
All the components of the stiffness matrix associated with the component v of the
displacement are zero. Those of the mass matrix, on the other hand, are not all. The
effects of inertia also exist when the ends of the bar move in the orthogonal direction,
only there is no coupling between the two components u and v of the displacement.
The two matrices are written as follows:
ÿ1010ÿÿÿ1
ÿ
ÿÿ
ÿ ÿÿ ÿ2 10 01 20 0ÿ ÿÿ ÿÿ ÿ
0000 ÿÿ
AE
ÿ AL 0201
Ke ÿ
; Me ÿ
(2.17)
L ÿ
010ÿÿ 6
ÿÿÿÿ
0000 0102
The concentrated mass matrix is written in the same way as in (2.15) by assigning half
of the mass of the element for all the components of the displacement:
ÿÿ ÿ1000ÿ
0100 ÿ
ÿ AL
Me ÿ
(2.18)
2 ÿ0010ÿÿ
ÿÿÿÿ
0001
52
Machine Translated by Google
The expressions of the elementary matrices as they are written by equations (2.17) and (2.18) are
valid in a system of axes coincident with the longitudinal axis of the bar element. In practical cases,
the bar can be inclined relative to the reference axes. It is then necessary to rotate the axes to
return to the axes of the bar. v2
uÿ2
vÿ2
u2
y
yÿ ÿ
xÿ
v1
vÿ1 uÿ1
u1
oÿ x
o
Figure 2.5 shows a bar inclined at an angle ÿ with respect to the horizontal axis of the coordinate
system (oxy). We note (u,v) the components of the displacement in this system and (uÿ,vÿ) those
of the displacement in the reference frame (oÿxÿyÿ) linked to the bar. We also note R the reference
rotation matrix which makes it possible to make the transition from the system (oxy) to the new
system (oÿxÿyÿ). We can thus write the following relationships:
ÿ
ÿ
u1ÿ ÿ cs ÿÿÿÿ u1ÿ ÿ ÿu2ÿ ÿ cs ÿÿÿÿ u2 ÿ
ÿ ÿ
ÿ
ÿ ÿ
; ÿ ÿ ÿ
ÿ
ÿ ÿ
ÿ
v1 ÿ
sc v1 ÿ
v2
ÿ ÿÿ
ÿ
sc ÿ
v2
ÿ
ÿ ÿ ÿÿ ÿ ÿ
53
Machine Translated by Google
ÿ
ÿ
u1ÿ ÿÿ
cs 0ÿÿÿ0 ÿÿ0 u1 ÿ
0ÿÿ
ÿ
v1
ÿ
sc ÿÿÿÿÿÿ v1
ÿ ÿ
ÿ ÿÿ ÿÿ ; Eu ÿ RUe (2.19)
ÿ
u2 00 cs u2
ÿ
ÿÿÿÿÿ v 2 ÿÿÿÿ ÿÿÿÿ
00 ÿ
sc v2
ÿÿÿÿ
It now remains to link the loading to the displacements in the frame (oxy), we have the
Fe Ke Ue . The relationship between the two vectors
ÿ ÿ ÿ
relationship in the frame linked to the ÿ
Fe ÿ RT KÿeeUÿ ÿ R Kÿ
T
RU
e e ÿ Ke Ue
(2.21)
We thus obtain the relationship between the expressions of the rigidity matrix in the two
benchmarks:
T ÿ
KReKe R
ÿ
(2.22)
Either :
cs ÿ
ÿ00ÿÿ ÿÿ ÿ1010ÿÿÿ ÿ
ÿ
cs 00ÿÿÿ ÿ
ÿ ÿ ÿ
sc 00 AE 0000 ÿ
sc 00
Ke ÿ
ÿÿÿÿ00 vs
ÿ
s L ÿ
ÿÿ1010ÿÿ 00 cs
ÿÿ
ÿÿ
00 sc ÿÿ ÿÿÿÿ
0000 00 ÿ
sc ÿ
2
ÿ tbsp 2 tbsp c ÿÿ
cs ÿÿ
ÿ 2 2
AE ÿ ÿ cs sec
ÿÿ
cs sec
ÿ ÿ
2
L ÿ
tbsp
ÿ
2 tbsp c cs
2 2
ÿ
cs ÿ
sec cs sec
ÿÿ ÿÿÿÿÿ
the stiffness matrix, the coherent or concentrated mass matrix remains unchanged at the
reference rotation. Indeed, from the point of view of physics, the mass is independent of the
orientation of the reference frame.
54
Machine Translated by Google
%--------------------------------------------
% Elementary matrices of the bar element
%
% A. Seghir, 08/10/04
%--------------------------------------------
clear % clears all variables
in global memory
clc % clears the window
orders
syms sc real symbolic % declares variables
R = [ cs 0 0 % rotation matrix
-sc 0 0
0 0 cs
0 0 -sc
]
-1 0 1 0
0000
]
55
Machine Translated by Google
Which gives for bar No. 1: c ÿ ÿ 0.8 and s ÿ 0.6 Fig. 2.5: Two-bar trellis
1 e1
ÿÿ
0.6 4 0.4 8
ÿ ÿ
ÿ ÿ 0.6 4 0.4 8 ÿ ÿ e ÿ ÿF ÿ ÿ
u1 1x _
ÿÿ e1 1st _
6
ÿ
F1
y1
525 1 0
ÿ
ÿ
ÿ
ÿÿ
1
ÿÿ
e ÿÿ
ÿ
and Fÿ
ÿ 2_ 2x _
e1 1st _
0.3 6 v2 F2
y
ÿÿÿÿ ÿÿÿÿ ÿÿ ÿÿÿÿ
By involving the displacement vector of all the nodes (from 1 to 3) the system becomes:
ÿÿÿ
0.6 4 ÿ
u1 ÿÿ
ÿ F 1st _
ÿÿ
x1
ÿ ÿ
e1
ÿ
v1 Fÿÿÿÿ
ÿ 1y
0 000 0 0 u2 0
6
525 1 0
ÿ
ÿÿ
ÿ
ÿ ÿÿ
0 000 0 v2 0
0ÿ
ÿ
u3 F 1st _
x2
0.4 8 ÿ
v3 F e1
ÿÿÿÿÿÿ ÿÿÿÿÿ
ÿ 2y
ÿÿÿ
ÿÿÿÿÿÿÿ
For bar No. 2: c ÿ 0.8 and s ÿ 0.6, the system with all the components of the displacement
vector is:
56
Machine Translated by Google
ÿ00ÿ 0 0 0 ÿÿÿÿ0
u1 ÿÿ ÿÿ
0 ÿÿ
0ÿ
00ÿÿ 0 0 0 ÿÿ v1 0
ÿ 0.4
e2
0 0 0.6 4 0.4 8 ÿ ÿ ÿ 0 0 0.6 ÿ
0.6 4 ÿ
ÿÿÿÿÿÿ 8 u2 F 1x _
6
525 1 0
ÿ
0.4 8 ÿÿ
ÿ
ÿÿ e2 ÿÿ
0.3 6 v2 F
ÿ 1y
e2
4 0.4 8 ÿ ÿ ÿ ÿ
e2
0 0 0.4 8 0.3 6 0.4 8
ÿ ÿ
0.3 6 v3 F
ÿÿÿÿÿ ÿÿ y 2 ÿÿÿÿÿÿÿ
The assembly of the two elementary systems gives the overall system:
ÿÿÿ
0.6 4 0.4 8 ÿ
0 0 ÿ
6
ÿ
ÿÿÿ v1 0
ÿ
0 0 0.6 4 0.4 8 ÿ
u2 0
6
525 1 0
ÿ
6 ÿÿ
ÿ
ÿÿ ÿÿ
ÿÿÿ v2 0
ÿ0
ÿ
0.6 4 0.4 8 ÿ
0.6 4 0.4 8 ÿ
1.2 8 ÿ
ÿ u3 0
ÿ 6
ÿÿÿÿÿÿ
0.4 8 ÿ
0.3 6 0.4 8 ÿ ÿ
0.3 6 0 0.7 2 ÿ ÿ v3
ÿÿÿÿÿ ÿÿÿÿÿ
ÿÿ
3.4 1 0 ÿÿÿÿÿ
ÿ 1.28 0 u3 ÿ ÿ 0 ÿ
6
525 10
ÿ
ÿ ÿ
ÿ
ÿ ÿ
6
ÿÿ
ÿ ÿ ÿ 0 0.72 ÿ ÿ v 3 ÿ ÿ
ÿÿ
3.4 10 ÿ
0.6 4 0.4 8 ÿ ÿ u1 ÿ
0 ÿ
ÿ
ÿ
2265.4 8
ÿ 1
6
ÿ
ÿ 0.3 6 ÿ ÿ ÿ e ÿ
0 ÿ ÿ ÿ 1699.1
v1
525 1 0
ÿ ÿ ÿ KN ÿ
ÿ e1 ÿÿ ÿ 1ÿ
ÿ
u2 ÿ
0 2265.4 8
ÿ
1 ÿ
3
0.4 8 ÿ
0.3 6 0.4 8 ÿ
0.3 6 ÿ ÿ ÿ e ÿÿÿ
8.9 9 1 0
ÿ
ÿ 1699.1 1 ÿ
ÿÿÿÿ v2 ÿÿÿÿ
ÿÿÿÿÿ
The reactions correspond to the first two components of the Fe vector and they are equal
to the opposite of the forces applied on the other end and which correspond to the third
and fourth components.
57
Machine Translated by Google
The axial force in the bar is obtained with the same reference rotation defined above:
The calculations give the same value for the second bar.
The following MATLAB function file returns a location table in the case of
function L = Locate(t)
% L = Locate(t)
% t: element connectivity table
% L: location table
nne = length(t);
for i= 1:nne
In the case of any number of degrees of freedom, we propose the following function which is more general:
function L = Loc(t,n)
%-------------------------------------------------
% L = Loc(t,n)
% t: element connectivity table
58
Machine Translated by Google
% L: location table
% n: number of degrees of freedom per node
%
The implementation of a finite element program for bar assembly structures first
requires good organization of the data file. The program must have a structure that
allows it to perform three main tasks: reading data, calculating the solution and
displaying the results.
- The geometry concerns the coordinates of the nodes p, the connectivities of the
elements t and their straight sections A as well as the embedding conditions
which are grouped into a vector e.
- The characteristics of the material are the modulus of elasticity E and the mass
rho volume .
59
Machine Translated by Google
t = [1 3 % connectivity of element 1
2 3 % connectivity of element 2
];
];
e = [ 1; 2 % embedding node 1
3; 4 % embedding node 2
] ;
If we want to display the structure for visual verification, we use the following
commands:
>> plotmesh(t,p,1,1,'b');
The plotmesh function displays a figure of the mesh, it therefore allows, with plotting
the structure entered, a visual verification of the elements and nodes. Its script is:
60
Machine Translated by Google
for ie = 1:Net
XY = P(T(ie,:),:);
X = [[XY(:,1)]; XY(1,1)];
Y = [[XY(:,2)]; XY(1,2)];
line(X,Y,'color',color)
if(EltLabels)
x = mean(XY(:,1));
y = mean(XY(:,2));
text(x,y,num2str(ie),'color','b')
end
end
if(NodeLabels)
Np = size(P,1);
for i=1:Np
text(P(i,1),P(i,2),num2str(i),'color','m')
end
end
elements t, the table of coordinates of the nodes t and the sections of the elements A. We add the elastic
modules E for the stiffness matrix K and the densities rho for the mass matrix M. We take different
characteristics for each element (A, E and rho of the vectors) to be able to calculate assembly structures
for bars of several types of material and different sections.
61
Machine Translated by Google
% rho: density
It should be noted that we initialized the matrices K and M with sparse matrices . The advantage offered by
sparse matrices is that only non-zero elements are saved in memory. MATLAB is equipped with a data
structure and several functions to support all matrix operations on this type of matrices and in a way that is
practically imperceptible to the user.
The construction of the two matrices K and M is not very different from what was presented for the differential
equations. We have introduced here a localization table Li which we calculate with the localise function
(§2.6) and which we use instead of the connectivity table t for the assembly of K and M.
For the calculation of the elementary matrices Ke and Me we practically only need to enter the components.
The length and direction cosines of the element are calculated from the coordinates of its nodes:
L ÿ (x ÿ 2x ) ÿ1( 2y ÿ y 2) 1
2
; cos(ÿ) ÿ (x2 ÿ x1 )/ L ; sin(ÿ) ÿ ( y2 ÿ y1 )/ L (2.24)
function ke = truss2DKe(XY,A,E)
62
Machine Translated by Google
% ke = truss2dKe(XY,A,E)
% Calculation of the elementary matrix for a bar element with two nodes (x1,y1)
% (x2,y2)
% A: section of the bar
% A. Seghir, 06/08/04
cc = c*c; % cos(angle)^2
cs = c*s % cos(angle)*sin(angle)
ss = s*s; % sin(angle)^2
-cc -cs cc cs
-cs -ss cs ss
];
return
function Me = truss2dMe(XY,A,rho)
% Me = truss2dMe(XY,A,rho)
% Calculation of the elementary mass matrix Me for a bar element with two nodes (x1,y1) (x2,y2)
%
[x1,y1; x2,y2]
% A. Seghir, 07/08/04
L = EltLen(XY);
Me = 0.5*rho*A*L*eye(4);
return
0 2 01
1 0 20
0 1 02
63
Machine Translated by Google
];
% A. Seghir, 06/08/04
dx = XY(2,1) - XY(1,1);
dy = XY(2,2) - XY(1,2);
ds = sqrt(dx^2 + dy^2);
c = dx/ds;
s = dy/ds;
return
64
Machine Translated by Google
K and M as well as the vector F since the loading is entered for all the nodes including
the support ones.
Care should be taken when applying the MATLAB commands A(i,:)=[] and A(:,i)=[]
which allow you to delete rows and columns from a matrix. With each column or row
deleted the size of the matrix is reduced and the indices are shifted to the left in the
case of a column and upwards in the case of a row.
Thus, before proceeding to delete a list of degrees of freedom, it must first be sorted
in an ascending or descending order and then delete the rows and columns by going
through it from the largest to the smallest index. This way we don't have to worry about
offsets in the list values.
The MATLAB command which allows you to order a list or a vector L is: sort(L).
The function which allows the support conditions to be applied is called DelDOFs and
expects as input arguments a variable A which can be a square matrix or a column
vector, and a list L of the degrees of freedom to be deleted. Its script is as follows:
function A = DelDOFs(A,L)
% A = DelDOFs(A,L)
%
n = length(L); % length of L
65
Machine Translated by Google
end
return
% [F,R] = TrussForces(t,p,A,E,U)
% F: axial forces in the bars
% E: moduli of elasticity
% U: solution on the go
66
Machine Translated by Google
ke = truss2dKe(p(t(ie,:),:),A(ie),E(ie)); % matrix
elementary
(oxy)
[Len,c,s] = EltLen(p(t(ie,:),:)); % direction cosines
F(ie,:) = -(c*fe(1)+s*fe(2)); % rotation at local reference
R(L) = R(L) + fe; % all elements related to
node
return
We can calculate the eigenmodes of the structure with the eigs function which
ÿ
system ÿK ÿ ÿ resolves M ÿ ÿ ÿ 0. It takes as input argument the two matrices K and M and
returns two matrices as a result: one orthogonal for the eigenvectors and the other
diagonal for the eigenvalues. The eigenmodes are therefore the columns of the
eigenvector matrix and the eigenperiods are given by: T ÿ 2ÿ/ÿ.
% R: reactions to support
%T : specific periods of the structure
% phi: eigenmodes of the structure
% containing data
loaded
67
Machine Translated by Google
% display results
net = size(t,1); nnt = size(p,1);
disp('Calculation results of the 'bar assembly' structure)
disp([' data file: ',ffd])
disp([' Number of bars: ',num2str(net)])
disp([' Number of nodes: ',num2str(nnt)])
68
Machine Translated by Google
disp(sprintf(' %d\t\t\t%+1.4E\t\t%+1.4E',i,R(L)))
end
end
Notice how the data file is called by this function. The ffd variable
must be of character type (string), str2func allows you to construct a function address from a name and feval evaluates it. To
use trussfem, you must therefore prepare a data file similar to expl2barres.m and use the command:
Movements at nodes:
Node Ux Uy
1 +0.0000 +0.0000
2 +0.0000 +0.0000
3 +0.0000 -0.0090
Reactions to support:
Supports Rx Ry
1 -2.2667E+006 +1.7000E+006
2 +2.2667E+006 +1.7000E+006
69
Machine Translated by Google
4.8 TP No. 3
Model and calculate the structure below using the trussfem program and
SAP2000 software . All the bars of the structure have a cross section A ÿ
6cmÿ6cm and are made of a material with a density ÿ ÿ 7800 Kg/mÿ and a
modulus of elasticity E ÿ 210000 MPa. Distances are given in meters and loads
in KN . Give the displacements of the nodes, the reactions to the supports and
the internal forces in the bars.
10KN _
4 7 6 1 8
1 1
4 6 8 1
0
3 2
7
3 5 5 9
2
1
70
Machine Translated by Google
chapter 5
Beam Element
We consider beams to be slender pieces (in reinforced concrete or steel), which have a very large dimension
compared to the other two and which generally work in
bending.
The formulation of the beam element can be obtained based on the theory of material strength; we consider
a beam of section A and length L subjected to a loading q(x) varying along its longitudinal axis as shown in
figure 3.1 below:
y
q(x)
Under the effect of loading, the beam bends and moves vertically by a displacement v(x). It is assumed that
after this deformation, the straight sections remain flat and
Machine Translated by Google
perpendicular to the mean line; they therefore undergo a small rotation of angle ÿ in the
(oxy) plane. Consider an element dx of the beam delimited by two neighboring sections,
one straight and the other inclined.
y
u ÿ
not
y
ÿ
v(x)
ÿ
ÿ vx( )
dx vx( ) ÿ dx
ÿx
v(x)
x
The rotation of the deformed section is the tangent of the curved mean line:
v
ÿÿ (3.1)
ÿ ÿx
Because of the rotation, the points of the section undergo a horizontal displacement u
varying linearly from the lower fiber to the upper fiber. At a point in the section this
displacement is worth:
v
u ÿ ÿ ÿ ÿ ÿÿ xÿ yy (3.2)
where y denotes the distance from the mean line (center of the section)
Within the framework of the hypothesis of small deformations, the axial deformation along
x along the section is:
72
Machine Translated by Google
u
ÿÿÿ (3.3)
x
ÿx
If we designate by E the modulus of elasticity of the material of the beam, Hooke's law gives the
distribution of stresses along the section:
ÿu ÿ 2v _
ÿ ÿx ÿ ÿ E x
E ÿÿ
Ey2ÿx (3.4)
ÿx
The moment created by these constraints must balance the bending moment M created by the external
loading:
ÿ 2v _ 2
ÿ 2v _
2
ÿ ÿE 0. ÿ.
M yÿds ÿÿ ÿ y ds ME ÿ ÿ
ÿ y ds (3.5)
s 2x _ s 2x _ s
with s designates the area of the cross section. We set Iz the moment of inertia with respect to
2
the z axis perpendicular to the plane (xy) I yÿ ds
ÿ , the expression of the moment becomes:
s
ÿ 2v _
M EI ÿÿ (3.6)
2x _
q
M
MÿdM
x
T TÿdT
dx
73
Machine Translated by Google
dx dx
ÿ ÿTM
ÿÿ2 ( T dT ) ( ÿ M ÿ dM )ÿ 0
2
dx
Tdx dT
ÿ ÿ dM ÿ 0
2
By neglecting the second order terms, we obtain the relationship between the shear force and
the bending moment:
dM ÿ ÿ 2v
T ÿÿÿÿ
( EI ) (3.7)
dx ÿx ÿx 2
Balance of vertical forces for positive loading in the direction of the y axis (figure 3.3):
T ÿ dT ÿ q dxÿT ÿ 0 (3.8)
gives the relationship between the loading q and the shear force T and relates the loading to
the displacement v by:
2 2
dT ÿ ÿ v
q ÿÿÿ
2 (
EI
2)
(3.9)
dx x ÿ ÿx
This equation translates the static balance of the beam. In the case of a dynamic movement, a
term reflecting the inertia forces must be added to equation (3.8):
2
ÿ u
F im A dx ÿ ÿ ÿ ÿ 2
(3.10)
ÿt
with ÿ is the density of the material, A the section of the beam and t represents the time.
T ÿ dT ÿ q dxÿT ÿ Fi (3.11)
ÿ 2v ÿ ÿ 2v
ÿA ÿ ( EI ) ÿ
qx( ) (3.12)
ÿ tx2 2 ÿ ÿx 2
Equation (3.11) is the Euler-Bernoulli equation for beam bending. The displacement v is a
function of the coordinate x along the axis of the beam and the time t.
74
Machine Translated by Google
L 2v _
L ÿ2 ÿ 2v _ L
ÿ ÿ ÿÿ v A 2 ÿ dx ÿ ÿÿ v ( IS ) dx ÿ ÿ ÿ vqx (dx
) (3.13)
0 t 0 ÿ 2x _ ÿ 2x _ 0
The weak integral form is obtained with two integrations by parts of the second term.
L
L 2 L
ÿ ÿ 2v _ ÿÿ v ÿ ÿ 2v _ ÿ ÿ 2v _
v ( IS ) dx ÿÿ ÿ ( IS ÿ ) dx ÿÿÿÿ v ( IS (3.14a)
ÿ 0ÿ ÿ 2x _ ÿ 2x _ 0 ÿ xx ÿ ÿ 2x _ ÿx ÿ 2x _
ÿ )ÿ 0ÿ
L
L ÿÿ v 2
ÿ ÿ 2v _ L ÿÿ v ÿ 2v _ ÿ ÿÿ ÿ ÿ v ÿ 2v _ ÿ
ÿ ( IS ) dx
ÿÿ
ÿ IS dx ÿ IS (3.14b)
0 ÿ ÿ xx ÿ 2x _ 0 ÿ 2x _ ÿ 2x _ ÿx _ ÿ 2x _
ÿÿ
0
Taking into account expressions (3.6) and (3.7), the second terms represent the difference
in the loadings in forces (T0 and TL) and in moments (M0 and ML) applied to the ends of the
beam. Furthermore, we can replace the derivative of the disturbances of the displacements
by a disturbance of the rotations (equation 3.1):ÿÿv ÿx ÿ ÿÿ .
L
ÿ ÿÿ ÿ v ÿ 2v _
IS ÿ ÿ ÿ ÿÿ ÿ M0 ÿ ÿÿ M
xÿ 0 x LL
ÿ
ÿÿ x ÿ 2x _
0
(3.15a)
L
ÿ ÿÿ( 2v _
ÿv _ EI ÿ ÿ ÿ ÿ v T v T x LL 0 0
2ÿx ÿ) ÿ
xÿ
ÿx
ÿÿ ÿÿ 0
(3.15b)
Now substituting (3.15) into (3.14) and the result into (3.13) we obtain the expression for the
weak variational form:
75
Machine Translated by Google
L ÿ 2v L ÿ 2ÿ v ÿ 2v
ÿ ÿ go
ÿ dx ÿ ÿ EI dx M
ÿ ÿÿ ÿ
0 ÿt2 0 ÿx 2 ÿx 2 x L.L.
ÿ
(3.16)
L
ÿ ÿ ÿ ÿ ÿÿ v T v TM vqx dx ÿ ÿÿ ()
x L.L.
ÿ
x 00ÿ
x 0
ÿ 0
0
5.2.2 Discretization
For the discretization of this equation we consider an element with two nodes: a node at each end
of the beam. The presence of derivatives of order two requires the use of quadratic polynomials or
more. Furthermore, we see that the expression of the boundary conditions involves rotation at the
ends, it is therefore more interesting to take two degrees of freedom per node in order to ensure at
the same time the continuity of the displacements and their derivatives which are the rotations. The
number of degrees of freedom thus reaches four and the interpolation polynomial must be cubic
(four constants).
The vector of elementary displacements and rotations is therefore written as follows:
T
U ÿÿ v1 ÿ1 v2 ÿ2 ÿ
not
(3.17)
v1 (F1) v2 (F2)
ÿ1 (Mÿ) ÿ2
(M2)
1 2
x1 ÿ 0 x2 ÿ L
Fig. 3.4: Beam element with two nodes
The displacements and rotations along the beam are approximated by:
2 3
v(x) ÿ a 0ÿ ax 1ÿ ax ÿ2 ax 3 (3.18a)
2
ÿ(x) ÿ a ÿ1ax ÿ2 ax2 3 3 (3.18b)
v(0) ÿ a 0ÿ v 1
; ÿ(0) ÿ a 1ÿ ÿ 1 (3.19a)
76
Machine Translated by Google
2 3 2
v(L) ÿ v 2ÿ v ÿ1 ÿ L 1ÿ a L2ÿ a L 3 ; ÿ(L) ÿ ÿ ÿ 2ÿ ÿ a 1L ÿ 2a L2 3 3 (3.19b)
has
2 has
3
ÿ ÿ
) ÿ ( ÿ1 ÿ ÿ2 )
2 3 2
L L L L
Replace these parameters in equation (3.18) and after arrangement of the terms we
write the nodal interpolation of the displacements in the form:
The Ni shape functions are called Hermite polynomials, their expressions are:
2 3 3
3x 2x 2 2x x
N x1 (ÿ)ÿ1ÿ ; N x (ÿ )x ÿ 2 ÿ ;
2
L L
3
L L2
x2 2x 3
x
3
x
2
N x3 3ÿ ( ) ÿ
; N 4x( ) ÿ ÿ (3.22)
L2 L3 L
2
L
We can verify that the sum of the shape functions associated with the displacements is
equal to unity: N1ÿN3 ÿ1. They also take values equal to one at the nodes that
correspond to them and zero values at the opposite nodes. This remark is not valid for
the functions associated with rotations since the rotations are themselves derivatives
of the displacements. The MATLAB program which allows you to calculate and plot the
Hermite form functions is as follows:
clear, clc
syms x L real % declare real symbolic x and L
% graphs of N and dN
t = 0:0.01:1;
subplot(2,1,1), plot(t, N(1,t')), title(' Functions of form N1 N2 N3
N4')
subplot(2,1,2), plot(t,dN(1,t')), title(' Derivatives dN1 dN2 dN3 dN4 ')
77
Machine Translated by Google
The figure below shows the curves of the shape functions and their derivatives for a
beam element of unit length (L ÿ 1):
We now replace the displacement v in the variational form (3.16) by its approximation
(3.21), we obtain for the disturbances:
T
TT T
dN
ÿv ÿ ÿAn N ; ÿÿ ÿ ÿU with ÿU Tÿ ÿ ÿv1 ÿÿ1 ÿv1 ÿÿ2 ÿ (3.23)
dx
not not
ÿ 2v 2
dN 2
ÿ v of
2
not
ÿÿ
2
ÿ
2 A ; 2
ÿ
NOT
2
ÿ
NAKEDnot (3.24)
ÿx dx ÿt dt
78
Machine Translated by Google
2
dN 1
with : ( x) ÿÿÿ 12 6 , 6 6 12 x4 L 2Wx
ÿ
, LL x Lx L
ÿ
, 6 ÿ
2 2
ÿ
(3.25)
dx 2
L3
Taking into account the values of the functions N and dN at the nodes (Fig. 3.5), the conditions at
limits are written:
T T T
ÿ ÿ ÿ v T v TU x LL 0
ÿ
x 0
ÿ
ÿÿÿ not (0010 ÿ TL ÿÿÿ 1000 T0 )
T T
(3.26a)
ÿ ÿ ÿ UT
ÿ not 0 0 TL 0ÿ
ÿÿ Mx ÿ ÿÿ MU 0 0 ÿ ÿ ÿ ( 0T 0
01 ÿ T M0100ÿÿÿ T
M )
LL
ÿ
x ÿ not L 0
(3.26b)
ÿ Tÿ 0
0 ÿ ÿUMM ÿ T
not 0 L
These conditions correspond to the external loading applied to the nodes, that is to say
at the junctions between elements such as post-beam junctions for example. The elementary
vector Fn of the forces and moments concentrated at the nodes is written as follows:
T
Fc ÿ ÿ ÿ T0 ÿ M0 TL ML ÿ (3.26c)
The loading Fe distributed on the beam element corresponds to the second term of the variational
form (3.16):
L L L
T T T
( ) dx UNÿ qx
ÿ ÿvqx ÿ dx ÿ not
() ; Fe ÿNÿqx dx ( ) (3.27)
0 0 0
This loading is a function of the distribution q(x). In simple cases we can integrate and give the
explicit expression of Fe, otherwise, it is possible to subdivide the beam (or the element) into
several small elements so as to be able to replace the distributed loading q by two equivalent
concentrated forces at the extremities.
We give below the expression of Fe for a case of trapezoidal loading varying from q0 to qL.
Uniform and triangular loadings are only particular cases of trapezoidal loading.
x
q(x) q (qL q )ÿ ÿ 0 ;
ÿ
0 (3.28a)
L
79
Machine Translated by Google
L T
F eÿ ÿ (9 ÿ 2 1 ) , (2 ÿ 3 ) , q(20L1qL
ÿ 9q ) , qL 0 qL q 0 ÿ (3 ÿ 2q) ÿ
L qL 0 (3.28b)
60
2 2 2 T 2
L ÿÿ v ÿ v L
T dN dN T
ÿ 2
EI 2
dx U 2
EI 2
U dx (3.29a)
0 ÿx ÿx ÿ ÿ ÿ0 not
dx dx
not
L ÿ 2v L
TT
ÿÿ
ÿ ÿ go
ÿ dx UNNU dx
ÿ ÿ ÿ0
ÿ (3.29b)
ÿt2
not not
0
T
The elimination of ÿA of the discrete integral equation gives the two mass matrices
Me and Ke rigidity :
L d 2N T
d 2N
Ke EI dx (3.29)
ÿ ÿ0 dx 2 dx 2
L
T
ÿ ÿ dx
Me NAN ÿ (3.30)
0
If the beam is made of the same homogeneous material and of the same section (E, I and ÿ are
constant), then the explicit expressions of the elementary matrices can be obtained and are
written as follows:
ÿ 12 6 L ÿ
12 6 Lÿ ÿ 156 22 L 54 13 ÿ
Lÿ
2
EI LL 6 LL
2 2 22LL 13 L 3L 2
ÿ ÿ
4
ÿ ÿ
26 4
ÿ AL
ÿ ÿ
Ke
ÿ ÿ ÿ
; Me ÿ ÿ ÿ
L3 ÿ
ÿÿ
12 6 L 12 6 ÿ
L ÿ 420 ÿ 54 13 L 156 22 ÿ
L ÿ
2 2
LL 6 LL
ÿ ÿ ÿ ÿ
262 ÿ
4 ÿ
2 13LL
3 ÿ ÿ
22 L 4L ÿ
ÿ ÿ ÿ
(4.31)
The same remark concerning the mass matrix of the bar element can be made for the beam
element. We can associate half of the total mass of the element with the degrees of translation
of each node. We only take translations because rotations do not produce inertial forces. The
concentrated mass matrix is therefore written as
follows:
80
Machine Translated by Google
ÿ 0ÿ 0
1000ÿÿ
AL
ÿÿÿÿÿ0010ÿÿ (4.32)
Me ÿ
2 ÿ0000ÿ
It should be noted that the two concentrated and distributed matrices give the same total mass
with the sum of the components associated with the degrees of freedom of translation: M(1, 1) ÿ
M(1, 3) ÿ M(3, 1) ÿ M(3, 3) ÿ ÿAL.
ÿ
86 ÿ
86ÿ66 ÿ
6
3.2 16 3 ÿ 3ÿ ÿ
K e ÿ MN / m
3 1.5 ÿÿ
ÿÿ
86 ÿ86ÿ
ÿ
ÿ
6366ÿ ÿ
2ÿÿ
3 T
The force vector according to equation (3.26) is: F ÿ10 ÿ 0 0 ÿ 90 60ÿ
81
Machine Translated by Google
ÿÿ
86 ÿ86ÿÿÿ v1
ÿ
ÿ ÿ
0
ÿ
3.2 1ÿ6 3ÿ 6663ÿÿÿ86ÿÿÿÿ ÿ1 ÿ
0
6 ÿ
K ÿ ÿ
10 ÿ
ÿ ÿ
ÿ
3 ÿÿ ÿ
1.5 2 ÿÿ
86 v2 ÿ ÿ
ÿ ÿ ÿ 90000 ÿ
ÿÿ
6366 ÿ
ÿ2
ÿÿÿÿ ÿÿÿÿÿ
60000 ÿÿ
ÿ86ÿÿÿ
ÿ
v2 ÿ ÿÿ ÿÿ90000
ÿ 60000
ÿ
7ÿ
K ÿ
2.27556 10 ÿ
6 ÿ
ÿ
ÿ
ÿ
6ÿÿÿ
ÿÿ 2 ÿ
ÿÿ
86 ÿ86ÿ ÿ
ÿ
0 ÿ
F1 ÿ ÿ 90ÿ ÿ
ÿÿ ÿ
6663ÿÿÿ86ÿÿÿ6
ÿ
0 ÿ
3
M1 75
K ÿ
7 2.27556 1 0 ÿ
3 ÿ 10 ÿ
ÿ ÿÿ
ÿ
310 ÿ ÿ
ÿÿ
86 66ÿÿ ÿ ÿ
ÿ ÿ ÿ 0.6592 F2_ ÿ
90ÿ
ÿ
ÿ ÿ
ÿ ÿ 0.2197 M 60ÿ
ÿÿÿÿ ÿ ÿÿÿÿÿ 2 ÿÿÿÿ ÿÿÿÿÿ
Ry = 90 KN ; Mz ÿ 90 ÿ 1.5 ÿ 60 ÿ 75 KN m.
The moment is positive because of the sign convention adopted in Figure 3.4: At node 1, the
positive moment stretches the upper fiber to rotate in the trigonometric direction. The last two
components correspond to the nodal forces applied to the free end.
It should be noted that the solution obtained, whether for the arrow or the reactions, is an exact
3
solution. This is due to the fact that the arrow is a function in x of form are and functions
polynomials of the third degree. It follows that the Hermite polynomials make it possible to
obtain the exact solution.
82
Machine Translated by Google
We now consider the same previous load distributed uniformly along the beam, i.e.:
q ÿ 90/1.5 = 60 KN / ÿ. ; q ÿ 60 KN / mÿ
M ÿ 60 KNm
3 T
The vector concentrated forces from the moment is: FC ÿ10 ÿ 0 0 0 60ÿ
T
The total force vector is therefore: F ÿ10 ÿ ÿ3 45 ÿ11.25 ÿ 45 71.25ÿ
The rigidity matrix being the same, the solution of the reduced system gives:
T
R ÿ KU ÿ10 ÿ 453 ÿ3.75 ÿ 45 71.25ÿ
corresponds.
83
Machine Translated by Google
The total reaction therefore corresponds to the sum of the two types of reactions:
At the free end the sum of the two reactions cancel each other out in force and their sum equals the
applied moment:
M ÿ Rÿ ÿ (ÿFqÿ) ÿ 60 KN m.
3
This moment cancels at the position xÿÿÿ 2 0.08579
2
Note : In the case of a trapezoidal load (expression 3.28a), it is necessary to replace by the sum of
ÿ
½ tbsp the moment of a uniform load q0 and that of a load
2
x3
Mq qx 1 2 0
ÿ
( ÿ qL
ÿ q 0)
6L
78 ÿ
00 00 132 36 78 27
ÿ
ÿ
450 ÿ
Mc
ÿ ÿ ÿ
; Mr. ÿ ÿ ÿ
ÿ ÿ
00 00
ÿ ÿ
ÿ ÿ ÿ
ÿ
78 27 132
ÿÿ
36 ÿ
The natural periods of the beams are given by T ÿ 2ÿ/ÿ with ÿ solution of
ÿ
the equation: det(K ÿ ÿ M) ÿ 0.
84
Machine Translated by Google
%------------------------------------------------- ------------------
% console.m
A = b*h; % Section
I = b*h^3/12; % Inertia
% Stiffness matrix
K = E*I/L^3 * [ 12 6*L -12 6*L
6*L 4*L^2 -6*L 2*L^2
-12 -6*L 12 -6*L
85
Machine Translated by Google
2500 for Mass per Unite Volume and 0 in all other input fields.
3) For the section, you must put 0.3 for Depth (t3) and 0.4 for Width (t2) since the model is
planar and the height of the beam is in the Y direction instead of the Z direction.
4) Define the three static load cases FP, FQ and FM in the Define Static Load Case Names window ; choose the Live type
5) Once the loads have been defined, you can make the FM+FQ and FM+FP combinations
with the Define/Load Combinations menu. Click on the Add New Combo button. In the
Load Combination Data window , enter FQM for both Load Combination Name and
Title fields, leave ADD for Load Combination Type. In the
86
Machine Translated by Google
Define Combination pane , choose FQ Load Case for Case Name and keep 1 as Scale
Factor then press the Add button. Add FM in the same way and validate with OK. Now
define the FPM combination in the same way .
Use the Delete button to erase previous loads or the Modify button for modified ones.
Close both windows by validating in both cases with OK.
6) Select the element to assign the distributed load to it with the Assign/Frame Static Loads/
Point and Uniform menu. Choose FQ for Load Case Name, Forces and GlobalY for
Load Type and Direction and enter the value -60000 in the Uniform Load field.
7) Now select the node at the free end to assign it the load P
with the Assign/Joint Static Loads/Forces menu . Choose FQ for Load Case
Name and enter -90000 for Force GlobalY. Select the node again to assign the
moment M to it. Now choose FM for Load Case Name and enter 60000 for Moment
GlobalZZ. The moment is only visible in the drawing window if it is in 3D mode or in
the XZ plane, change view if necessary.
8) In the Analysis Options window, check only UY and RZ for Available DOF's, also
activate the Dynamic Analysis option and press Set Dynamic Parameters to set
Number of Modes to 1.
9) Start the analysis. Before closing the calculation progress window, we can read:
Period = 0.014265, the second vibration mode is deleted by the SAP since it has
zero periods.
10) The results can be displayed according to the defined combinations or according to the
charges alone.
Note :
Note the definition of loads and their combinations in steps 4 to 6 and compare with the
console.m script. In fact, this remark is generalized for all data declarations, the SAP2000
graphical interface creates a data file which is saved before analyzing the model to be
loaded and read by the software modules. A version in ASCII format can be created with
the File/Export/SAP2000.S2K menu. It is interesting to do this operation and call the
87
Machine Translated by Google
file for example console.s2k to load it with a text editor like WordPad or NotePad in
order to study it.
Find the expressions of the stiffness and mass matrices of the beam element
(equations: 4.31)
Force F in the case of a triangular distributed load ÿ and
88