Sie sind auf Seite 1von 4

K N M n m nl

2 5 10 5 11 5
.3 .1 4 1 2 2 1 3 1 9 1
.2 .2 5 1 1 3 2 6 2 7 2 8 1
.4 .2 3 2 2 3 3 4 1
.5 .1 3 4 2 5 1 10 1
.6 .1 1 5 2
.0 .4 1 6 1
.0 .2 2 6 3 7 1
.0 .0 2 7 3 8 3
.2 .0 3 1 3 8 2 9 3
.4 .0 4 2 3 4 3 9 2 10 3
.6 .0 2 5 3 10 2
6 2 2 3 3 4 4 5 5 11
En Matlab:

>> FINEL125
This is the Finite Element Method.
The input will be from a text file in the following form:
K N M n m nl
Each of the above is an integer -separate with at least one blank.
Follow with the input for each node in the form:
x-coord., y-coord., number of triangles in which the node is a vertex.
Continue with the triangle number and vertex number for
each triangle in which the node is a vertex.
Separate each entry with at least one blank.
After all nodes have been entered follow with information
on the lines over which line integrals must be computed.
The format of this data will be the node number of the
starting node, followed by the node number of the ending
node for each line, taken in the positive direction.
There should be 2 * nl such entries, each an integer
separated by a blank.
Functions can be input or coded as procedures.
The example has all functions as procedures.
However, the functions could be input by uncommenting
the code as indicated.
Have the functions P,Q,R,F,G,G1,G2 been created and
has the input file been created? Answer Y or N.
Y
Input the file name in the form - drive:\name.ext
for example: A:\DATA.DTA
data1.txt
Choice of output method:
1. Output to screen
2. Output to text file
Please enter 1 or 2.
1
FINITE ELEMENT METHOD

Vertices and Nodes of Triangles


Triangle-node number for vertex 1 to 3
1 2 1 9
2 1 3 10
3 1 2 3
4 3 4 10
5 4 5 11
6 6 2 7
7 7 2 8
8 2 9 8
9 1 10 9
10 4 11 10
x and y coordinates of nodes
1 0.30000000 0.10000000
2 0.20000000 0.20000000
3 0.40000000 0.20000000
4 0.50000000 0.10000000
5 0.60000000 0.10000000
6 0.00000000 0.40000000
7 0.00000000 0.20000000
8 0.00000000 0.00000000
9 0.20000000 0.00000000
10 0.40000000 0.00000000
11 0.60000000 0.00000000
Lines of the Domain
1 6 2
2 2 3
3 3 4
4 4 5
5 5 11
Basis Functions
Triangle - Vertex - Node - Function
1 1 2 1.00000000 -5.00000000 5.00000000
1 2 1 -2.00000000 10.00000000 -0.00000000
1 3 9 2.00000000 -5.00000000 -5.00000000
2 1 1 4.00000000 -10.00000000 -0.00000000
2 2 3 -2.00000000 5.00000000 5.00000000
2 3 10 -1.00000000 5.00000000 -5.00000000
3 1 1 2.00000000 -0.00000000 -10.00000000
3 2 2 1.00000000 -5.00000000 5.00000000
3 3 3 -2.00000000 5.00000000 5.00000000
4 1 3 2.00000000 -5.00000000 5.00000000
4 2 4 -4.00000000 10.00000000 -0.00000000
4 3 10 3.00000000 -5.00000000 -5.00000000
5 1 4 6.00000000 -10.00000000 -0.00000000
5 2 5 -6.00000000 10.00000000 10.00000000
5 3 11 1.00000000 -0.00000000 -10.00000000
6 1 6 -1.00000000 -0.00000000 5.00000000
6 2 2 -0.00000000 5.00000000 -0.00000000
6 3 7 2.00000000 -5.00000000 -5.00000000
7 1 7 -0.00000000 -5.00000000 5.00000000
7 2 2 -0.00000000 5.00000000 -0.00000000
7 3 8 1.00000000 -0.00000000 -5.00000000
8 1 2 -0.00000000 -0.00000000 5.00000000
8 2 9 -0.00000000 5.00000000 -5.00000000
8 3 8 1.00000000 -5.00000000 -0.00000000
9 1 1 -0.00000000 -0.00000000 10.00000000
9 2 10 -1.00000000 5.00000000 -5.00000000
9 3 9 2.00000000 -5.00000000 -5.00000000
10 1 4 -0.00000000 -0.00000000 10.00000000
10 2 11 -2.00000000 5.00000000 -5.00000000
10 3 10 3.00000000 -5.00000000 -5.00000000
Matrix ALPHA follows:
Row 1
4.0000000000e+00
-1.0000000000e+00
-1.0000000000e+00
0.0000000000e+00
0.0000000000e+00
8.0000000000e+00
Row 2
-1.0000000000e+00
2.5000000000e+00
2.7755575616e-17
0.0000000000e+00
0.0000000000e+00
6.0267218951e+00
Row 3
-1.0000000000e+00
2.7755575616e-17
1.5000000000e+00
-5.0000000000e-01
0.0000000000e+00
6.3349509379e-02
Row 4
0.0000000000e+00
0.0000000000e+00
-5.0000000000e-01
2.5000000000e+00
-5.0000000000e-01
6.0566414214e+00
Row 5
0.0000000000e+00
0.0000000000e+00
0.0000000000e+00
-5.0000000000e-01
1.0000000000e+00
2.0315000000e+00

Coefficients of Basis Functions:


1 4.02357050 1 1 2 3 9
2 4.02011696 2 1 3 6 7 8
3 4.07416503 3 2 3 4
4 4.04865508 4 4 5 10
5 4.05582754 5 5
6 4.00000000 6 6
7 4.00000000 7 6 7
8 4.00000000 8 7 8
9 4.00000000 9 1 8 9
10 4.00000000 10 2 4 9 10
11 4.00000000 11 5 10

y=
0.1000
0.2000
0.2000
0.1000
0.1000
0.4000
0.2000
0
0
0
0
Linear interpolant:
fitresult(x,y) = piecewise linear surface computed from p
where x is normalized by mean 0.2909 and std 0.23
and where y is normalized by mean 0.1182 and std 0.125
Coefficients:
p = coefficient structure
gof =
sse: 7.6784e-04
rsquare: 0.8969
dfe: 0
adjrsquare: NaN
rmse: NaN

Das könnte Ihnen auch gefallen